src/cpu/zero/vm/frame_zero.inline.hpp

changeset 0
f90c822e73f8
child 6876
710a3c8b516e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/cpu/zero/vm/frame_zero.inline.hpp	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,175 @@
     1.4 +/*
     1.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
     1.7 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8 + *
     1.9 + * This code is free software; you can redistribute it and/or modify it
    1.10 + * under the terms of the GNU General Public License version 2 only, as
    1.11 + * published by the Free Software Foundation.
    1.12 + *
    1.13 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.15 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.16 + * version 2 for more details (a copy is included in the LICENSE file that
    1.17 + * accompanied this code).
    1.18 + *
    1.19 + * You should have received a copy of the GNU General Public License version
    1.20 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.21 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.22 + *
    1.23 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.24 + * or visit www.oracle.com if you need additional information or have any
    1.25 + * questions.
    1.26 + *
    1.27 + */
    1.28 +
    1.29 +#ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
    1.30 +#define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
    1.31 +
    1.32 +// Constructors
    1.33 +
    1.34 +inline frame::frame() {
    1.35 +  _zeroframe = NULL;
    1.36 +  _sp = NULL;
    1.37 +  _pc = NULL;
    1.38 +  _cb = NULL;
    1.39 +  _deopt_state = unknown;
    1.40 +}
    1.41 +
    1.42 +inline address  frame::sender_pc()           const { ShouldNotCallThis(); return NULL; }
    1.43 +
    1.44 +inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
    1.45 +  _zeroframe = zf;
    1.46 +  _sp = sp;
    1.47 +  switch (zeroframe()->type()) {
    1.48 +  case ZeroFrame::ENTRY_FRAME:
    1.49 +    _pc = StubRoutines::call_stub_return_pc();
    1.50 +    _cb = NULL;
    1.51 +    _deopt_state = not_deoptimized;
    1.52 +    break;
    1.53 +
    1.54 +  case ZeroFrame::INTERPRETER_FRAME:
    1.55 +    _pc = NULL;
    1.56 +    _cb = NULL;
    1.57 +    _deopt_state = not_deoptimized;
    1.58 +    break;
    1.59 +
    1.60 +  case ZeroFrame::SHARK_FRAME: {
    1.61 +    _pc = zero_sharkframe()->pc();
    1.62 +    _cb = CodeCache::find_blob_unsafe(pc());
    1.63 +    address original_pc = nmethod::get_deopt_original_pc(this);
    1.64 +    if (original_pc != NULL) {
    1.65 +      _pc = original_pc;
    1.66 +      _deopt_state = is_deoptimized;
    1.67 +    } else {
    1.68 +      _deopt_state = not_deoptimized;
    1.69 +    }
    1.70 +    break;
    1.71 +  }
    1.72 +  case ZeroFrame::FAKE_STUB_FRAME:
    1.73 +    _pc = NULL;
    1.74 +    _cb = NULL;
    1.75 +    _deopt_state = not_deoptimized;
    1.76 +    break;
    1.77 +
    1.78 +  default:
    1.79 +    ShouldNotReachHere();
    1.80 +  }
    1.81 +}
    1.82 +
    1.83 +// Accessors
    1.84 +
    1.85 +inline intptr_t* frame::sender_sp() const {
    1.86 +  return fp() + 1;
    1.87 +}
    1.88 +
    1.89 +inline intptr_t* frame::real_fp() const {
    1.90 +  return fp();
    1.91 +}
    1.92 +
    1.93 +inline intptr_t* frame::link() const {
    1.94 +  ShouldNotCallThis();
    1.95 +  return NULL;
    1.96 +}
    1.97 +
    1.98 +#ifdef CC_INTERP
    1.99 +inline interpreterState frame::get_interpreterState() const {
   1.100 +  return zero_interpreterframe()->interpreter_state();
   1.101 +}
   1.102 +
   1.103 +inline intptr_t** frame::interpreter_frame_locals_addr() const {
   1.104 +  return &(get_interpreterState()->_locals);
   1.105 +}
   1.106 +
   1.107 +inline intptr_t* frame::interpreter_frame_bcx_addr() const {
   1.108 +  return (intptr_t*) &(get_interpreterState()->_bcp);
   1.109 +}
   1.110 +
   1.111 +inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
   1.112 +  return &(get_interpreterState()->_constants);
   1.113 +}
   1.114 +
   1.115 +inline Method** frame::interpreter_frame_method_addr() const {
   1.116 +  return &(get_interpreterState()->_method);
   1.117 +}
   1.118 +
   1.119 +inline intptr_t* frame::interpreter_frame_mdx_addr() const {
   1.120 +  return (intptr_t*) &(get_interpreterState()->_mdx);
   1.121 +}
   1.122 +
   1.123 +inline intptr_t* frame::interpreter_frame_tos_address() const {
   1.124 +  return get_interpreterState()->_stack + 1;
   1.125 +}
   1.126 +#endif // CC_INTERP
   1.127 +
   1.128 +inline int frame::interpreter_frame_monitor_size() {
   1.129 +  return BasicObjectLock::size();
   1.130 +}
   1.131 +
   1.132 +inline intptr_t* frame::interpreter_frame_expression_stack() const {
   1.133 +  intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
   1.134 +  return monitor_end - 1;
   1.135 +}
   1.136 +
   1.137 +inline jint frame::interpreter_frame_expression_stack_direction() {
   1.138 +  return -1;
   1.139 +}
   1.140 +
   1.141 +// Return a unique id for this frame. The id must have a value where
   1.142 +// we can distinguish identity and younger/older relationship. NULL
   1.143 +// represents an invalid (incomparable) frame.
   1.144 +inline intptr_t* frame::id() const {
   1.145 +  return fp();
   1.146 +}
   1.147 +
   1.148 +inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
   1.149 +  return zero_entryframe()->call_wrapper();
   1.150 +}
   1.151 +
   1.152 +inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
   1.153 +  ShouldNotCallThis();
   1.154 +}
   1.155 +
   1.156 +inline oop frame::saved_oop_result(RegisterMap* map) const {
   1.157 +  ShouldNotCallThis();
   1.158 +  return NULL;
   1.159 +}
   1.160 +
   1.161 +inline bool frame::is_older(intptr_t* id) const {
   1.162 +  ShouldNotCallThis();
   1.163 +  return false;
   1.164 +}
   1.165 +
   1.166 +inline intptr_t* frame::entry_frame_argument_at(int offset) const {
   1.167 +  ShouldNotCallThis();
   1.168 +  return NULL;
   1.169 +}
   1.170 +
   1.171 +inline intptr_t* frame::unextended_sp() const {
   1.172 +  if (zeroframe()->is_shark_frame())
   1.173 +    return zero_sharkframe()->unextended_sp();
   1.174 +  else
   1.175 +    return (intptr_t *) -1;
   1.176 +}
   1.177 +
   1.178 +#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP

mercurial