432 if (!os::stack_shadow_pages_available(THREAD, method, sp)) { 433 // Throw stack overflow exception with preinitialized exception. 434 Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__, method); 435 return; 436 } else { 437 // Touch pages checked if the OS needs them to be touched to be mapped. 438 os::map_stack_shadow_pages(sp); 439 } 440 441 #if INCLUDE_JVMCI 442 if (alternative_target != NULL) { 443 if (alternative_target->is_alive() && !alternative_target->is_unloading()) { 444 thread->set_jvmci_alternate_call_target(alternative_target->verified_entry_point()); 445 entry_point = method->adapter()->get_i2c_entry(); 446 } else { 447 THROW(vmSymbols::jdk_vm_ci_code_InvalidInstalledCodeException()); 448 } 449 } 450 #endif 451 452 // do call 453 { JavaCallWrapper link(method, receiver, result, CHECK); 454 { HandleMark hm(thread); // HandleMark used by HandleMarkCleaner 455 456 StubRoutines::call_stub()( 457 (address)&link, 458 // (intptr_t*)&(result->_value), // see NOTE above (compiler problem) 459 result_val_address, // see NOTE above (compiler problem) 460 result_type, 461 method(), 462 entry_point, 463 args->parameters(), 464 args->size_of_parameters(), 465 CHECK 466 ); 467 468 result = link.result(); // circumvent MS C++ 5.0 compiler bug (result is clobbered across call) 469 // Preserve oop return value across possible gc points 470 if (oop_result_flag) { 471 thread->set_vm_result((oop) result->get_jobject()); | 432 if (!os::stack_shadow_pages_available(THREAD, method, sp)) { 433 // Throw stack overflow exception with preinitialized exception. 434 Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__, method); 435 return; 436 } else { 437 // Touch pages checked if the OS needs them to be touched to be mapped. 438 os::map_stack_shadow_pages(sp); 439 } 440 441 #if INCLUDE_JVMCI 442 if (alternative_target != NULL) { 443 if (alternative_target->is_alive() && !alternative_target->is_unloading()) { 444 thread->set_jvmci_alternate_call_target(alternative_target->verified_entry_point()); 445 entry_point = method->adapter()->get_i2c_entry(); 446 } else { 447 THROW(vmSymbols::jdk_vm_ci_code_InvalidInstalledCodeException()); 448 } 449 } 450 #endif 451 452 Handle vt; 453 if (result->get_type() == T_VALUETYPE) { 454 // Pre allocate buffered value in case the result is returned 455 // flattened by compiled code 456 ValueKlass* vk = method->returned_value_type(thread); 457 vt = vk->allocate_instance_handle(CHECK); 458 result->set_jobject((jobject)vt()); 459 } 460 461 // do call 462 { JavaCallWrapper link(method, receiver, result, CHECK); 463 { HandleMark hm(thread); // HandleMark used by HandleMarkCleaner 464 465 StubRoutines::call_stub()( 466 (address)&link, 467 // (intptr_t*)&(result->_value), // see NOTE above (compiler problem) 468 result_val_address, // see NOTE above (compiler problem) 469 result_type, 470 method(), 471 entry_point, 472 args->parameters(), 473 args->size_of_parameters(), 474 CHECK 475 ); 476 477 result = link.result(); // circumvent MS C++ 5.0 compiler bug (result is clobbered across call) 478 // Preserve oop return value across possible gc points 479 if (oop_result_flag) { 480 thread->set_vm_result((oop) result->get_jobject()); |