void NativeMovConstReg32::set_data(intptr_t x) { set_long_at(sethi_offset, set_data32_sethi( long_at(sethi_offset), x)); set_long_at(add_offset, set_data32_simm13( long_at(add_offset), x)); // also store the value into an oop_Relocation cell, if any CodeBlob* cb = CodeCache::find_blob(instruction_address()); nmethod* nm = cb ? cb->as_nmethod_or_null() : NULL; if (nm != NULL) { RelocIterator iter(nm, instruction_address(), next_instruction_address()); oop* oop_addr = NULL; Metadata** metadata_addr = NULL; while (iter.next()) { if (iter.type() == relocInfo::oop_type) { oop_Relocation *r = iter.oop_reloc(); if (oop_addr == NULL) { oop_addr = r->oop_addr(); *oop_addr = cast_to_oop(x); } else { assert(oop_addr == r->oop_addr(), "must be only one set-oop here"); } } if (iter.type() == relocInfo::metadata_type) { metadata_Relocation *r = iter.metadata_reloc(); if (metadata_addr == NULL) { metadata_addr = r->metadata_addr(); *metadata_addr = (Metadata*)x; } else { assert(metadata_addr == r->metadata_addr(), "must be only one set-metadata here"); } } } } }
void NativeMovRegMem::copy_instruction_to(address new_instruction_address) { Untested("copy_instruction_to"); int instruction_size = next_instruction_address() - instruction_address(); for (int i = 0; i < instruction_size; i += BytesPerInstWord) { *(int*)(new_instruction_address + i) = *(int*)(address(this) + i); } }
void NativeMovConstReg::set_data(int64_t src) { verify(); uint41_t new_X; uint41_t new_L; IPF_Bundle *bundle = (IPF_Bundle *)addr_at(0); X2::set_imm((uint64_t)src, bundle->get_slot2(), new_X, new_L); bundle->set_slot1( new_L ); bundle->set_slot2( new_X ); ICache::invalidate_range((address)bundle, sizeof(bundle)); // also store the value into an oop_Relocation cell, if any CodeBlob* nm = CodeCache::find_blob(instruction_address()); if (nm != NULL) { RelocIterator iter(nm, instruction_address(), next_instruction_address()); oop* oop_addr = NULL; while (iter.next()) { if (iter.type() == relocInfo::oop_type) { oop_Relocation *r = iter.oop_reloc(); if (oop_addr == NULL) { oop_addr = r->oop_addr(); *oop_addr = (oop)src; } else { assert(oop_addr == r->oop_addr(), "must be only one set-oop here") ; } } } } }