292 args.push_oop(arg1);
293 args.push_oop(arg2);
294 call_static(result, klass, name, signature, &args, CHECK);
295 }
296
297
298 // -------------------------------------------------
299 // Implementation of JavaCalls (low level)
300
301
302 void JavaCalls::call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS) {
303 // Check if we need to wrap a potential OS exception handler around thread
304 // This is used for e.g. Win32 structured exception handlers
305 assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
306 // Need to wrap each and every time, since there might be native code down the
307 // stack that has installed its own exception handlers
308 os::os_exception_wrapper(call_helper, result, &method, args, THREAD);
309 }
310
311 void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArguments* args, TRAPS) {
312 methodHandle method = *m;
313 JavaThread* thread = (JavaThread*)THREAD;
314 assert(thread->is_Java_thread(), "must be called by a java thread");
315 assert(method.not_null(), "must have a method to call");
316 assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation");
317 assert(!thread->handle_area()->no_handle_mark_active(), "cannot call out to Java here");
318
319
320 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
321
322 // Verify the arguments
323
324 if (CheckJNICalls) {
325 args->verify(method, result->get_type(), thread);
326 }
327 else debug_only(args->verify(method, result->get_type(), thread));
328
329 // Ignore call if method is empty
330 if (method->is_empty_method()) {
331 assert(result->get_type() == T_VOID, "an empty method must return a void value");
|
292 args.push_oop(arg1);
293 args.push_oop(arg2);
294 call_static(result, klass, name, signature, &args, CHECK);
295 }
296
297
298 // -------------------------------------------------
299 // Implementation of JavaCalls (low level)
300
301
302 void JavaCalls::call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS) {
303 // Check if we need to wrap a potential OS exception handler around thread
304 // This is used for e.g. Win32 structured exception handlers
305 assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
306 // Need to wrap each and every time, since there might be native code down the
307 // stack that has installed its own exception handlers
308 os::os_exception_wrapper(call_helper, result, &method, args, THREAD);
309 }
310
311 void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArguments* args, TRAPS) {
312 // During dumping, Java execution environment is not fully initialized. Also, Java execution
313 // may cause undesirable side-effects in the class metadata.
314 assert(!DumpSharedSpaces, "must not execute Java bytecodes when dumping");
315
316 methodHandle method = *m;
317 JavaThread* thread = (JavaThread*)THREAD;
318 assert(thread->is_Java_thread(), "must be called by a java thread");
319 assert(method.not_null(), "must have a method to call");
320 assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation");
321 assert(!thread->handle_area()->no_handle_mark_active(), "cannot call out to Java here");
322
323
324 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
325
326 // Verify the arguments
327
328 if (CheckJNICalls) {
329 args->verify(method, result->get_type(), thread);
330 }
331 else debug_only(args->verify(method, result->get_type(), thread));
332
333 // Ignore call if method is empty
334 if (method->is_empty_method()) {
335 assert(result->get_type() == T_VOID, "an empty method must return a void value");
|