59 Interval::initialize(arena); 60 } 61 62 63 void Compiler::initialize() { 64 // Buffer blob must be allocated per C1 compiler thread at startup 65 BufferBlob* buffer_blob = init_buffer_blob(); 66 67 if (should_perform_init()) { 68 if (buffer_blob == NULL) { 69 // When we come here we are in state 'initializing'; entire C1 compilation 70 // can be shut down. 71 set_state(failed); 72 } else { 73 init_c1_runtime(); 74 set_state(initialized); 75 } 76 } 77 } 78 79 BufferBlob* Compiler::init_buffer_blob() { 80 // Allocate buffer blob once at startup since allocation for each 81 // compilation seems to be too expensive (at least on Intel win32). 82 assert (CompilerThread::current()->get_buffer_blob() == NULL, "Should initialize only once"); 83 84 // setup CodeBuffer. Preallocate a BufferBlob of size 85 // NMethodSizeLimit plus some extra space for constants. 86 int code_buffer_size = Compilation::desired_max_code_buffer_size() + 87 Compilation::desired_max_constant_size(); 88 89 BufferBlob* buffer_blob = BufferBlob::create("C1 temporary CodeBuffer", code_buffer_size); 90 if (buffer_blob != NULL) { 91 CompilerThread::current()->set_buffer_blob(buffer_blob); 92 } 93 94 return buffer_blob; 95 } 96 97 98 void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) { | 59 Interval::initialize(arena); 60 } 61 62 63 void Compiler::initialize() { 64 // Buffer blob must be allocated per C1 compiler thread at startup 65 BufferBlob* buffer_blob = init_buffer_blob(); 66 67 if (should_perform_init()) { 68 if (buffer_blob == NULL) { 69 // When we come here we are in state 'initializing'; entire C1 compilation 70 // can be shut down. 71 set_state(failed); 72 } else { 73 init_c1_runtime(); 74 set_state(initialized); 75 } 76 } 77 } 78 79 int Compiler::code_buffer_size() { 80 assert(SegmentedCodeCache, "Should be only used with a segmented code cache"); 81 return Compilation::desired_max_code_buffer_size() + Compilation::desired_max_constant_size(); 82 } 83 84 BufferBlob* Compiler::init_buffer_blob() { 85 // Allocate buffer blob once at startup since allocation for each 86 // compilation seems to be too expensive (at least on Intel win32). 87 assert (CompilerThread::current()->get_buffer_blob() == NULL, "Should initialize only once"); 88 89 // setup CodeBuffer. Preallocate a BufferBlob of size 90 // NMethodSizeLimit plus some extra space for constants. 91 int code_buffer_size = Compilation::desired_max_code_buffer_size() + 92 Compilation::desired_max_constant_size(); 93 94 BufferBlob* buffer_blob = BufferBlob::create("C1 temporary CodeBuffer", code_buffer_size); 95 if (buffer_blob != NULL) { 96 CompilerThread::current()->set_buffer_blob(buffer_blob); 97 } 98 99 return buffer_blob; 100 } 101 102 103 void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) { |