Mercurial > hg > graal-compiler
annotate agent/src/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java @ 2426:1d1603768966
7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
Summary: Update the copyright to be 2010 on all changed files in OpenJDK
Reviewed-by: ohair
author | trims |
---|---|
date | Tue, 05 Apr 2011 14:12:31 -0700 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
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 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.runtime; | |
26 | |
27 import java.util.*; | |
28 import sun.jvm.hotspot.debugger.*; | |
29 import sun.jvm.hotspot.types.*; | |
30 | |
31 /** <P> A JavaCallWrapper is constructed before each JavaCall and | |
32 destroyed after the call. Its purpose is to allocate/deallocate a | |
33 new handle block and to save/restore the last Java fp/sp. A | |
34 pointer to the JavaCallWrapper is stored on the stack. </P> | |
35 | |
36 <P> NOTE: this port is very minimal and is only designed to get | |
37 frame traversal working. FIXME: we will have to add platform- | |
38 specific stuff later and therefore a factory for these | |
39 objects. </P> */ | |
40 | |
41 public class JavaCallWrapper extends VMObject { | |
42 protected static AddressField anchorField; | |
43 private static AddressField lastJavaSPField; | |
44 private static AddressField lastJavaPCField; | |
45 | |
46 static { | |
47 VM.registerVMInitializedObserver(new Observer() { | |
48 public void update(Observable o, Object data) { | |
49 initialize(VM.getVM().getTypeDataBase()); | |
50 } | |
51 }); | |
52 } | |
53 | |
54 private static synchronized void initialize(TypeDataBase db) { | |
55 Type type = db.lookupType("JavaCallWrapper"); | |
56 Type anchorType = db.lookupType("JavaFrameAnchor"); | |
57 | |
58 anchorField = type.getAddressField("_anchor"); | |
59 lastJavaSPField = anchorType.getAddressField("_last_Java_sp"); | |
60 lastJavaPCField = anchorType.getAddressField("_last_Java_pc"); | |
61 } | |
62 | |
63 public JavaCallWrapper(Address addr) { | |
64 super(addr); | |
65 } | |
66 | |
67 public Address getLastJavaSP() { | |
68 return lastJavaSPField.getValue(addr.addOffsetTo(anchorField.getOffset())); | |
69 } | |
70 | |
71 public Address getLastJavaPC() { | |
72 return lastJavaPCField.getValue(addr.addOffsetTo(anchorField.getOffset())); | |
73 } | |
74 | |
75 } |