Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8228634

[lworld] ciField::will_link() returns incorrect result for the withfield bytecode

XMLWordPrintable

      If this line is commented out:

      http://hg.openjdk.java.net/valhalla/valhalla/file/ab1e0ac6b32f/src/hotspot/share/c1/c1_GraphBuilder.cpp#l1880

        if (!holder->is_loaded()
      //// || needs_patching /* FIXME: 8228634 - field_modify->will_link() may incorrectly return false */
            ) {

      TestWithfieldC1.java would fail in Scenario #3:

      # Internal Error (/home/iklam/jdk/valhalla/open/src/hotspot/share/c1/c1_LIRAssembler.cpp:59), pid=27024, tid=27035
      # Error: ShouldNotReachHere()

      Current thread (0x00007f13f0388800): JavaThread "C1 CompilerThread0" daemon [_thread_in_native, id=27035, stack(0x00007f13c2336000,0x00007f13c2437000)]

      Current CompileTask:
      C1: 1676 609 b 1 compiler.valhalla.valuetypes.TestWithfieldC1::test2 (39 bytes)

      Stack: [0x00007f13c2336000,0x00007f13c2437000], sp=0x00007f13c2434bf0, free space=1018k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xb9737f] LIR_Assembler::patching_epilog(PatchingStub*, LIR_PatchCode, RegisterImpl*, CodeEmitInfo*)+0x3af
      V [libjvm.so+0xba50c4] LIR_Assembler::mem2reg(LIR_OprDesc*, LIR_OprDesc*, BasicType, LIR_PatchCode, CodeEmitInfo*, bool, bool)+0x6c4
      V [libjvm.so+0xb9a3e6] LIR_Assembler::emit_op1(LIR_Op1*)+0x86
      V [libjvm.so+0xb9acb6] LIR_Assembler::emit_lir_list(LIR_List*)+0xa6
      V [libjvm.so+0xb9b986] LIR_Assembler::emit_code(BlockList*)+0xb6
      V [libjvm.so+0xb3d2e3] Compilation::emit_code_body()+0x1e3
      V [libjvm.so+0xb3de10] Compilation::compile_java_method()+0x940
      V [libjvm.so+0xb3e42f] Compilation::compile_method()+0x24f
      V [libjvm.so+0xb3ee00] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, DirectiveSet*)+0x420
      V [libjvm.so+0xb40d9a] Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x1aa
      V [libjvm.so+0xe3ff2c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x3cc
      V [libjvm.so+0xe41178] CompileBroker::compiler_thread_loop()+0x4f8
      V [libjvm.so+0x1bf766a] JavaThread::thread_main_inner()+0x26a
      V [libjvm.so+0x1bff678] JavaThread::run()+0x238
      V [libjvm.so+0x1bfcfc6] Thread::call_run()+0xf6
      V [libjvm.so+0x18dc27e] thread_native_entry(Thread*)+0x10e

          @Test(compLevel=C1)
          public FooValue test2() {
              FooValue v = FooValue.default;

              v = __WithField(v.x, 1);
              v = __WithField(v.y, 1);
              foo_instance = v;

              v = __WithField(v.x, 2);
              v = __WithField(v.y, 2);
              return v;
          }


            thartmann Tobias Hartmann
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: