Skip to content

Commit b38c69a

Browse files
committed
c1 overflow fix
1 parent 3bb2ef5 commit b38c69a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/hotspot/share/c1/c1_Compiler.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Compiler::Compiler() : AbstractCompiler(compiler_c1) {
4949
}
5050

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

@@ -243,7 +244,9 @@ bool Compiler::is_intrinsic_supported(vmIntrinsics::ID id) {
243244
}
244245

245246
void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci, bool install_code, DirectiveSet* directive) {
246-
BufferBlob* buffer_blob = init_buffer_blob();
247+
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
248+
if (buffer_blob == nullptr) { buffer_blob = init_buffer_blob(); }
249+
247250
if (buffer_blob == nullptr) {
248251
warning("no space to run C1 compiler");
249252
return;

src/hotspot/share/c1/c1_Runtime1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void StubAssembler::set_num_rt_args(int args) {
109109

110110
// Implementation of Runtime1
111111

112-
CodeBlob* Runtime1::_blobs[Runtime1::number_of_ids];
112+
CodeBlob* Runtime1::_blobs[Runtime1::number_of_ids] = {nullptr};
113113
const char *Runtime1::_blob_names[] = {
114114
RUNTIME1_STUBS(STUB_NAME, LAST_STUB_NAME)
115115
};

src/hotspot/share/opto/output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ PhaseOutput::PhaseOutput()
253253
PhaseOutput::~PhaseOutput() {
254254
C->set_output(nullptr);
255255
if (_scratch_buffer_blob != nullptr) {
256-
// BufferBlob::free(_scratch_buffer_blob);
256+
BufferBlob::free(_scratch_buffer_blob);
257257
}
258258
}
259259

0 commit comments

Comments
 (0)