Thu, 05 May 2016 14:53:07 -0400
TemplateTable::_new(): fix unaligned lw
InstanceKlass::init_state is defiend as "u2" and is assigned to 2-byte
boundary. Its offset is 0x16a.
Such field should be accessed with LHU.
public class List {
public static void main(String[] args) {
List th;
while(true)
th = new List();
}
}
Effect:
* -Xmixed / -Xint: no unaligned instructions
src/cpu/mips/vm/templateTable_mips_64.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/templateTable_mips_64.cpp Fri Apr 29 00:06:10 2016 +0800 1.2 +++ b/src/cpu/mips/vm/templateTable_mips_64.cpp Thu May 05 14:53:07 2016 -0400 1.3 @@ -4016,7 +4016,7 @@ 1.4 /*make sure klass is initialized & doesn't have finalizer*/ 1.5 1.6 // make sure klass is fully initialized 1.7 - __ lw(T1, T3, in_bytes(InstanceKlass::init_state_offset())); 1.8 + __ lhu(T1, T3, in_bytes(InstanceKlass::init_state_offset())); 1.9 __ daddiu(AT, T1, - (int)InstanceKlass::fully_initialized); 1.10 __ bne(AT, R0, slow_case); 1.11 __ delayed()->nop();