285 call_static(result, klass, name, signature, &args, CHECK);
286 }
287
288
289 void JavaCalls::call_static(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, Handle arg1, Handle arg2, TRAPS) {
290 JavaCallArguments args; // One oop argument
291 args.push_oop(arg1);
292 args.push_oop(arg2);
293 call_static(result, klass, name, signature, &args, CHECK);
294 }
295
296
297 // -------------------------------------------------
298 // Implementation of JavaCalls (low level)
299
300
301 void JavaCalls::call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS) {
302 // Check if we need to wrap a potential OS exception handler around thread
303 // This is used for e.g. Win32 structured exception handlers
304 assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
305 // Need to wrap each and everytime, since there might be native code down the
306 // stack that has installed its own exception handlers
307 os::os_exception_wrapper(call_helper, result, &method, args, THREAD);
308 }
309
310 void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArguments* args, TRAPS) {
311 methodHandle method = *m;
312 JavaThread* thread = (JavaThread*)THREAD;
313 assert(thread->is_Java_thread(), "must be called by a java thread");
314 assert(method.not_null(), "must have a method to call");
315 assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation");
316 assert(!thread->handle_area()->no_handle_mark_active(), "cannot call out to Java here");
317
318
319 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
320
321 // Verify the arguments
322
323 if (CheckJNICalls) {
324 args->verify(method, result->get_type(), thread);
325 }
|
285 call_static(result, klass, name, signature, &args, CHECK);
286 }
287
288
289 void JavaCalls::call_static(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, Handle arg1, Handle arg2, TRAPS) {
290 JavaCallArguments args; // One oop argument
291 args.push_oop(arg1);
292 args.push_oop(arg2);
293 call_static(result, klass, name, signature, &args, CHECK);
294 }
295
296
297 // -------------------------------------------------
298 // Implementation of JavaCalls (low level)
299
300
301 void JavaCalls::call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS) {
302 // Check if we need to wrap a potential OS exception handler around thread
303 // This is used for e.g. Win32 structured exception handlers
304 assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
305 // Need to wrap each and every time, since there might be native code down the
306 // stack that has installed its own exception handlers
307 os::os_exception_wrapper(call_helper, result, &method, args, THREAD);
308 }
309
310 void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArguments* args, TRAPS) {
311 methodHandle method = *m;
312 JavaThread* thread = (JavaThread*)THREAD;
313 assert(thread->is_Java_thread(), "must be called by a java thread");
314 assert(method.not_null(), "must have a method to call");
315 assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation");
316 assert(!thread->handle_area()->no_handle_mark_active(), "cannot call out to Java here");
317
318
319 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
320
321 // Verify the arguments
322
323 if (CheckJNICalls) {
324 args->verify(method, result->get_type(), thread);
325 }
|