Skip to content

Commit

Permalink
c1 overflow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bulasevich committed Apr 14, 2024
1 parent 3bb2ef5 commit b38c69a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/hotspot/share/c1/c1_Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Compiler::Compiler() : AbstractCompiler(compiler_c1) {
}

void Compiler::init_c1_runtime() {
if (Runtime1::blob_for((Runtime1::StubID)0) == nullptr) // check if Runtime1 is initialized
Runtime1::initialize(CompilerThread::current()->get_buffer_blob());
}

Expand Down Expand Up @@ -243,7 +244,9 @@ bool Compiler::is_intrinsic_supported(vmIntrinsics::ID id) {
}

void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci, bool install_code, DirectiveSet* directive) {
BufferBlob* buffer_blob = init_buffer_blob();
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
if (buffer_blob == nullptr) { buffer_blob = init_buffer_blob(); }

if (buffer_blob == nullptr) {
warning("no space to run C1 compiler");
return;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/c1/c1_Runtime1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void StubAssembler::set_num_rt_args(int args) {

// Implementation of Runtime1

CodeBlob* Runtime1::_blobs[Runtime1::number_of_ids];
CodeBlob* Runtime1::_blobs[Runtime1::number_of_ids] = {nullptr};
const char *Runtime1::_blob_names[] = {
RUNTIME1_STUBS(STUB_NAME, LAST_STUB_NAME)
};
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ PhaseOutput::PhaseOutput()
PhaseOutput::~PhaseOutput() {
C->set_output(nullptr);
if (_scratch_buffer_blob != nullptr) {
// BufferBlob::free(_scratch_buffer_blob);
BufferBlob::free(_scratch_buffer_blob);
}
}

Expand Down

0 comments on commit b38c69a

Please sign in to comment.