Path: blob/master/src/hotspot/cpu/zero/frame_zero.inline.hpp
40931 views
/*1* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.2* Copyright 2007, 2008, 2009, 2010 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#ifndef CPU_ZERO_FRAME_ZERO_INLINE_HPP26#define CPU_ZERO_FRAME_ZERO_INLINE_HPP2728#include "code/codeCache.hpp"2930// Constructors3132inline frame::frame() {33_zeroframe = NULL;34_sp = NULL;35_pc = NULL;36_cb = NULL;37_deopt_state = unknown;38}3940inline address frame::sender_pc() const { ShouldNotCallThis(); return NULL; }4142inline frame::frame(ZeroFrame* zf, intptr_t* sp) {43_zeroframe = zf;44_sp = sp;45switch (zeroframe()->type()) {46case ZeroFrame::ENTRY_FRAME:47_pc = StubRoutines::call_stub_return_pc();48_cb = NULL;49_deopt_state = not_deoptimized;50break;5152case ZeroFrame::INTERPRETER_FRAME:53_pc = NULL;54_cb = NULL;55_deopt_state = not_deoptimized;56break;5758case ZeroFrame::FAKE_STUB_FRAME:59_pc = NULL;60_cb = NULL;61_deopt_state = not_deoptimized;62break;6364default:65ShouldNotReachHere();66}67}6869// Accessors7071inline intptr_t* frame::sender_sp() const {72return fp() + 1;73}7475inline intptr_t* frame::real_fp() const {76return fp();77}7879inline intptr_t* frame::link() const {80ShouldNotCallThis();81return NULL;82}8384inline interpreterState frame::get_interpreterState() const {85return zero_interpreterframe()->interpreter_state();86}8788inline intptr_t** frame::interpreter_frame_locals_addr() const {89return &(get_interpreterState()->_locals);90}9192inline intptr_t* frame::interpreter_frame_bcp_addr() const {93return (intptr_t*) &(get_interpreterState()->_bcp);94}9596inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {97return &(get_interpreterState()->_constants);98}99100inline Method** frame::interpreter_frame_method_addr() const {101return &(get_interpreterState()->_method);102}103104inline oop* frame::interpreter_frame_mirror_addr() const {105return &(get_interpreterState()->_mirror);106}107108inline intptr_t* frame::interpreter_frame_mdp_addr() const {109fatal("Should not call this: Zero never profiles");110return NULL; // silence compiler warnings111}112113inline intptr_t* frame::interpreter_frame_tos_address() const {114return get_interpreterState()->_stack + 1;115}116117inline oop* frame::interpreter_frame_temp_oop_addr() const {118interpreterState istate = get_interpreterState();119return (oop *)&istate->_oop_temp;120}121122inline int frame::interpreter_frame_monitor_size() {123return BasicObjectLock::size();124}125126inline intptr_t* frame::interpreter_frame_expression_stack() const {127intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();128return monitor_end - 1;129}130131// Return a unique id for this frame. The id must have a value where132// we can distinguish identity and younger/older relationship. NULL133// represents an invalid (incomparable) frame.134inline intptr_t* frame::id() const {135return fp();136}137138inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {139return zero_entryframe()->call_wrapper();140}141142inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {143ShouldNotCallThis();144}145146inline oop frame::saved_oop_result(RegisterMap* map) const {147ShouldNotCallThis();148return NULL;149}150151inline bool frame::is_older(intptr_t* id) const {152ShouldNotCallThis();153return false;154}155156inline intptr_t* frame::entry_frame_argument_at(int offset) const {157ShouldNotCallThis();158return NULL;159}160161inline intptr_t* frame::unextended_sp() const {162return (intptr_t *) -1;163}164165#endif // CPU_ZERO_FRAME_ZERO_INLINE_HPP166167168