Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
32285 views
/*1* Copyright (c) 2003, 2013, 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_VM_FRAME_ZERO_INLINE_HPP26#define CPU_ZERO_VM_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::SHARK_FRAME: {59_pc = zero_sharkframe()->pc();60_cb = CodeCache::find_blob_unsafe(pc());61address original_pc = nmethod::get_deopt_original_pc(this);62if (original_pc != NULL) {63_pc = original_pc;64_deopt_state = is_deoptimized;65} else {66_deopt_state = not_deoptimized;67}68break;69}70case ZeroFrame::FAKE_STUB_FRAME:71_pc = NULL;72_cb = NULL;73_deopt_state = not_deoptimized;74break;7576default:77ShouldNotReachHere();78}79}8081// Accessors8283inline intptr_t* frame::sender_sp() const {84return fp() + 1;85}8687inline intptr_t* frame::real_fp() const {88return fp();89}9091inline intptr_t* frame::link() const {92ShouldNotCallThis();93return NULL;94}9596#ifdef CC_INTERP97inline interpreterState frame::get_interpreterState() const {98return zero_interpreterframe()->interpreter_state();99}100101inline intptr_t** frame::interpreter_frame_locals_addr() const {102return &(get_interpreterState()->_locals);103}104105inline intptr_t* frame::interpreter_frame_bcx_addr() const {106return (intptr_t*) &(get_interpreterState()->_bcp);107}108109inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {110return &(get_interpreterState()->_constants);111}112113inline Method** frame::interpreter_frame_method_addr() const {114return &(get_interpreterState()->_method);115}116117inline intptr_t* frame::interpreter_frame_mdx_addr() const {118return (intptr_t*) &(get_interpreterState()->_mdx);119}120121inline intptr_t* frame::interpreter_frame_tos_address() const {122return get_interpreterState()->_stack + 1;123}124#endif // CC_INTERP125126inline int frame::interpreter_frame_monitor_size() {127return BasicObjectLock::size();128}129130inline intptr_t* frame::interpreter_frame_expression_stack() const {131intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();132return monitor_end - 1;133}134135inline jint frame::interpreter_frame_expression_stack_direction() {136return -1;137}138139// Return a unique id for this frame. The id must have a value where140// we can distinguish identity and younger/older relationship. NULL141// represents an invalid (incomparable) frame.142inline intptr_t* frame::id() const {143return fp();144}145146inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {147return zero_entryframe()->call_wrapper();148}149150inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {151ShouldNotCallThis();152}153154inline oop frame::saved_oop_result(RegisterMap* map) const {155ShouldNotCallThis();156return NULL;157}158159inline bool frame::is_older(intptr_t* id) const {160ShouldNotCallThis();161return false;162}163164inline intptr_t* frame::entry_frame_argument_at(int offset) const {165ShouldNotCallThis();166return NULL;167}168169inline intptr_t* frame::unextended_sp() const {170if (zeroframe()->is_shark_frame())171return zero_sharkframe()->unextended_sp();172else173return (intptr_t *) -1;174}175176#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP177178179