Skip to content
Closed
1 change: 1 addition & 0 deletions src/hotspot/cpu/arm/methodHandles_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "prims/jvmtiExport.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/preserveException.hpp"

Expand Down
9 changes: 7 additions & 2 deletions src/hotspot/cpu/arm/sharedRuntime_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,11 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address runtime_entry) {
int insts_size = 128;
int locs_size = 32;

ResourceMark rm;
const char* timer_msg = "SharedRuntime generate_throw_exception";
TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));

CodeBuffer code(name, insts_size, locs_size);
OopMapSet* oop_maps;
int frame_size;
Expand Down Expand Up @@ -1780,7 +1785,7 @@ RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address r
// For c2: c_rarg0 is junk, call to runtime to write a checkpoint.
// It returns a jobject handle to the event writer.
// The handle is dereferenced and the return value is the event writer oop.
static RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
enum layout {
r1_off,
r2_off,
Expand Down Expand Up @@ -1823,7 +1828,7 @@ static RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
}

// For c2: call to return a leased buffer.
static RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
enum layout {
r1_off,
r2_off,
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/signature.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/timerTrace.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/align.hpp"
#include "utilities/macros.hpp"
Expand Down Expand Up @@ -3426,6 +3427,10 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
// SharedRuntime.cpp requires that this code be generated into a
// RuntimeStub.
RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address runtime_entry) {
ResourceMark rm;
const char* timer_msg = "SharedRuntime generate_throw_exception";
TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));

CodeBuffer code(name, 1024 DEBUG_ONLY(+ 512), 0);
MacroAssembler* masm = new MacroAssembler(&code);

Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/signature.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/timerTrace.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/align.hpp"
#include "utilities/formatBuffer.hpp"
Expand Down Expand Up @@ -2663,6 +2664,10 @@ RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address r
const int insts_size = 1024;
const int locs_size = 64;

ResourceMark rm;
const char* timer_msg = "SharedRuntime generate_throw_exception";
TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));

CodeBuffer code(name, insts_size, locs_size);
OopMapSet* oop_maps = new OopMapSet();
MacroAssembler* masm = new MacroAssembler(&code);
Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/cpu/s390/sharedRuntime_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,11 @@ RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address r

int insts_size = 256;
int locs_size = 0;

ResourceMark rm;
const char* timer_msg = "SharedRuntime generate_throw_exception";
TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));

CodeBuffer code(name, insts_size, locs_size);
MacroAssembler* masm = new MacroAssembler(&code);
int framesize_in_bytes;
Expand All @@ -3045,9 +3050,6 @@ RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address r
framesize_in_bytes = __ push_frame_abi160(0);

address frame_complete_pc = __ pc();
if (restore_saved_exception_pc) {
__ unimplemented("SharedRuntime::throw_exception", 74);
}

// Note that we always have a runtime stub frame on the top of stack at this point.
__ get_PC(Z_R1);
Expand Down
36 changes: 26 additions & 10 deletions src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/signature.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/timerTrace.hpp"
#include "runtime/vframeArray.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/align.hpp"
Expand All @@ -56,6 +57,12 @@

#define __ masm->

#ifdef PRODUCT
#define BLOCK_COMMENT(str) /* nothing */
#else
#define BLOCK_COMMENT(str) __ block_comment(str)
#endif // PRODUCT

const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size;

class RegisterSaver {
Expand Down Expand Up @@ -2656,9 +2663,26 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
// so caller saved registers were assumed volatile in the compiler.
RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address runtime_entry) {

// Information about frame layout at time of blocking runtime call.
// Note that we only have to preserve callee-saved registers since
// the compilers are responsible for supplying a continuation point
// if they expect all registers to be preserved.
enum layout {
thread_off, // last_java_sp
arg1_off,
arg2_off,
rbp_off, // callee saved register
ret_pc,
framesize
};

int insts_size = 256;
int locs_size = 32;

ResourceMark rm;
const char* timer_msg = "SharedRuntime generate_throw_exception";
TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));

CodeBuffer code(name, insts_size, locs_size);
OopMapSet* oop_maps = new OopMapSet();
MacroAssembler* masm = new MacroAssembler(&code);
Expand All @@ -2683,14 +2707,6 @@ RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address r

