annotate agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/cInterpreter.java @ 3960:f08d439fab8c

7089790: integrate bsd-port changes Reviewed-by: kvn, twisti, jrose Contributed-by: Kurt Miller <kurt@intricatesoftware.com>, Greg Lewis <glewis@eyesbeyond.com>, Jung-uk Kim <jkim@freebsd.org>, Christos Zoulas <christos@zoulas.com>, Landon Fuller <landonf@plausible.coop>, The FreeBSD Foundation <board@freebsdfoundation.org>, Michael Franz <mvfranz@gmail.com>, Roger Hoover <rhoover@apple.com>, Alexander Strange <astrange@apple.com>
author never
date Sun, 25 Sep 2011 16:03:29 -0700
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.runtime.ia64;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import java.util.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // import sun.jvm.hotspot.asm.ia64.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
29 import sun.jvm.hotspot.code.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
30 import sun.jvm.hotspot.compiler.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
31 import sun.jvm.hotspot.debugger.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 import sun.jvm.hotspot.oops.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 import sun.jvm.hotspot.runtime.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 import sun.jvm.hotspot.types.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 import sun.jvm.hotspot.utilities.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 /** Specialization of and implementation of abstract methods of the
a61af66fc99e Initial load
duke
parents:
diff changeset
38 Frame class for the ia64 family of CPUs. */
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 public class cInterpreter extends VMObject {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 private static final boolean DEBUG = true;
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 private static AddressField bcpField;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 private static AddressField localsField;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 private static AddressField constantsField;
a61af66fc99e Initial load
duke
parents:
diff changeset
46 private static AddressField methodField;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 private static AddressField stackField; // i.e. tos
a61af66fc99e Initial load
duke
parents:
diff changeset
48 private static AddressField stackBaseField; // ultimate bottom of stack
a61af66fc99e Initial load
duke
parents:
diff changeset
49 private static AddressField stackLimitField; // ultimate top of stack
a61af66fc99e Initial load
duke
parents:
diff changeset
50 private static AddressField monitorBaseField;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 private static CIntegerField messageField;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 private static AddressField prevFieldField;
a61af66fc99e Initial load
duke
parents:
diff changeset
53 private static AddressField wrapperField;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 private static AddressField prevField;
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 private static int NO_REQUEST;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 private static int INITIALIZE;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 private static int METHOD_ENTRY;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 private static int METHOD_RESUME;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 private static int GOT_MONITORS;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 private static int RETHROW_EXCEPTION;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 private static int CALL_METHOD;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 private static int RETURN_FROM_METHOD;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 private static int RETRY_METHOD;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 private static int MORE_MONITORS;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 private static int THROWING_EXCEPTION;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 private static int POPPING_FRAME;
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 static {
a61af66fc99e Initial load
duke
parents:
diff changeset
70 VM.registerVMInitializedObserver(new Observer() {
a61af66fc99e Initial load
duke
parents:
diff changeset
71 public void update(Observable o, Object data) {
a61af66fc99e Initial load
duke
parents:
diff changeset
72 initialize(VM.getVM().getTypeDataBase());
a61af66fc99e Initial load
duke
parents:
diff changeset
73 }
a61af66fc99e Initial load
duke
parents:
diff changeset
74 });
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 private static synchronized void initialize(TypeDataBase db) {
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 Type cInterpreterType = db.lookupType("cInterpreter");
a61af66fc99e Initial load
duke
parents:
diff changeset
80 bcpField = cInterpreterType.getAddressField("_bcp");
a61af66fc99e Initial load
duke
parents:
diff changeset
81 localsField = cInterpreterType.getAddressField("_locals");
a61af66fc99e Initial load
duke
parents:
diff changeset
82 constantsField = cInterpreterType.getAddressField("_constants");
a61af66fc99e Initial load
duke
parents:
diff changeset
83 methodField = cInterpreterType.getAddressField("_method");
a61af66fc99e Initial load
duke
parents:
diff changeset
84 stackField = cInterpreterType.getAddressField("_stack");
a61af66fc99e Initial load
duke
parents:
diff changeset
85 stackBaseField = cInterpreterType.getAddressField("_stack_base");
a61af66fc99e Initial load
duke
parents:
diff changeset
86 stackLimitField = cInterpreterType.getAddressField("_stack_limit");
a61af66fc99e Initial load
duke
parents:
diff changeset
87 monitorBaseField = cInterpreterType.getAddressField("_monitor_base");
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // messageField = cInterpreterType.getCIntegerField("_msg");
a61af66fc99e Initial load
duke
parents:
diff changeset
89 messageField = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 wrapperField = cInterpreterType.getAddressField("_wrapper");
a61af66fc99e Initial load
duke
parents:
diff changeset
91 prevField = cInterpreterType.getAddressField("_prev_link");
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
94 NO_REQUEST = db.lookupIntConstant("no_request").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
95 INITIALIZE = db.lookupIntConstant("initialize").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
96 METHOD_ENTRY = db.lookupIntConstant("method_entry").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
97 METHOD_RESUME = db.lookupIntConstant("method_resume").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
98 GOT_MONITORS = db.lookupIntConstant("got_monitors").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
99 RETHROW_EXCEPTION = db.lookupIntConstant("rethrow_exception").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
100 CALL_METHOD = db.lookupIntConstant("call_method").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
101 RETURN_FROM_METHOD = db.lookupIntConstant("return_from_method").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
102 RETRY_METHOD = db.lookupIntConstant("retry_method").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
103 MORE_MONITORS = db.lookupIntConstant("more_monitors").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
104 THROWING_EXCEPTION = db.lookupIntConstant("throwing_exception").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
105 POPPING_FRAME = db.lookupIntConstant("popping_frame").intValue();
a61af66fc99e Initial load
duke
parents:
diff changeset
106 */
a61af66fc99e Initial load
duke
parents:
diff changeset
107 }
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public cInterpreter(Address addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
111 super(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 public Address prev() {
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return prevField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 public Address locals() {
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 Address val = localsField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
121 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 }
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 public Address localsAddr() {
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 Address localsAddr = localsField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 return localsAddr;
a61af66fc99e Initial load
duke
parents:
diff changeset
128 }
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 public Address bcp() {
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 Address val = bcpField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
133 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 public Address bcpAddr() {
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 Address bcpAddr = addr.addOffsetTo(bcpField.getOffset());
a61af66fc99e Initial load
duke
parents:
diff changeset
139 return bcpAddr;
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 public Address constants() {
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 Address val = constantsField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
145 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 }
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 public Address constantsAddr() {
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 Address constantsAddr = constantsField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 return constantsAddr;
a61af66fc99e Initial load
duke
parents:
diff changeset
152 }
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 public Address method() {
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 Address val = methodField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
157 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
158 }
a61af66fc99e Initial load
duke
parents:
diff changeset
159 public Address methodAddr() {
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 Address methodAddr = addr.addOffsetTo(methodField.getOffset());
a61af66fc99e Initial load
duke
parents:
diff changeset
162 return methodAddr;
a61af66fc99e Initial load
duke
parents:
diff changeset
163 }
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 public Address stack() {
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 Address val = stackField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
168 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
169 }
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171 public Address stackBase() {
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 Address val = stackBaseField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
174 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
175 }
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 public Address stackLimit() {
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 Address val = stackLimitField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
180 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
181 }
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 public Address monitorBase() {
a61af66fc99e Initial load
duke
parents:
diff changeset
184
a61af66fc99e Initial load
duke
parents:
diff changeset
185 Address val = monitorBaseField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
186 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
187 }
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 public Address wrapper() {
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191 return wrapperField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
192 }
a61af66fc99e Initial load
duke
parents:
diff changeset
193
a61af66fc99e Initial load
duke
parents:
diff changeset
194 public int message() {
a61af66fc99e Initial load
duke
parents:
diff changeset
195 int val = (int) messageField.getValue(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
196 return val;
a61af66fc99e Initial load
duke
parents:
diff changeset
197 }
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 }