1 /* |
1 /* |
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 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. |
1270 |
1270 |
1271 // If result is an oop unbox and store it in frame where gc will see it |
1271 // If result is an oop unbox and store it in frame where gc will see it |
1272 // and result handler will pick it up |
1272 // and result handler will pick it up |
1273 |
1273 |
1274 { |
1274 { |
1275 Label no_oop, store_result; |
1275 Label no_oop; |
1276 __ lea(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT))); |
1276 __ lea(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT))); |
1277 __ cmpptr(t, Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize)); |
1277 __ cmpptr(t, Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize)); |
1278 __ jcc(Assembler::notEqual, no_oop); |
1278 __ jcc(Assembler::notEqual, no_oop); |
1279 // retrieve result |
1279 // retrieve result |
1280 __ pop(ltos); |
1280 __ pop(ltos); |
1281 __ testptr(rax, rax); |
1281 // Unbox oop result, e.g. JNIHandles::resolve value. |
1282 __ jcc(Assembler::zero, store_result); |
1282 __ resolve_jobject(rax /* value */, |
1283 __ movptr(rax, Address(rax, 0)); |
1283 r15_thread /* thread */, |
1284 __ bind(store_result); |
1284 t /* tmp */); |
1285 __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset*wordSize), rax); |
1285 __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset*wordSize), rax); |
1286 // keep stack depth as expected by pushing oop which will eventually be discarde |
1286 // keep stack depth as expected by pushing oop which will eventually be discarde |
1287 __ push(ltos); |
1287 __ push(ltos); |
1288 __ bind(no_oop); |
1288 __ bind(no_oop); |
1289 } |
1289 } |