src/hotspot/share/opto/compile.cpp
changeset 52325 0451e0a2f1f5
parent 52224 4f2215a00ed1
child 52426 38bf0c9c4e64
--- a/src/hotspot/share/opto/compile.cpp	Mon Oct 29 17:11:46 2018 -0400
+++ b/src/hotspot/share/opto/compile.cpp	Tue Oct 30 09:06:08 2018 +0100
@@ -544,9 +544,7 @@
 
     ResourceMark rm;
     _scratch_const_size = 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);
+    int size = C2Compiler::initial_code_buffer_size(const_size);
     blob = BufferBlob::create("Compile::scratch_buffer", size);
     // Record the buffer blob for next time.
     set_scratch_buffer_blob(blob);