[aarch64-port-dev ] RFR: Large code cache
Andrew Dinn
adinn at redhat.com
Tue Dec 9 11:31:10 UTC 2014
Hmm, this looks a tad like a hack-in-progress
src/cpu/aarch64/vm/nativeInst_aarch64.cpp
. . .
@@ -212,23 +310,28 @@
void NativeGeneralJump::insert_unconditional(address code_pos, address
entry) {
NativeGeneralJump* n_jump = (NativeGeneralJump*)code_pos;
- ptrdiff_t disp = entry - code_pos;
- guarantee(disp < 1 << 27 && disp > - (1 << 27), "branch overflow");
- unsigned int insn = (0b000101 << 26) | ((disp >> 2) & 0x3ffffff);
- *(unsigned int*)code_pos = insn;
+ CodeBuffer cb(code_pos, instruction_size);
+ MacroAssembler* a = new MacroAssembler(&cb);
+
+ a->mov(rscratch1, entry);
+ a->br(rscratch1);
+
ICache::invalidate_range(code_pos, instruction_size);
}
Do you really need to allocate a MacroAssembler to do this? Also, I
don't see a delete for that new.
regards,
Andrew Dinn
-----------
More information about the aarch64-port-dev
mailing list