// push java thread (becomes first argument of C function)
__ movptr(Address(rsp, thread_off * wordSize), java_thread);
if (arg1 != noreg) {
__ movptr(Address(rsp, arg1_off * wordSize), arg1);
}
if (arg2 != noreg) {
assert(arg1 != noreg, "missing reg arg");
__ movptr(Address(rsp, arg2_off * wordSize), arg2);
}

// Set up last_Java_sp and last_Java_fp
__ set_last_Java_frame(java_thread, rsp, rbp, nullptr, noreg);

Expand Down Expand Up @@ -2744,7 +2760,7 @@ static void jfr_epilogue(MacroAssembler* masm) {
// For c2: c_rarg0 is junk, call to runtime to write a checkpoint.
// It returns a jobject handle to the event writer.
// The handle is dereferenced and the return value is the event writer oop.
static RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
enum layout {
FPUState_off = 0,
rbp_off = FPUStateSizeInWords,
Expand Down Expand Up @@ -2785,7 +2801,7 @@ static RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
}

// For c2: call to return a leased buffer.
static RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
enum layout {
FPUState_off = 0,
rbp_off = FPUStateSizeInWords,
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/signature.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/timerTrace.hpp"
#include "runtime/vframeArray.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/align.hpp"
Expand Down Expand Up @@ -3247,6 +3248,10 @@ RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address r
int insts_size = 512;
int locs_size = 64;

ResourceMark rm;
const char* timer_msg = "SharedRuntime generate_throw_exception";
TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));

CodeBuffer code(name, insts_size, locs_size);
OopMapSet* oop_maps = new OopMapSet();
MacroAssembler* masm = new MacroAssembler(&code);
Expand Down
17 changes: 0 additions & 17 deletions src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3843,25 +3843,8 @@ class StubGenerator: public StubCodeGenerator {
return start;
}

public:
// Information about frame layout at time of blocking runtime call.
// Note that we only have to preserve callee-saved registers since
// the compilers are responsible for supplying a continuation point
// if they expect all registers to be preserved.
enum layout {
thread_off, // last_java_sp
arg1_off,
arg2_off,
rbp_off, // callee saved register
ret_pc,
framesize
};

private:

#undef __
#define __ masm->

void create_control_words() {
// Round to nearest, 53-bit mode, exceptions masked
StubRoutines::x86::_fpu_cntrl_wrd_std = 0x027F;
Expand Down
9 changes: 6 additions & 3 deletions src/hotspot/cpu/zero/sharedRuntime_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ JRT_LEAF(void, zero_stub())
ShouldNotCallThis();
JRT_END

static RuntimeStub* generate_empty_runtime_stub(const char* name) {
static RuntimeStub* generate_empty_runtime_stub() {
return CAST_FROM_FN_PTR(RuntimeStub*,zero_stub);
}

Expand All @@ -101,7 +101,6 @@ static DeoptimizationBlob* generate_empty_deopt_blob() {
return CAST_FROM_FN_PTR(DeoptimizationBlob*,zero_stub);
}


void SharedRuntime::generate_deopt_blob() {
_deopt_blob = generate_empty_deopt_blob();
}
Expand All @@ -111,7 +110,11 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
}

RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const char* name) {
return generate_empty_runtime_stub("resolve_blob");
return generate_empty_runtime_stub();
}

RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address runtime_entry) {
return generate_empty_runtime_stub();
}

int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
Expand Down
16 changes: 0 additions & 16 deletions src/hotspot/cpu/zero/stubGenerator_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,6 @@ class StubGenerator: public StubCodeGenerator {
void generate_final_stubs() {
// Generates all stubs and initializes the entry points

// These entry points require SharedInfo::stack0 to be set up in
// non-core builds and need to be relocatable, so they each
// fabricate a RuntimeStub internally.
StubRoutines::_throw_AbstractMethodError_entry =
ShouldNotCallThisStub();

StubRoutines::_throw_NullPointerException_at_call_entry =
ShouldNotCallThisStub();

StubRoutines::_throw_StackOverflowError_entry =
ShouldNotCallThisStub();

// support for verify_oop (must happen after universe_init)
StubRoutines::_verify_oop_subroutine_entry =
ShouldNotCallThisStub();

// arraycopy stubs used by compilers
generate_arraycopy_stubs();

Expand Down