--- old/src/cpu/x86/vm/templateTable_x86.cpp 2016-08-17 17:17:23.148749092 -0400 +++ new/src/cpu/x86/vm/templateTable_x86.cpp 2016-08-17 17:17:22.774478308 -0400 @@ -858,26 +858,23 @@ // get next byte __ load_unsigned_byte(rbx, at_bcp(Bytecodes::length_for(Bytecodes::_aload_0))); - // do actual aload_0 - aload(0); - // if _getfield then wait with rewrite __ cmpl(rbx, Bytecodes::_getfield); __ jcc(Assembler::equal, done); - // if _igetfield then reqrite to _fast_iaccess_0 + // if _igetfield then rewrite to _fast_iaccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_iaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpl(rbx, Bytecodes::_fast_igetfield); __ movl(bc, Bytecodes::_fast_iaccess_0); __ jccb(Assembler::equal, rewrite); - // if _agetfield then reqrite to _fast_aaccess_0 + // if _agetfield then rewrite to _fast_aaccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_aaccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpl(rbx, Bytecodes::_fast_agetfield); __ movl(bc, Bytecodes::_fast_aaccess_0); __ jccb(Assembler::equal, rewrite); - // if _fgetfield then reqrite to _fast_faccess_0 + // if _fgetfield then rewrite to _fast_faccess_0 assert(Bytecodes::java_code(Bytecodes::_fast_faccess_0) == Bytecodes::_aload_0, "fix bytecode definition"); __ cmpl(rbx, Bytecodes::_fast_fgetfield); __ movl(bc, Bytecodes::_fast_faccess_0); @@ -893,9 +890,10 @@ patch_bytecode(Bytecodes::_aload_0, bc, rbx, false); __ bind(done); - } else { - aload(0); } + + // Do actual aload_0 (must do this after patch_bytecode which might call VM and GC might change oop). + aload(0); } void TemplateTable::istore() {