Mercurial > hg > graal-compiler
comparison src/share/vm/graal/graalCompiler.cpp @ 7125:1baf7f1e3f23
decoupled C++ Graal runtime from C1
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 03 Dec 2012 15:32:17 +0100 |
parents | 1c76a458616e |
children | ce248dc0a656 |
comparison
equal
deleted
inserted
replaced
7124:ab65fa23f8e9 | 7125:1baf7f1e3f23 |
---|---|
28 #include "graal/graalJavaAccess.hpp" | 28 #include "graal/graalJavaAccess.hpp" |
29 #include "graal/graalVMToCompiler.hpp" | 29 #include "graal/graalVMToCompiler.hpp" |
30 #include "graal/graalCompilerToVM.hpp" | 30 #include "graal/graalCompilerToVM.hpp" |
31 #include "graal/graalVmIds.hpp" | 31 #include "graal/graalVmIds.hpp" |
32 #include "graal/graalEnv.hpp" | 32 #include "graal/graalEnv.hpp" |
33 #include "c1/c1_Runtime1.hpp" | 33 #include "graal/graalRuntime.hpp" |
34 #include "runtime/arguments.hpp" | 34 #include "runtime/arguments.hpp" |
35 #include "runtime/compilationPolicy.hpp" | 35 #include "runtime/compilationPolicy.hpp" |
36 | 36 |
37 GraalCompiler* GraalCompiler::_instance = NULL; | 37 GraalCompiler* GraalCompiler::_instance = NULL; |
38 | 38 |
55 NOT_LP64(error("check TLAB allocation code for address space conflicts")); | 55 NOT_LP64(error("check TLAB allocation code for address space conflicts")); |
56 | 56 |
57 _deopted_leaf_graph_count = 0; | 57 _deopted_leaf_graph_count = 0; |
58 | 58 |
59 initialize_buffer_blob(); | 59 initialize_buffer_blob(); |
60 Runtime1::initialize(THREAD->get_buffer_blob()); | 60 GraalRuntime::initialize(THREAD->get_buffer_blob()); |
61 | 61 |
62 JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment(); | 62 JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment(); |
63 jclass klass = env->FindClass("com/oracle/graal/hotspot/bridge/CompilerToVMImpl"); | 63 jclass klass = env->FindClass("com/oracle/graal/hotspot/bridge/CompilerToVMImpl"); |
64 if (klass == NULL) { | 64 if (klass == NULL) { |
65 tty->print_cr("graal CompilerToVMImpl class not found"); | 65 tty->print_cr("graal CompilerToVMImpl class not found"); |
142 | 142 |
143 void GraalCompiler::initialize_buffer_blob() { | 143 void GraalCompiler::initialize_buffer_blob() { |
144 | 144 |
145 JavaThread* THREAD = JavaThread::current(); | 145 JavaThread* THREAD = JavaThread::current(); |
146 if (THREAD->get_buffer_blob() == NULL) { | 146 if (THREAD->get_buffer_blob() == NULL) { |
147 // setup CodeBuffer. Preallocate a BufferBlob of size | 147 BufferBlob* blob = BufferBlob::create("Graal thread-local CodeBuffer", GraalNMethodSizeLimit); |
148 // NMethodSizeLimit plus some extra space for constants. | |
149 int code_buffer_size = Compilation::desired_max_code_buffer_size() + | |
150 Compilation::desired_max_constant_size(); | |
151 BufferBlob* blob = BufferBlob::create("graal temporary CodeBuffer", | |
152 code_buffer_size); | |
153 guarantee(blob != NULL, "must create code buffer"); | 148 guarantee(blob != NULL, "must create code buffer"); |
154 THREAD->set_buffer_blob(blob); | 149 THREAD->set_buffer_blob(blob); |
155 } | 150 } |
156 } | 151 } |
157 | 152 |