RFR 8207205 [lworld] Unsafe/VarHandle read-modify-write value accessors

Paul Sandoz paul.sandoz at oracle.com
Thu Jul 12 23:26:02 UTC 2018


An additional issue is because static fields are not (currently flattened) the ref var handle is used which uses an atomic hardware instruction for CAS/CAE and thus does ref equality, so there is more work to be done here to fix this.

Paul.

> On Jul 12, 2018, at 4:06 PM, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
> 
> 
> 
>> On Jul 12, 2018, at 2:44 PM, Karen Kinnear <karen.kinnear at oracle.com> wrote:
>> 
>> Paul,
>> 
>> I was so hoping you or Mandy would get a chance to add those. Code looks good - check it in and add tests as you can.
>> 
> 
> Thanks. 
> 
> I had my suspicions the test i am working on might crash the compiler and it did :-) [1]. 
> 
> It’s crashing with -XX:-TieredCompilation when compiling the value type Point::equals method in either a CAS or CAE test where equality is required. The test passes when executed with -Xint.
> 
> I may just finish polishing the test and commit for others to reproduce the failure and work out a solution.
> 
> Paul.
> 
> Current CompileTask:
> C2:   5268  439             Point::equals (8 bytes)
> 
> Stack: [0x00007000059d2000,0x0000700005ad2000],  sp=0x0000700005ace5c0,  free space=1009k
> Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
> V  [libjvm.dylib+0x20d85d]  AddPNode::Value(PhaseGVN*) const+0xd9
> V  [libjvm.dylib+0xc0a485]  PhaseGVN::transform_no_reclaim(Node*)+0x119
> V  [libjvm.dylib+0xbf0320]  Parse::optimize_cmp_with_klass(Node*)+0x1e2
> V  [libjvm.dylib+0xbf6526]  Parse::do_one_bytecode()+0x615c
> V  [libjvm.dylib+0xbe23af]  Parse::do_one_block()+0x35f
> V  [libjvm.dylib+0xbe0e11]  Parse::do_all_blocks()+0x421
> V  [libjvm.dylib+0xbdd7b2]  Parse::Parse(JVMState*, ciMethod*, float)+0xc96
> V  [libjvm.dylib+0x35985c]  ParseGenerator::generate(JVMState*)+0xb6
> V  [libjvm.dylib+0x57b76e]  Parse::do_call()+0x78a
> V  [libjvm.dylib+0xbf04bd]  Parse::do_one_bytecode()+0xf3
> V  [libjvm.dylib+0xbe23af]  Parse::do_one_block()+0x35f
> V  [libjvm.dylib+0xbe0e11]  Parse::do_all_blocks()+0x421
> V  [libjvm.dylib+0xbdd7b2]  Parse::Parse(JVMState*, ciMethod*, float)+0xc96
> V  [libjvm.dylib+0x35985c]  ParseGenerator::generate(JVMState*)+0xb6
> V  [libjvm.dylib+0x57b76e]  Parse::do_call()+0x78a
> V  [libjvm.dylib+0xbf04bd]  Parse::do_one_bytecode()+0xf3
> V  [libjvm.dylib+0xbe23af]  Parse::do_one_block()+0x35f
> V  [libjvm.dylib+0xbe0e11]  Parse::do_all_blocks()+0x421
> V  [libjvm.dylib+0xbdd7b2]  Parse::Parse(JVMState*, ciMethod*, float)+0xc96
> V  [libjvm.dylib+0x35985c]  ParseGenerator::generate(JVMState*)+0xb6
> V  [libjvm.dylib+0x57b76e]  Parse::do_call()+0x78a
> V  [libjvm.dylib+0xbf04bd]  Parse::do_one_bytecode()+0xf3
> V  [libjvm.dylib+0xbe23af]  Parse::do_one_block()+0x35f
> V  [libjvm.dylib+0xbe0e11]  Parse::do_all_blocks()+0x421
> V  [libjvm.dylib+0xbdd7b2]  Parse::Parse(JVMState*, ciMethod*, float)+0xc96
> V  [libjvm.dylib+0x35985c]  ParseGenerator::generate(JVMState*)+0xb6
> V  [libjvm.dylib+0x57b76e]  Parse::do_call()+0x78a
> V  [libjvm.dylib+0xbf04bd]  Parse::do_one_bytecode()+0xf3
> V  [libjvm.dylib+0xbe23af]  Parse::do_one_block()+0x35f
> V  [libjvm.dylib+0xbe0e11]  Parse::do_all_blocks()+0x421
> V  [libjvm.dylib+0xbdd7b2]  Parse::Parse(JVMState*, ciMethod*, float)+0xc96
> V  [libjvm.dylib+0x35985c]  ParseGenerator::generate(JVMState*)+0xb6
> V  [libjvm.dylib+0x4894ac]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x8e6
> V  [libjvm.dylib+0x48c61b]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x31
> V  [libjvm.dylib+0x358470]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x130
> V  [libjvm.dylib+0x49f3ec]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x668
> V  [libjvm.dylib+0x49ec19]  CompileBroker::compiler_thread_loop()+0x2f1
> V  [libjvm.dylib+0xd6c1c9]  JavaThread::thread_main_inner()+0x1ed
> V  [libjvm.dylib+0xd6bca2]  JavaThread::run()+0x3da
> V  [libjvm.dylib+0xba4ec8]  thread_native_entry(Thread*)+0x12b
> C  [libsystem_pthread.dylib+0x3661]  _pthread_body+0x154
> C  [libsystem_pthread.dylib+0x350d]  _pthread_body+0x0
> C  [libsystem_pthread.dylib+0x2bf9]  thread_start+0xd
> 




More information about the valhalla-dev mailing list