Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/javaCalls.cpp @ 1407:09e7826ecf01
Can now call to Java code from the VM.
Need to specify a JAR file with the classes from the Maxine subprojects C1X, CRI, and HotSpotVM in the bootclasspath.
See HotSpotVM/README.txt in the Maxine sources for details.
author | Thomas Wuerthinger <thomas.wuerthinger@gmail.com> |
---|---|
date | Tue, 11 May 2010 19:24:14 +0200 |
parents | b9fba36710f2 |
children | 6223633ce7dd |
comparison
equal
deleted
inserted
replaced
1406:35069ca331f2 | 1407:09e7826ecf01 |
---|---|
32 JavaThread* thread = (JavaThread *)THREAD; | 32 JavaThread* thread = (JavaThread *)THREAD; |
33 bool clear_pending_exception = true; | 33 bool clear_pending_exception = true; |
34 | 34 |
35 guarantee(thread->is_Java_thread(), "crucial check - the VM thread cannot and must not escape to Java code"); | 35 guarantee(thread->is_Java_thread(), "crucial check - the VM thread cannot and must not escape to Java code"); |
36 assert(!thread->owns_locks(), "must release all locks when leaving VM"); | 36 assert(!thread->owns_locks(), "must release all locks when leaving VM"); |
37 guarantee(!thread->is_Compiler_thread(), "cannot make java calls from the compiler"); | 37 // (tw) may we do this? |
38 // guarantee(!thread->is_Compiler_thread(), "cannot make java calls from the compiler"); | |
38 _result = result; | 39 _result = result; |
39 | 40 |
40 // Allocate handle block for Java code. This must be done before we change thread_state to _thread_in_Java_or_stub, | 41 // Allocate handle block for Java code. This must be done before we change thread_state to _thread_in_Java_or_stub, |
41 // since it can potentially block. | 42 // since it can potentially block. |
42 JNIHandleBlock* new_handles = JNIHandleBlock::allocate_block(thread); | 43 JNIHandleBlock* new_handles = JNIHandleBlock::allocate_block(thread); |
326 assert(instanceKlass::cast(holder)->is_linked(), "rewritting must have taken place"); | 327 assert(instanceKlass::cast(holder)->is_linked(), "rewritting must have taken place"); |
327 } | 328 } |
328 #endif | 329 #endif |
329 | 330 |
330 | 331 |
331 assert(!thread->is_Compiler_thread(), "cannot compile from the compiler"); | 332 // (tw) may we do this? |
333 //assert(!thread->is_Compiler_thread(), "cannot compile from the compiler"); | |
332 if (CompilationPolicy::mustBeCompiled(method)) { | 334 if (CompilationPolicy::mustBeCompiled(method)) { |
333 CompileBroker::compile_method(method, InvocationEntryBci, | 335 CompileBroker::compile_method(method, InvocationEntryBci, |
334 methodHandle(), 0, "mustBeCompiled", CHECK); | 336 methodHandle(), 0, "mustBeCompiled", CHECK); |
335 } | 337 } |
336 | 338 |