hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp
changeset 44406 a46a6c4d1dd9
parent 44093 e22e0d071bf9
child 46369 3bf4544bec14
equal deleted inserted replaced
44405:5bc48f22b149 44406:a46a6c4d1dd9
     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.
  1191 
  1191 
  1192   // If result is an oop unbox and store it in frame where gc will see it
  1192   // If result is an oop unbox and store it in frame where gc will see it
  1193   // and result handler will pick it up
  1193   // and result handler will pick it up
  1194 
  1194 
  1195   {
  1195   {
  1196     Label no_oop, store_result;
  1196     Label no_oop, not_weak, store_result;
  1197     __ lea(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT)));
  1197     __ lea(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT)));
  1198     __ cmpptr(t, Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize));
  1198     __ cmpptr(t, Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize));
  1199     __ jcc(Assembler::notEqual, no_oop);
  1199     __ jcc(Assembler::notEqual, no_oop);
  1200     // retrieve result
  1200     // retrieve result
  1201     __ pop(ltos);
  1201     __ pop(ltos);
  1202     __ testptr(rax, rax);
  1202     // Unbox oop result, e.g. JNIHandles::resolve value.
  1203     __ jcc(Assembler::zero, store_result);
  1203     __ resolve_jobject(rax /* value */,
  1204     __ movptr(rax, Address(rax, 0));
  1204                        thread /* thread */,
  1205     __ bind(store_result);
  1205                        t /* tmp */);
  1206     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset*wordSize), rax);
  1206     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset*wordSize), rax);
  1207     // keep stack depth as expected by pushing oop which will eventually be discarded
  1207     // keep stack depth as expected by pushing oop which will eventually be discarded
  1208     __ push(ltos);
  1208     __ push(ltos);
  1209     __ bind(no_oop);
  1209     __ bind(no_oop);
  1210   }
  1210   }