hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
author rottenha
Mon, 28 Feb 2011 15:35:45 -0800
changeset 8478 d89e2f60ba40
parent 7397 5b173b4ca846
child 11486 cdc636532368
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
     3
 * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     5
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     8
 * published by the Free Software Foundation.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     9
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    14
 * accompanied this code).
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    15
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    19
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5418
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5418
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5418
diff changeset
    22
 * questions.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    23
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    24
 */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    25
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    29
// Constructors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    30
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    31
inline frame::frame() {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    32
  _zeroframe = NULL;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    33
  _sp = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    34
  _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    35
  _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    36
  _deopt_state = unknown;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    37
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    38
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    39
inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    40
  _zeroframe = zf;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    41
  _sp = sp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    42
  switch (zeroframe()->type()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    43
  case ZeroFrame::ENTRY_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    44
    _pc = StubRoutines::call_stub_return_pc();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    45
    _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    46
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    47
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
  case ZeroFrame::INTERPRETER_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
    _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    50
    _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    51
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    52
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    53
  case ZeroFrame::SHARK_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
    _pc = zero_sharkframe()->pc();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
    _cb = CodeCache::find_blob_unsafe(pc());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    56
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
  case ZeroFrame::FAKE_STUB_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
    _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
    _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    62
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
  default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
    ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    66
  _deopt_state = not_deoptimized;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    67
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    68
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    69
// Accessors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    70
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    71
inline intptr_t* frame::sender_sp() const {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    72
  return fp() + 1;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    73
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    74
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
inline intptr_t* frame::link() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    76
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    77
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    78
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    79
#ifdef CC_INTERP
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
inline interpreterState frame::get_interpreterState() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    81
  return zero_interpreterframe()->interpreter_state();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    82
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    83
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    84
inline intptr_t** frame::interpreter_frame_locals_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    85
  return &(get_interpreterState()->_locals);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    86
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    87
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    88
inline intptr_t* frame::interpreter_frame_bcx_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    89
  return (intptr_t*) &(get_interpreterState()->_bcp);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    90
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    91
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    92
inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    93
  return &(get_interpreterState()->_constants);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    94
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    95
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    96
inline methodOop* frame::interpreter_frame_method_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    97
  return &(get_interpreterState()->_method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    98
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    99
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   100
inline intptr_t* frame::interpreter_frame_mdx_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   101
  return (intptr_t*) &(get_interpreterState()->_mdx);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   102
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   104
inline intptr_t* frame::interpreter_frame_tos_address() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   105
  return get_interpreterState()->_stack + 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   106
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   107
#endif // CC_INTERP
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   108
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   109
inline int frame::interpreter_frame_monitor_size() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   110
  return BasicObjectLock::size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
inline intptr_t* frame::interpreter_frame_expression_stack() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
  intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
  return monitor_end - 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   116
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   117
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   118
inline jint frame::interpreter_frame_expression_stack_direction() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   119
  return -1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   120
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   121
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   122
// Return a unique id for this frame. The id must have a value where
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   123
// we can distinguish identity and younger/older relationship. NULL
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   124
// represents an invalid (incomparable) frame.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   125
inline intptr_t* frame::id() const {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
   126
  return fp();
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   127
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   128
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   129
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   130
  return zero_entryframe()->call_wrapper();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   131
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   132
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   133
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   134
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   135
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   136
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   137
inline oop frame::saved_oop_result(RegisterMap* map) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   138
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   139
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   140
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   141
inline bool frame::is_older(intptr_t* id) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   142
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   143
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   144
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   145
inline intptr_t* frame::entry_frame_argument_at(int offset) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   146
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   147
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   148
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   149
inline intptr_t* frame::unextended_sp() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   150
  if (zeroframe()->is_shark_frame())
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   151
    return zero_sharkframe()->unextended_sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   152
  else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   153
    return (intptr_t *) -1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   154
}
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   155
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   156
#endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP