Path: blob/master/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp
40931 views
/*1* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.2* Copyright 2008 Red Hat, Inc.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#include "precompiled.hpp"26#include "asm/assembler.hpp"27#include "interpreter/interpreter.hpp"28#include "interpreter/interpreterRuntime.hpp"29#include "interpreter/zero/bytecodeInterpreter.inline.hpp"30#include "oops/klass.inline.hpp"31#include "oops/methodData.hpp"32#include "oops/method.hpp"33#include "oops/oop.inline.hpp"34#include "runtime/deoptimization.hpp"35#include "runtime/frame.inline.hpp"36#include "runtime/sharedRuntime.hpp"37#include "runtime/stubRoutines.hpp"38#include "runtime/synchronizer.hpp"39#include "runtime/vframeArray.hpp"40#include "utilities/debug.hpp"4142const char *BytecodeInterpreter::name_of_field_at_address(address addr) {43#define DO(member) {if (addr == (address) &(member)) return XSTR(member);}44DO(_thread);45DO(_bcp);46DO(_locals);47DO(_constants);48DO(_method);49DO(_mirror);50DO(_stack);51DO(_msg);52DO(_result);53DO(_prev_link);54DO(_oop_temp);55DO(_stack_base);56DO(_stack_limit);57DO(_monitor_base);58DO(_self_link);59#undef DO60if (addr > (address) &_result && addr < (address) (&_result + 1))61return "_result)";62return NULL;63}6465void BytecodeInterpreter::layout_interpreterState(interpreterState istate,66frame* caller,67frame* current,68Method* method,69intptr_t* locals,70intptr_t* stack,71intptr_t* stack_base,72intptr_t* monitor_base,73intptr_t* frame_bottom,74bool is_top_frame) {75istate->set_locals(locals);76istate->set_method(method);77istate->set_mirror(method->method_holder()->java_mirror());78istate->set_self_link(istate);79istate->set_prev_link(NULL);80// thread will be set by a hacky repurposing of frame::patch_pc()81// bcp will be set by vframeArrayElement::unpack_on_stack()82istate->set_constants(method->constants()->cache());83istate->set_msg(BytecodeInterpreter::method_resume);84istate->set_bcp_advance(0);85istate->set_oop_temp(NULL);86if (caller->is_interpreted_frame()) {87interpreterState prev = caller->get_interpreterState();88prev->set_callee(method);89if (*prev->bcp() == Bytecodes::_invokeinterface)90prev->set_bcp_advance(5);91else92prev->set_bcp_advance(3);93}94istate->set_callee(NULL);95istate->set_monitor_base((BasicObjectLock *) monitor_base);96istate->set_stack_base(stack_base);97istate->set_stack(stack);98istate->set_stack_limit(stack_base - method->max_stack() - 1);99}100101102