src/hotspot/share/opto/compile.cpp
changeset 51633 21154cb84d2a
parent 51489 b5abbca5b2dc
child 52092 4cffba2df537
--- a/src/hotspot/share/opto/compile.cpp	Tue Sep 04 18:32:28 2018 +0100
+++ b/src/hotspot/share/opto/compile.cpp	Tue Sep 04 12:44:02 2018 -0700
@@ -544,7 +544,9 @@
 
     ResourceMark rm;
     _scratch_const_size = const_size;
-    int size = (MAX_inst_size + MAX_stubs_size + _scratch_const_size);
+    int locs_size = sizeof(relocInfo) * MAX_locs_size;
+    int slop = 2 * CodeSection::end_slop(); // space between sections
+    int size = (MAX_inst_size + MAX_stubs_size + _scratch_const_size + slop + locs_size);
     blob = BufferBlob::create("Compile::scratch_buffer", size);
     // Record the buffer blob for next time.
     set_scratch_buffer_blob(blob);