76 mark_initialized();
77 }
78
79
80 BufferBlob* Compiler::get_buffer_blob(ciEnv* env) {
81 // Allocate buffer blob once at startup since allocation for each
82 // compilation seems to be too expensive (at least on Intel win32).
83 BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
84 if (buffer_blob != NULL) {
85 return buffer_blob;
86 }
87
88 // setup CodeBuffer. Preallocate a BufferBlob of size
89 // NMethodSizeLimit plus some extra space for constants.
90 int code_buffer_size = Compilation::desired_max_code_buffer_size() +
91 Compilation::desired_max_constant_size();
92
93 buffer_blob = BufferBlob::create("Compiler1 temporary CodeBuffer",
94 code_buffer_size);
95 if (buffer_blob == NULL) {
96 CompileBroker::handle_full_code_cache();
97 env->record_failure("CodeCache is full");
98 } else {
99 CompilerThread::current()->set_buffer_blob(buffer_blob);
100 }
101
102 return buffer_blob;
103 }
104
105
106 void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) {
107 BufferBlob* buffer_blob = Compiler::get_buffer_blob(env);
108 if (buffer_blob == NULL) {
109 return;
110 }
111
112 if (!is_initialized()) {
113 initialize();
114 }
115
116 // invoke compilation
|
76 mark_initialized();
77 }
78
79
80 BufferBlob* Compiler::get_buffer_blob(ciEnv* env) {
81 // Allocate buffer blob once at startup since allocation for each
82 // compilation seems to be too expensive (at least on Intel win32).
83 BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
84 if (buffer_blob != NULL) {
85 return buffer_blob;
86 }
87
88 // setup CodeBuffer. Preallocate a BufferBlob of size
89 // NMethodSizeLimit plus some extra space for constants.
90 int code_buffer_size = Compilation::desired_max_code_buffer_size() +
91 Compilation::desired_max_constant_size();
92
93 buffer_blob = BufferBlob::create("Compiler1 temporary CodeBuffer",
94 code_buffer_size);
95 if (buffer_blob == NULL) {
96 CompileBroker::handle_full_code_cache(CodeBlobType::NonMethod);
97 env->record_failure("CodeCache is full");
98 } else {
99 CompilerThread::current()->set_buffer_blob(buffer_blob);
100 }
101
102 return buffer_blob;
103 }
104
105
106 void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) {
107 BufferBlob* buffer_blob = Compiler::get_buffer_blob(env);
108 if (buffer_blob == NULL) {
109 return;
110 }
111
112 if (!is_initialized()) {
113 initialize();
114 }
115
116 // invoke compilation
|