frame_zero.inline.hpp revision 3602:da91efe96a93
12786Ssos/*
22786Ssos * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
32786Ssos * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
42786Ssos * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
52786Ssos *
62786Ssos * This code is free software; you can redistribute it and/or modify it
72786Ssos * under the terms of the GNU General Public License version 2 only, as
82786Ssos * published by the Free Software Foundation.
92786Ssos *
102786Ssos * This code is distributed in the hope that it will be useful, but WITHOUT
112786Ssos * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
122786Ssos * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
132786Ssos * version 2 for more details (a copy is included in the LICENSE file that
142786Ssos * accompanied this code).
152786Ssos *
162786Ssos * You should have received a copy of the GNU General Public License version
172786Ssos * 2 along with this work; if not, write to the Free Software Foundation,
182786Ssos * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
197420Ssos *
202786Ssos * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
212786Ssos * or visit www.oracle.com if you need additional information or have any
222786Ssos * questions.
232786Ssos *
242786Ssos */
252786Ssos
262786Ssos#ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
272786Ssos#define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
282786Ssos
292786Ssos// Constructors
302786Ssos
312786Ssosinline frame::frame() {
322786Ssos  _zeroframe = NULL;
332786Ssos  _sp = NULL;
342786Ssos  _pc = NULL;
352786Ssos  _cb = NULL;
362786Ssos  _deopt_state = unknown;
372786Ssos}
382786Ssos
392786Ssosinline frame::frame(ZeroFrame* zf, intptr_t* sp) {
402786Ssos  _zeroframe = zf;
412786Ssos  _sp = sp;
422786Ssos  switch (zeroframe()->type()) {
432786Ssos  case ZeroFrame::ENTRY_FRAME:
442786Ssos    _pc = StubRoutines::call_stub_return_pc();
452786Ssos    _cb = NULL;
462786Ssos    break;
472786Ssos
482786Ssos  case ZeroFrame::INTERPRETER_FRAME:
492786Ssos    _pc = NULL;
502786Ssos    _cb = NULL;
512786Ssos    break;
522786Ssos
532786Ssos  case ZeroFrame::SHARK_FRAME:
542786Ssos    _pc = zero_sharkframe()->pc();
552786Ssos    _cb = CodeCache::find_blob_unsafe(pc());
562786Ssos    break;
572786Ssos
582786Ssos  case ZeroFrame::FAKE_STUB_FRAME:
592786Ssos    _pc = NULL;
602786Ssos    _cb = NULL;
612786Ssos    break;
626851Ssos
632786Ssos  default:
642786Ssos    ShouldNotReachHere();
652786Ssos  }
662786Ssos  _deopt_state = not_deoptimized;
672786Ssos}
682786Ssos
692786Ssos// Accessors
702786Ssos
712786Ssosinline intptr_t* frame::sender_sp() const {
722786Ssos  return fp() + 1;
732786Ssos}
742786Ssos
752786Ssosinline intptr_t* frame::real_fp() const {
762786Ssos  return fp();
772786Ssos}
782786Ssos
792786Ssosinline intptr_t* frame::link() const {
802786Ssos  ShouldNotCallThis();
815994Ssos}
822786Ssos
832786Ssos#ifdef CC_INTERP
842786Ssosinline interpreterState frame::get_interpreterState() const {
852786Ssos  return zero_interpreterframe()->interpreter_state();
862786Ssos}
872786Ssos
886045Ssosinline intptr_t** frame::interpreter_frame_locals_addr() const {
892786Ssos  return &(get_interpreterState()->_locals);
902786Ssos}
912786Ssos
922786Ssosinline intptr_t* frame::interpreter_frame_bcx_addr() const {
932786Ssos  return (intptr_t*) &(get_interpreterState()->_bcp);
9418194Ssos}
952786Ssos
962786Ssosinline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
972786Ssos  return &(get_interpreterState()->_constants);
982786Ssos}
992786Ssos
1002786Ssosinline Method** frame::interpreter_frame_method_addr() const {
1012786Ssos  return &(get_interpreterState()->_method);
1022786Ssos}
1032786Ssos
1042786Ssosinline intptr_t* frame::interpreter_frame_mdx_addr() const {
1052786Ssos  return (intptr_t*) &(get_interpreterState()->_mdx);
1062786Ssos}
1072786Ssos
1086851Ssosinline intptr_t* frame::interpreter_frame_tos_address() const {
1092786Ssos  return get_interpreterState()->_stack + 1;
1106851Ssos}
1116851Ssos#endif // CC_INTERP
1126851Ssos
113inline int frame::interpreter_frame_monitor_size() {
114  return BasicObjectLock::size();
115}
116
117inline intptr_t* frame::interpreter_frame_expression_stack() const {
118  intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
119  return monitor_end - 1;
120}
121
122inline jint frame::interpreter_frame_expression_stack_direction() {
123  return -1;
124}
125
126// Return a unique id for this frame. The id must have a value where
127// we can distinguish identity and younger/older relationship. NULL
128// represents an invalid (incomparable) frame.
129inline intptr_t* frame::id() const {
130  return fp();
131}
132
133inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
134  return zero_entryframe()->call_wrapper();
135}
136
137inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
138  ShouldNotCallThis();
139}
140
141inline oop frame::saved_oop_result(RegisterMap* map) const {
142  ShouldNotCallThis();
143}
144
145inline bool frame::is_older(intptr_t* id) const {
146  ShouldNotCallThis();
147}
148
149inline intptr_t* frame::entry_frame_argument_at(int offset) const {
150  ShouldNotCallThis();
151}
152
153inline intptr_t* frame::unextended_sp() const {
154  if (zeroframe()->is_shark_frame())
155    return zero_sharkframe()->unextended_sp();
156  else
157    return (intptr_t *) -1;
158}
159
160#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
161