hotspot/src/cpu/zero/vm/stack_zero.hpp
author twisti
Thu, 06 May 2010 02:09:18 -0700
changeset 5424 fc1c380199b0
parent 5418 c4955cb6ed33
child 5547 f4b087cbb361
permissions -rw-r--r--
6950178: Zero stack improvements Summary: Moves the logic for determining the size of the Zero stack into the ZeroStack class. Reviewed-by: twisti Contributed-by: Gary Benson <gbenson@redhat.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     1
/*
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     2
 * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
5335
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
     3
 * Copyright 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
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    22
 * have any questions.
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
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    26
class ZeroStack {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    27
 private:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    28
  intptr_t *_base; // the last available word
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    29
  intptr_t *_top;  // the word past the end of the stack
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    30
  intptr_t *_sp;   // the top word on the stack
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    31
5335
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    32
 private:
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    33
  int _shadow_pages_size; // how much ABI stack must we keep free?
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    34
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    35
 public:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    36
  ZeroStack()
5335
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    37
    : _base(NULL), _top(NULL), _sp(NULL) {
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    38
    _shadow_pages_size = StackShadowPages * os::vm_page_size();
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    39
  }
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    40
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    41
  bool needs_setup() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    42
    return _base == NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    43
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    44
5424
fc1c380199b0 6950178: Zero stack improvements
twisti
parents: 5418
diff changeset
    45
  int suggest_size(Thread *thread) const;
fc1c380199b0 6950178: Zero stack improvements
twisti
parents: 5418
diff changeset
    46
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    47
  void setup(void *mem, size_t size) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
    assert(needs_setup(), "already set up");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
    assert(!(size & WordAlignmentMask), "unaligned");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    50
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    51
    _base = (intptr_t *) mem;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    52
    _top  = _base + (size >> LogBytesPerWord);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    53
    _sp   = _top;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
  void teardown() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    56
    assert(!needs_setup(), "not set up");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
    assert(_sp == _top, "stuff on stack at teardown");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
    _base = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
    _top  = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
    _sp   = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    62
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
  intptr_t *sp() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
    return _sp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    66
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    67
  void set_sp(intptr_t *new_sp) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    68
    assert(_top >= new_sp && new_sp >= _base, "bad stack pointer");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    69
    _sp = new_sp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    70
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    71
5424
fc1c380199b0 6950178: Zero stack improvements
twisti
parents: 5418
diff changeset
    72
  int total_words() const {
fc1c380199b0 6950178: Zero stack improvements
twisti
parents: 5418
diff changeset
    73
    return _top - _base;
fc1c380199b0 6950178: Zero stack improvements
twisti
parents: 5418
diff changeset
    74
  }
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
  int available_words() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    76
    return _sp - _base;
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
  void push(intptr_t value) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
    assert(_sp > _base, "stack overflow");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    81
    *(--_sp) = value;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    82
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    83
  intptr_t pop() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    84
    assert(_sp < _top, "stack underflow");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    85
    return *(_sp++);
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
  void *alloc(size_t size) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    89
    int count = align_size_up(size, wordSize) >> LogBytesPerWord;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    90
    assert(count <= available_words(), "stack overflow");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    91
    return _sp -= count;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    92
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    93
5335
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    94
  int shadow_pages_size() const {
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    95
    return _shadow_pages_size;
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    96
  }
5424
fc1c380199b0 6950178: Zero stack improvements
twisti
parents: 5418
diff changeset
    97
  int abi_stack_available(Thread *thread) const;
5335
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    98
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
    99
 public:
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
   100
  void overflow_check(int required_words, TRAPS);
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
   101
  static void handle_overflow(TRAPS);
4319cb12ddfe 6941224: Improved stack overflow handling for Zero
twisti
parents: 4013
diff changeset
   102
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
 public:
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 5335
diff changeset
   104
  void zap(int c) PRODUCT_RETURN;
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 5335
diff changeset
   105
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 5335
diff changeset
   106
 public:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   107
  static ByteSize base_offset() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   108
    return byte_offset_of(ZeroStack, _base);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   109
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   110
  static ByteSize top_offset() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
    return byte_offset_of(ZeroStack, _top);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
  static ByteSize sp_offset() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
    return byte_offset_of(ZeroStack, _sp);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
  }
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
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   119
class EntryFrame;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   120
class InterpreterFrame;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   121
class SharkFrame;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   122
class FakeStubFrame;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   123
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   124
//
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   125
// |  ...               |
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   126
// +--------------------+  ------------------
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   127
// |  ...               |       low addresses
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   128
// | frame_type         |
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   129
// | next_frame         |      high addresses
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   130
// +--------------------+  ------------------
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
class ZeroFrame {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   134
  friend class frame;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   135
  friend class ZeroStackPrinter;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   136
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   137
 protected:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   138
  ZeroFrame() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   139
    ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   140
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   141
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   142
  enum Layout {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   143
    next_frame_off,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   144
    frame_type_off,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   145
    jf_header_words
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   146
  };
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   147
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   148
  enum FrameType {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   149
    ENTRY_FRAME = 1,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   150
    INTERPRETER_FRAME,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   151
    SHARK_FRAME,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   152
    FAKE_STUB_FRAME
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   153
  };
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   154
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   155
 protected:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   156
  intptr_t *addr_of_word(int offset) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   157
    return (intptr_t *) this - offset;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   158
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   159
  intptr_t value_of_word(int offset) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   160
    return *addr_of_word(offset);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   161
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   162
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   163
 public:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   164
  ZeroFrame *next() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   165
    return (ZeroFrame *) value_of_word(next_frame_off);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   166
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   167
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   168
 protected:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   169
  FrameType type() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   170
    return (FrameType) value_of_word(frame_type_off);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   171
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   172
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   173
 public:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   174
  bool is_entry_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   175
    return type() == ENTRY_FRAME;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   176
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   177
  bool is_interpreter_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   178
    return type() == INTERPRETER_FRAME;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   179
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   180
  bool is_shark_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   181
    return type() == SHARK_FRAME;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   182
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   183
  bool is_fake_stub_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   184
    return type() == FAKE_STUB_FRAME;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   185
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   186
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   187
 public:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   188
  EntryFrame *as_entry_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   189
    assert(is_entry_frame(), "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   190
    return (EntryFrame *) this;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   191
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   192
  InterpreterFrame *as_interpreter_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   193
    assert(is_interpreter_frame(), "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   194
    return (InterpreterFrame *) this;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   195
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   196
  SharkFrame *as_shark_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   197
    assert(is_shark_frame(), "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   198
    return (SharkFrame *) this;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   199
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   200
  FakeStubFrame *as_fake_stub_frame() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   201
    assert(is_fake_stub_frame(), "should be");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   202
    return (FakeStubFrame *) this;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   203
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   204
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   205
 public:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   206
  void identify_word(int   frame_index,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   207
                     int   offset,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   208
                     char* fieldbuf,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   209
                     char* valuebuf,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   210
                     int   buflen) const;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   211
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   212
 protected:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   213
  void identify_vp_word(int       frame_index,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   214
                        intptr_t* addr,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   215
                        intptr_t* monitor_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   216
                        intptr_t* stack_base,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   217
                        char*     fieldbuf,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   218
                        int       buflen) const;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   219
};