src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
Print this page
@@ -492,27 +492,32 @@
virtual void null_check(Register reg, int offset = -1);
static bool needs_explicit_null_check(intptr_t offset);
static address target_addr_for_insn(address insn_addr, unsigned insn);
+ static address target_addr_for_insn(address insn_addr) {
+ unsigned insn = *(unsigned*)insn_addr;
+ return target_addr_for_insn(insn_addr, insn);
+ }
// Required platform-specific helpers for Label::patch_instructions.
// They _shadow_ the declarations in AbstractAssembler, which are undefined.
static int pd_patch_instruction_size(address branch, address target);
static void pd_patch_instruction(address branch, address target) {
pd_patch_instruction_size(branch, target);
}
static address pd_call_destination(address branch) {
- unsigned insn = *(unsigned*)branch;
- return target_addr_for_insn(branch, insn);
+ return target_addr_for_insn(branch);
}
#ifndef PRODUCT
static void pd_print_patched_instruction(address branch);
#endif
static int patch_oop(address insn_addr, address o);
+ void emit_trampoline_stub(int insts_call_instruction_offset, address target);
+
// The following 4 methods return the offset of the appropriate move instruction
// Support for fast byte/short loading with zero extension (depending on particular CPU)
int load_unsigned_byte(Register dst, Address src);
int load_unsigned_short(Register dst, Address src);
@@ -914,16 +919,28 @@
str(rscratch2, adr);
}
// Calls
- // void call(Label& L, relocInfo::relocType rtype);
+ void trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
+
+ static bool far_branches() {
+ return ReservedCodeCacheSize > branch_range;
+ }
- // NOTE: this call tranfers to the effective address of entry NOT
- // the address contained by entry. This is because this is more natural
- // for jumps/calls.
- void call(Address entry);
+ // Jumps that can reach anywhere in the code cache.
+ // Trashes tmp.
+ void far_call(Address entry, CodeBuffer *cbuf = NULL, Register tmp = rscratch1);
+ void far_jump(Address entry, CodeBuffer *cbuf = NULL, Register tmp = rscratch1);
+
+ static int far_branch_size() {
+ if (far_branches()) {
+ return 3 * 4; // adrp, add, br
+ } else {
+ return 4;
+ }
+ }
// Emit the CompiledIC call idiom
void ic_call(address entry);
public: