hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
{- -------------------------------------------
(1) JNI_FastGetField::generate_fast_get_int_field0() とほぼ同様.
---------------------------------------- -}
const char *name;
switch (type) {
case T_FLOAT: name = "jni_fast_GetFloatField"; break;
case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
default: ShouldNotReachHere();
}
ResourceMark rm;
BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize);
CodeBuffer cbuf(blob);
MacroAssembler* masm = new MacroAssembler(&cbuf);
address fast_entry = __ pc();
Label label1, label2;
AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
__ sethi (cnt_addrlit, O3);
Address cnt_addr(O3, cnt_addrlit.low10());
__ ld (cnt_addr, G4);
__ andcc (G4, 1, G0);
__ br (Assembler::notZero, false, Assembler::pn, label1);
__ delayed()->srl (O2, 2, O4);
__ ld_ptr (O1, 0, O5);
assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
speculative_load_pclist[count] = __ pc();
switch (type) {
case T_FLOAT: __ ldf (FloatRegisterImpl::S, O5, O4, F0); break;
case T_DOUBLE: __ ldf (FloatRegisterImpl::D, O5, O4, F0); break;
default: ShouldNotReachHere();
}
__ ld (cnt_addr, O5);
__ cmp (O5, G4);
__ br (Assembler::notEqual, false, Assembler::pn, label2);
__ delayed()->mov (O7, G1);
__ retl ();
__ delayed()-> nop ();
slowcase_entry_pclist[count++] = __ pc();
__ bind (label1);
__ mov (O7, G1);
address slow_case_addr;
switch (type) {
case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break;
case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); break;
default: ShouldNotReachHere();
}
__ bind (label2);
__ call (slow_case_addr, relocInfo::none);
__ delayed()->mov (G1, O7);
__ flush ();
return fast_entry;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.