< prev index next > src/hotspot/share/runtime/javaCalls.cpp
Print this page
JavaThread* thread = THREAD;
guarantee(thread->is_Java_thread(), "crucial check - the VM thread cannot and must not escape to Java code");
assert(!thread->owns_locks(), "must release all locks when leaving VM");
guarantee(thread->can_call_java(), "cannot make java calls from the native compiler");
+ assert(!thread->preempting(), "");
_result = result;
// Allocate handle block for Java code. This must be done before we change thread_state to _thread_in_Java_or_stub,
// since it can potentially block.
JNIHandleBlock* new_handles = JNIHandleBlock::allocate_block(thread);
// ============ Static calls ============
void JavaCalls::call_static(JavaValue* result, Klass* klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
CallInfo callinfo;
LinkInfo link_info(klass, name, signature);
! LinkResolver::resolve_static_call(callinfo, link_info, true, CHECK);
methodHandle method(THREAD, callinfo.selected_method());
assert(method.not_null(), "should have thrown exception");
// Invoke the method
JavaCalls::call(result, method, args, CHECK);
// ============ Static calls ============
void JavaCalls::call_static(JavaValue* result, Klass* klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
CallInfo callinfo;
LinkInfo link_info(klass, name, signature);
! LinkResolver::resolve_static_call(callinfo, link_info, StaticMode::initialize_klass, CHECK);
methodHandle method(THREAD, callinfo.selected_method());
assert(method.not_null(), "should have thrown exception");
// Invoke the method
JavaCalls::call(result, method, args, CHECK);
< prev index next >