sharkFrame_zero.hpp revision 1010:354d3184f6b2
155682Smarkm/*
2233294Sstas * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
3233294Sstas * Copyright 2008 Red Hat, Inc.
4233294Sstas * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
555682Smarkm *
6233294Sstas * This code is free software; you can redistribute it and/or modify it
7233294Sstas * under the terms of the GNU General Public License version 2 only, as
8233294Sstas * published by the Free Software Foundation.
955682Smarkm *
10233294Sstas * This code is distributed in the hope that it will be useful, but WITHOUT
11233294Sstas * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1255682Smarkm * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13233294Sstas * version 2 for more details (a copy is included in the LICENSE file that
14233294Sstas * accompanied this code).
15233294Sstas *
1655682Smarkm * You should have received a copy of the GNU General Public License version
17233294Sstas * 2 along with this work; if not, write to the Free Software Foundation,
18233294Sstas * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19233294Sstas *
2055682Smarkm * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21233294Sstas * CA 95054 USA or visit www.sun.com if you need additional information or
22233294Sstas * have any questions.
23233294Sstas *
24233294Sstas */
25233294Sstas
26233294Sstas// |  ...               |
27233294Sstas// +--------------------+  ------------------
28233294Sstas// | stack slot n-1     |       low addresses
29233294Sstas// |  ...               |
30233294Sstas// | stack slot 0       |
31233294Sstas// | monitor m-1        |
3255682Smarkm// |  ...               |
3355682Smarkm// | monitor 0          |
3455682Smarkm// | oop_tmp            |
3555682Smarkm// | method             |
36233294Sstas// | unextended_sp      |
3755682Smarkm// | pc                 |
3855682Smarkm// | frame_type         |
39178825Sdfr// | next_frame         |      high addresses
4055682Smarkm// +--------------------+  ------------------
4178527Sassar// |  ...               |
4255682Smarkm
4378527Sassarclass SharkFrame : public ZeroFrame {
4455682Smarkm  friend class SharkFunction;
4555682Smarkm
46178825Sdfr private:
47178825Sdfr  SharkFrame() : ZeroFrame() {
48178825Sdfr    ShouldNotCallThis();
4955682Smarkm  }
50178825Sdfr
5178527Sassar protected:
5255682Smarkm  enum Layout {
5355682Smarkm    pc_off = jf_header_words,
54178825Sdfr    unextended_sp_off,
55178825Sdfr    method_off,
5655682Smarkm    oop_tmp_off,
5755682Smarkm    header_words
58178825Sdfr  };
5955682Smarkm
6055682Smarkm public:
61178825Sdfr  address pc() const {
6255682Smarkm    return (address) value_of_word(pc_off);
6355682Smarkm  }
6478527Sassar
6555682Smarkm  intptr_t* unextended_sp() const {
6655682Smarkm    return (intptr_t *) value_of_word(unextended_sp_off);
6755682Smarkm  }
68178825Sdfr
69233294Sstas  methodOop method() const {
7055682Smarkm    return (methodOop) value_of_word(method_off);
7155682Smarkm  }
72178825Sdfr
73178825Sdfr public:
7455682Smarkm  void identify_word(int   frame_index,
7578527Sassar                     int   offset,
76178825Sdfr                     char* fieldbuf,
77178825Sdfr                     char* valuebuf,
78178825Sdfr                     int   buflen) const;
79178825Sdfr};
8078527Sassar