1 /* |
1 /* |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
1294 // reset handle block |
1294 // reset handle block |
1295 __ movptr(t, Address(thread, JavaThread::active_handles_offset())); |
1295 __ movptr(t, Address(thread, JavaThread::active_handles_offset())); |
1296 __ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD); |
1296 __ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD); |
1297 |
1297 |
1298 // If result was an oop then unbox and save it in the frame |
1298 // If result was an oop then unbox and save it in the frame |
1299 { Label L; |
1299 { |
1300 Label no_oop, store_result; |
1300 Label no_oop; |
1301 ExternalAddress handler(AbstractInterpreter::result_handler(T_OBJECT)); |
1301 ExternalAddress handler(AbstractInterpreter::result_handler(T_OBJECT)); |
1302 __ cmpptr(Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize), |
1302 __ cmpptr(Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize), |
1303 handler.addr()); |
1303 handler.addr()); |
1304 __ jcc(Assembler::notEqual, no_oop); |
1304 __ jcc(Assembler::notEqual, no_oop); |
1305 __ cmpptr(Address(rsp, 0), (int32_t)NULL_WORD); |
1305 __ cmpptr(Address(rsp, 0), (int32_t)NULL_WORD); |
1306 __ pop(ltos); |
1306 __ pop(ltos); |
1307 __ testptr(rax, rax); |
1307 // Unbox oop result, e.g. JNIHandles::resolve value. |
1308 __ jcc(Assembler::zero, store_result); |
1308 __ resolve_jobject(rax /* value */, |
1309 // unbox |
1309 thread /* thread */, |
1310 __ movptr(rax, Address(rax, 0)); |
1310 t /* tmp */); |
1311 __ bind(store_result); |
|
1312 __ movptr(Address(rbp, (frame::interpreter_frame_oop_temp_offset)*wordSize), rax); |
1311 __ movptr(Address(rbp, (frame::interpreter_frame_oop_temp_offset)*wordSize), rax); |
1313 // keep stack depth as expected by pushing oop which will eventually be discarded |
1312 // keep stack depth as expected by pushing oop which will eventually be discarded |
1314 __ push(ltos); |
1313 __ push(ltos); |
1315 __ bind(no_oop); |
1314 __ bind(no_oop); |
1316 } |
1315 } |