8333649: Allow different NativeCall encodings
Reviewed-by: kvn, mli
This commit is contained in:
parent
fe9c63cf73
commit
4d6064a760
@ -168,6 +168,7 @@ public:
|
|||||||
return_address_offset = 4
|
return_address_offset = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int byte_size() { return instruction_size; }
|
||||||
address instruction_address() const { return addr_at(instruction_offset); }
|
address instruction_address() const { return addr_at(instruction_offset); }
|
||||||
address next_instruction_address() const { return addr_at(return_address_offset); }
|
address next_instruction_address() const { return addr_at(return_address_offset); }
|
||||||
int displacement() const { return (int_at(displacement_offset) << 6) >> 4; }
|
int displacement() const { return (int_at(displacement_offset) << 6) >> 4; }
|
||||||
|
@ -415,6 +415,7 @@ inline NativeJump* nativeJump_at(address address) {
|
|||||||
|
|
||||||
class NativeCall: public RawNativeCall {
|
class NativeCall: public RawNativeCall {
|
||||||
public:
|
public:
|
||||||
|
static int byte_size() { return instruction_size; }
|
||||||
// NativeCall::next_instruction_address() is used only to define the
|
// NativeCall::next_instruction_address() is used only to define the
|
||||||
// range where to look for the relocation information. We need not
|
// range where to look for the relocation information. We need not
|
||||||
// walk over composed instructions (as long as the relocation information
|
// walk over composed instructions (as long as the relocation information
|
||||||
|
@ -137,6 +137,8 @@ class NativeCall: public NativeInstruction {
|
|||||||
instruction_size = 16 // Used in shared code for calls with reloc_info.
|
instruction_size = 16 // Used in shared code for calls with reloc_info.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int byte_size() { return instruction_size; }
|
||||||
|
|
||||||
static bool is_call_at(address a) {
|
static bool is_call_at(address a) {
|
||||||
return Assembler::is_bl(*(int*)(a));
|
return Assembler::is_bl(*(int*)(a));
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,7 @@ class NativeCall: public NativeInstruction {
|
|||||||
return_address_offset = 4
|
return_address_offset = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int byte_size() { return instruction_size; }
|
||||||
address instruction_address() const { return addr_at(instruction_offset); }
|
address instruction_address() const { return addr_at(instruction_offset); }
|
||||||
address next_instruction_address() const { return addr_at(return_address_offset); }
|
address next_instruction_address() const { return addr_at(return_address_offset); }
|
||||||
address return_address() const { return addr_at(return_address_offset); }
|
address return_address() const { return addr_at(return_address_offset); }
|
||||||
|
@ -212,6 +212,7 @@ class NativeCall: public NativeInstruction {
|
|||||||
call_far_pcrelative_displacement_alignment = 4
|
call_far_pcrelative_displacement_alignment = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int byte_size() { return instruction_size; }
|
||||||
|
|
||||||
// Maximum size (in bytes) of a call to an absolute address.
|
// Maximum size (in bytes) of a call to an absolute address.
|
||||||
// Used when emitting call to deopt handler blob, which is a
|
// Used when emitting call to deopt handler blob, which is a
|
||||||
|
@ -160,6 +160,7 @@ class NativeCall: public NativeInstruction {
|
|||||||
return_address_offset = 5
|
return_address_offset = 5
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int byte_size() { return instruction_size; }
|
||||||
address instruction_address() const { return addr_at(instruction_offset); }
|
address instruction_address() const { return addr_at(instruction_offset); }
|
||||||
address next_instruction_address() const { return addr_at(return_address_offset); }
|
address next_instruction_address() const { return addr_at(return_address_offset); }
|
||||||
int displacement() const { return (jint) int_at(displacement_offset); }
|
int displacement() const { return (jint) int_at(displacement_offset); }
|
||||||
|
@ -70,6 +70,8 @@ class NativeCall : public NativeInstruction {
|
|||||||
instruction_size = 0 // not used within the interpreter
|
instruction_size = 0 // not used within the interpreter
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int byte_size() { return instruction_size; }
|
||||||
|
|
||||||
address instruction_address() const {
|
address instruction_address() const {
|
||||||
ShouldNotCallThis();
|
ShouldNotCallThis();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -37,7 +37,7 @@ inline bool nmethod::is_deopt_pc(address pc) { return is_deopt_entry(pc) || is_d
|
|||||||
inline bool nmethod::is_deopt_entry(address pc) {
|
inline bool nmethod::is_deopt_entry(address pc) {
|
||||||
return pc == deopt_handler_begin()
|
return pc == deopt_handler_begin()
|
||||||
#if INCLUDE_JVMCI
|
#if INCLUDE_JVMCI
|
||||||
|| (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::instruction_size))
|
|| (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::byte_size()))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ inline bool nmethod::is_deopt_entry(address pc) {
|
|||||||
inline bool nmethod::is_deopt_mh_entry(address pc) {
|
inline bool nmethod::is_deopt_mh_entry(address pc) {
|
||||||
return pc == deopt_mh_handler_begin()
|
return pc == deopt_mh_handler_begin()
|
||||||
#if INCLUDE_JVMCI
|
#if INCLUDE_JVMCI
|
||||||
|| (is_compiled_by_jvmci() && pc == (deopt_mh_handler_begin() + NativeCall::instruction_size))
|
|| (is_compiled_by_jvmci() && pc == (deopt_mh_handler_begin() + NativeCall::byte_size()))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -1321,7 +1321,7 @@ CodeBuffer* PhaseOutput::init_buffer() {
|
|||||||
int code_req = _buf_sizes._code;
|
int code_req = _buf_sizes._code;
|
||||||
int const_req = _buf_sizes._const;
|
int const_req = _buf_sizes._const;
|
||||||
|
|
||||||
int pad_req = NativeCall::instruction_size;
|
int pad_req = NativeCall::byte_size();
|
||||||
|
|
||||||
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
|
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
|
||||||
stub_req += bs->estimate_stub_size();
|
stub_req += bs->estimate_stub_size();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user