annotate agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java @ 844:bd02caa94611

6862919: Update copyright year Summary: Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair
author xdono
date Tue, 28 Jul 2009 12:12:40 -0700
parents b109e761e927
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
844
bd02caa94611 6862919: Update copyright year
xdono
parents: 818
diff changeset
2 * Copyright 2000-2009 Sun Microsystems, Inc. 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 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
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.code;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import java.io.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 import sun.jvm.hotspot.utilities.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 /** <P> Classes used for serializing debugging information. These
a61af66fc99e Initial load
duke
parents:
diff changeset
32 abstractions are introducted to provide symmetric read and write
a61af66fc99e Initial load
duke
parents:
diff changeset
33 operations. </P>
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 <P>
a61af66fc99e Initial load
duke
parents:
diff changeset
36 <UL>
a61af66fc99e Initial load
duke
parents:
diff changeset
37 <LI> ScopeValue: describes the value of a variable/expression in a scope
a61af66fc99e Initial load
duke
parents:
diff changeset
38 <UL>
a61af66fc99e Initial load
duke
parents:
diff changeset
39 <LI> LocationValue: describes a value in a given location (in frame or register)
a61af66fc99e Initial load
duke
parents:
diff changeset
40 <LI> ConstantValue: describes a constant
a61af66fc99e Initial load
duke
parents:
diff changeset
41 </UL>
a61af66fc99e Initial load
duke
parents:
diff changeset
42 </UL>
a61af66fc99e Initial load
duke
parents:
diff changeset
43 </P> */
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 public abstract class ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // Package private enumeration values (FIXME: read from target VM)
a61af66fc99e Initial load
duke
parents:
diff changeset
47 static final int LOCATION_CODE = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
48 static final int CONSTANT_INT_CODE = 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 static final int CONSTANT_OOP_CODE = 2;
a61af66fc99e Initial load
duke
parents:
diff changeset
50 static final int CONSTANT_LONG_CODE = 3;
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static final int CONSTANT_DOUBLE_CODE = 4;
818
b109e761e927 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 0
diff changeset
52 static final int CONSTANT_OBJECT_CODE = 5;
b109e761e927 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 0
diff changeset
53 static final int CONSTANT_OBJECT_ID_CODE = 6;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 public boolean isLocation() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
56 public boolean isConstantInt() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
57 public boolean isConstantDouble() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
58 public boolean isConstantLong() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
59 public boolean isConstantOop() { return false; }
818
b109e761e927 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 0
diff changeset
60 public boolean isObject() { return false; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public static ScopeValue readFrom(DebugInfoReadStream stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 switch (stream.readInt()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
64 case LOCATION_CODE:
a61af66fc99e Initial load
duke
parents:
diff changeset
65 return new LocationValue(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
66 case CONSTANT_INT_CODE:
a61af66fc99e Initial load
duke
parents:
diff changeset
67 return new ConstantIntValue(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
68 case CONSTANT_OOP_CODE:
a61af66fc99e Initial load
duke
parents:
diff changeset
69 return new ConstantOopReadValue(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
70 case CONSTANT_LONG_CODE:
a61af66fc99e Initial load
duke
parents:
diff changeset
71 return new ConstantLongValue(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
72 case CONSTANT_DOUBLE_CODE:
a61af66fc99e Initial load
duke
parents:
diff changeset
73 return new ConstantDoubleValue(stream);
818
b109e761e927 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 0
diff changeset
74 case CONSTANT_OBJECT_CODE:
b109e761e927 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 0
diff changeset
75 return stream.readObjectValue();
b109e761e927 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 0
diff changeset
76 case CONSTANT_OBJECT_ID_CODE:
b109e761e927 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents: 0
diff changeset
77 return stream.getCachedObject();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
78 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
79 Assert.that(false, "should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
80 return null;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 }
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 public abstract void printOn(PrintStream tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
85 }