1010N/A/*
4155N/A * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
4155N/A * Copyright (c) 2007, 2013, Red Hat, Inc.
1010N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1010N/A *
1010N/A * This code is free software; you can redistribute it and/or modify it
1010N/A * under the terms of the GNU General Public License version 2 only, as
1010N/A * published by the Free Software Foundation.
1010N/A *
1010N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1010N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1010N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1010N/A * version 2 for more details (a copy is included in the LICENSE file that
1010N/A * accompanied this code).
1010N/A *
1010N/A * You should have received a copy of the GNU General Public License version
1010N/A * 2 along with this work; if not, write to the Free Software Foundation,
1010N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1010N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
1010N/A *
1010N/A */
1010N/A
1879N/A#ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
1879N/A#define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
1879N/A
1010N/A// Constructors
1010N/A
1010N/Ainline frame::frame() {
1425N/A _zeroframe = NULL;
1010N/A _sp = NULL;
1010N/A _pc = NULL;
1010N/A _cb = NULL;
1010N/A _deopt_state = unknown;
1010N/A}
1010N/A
4155N/Ainline address frame::sender_pc() const { ShouldNotCallThis(); }
4155N/A
1425N/Ainline frame::frame(ZeroFrame* zf, intptr_t* sp) {
1425N/A _zeroframe = zf;
1010N/A _sp = sp;
1010N/A switch (zeroframe()->type()) {
1010N/A case ZeroFrame::ENTRY_FRAME:
1010N/A _pc = StubRoutines::call_stub_return_pc();
1010N/A _cb = NULL;
1010N/A break;
1010N/A
1010N/A case ZeroFrame::INTERPRETER_FRAME:
1010N/A _pc = NULL;
1010N/A _cb = NULL;
1010N/A break;
1010N/A
1010N/A case ZeroFrame::SHARK_FRAME:
1010N/A _pc = zero_sharkframe()->pc();
1010N/A _cb = CodeCache::find_blob_unsafe(pc());
1010N/A break;
1010N/A
1010N/A case ZeroFrame::FAKE_STUB_FRAME:
1010N/A _pc = NULL;
1010N/A _cb = NULL;
1010N/A break;
1010N/A
1010N/A default:
1010N/A ShouldNotReachHere();
1010N/A }
1010N/A _deopt_state = not_deoptimized;
1010N/A}
1010N/A
1010N/A// Accessors
1010N/A
1010N/Ainline intptr_t* frame::sender_sp() const {
1425N/A return fp() + 1;
1010N/A}
1010N/A
3087N/Ainline intptr_t* frame::real_fp() const {
3087N/A return fp();
3087N/A}
3087N/A
1010N/Ainline intptr_t* frame::link() const {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/A#ifdef CC_INTERP
1010N/Ainline interpreterState frame::get_interpreterState() const {
1010N/A return zero_interpreterframe()->interpreter_state();
1010N/A}
1010N/A
1010N/Ainline intptr_t** frame::interpreter_frame_locals_addr() const {
1010N/A return &(get_interpreterState()->_locals);
1010N/A}
1010N/A
1010N/Ainline intptr_t* frame::interpreter_frame_bcx_addr() const {
1010N/A return (intptr_t*) &(get_interpreterState()->_bcp);
1010N/A}
1010N/A
1010N/Ainline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
1010N/A return &(get_interpreterState()->_constants);
1010N/A}
1010N/A
1010N/Ainline methodOop* frame::interpreter_frame_method_addr() const {
1010N/A return &(get_interpreterState()->_method);
1010N/A}
1010N/A
1010N/Ainline intptr_t* frame::interpreter_frame_mdx_addr() const {
1010N/A return (intptr_t*) &(get_interpreterState()->_mdx);
1010N/A}
1010N/A
1010N/Ainline intptr_t* frame::interpreter_frame_tos_address() const {
1010N/A return get_interpreterState()->_stack + 1;
1010N/A}
1010N/A#endif // CC_INTERP
1010N/A
1010N/Ainline int frame::interpreter_frame_monitor_size() {
1010N/A return BasicObjectLock::size();
1010N/A}
1010N/A
1010N/Ainline intptr_t* frame::interpreter_frame_expression_stack() const {
1010N/A intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
1010N/A return monitor_end - 1;
1010N/A}
1010N/A
1010N/Ainline jint frame::interpreter_frame_expression_stack_direction() {
1010N/A return -1;
1010N/A}
1010N/A
1010N/A// Return a unique id for this frame. The id must have a value where
1010N/A// we can distinguish identity and younger/older relationship. NULL
1010N/A// represents an invalid (incomparable) frame.
1010N/Ainline intptr_t* frame::id() const {
1425N/A return fp();
1010N/A}
1010N/A
1010N/Ainline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
1010N/A return zero_entryframe()->call_wrapper();
1010N/A}
1010N/A
1010N/Ainline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Ainline oop frame::saved_oop_result(RegisterMap* map) const {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Ainline bool frame::is_older(intptr_t* id) const {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Ainline intptr_t* frame::entry_frame_argument_at(int offset) const {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Ainline intptr_t* frame::unextended_sp() const {
1010N/A if (zeroframe()->is_shark_frame())
1010N/A return zero_sharkframe()->unextended_sp();
1010N/A else
1010N/A return (intptr_t *) -1;
1010N/A}
1879N/A
1879N/A#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP