review (L) for 7017732: move static fields into Class to prepare for perm gen removal

Christian Thalinger christian.thalinger at oracle.com
Wed Feb 9 03:52:04 PST 2011


On Feb 8, 2011, at 11:01 PM, Tom Rodriguez wrote:
> http://cr.openjdk.java.net/~never/7017732

src/cpu/x86/vm/c1_CodeStubs_x86.cpp:

 315     Register tmp = rax;
 316     Register tmp2 = rbx;
 317     if (_obj == tmp) tmp = rcx;
 318     else if (_obj == tmp2) tmp = rcx;
 319     __ push(tmp);
 320     __ push(tmp2);
 321     __ get_thread(tmp);
 322     __ movptr(tmp2, Address(_obj, java_lang_Class::klass_offset_in_bytes()));
 323     __ cmpptr(tmp, Address(tmp2, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
 324     __ pop(tmp2);
 325     __ pop(tmp);

Why do you change tmp if _obj == tmp2?  I think line 318 isn't required at all since if _obj == tmp2 it gets saved and restored anyway.  What about this:

 315     Register tmp = rax;
 316     Register tmp2 = rbx;
 319     __ push(tmp);
 320     __ push(tmp2);
 322     __ movptr(tmp2, Address(_obj, java_lang_Class::klass_offset_in_bytes()));
 321     __ get_thread(tmp);
 323     __ cmpptr(tmp, Address(tmp2, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
 324     __ pop(tmp2);
 325     __ pop(tmp);

-- Christian


More information about the hotspot-dev mailing list