comparison src/share/vm/runtime/javaCalls.cpp @ 4993:897b7d18bebc

added RiCompiledMethod.execute and the required VM infrastructure
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 28 Feb 2012 18:00:35 +0100
parents 1b8d02e10ee8
children 11ce128f8d28
comparison
equal deleted inserted replaced
4992:f86ddbd42a7b 4993:897b7d18bebc
332 // Check if we need to wrap a potential OS exception handler around thread 332 // Check if we need to wrap a potential OS exception handler around thread
333 // This is used for e.g. Win32 structured exception handlers 333 // This is used for e.g. Win32 structured exception handlers
334 assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls"); 334 assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
335 // Need to wrap each and everytime, since there might be native code down the 335 // Need to wrap each and everytime, since there might be native code down the
336 // stack that has installed its own exception handlers 336 // stack that has installed its own exception handlers
337 os::os_exception_wrapper(call_helper, result, &method, args, THREAD); 337 os::os_exception_wrapper(call_helper, result, &method, NULL, args, THREAD);
338 } 338 }
339 339
340 void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArguments* args, TRAPS) { 340 void JavaCalls::call(JavaValue* result, methodHandle method, nmethod* nm, JavaCallArguments* args, TRAPS) {
341 // Check if we need to wrap a potential OS exception handler around thread
342 // This is used for e.g. Win32 structured exception handlers
343 assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
344 // Need to wrap each and everytime, since there might be native code down the
345 // stack that has installed its own exception handlers
346 os::os_exception_wrapper(call_helper, result, &method, nm, args, THREAD);
347 }
348
349 void JavaCalls::call_helper(JavaValue* result, methodHandle* m, nmethod* nm, JavaCallArguments* args, TRAPS) {
341 methodHandle method = *m; 350 methodHandle method = *m;
342 JavaThread* thread = (JavaThread*)THREAD; 351 JavaThread* thread = (JavaThread*)THREAD;
343 assert(thread->is_Java_thread(), "must be called by a java thread"); 352 assert(thread->is_Java_thread(), "must be called by a java thread");
344 assert(method.not_null(), "must have a method to call"); 353 assert(method.not_null(), "must have a method to call");
345 assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation"); 354 assert(!SafepointSynchronize::is_at_safepoint(), "call to Java code during VM operation");
412 Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__, method); 421 Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__, method);
413 return; 422 return;
414 } else { 423 } else {
415 // Touch pages checked if the OS needs them to be touched to be mapped. 424 // Touch pages checked if the OS needs them to be touched to be mapped.
416 os::bang_stack_shadow_pages(); 425 os::bang_stack_shadow_pages();
426 }
427
428 if (nm != NULL) {
429 #ifdef GRAAL
430 if (nm->is_alive()) {
431 ((JavaThread*) THREAD)->set_graal_alternate_call_target(nm->entry_point());
432 entry_point = method->adapter()->get_i2c_entry();
433 } else {
434 THROW(vmSymbols::MethodInvalidatedException());
435 }
436 #else
437 ShouldNotReachHere();
438 #endif
417 } 439 }
418 440
419 // do call 441 // do call
420 { JavaCallWrapper link(method, receiver, result, CHECK); 442 { JavaCallWrapper link(method, receiver, result, CHECK);
421 { HandleMark hm(thread); // HandleMark used by HandleMarkCleaner 443 { HandleMark hm(thread); // HandleMark used by HandleMarkCleaner