Mercurial > hg > truffle
comparison src/share/vm/c1x/c1x_Compiler.cpp @ 1412:9195b99c841b
Added first VM entry method.
TODO: Check why initialization method of compiler is not called. Register native methods only once.
author | Thomas Wuerthinger <thomas.wuerthinger@gmail.com> |
---|---|
date | Mon, 17 May 2010 16:37:23 +0200 |
parents | b30a2cd5e3a2 |
children | 1ecc8f0aad00 |
comparison
equal
deleted
inserted
replaced
1411:d0753a274633 | 1412:9195b99c841b |
---|---|
28 | 28 |
29 | 29 |
30 // Initialization | 30 // Initialization |
31 void C1XCompiler::initialize() { | 31 void C1XCompiler::initialize() { |
32 TRACE_C1X_1("initialize"); | 32 TRACE_C1X_1("initialize"); |
33 | |
34 JNIEnv *env = ((JavaThread *)Thread::current())->jni_environment(); | |
35 jclass klass = env->FindClass("com/sun/hotspot/c1x/VMEntries"); | |
36 env->RegisterNatives(klass, VMEntries_methods, VMEntries_methods_count() ); | |
33 } | 37 } |
34 | 38 |
35 // Compilation entry point for methods | 39 // Compilation entry point for methods |
36 void C1XCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { | 40 void C1XCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { |
41 | |
42 initialize(); | |
43 | |
37 VM_ENTRY_MARK; | 44 VM_ENTRY_MARK; |
45 | |
38 | 46 |
39 ResourceMark rm; | 47 ResourceMark rm; |
40 HandleMark hm; | 48 HandleMark hm; |
41 | 49 |
42 CompilerThread::current()->set_compiling(true); | 50 CompilerThread::current()->set_compiling(true); |