< prev index next > src/hotspot/cpu/x86/c1_Runtime1_x86.cpp
Print this page
// Implementation of StubFrame
class StubFrame: public StackObj {
private:
StubAssembler* _sasm;
public:
! StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments);
void load_argument(int offset_in_words, Register reg);
~StubFrame();
};
void StubAssembler::prologue(const char* name, bool must_gc_arguments) {
set_info(name, must_gc_arguments);
enter();
}
! void StubAssembler::epilogue() {
! leave();
ret(0);
}
#define __ _sasm->
! StubFrame::StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments) {
_sasm = sasm;
__ prologue(name, must_gc_arguments);
}
// load parameters that were stored with LIR_Assembler::store_parameter
// Note: offsets for store_parameter and load_argument must match
// Implementation of StubFrame
class StubFrame: public StackObj {
private:
StubAssembler* _sasm;
+ bool _use_pop_on_epilog;
public:
! StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, bool use_pop_on_epilog = false);
void load_argument(int offset_in_words, Register reg);
~StubFrame();
};
void StubAssembler::prologue(const char* name, bool must_gc_arguments) {
set_info(name, must_gc_arguments);
enter();
}
! void StubAssembler::epilogue(bool use_pop) {
! // Avoid using a leave instruction when this frame may
+ // have been frozen, since the current value of rbp
+ // restored from the stub would be invalid. We still
+ // must restore the rbp value saved on enter though.
+ use_pop ? pop(rbp) : leave();
ret(0);
}
#define __ _sasm->
! StubFrame::StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, bool use_pop_on_epilog) {
_sasm = sasm;
+ _use_pop_on_epilog = use_pop_on_epilog;
__ prologue(name, must_gc_arguments);
}
// load parameters that were stored with LIR_Assembler::store_parameter
// Note: offsets for store_parameter and load_argument must match
__ load_parameter(offset_in_words, reg);
}
StubFrame::~StubFrame() {
! __ epilogue();
}
#undef __
__ load_parameter(offset_in_words, reg);
}
StubFrame::~StubFrame() {
! __ epilogue(_use_pop_on_epilog);
}
#undef __
void Runtime1::initialize_pd() {
// nothing to do
}
+ uint Runtime1::runtime_blob_current_thread_offset(frame f) {
+ #ifdef _LP64
+ return r15_off / 2;
+ #else
+ Unimplemented();
+ return 0;
+ #endif
+ }
// Target: the entry point of the method that creates and posts the exception oop.
// has_argument: true if the exception needs arguments (passed on the stack because
// registers must be preserved).
OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) {
case C1StubId::monitorenter_nofpu_id:
save_fpu_registers = false;
// fall through
case C1StubId::monitorenter_id:
{
! StubFrame f(sasm, "monitorenter", dont_gc_arguments);
OopMap* map = save_live_registers(sasm, 3, save_fpu_registers);
// Called with store_parameter and not C abi
f.load_argument(1, rax); // rax,: object
case C1StubId::monitorenter_nofpu_id:
save_fpu_registers = false;
// fall through
case C1StubId::monitorenter_id:
{
! StubFrame f(sasm, "monitorenter", dont_gc_arguments, true /* use_pop_on_epilog */);
OopMap* map = save_live_registers(sasm, 3, save_fpu_registers);
// Called with store_parameter and not C abi
f.load_argument(1, rax); // rax,: object
< prev index next >