comparison src/share/vm/c1x/c1x_Compiler.cpp @ 1931:48bbaead8b6c

Adjustments after merge with OpenJDK repository.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Tue, 30 Nov 2010 16:39:35 +0100
parents ba37b9335e1e
children 79d04223b8a5
comparison
equal deleted inserted replaced
1930:2d26b0046e0d 1931:48bbaead8b6c
34 } 34 }
35 35
36 // Initialization 36 // Initialization
37 void C1XCompiler::initialize() { 37 void C1XCompiler::initialize() {
38 if (_initialized) return; 38 if (_initialized) return;
39 Thread* THREAD = Thread::current(); 39 CompilerThread* THREAD = CompilerThread::current();
40 _initialized = true; 40 _initialized = true;
41 TRACE_C1X_1("C1XCompiler::initialize"); 41 TRACE_C1X_1("C1XCompiler::initialize");
42
43 initialize_buffer_blob();
44 Runtime1::initialize(THREAD->get_buffer_blob());
42 45
43 JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment(); 46 JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment();
44 jclass klass = env->FindClass("com/sun/hotspot/c1x/VMEntriesNative"); 47 jclass klass = env->FindClass("com/sun/hotspot/c1x/VMEntriesNative");
45 if (klass == NULL) { 48 if (klass == NULL) {
46 fatal("c1x VMEntries class not found"); 49 fatal("c1x VMEntries class not found");
64 if (!result) fatal("Invalid option for C1X!"); 67 if (!result) fatal("Invalid option for C1X!");
65 } 68 }
66 } 69 }
67 } 70 }
68 71
72 void C1XCompiler::initialize_buffer_blob() {
73
74 CompilerThread* THREAD = CompilerThread::current();
75 if (THREAD->get_buffer_blob() == NULL) {
76 // setup CodeBuffer. Preallocate a BufferBlob of size
77 // NMethodSizeLimit plus some extra space for constants.
78 int code_buffer_size = Compilation::desired_max_code_buffer_size() +
79 Compilation::desired_max_constant_size();
80 BufferBlob* blob = BufferBlob::create("C1X temporary CodeBuffer",
81 code_buffer_size);
82 guarantee(blob != NULL, "must create code buffer");
83 THREAD->set_buffer_blob(blob);
84 }
85 }
86
69 // Compilation entry point for methods 87 // Compilation entry point for methods
70 void C1XCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { 88 void C1XCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
71 initialize(); 89 initialize();
72 VM_ENTRY_MARK; 90 VM_ENTRY_MARK;
73 ResourceMark rm; 91 ResourceMark rm;
74 HandleMark hm; 92 HandleMark hm;
75 93
94 initialize_buffer_blob();
76 VmIds::initializeObjects(); 95 VmIds::initializeObjects();
77 96
78 CompilerThread::current()->set_compiling(true); 97 CompilerThread::current()->set_compiling(true);
79 methodOop method = (methodOop) target->get_oop(); 98 methodOop method = (methodOop) target->get_oop();
80 VMExits::compileMethod(VmIds::add<methodOop>(method), VmIds::toString<Handle>(method->name(), THREAD), entry_bci); 99 VMExits::compileMethod(VmIds::add<methodOop>(method), VmIds::toString<Handle>(method->name(), THREAD), entry_bci);
154 case 'd': return T_DOUBLE; 173 case 'd': return T_DOUBLE;
155 case 'a': return T_OBJECT; 174 case 'a': return T_OBJECT;
156 case 'r': return T_ADDRESS; 175 case 'r': return T_ADDRESS;
157 case '-': return T_ILLEGAL; 176 case '-': return T_ILLEGAL;
158 default: 177 default:
159 fatal1("unexpected CiKind: %c", ch); 178 fatal(err_msg("unexpected CiKind: %c", ch));
160 break; 179 break;
161 } 180 }
162 } 181 }
163 182