--- old/src/cpu/aarch64/vm/templateTable_aarch64.cpp 2016-08-17 17:17:03.478669351 -0400 +++ new/src/cpu/aarch64/vm/templateTable_aarch64.cpp 2016-08-17 17:17:03.053548337 -0400 @@ -852,26 +852,23 @@ // get next bytecode __ load_unsigned_byte(r1, at_bcp(Bytecodes::length_for(Bytecodes::_aload_0))); - // do actual aload_0 - aload(0); - // if _getfield then wait with rewrite __ cmpw(r1, Bytecodes::Bytecodes::_getfield); __ br(Assembler::EQ, 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"); __ cmpw(r1, Bytecodes::_fast_igetfield); __ movw(bc, Bytecodes::_fast_iaccess_0); __ br(Assembler::EQ, 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"); __ cmpw(r1, Bytecodes::_fast_agetfield); __ movw(bc, Bytecodes::_fast_aaccess_0); __ br(Assembler::EQ, 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"); __ cmpw(r1, Bytecodes::_fast_fgetfield); __ movw(bc, Bytecodes::_fast_faccess_0); @@ -887,9 +884,10 @@ patch_bytecode(Bytecodes::_aload_0, bc, r1, 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()