oop InlineCacheBuffer::ic_buffer_cached_oop(address code_begin) { // creation also verifies the object NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // Verifies the jump NativeJump* jump = nativeJump_at(move->next_instruction_address()); return (oop)move->data(); }
// Code for unit testing implementation of NativeMovConstReg class void NativeMovConstReg::test() { #ifdef ASSERT ResourceMark rm; CodeBuffer cb("test", 100, 100); MacroAssembler* a = new MacroAssembler(&cb); NativeMovConstReg* nm; uint idx; int offsets[] = { 0x0, 0x7fffffff, 0x80000000, 0xffffffff, 0x20, 4096, 4097, }; VM_Version::allow_all(); AddressLiteral al1(0xaaaabbbb, relocInfo::external_word_type); a->sethi(al1, I3); a->add(I3, al1.low10(), I3); AddressLiteral al2(0xccccdddd, relocInfo::external_word_type); a->sethi(al2, O2); a->add(O2, al2.low10(), O2); nm = nativeMovConstReg_at( cb.insts_begin() ); nm->print(); nm = nativeMovConstReg_at( nm->next_instruction_address() ); for (idx = 0; idx < ARRAY_SIZE(offsets); idx++) { nm->set_data( offsets[idx] ); assert(nm->data() == offsets[idx], "check unit test"); } nm->print(); VM_Version::revert(); #endif }
address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) { NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // creation also verifies the object NativeJump* jump = nativeJump_at(move->next_instruction_address()); return jump->jump_destination(); }
void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) { NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // creation also verifies the object NativeJump* jump = nativeJump_at(move->next_instruction_address()); void* o = (void*)move->data(); return o; }