2236 2237 __ bind(done); 2238 2239 } 2240 2241 { 2242 SkipIfEqual skip_if(masm, &DTraceMethodProbes, 0); 2243 // Tell dtrace about this method exit 2244 save_native_result(masm, ret_type, stack_slots); 2245 __ mov_metadata(rax, method()); 2246 __ call_VM_leaf( 2247 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), 2248 thread, rax); 2249 restore_native_result(masm, ret_type, stack_slots); 2250 } 2251 2252 // We can finally stop using that last_Java_frame we setup ages ago 2253 2254 __ reset_last_Java_frame(thread, false); 2255 2256 // Unpack oop result 2257 if (ret_type == T_OBJECT || ret_type == T_ARRAY) { 2258 Label L; 2259 __ cmpptr(rax, (int32_t)NULL_WORD); 2260 __ jcc(Assembler::equal, L); 2261 __ movptr(rax, Address(rax, 0)); 2262 __ bind(L); 2263 __ verify_oop(rax); 2264 } 2265 2266 if (!is_critical_native) { 2267 // reset handle block 2268 __ movptr(rcx, Address(thread, JavaThread::active_handles_offset())); 2269 __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD); 2270 2271 // Any exception pending? 2272 __ cmpptr(Address(thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD); 2273 __ jcc(Assembler::notEqual, exception_pending); 2274 } 2275 2276 // no exception, we're almost done 2277 2278 // check that only result value is on FPU stack 2279 __ verify_FPU(ret_type == T_FLOAT || ret_type == T_DOUBLE ? 1 : 0, "native_wrapper normal exit"); 2280 2281 // Fixup floating pointer results so that result looks like a return from a compiled method 2282 if (ret_type == T_FLOAT) { 2283 if (UseSSE >= 1) { | 2236 2237 __ bind(done); 2238 2239 } 2240 2241 { 2242 SkipIfEqual skip_if(masm, &DTraceMethodProbes, 0); 2243 // Tell dtrace about this method exit 2244 save_native_result(masm, ret_type, stack_slots); 2245 __ mov_metadata(rax, method()); 2246 __ call_VM_leaf( 2247 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), 2248 thread, rax); 2249 restore_native_result(masm, ret_type, stack_slots); 2250 } 2251 2252 // We can finally stop using that last_Java_frame we setup ages ago 2253 2254 __ reset_last_Java_frame(thread, false); 2255 2256 // Unbox oop result, e.g. JNIHandles::resolve value. 2257 if (ret_type == T_OBJECT || ret_type == T_ARRAY) { 2258 __ resolve_jobject(rax /* value */, 2259 thread /* thread */, 2260 rcx /* tmp */); 2261 } 2262 2263 if (!is_critical_native) { 2264 // reset handle block 2265 __ movptr(rcx, Address(thread, JavaThread::active_handles_offset())); 2266 __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD); 2267 2268 // Any exception pending? 2269 __ cmpptr(Address(thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD); 2270 __ jcc(Assembler::notEqual, exception_pending); 2271 } 2272 2273 // no exception, we're almost done 2274 2275 // check that only result value is on FPU stack 2276 __ verify_FPU(ret_type == T_FLOAT || ret_type == T_DOUBLE ? 1 : 0, "native_wrapper normal exit"); 2277 2278 // Fixup floating pointer results so that result looks like a return from a compiled method 2279 if (ret_type == T_FLOAT) { 2280 if (UseSSE >= 1) { |