Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java @ 8104:f16e75e0cf11
8000797: NPG: is_pseudo_string_at() doesn't work
Summary: Zero Symbol* for constant pool strings to indicate pseudo_strings (objects that aren't strings). Clean up JVM_CONSTANT_Object and unused flags.
Reviewed-by: sspitsyn, jrose
author | coleenp |
---|---|
date | Fri, 22 Feb 2013 08:36:42 -0500 |
parents | da91efe96a93 |
children |
comparison
equal
deleted
inserted
replaced
8103:5ed317b25e23 | 8104:f16e75e0cf11 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
49 private static final int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool | 49 private static final int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool |
50 private static final int JVM_CONSTANT_StringIndex = 102; // Temporary tag while constructing constant pool | 50 private static final int JVM_CONSTANT_StringIndex = 102; // Temporary tag while constructing constant pool |
51 private static final int JVM_CONSTANT_UnresolvedClassInError = 103; // Resolution failed | 51 private static final int JVM_CONSTANT_UnresolvedClassInError = 103; // Resolution failed |
52 private static final int JVM_CONSTANT_MethodHandleInError = 104; // Error tag due to resolution error | 52 private static final int JVM_CONSTANT_MethodHandleInError = 104; // Error tag due to resolution error |
53 private static final int JVM_CONSTANT_MethodTypeInError = 105; // Error tag due to resolution error | 53 private static final int JVM_CONSTANT_MethodTypeInError = 105; // Error tag due to resolution error |
54 private static final int JVM_CONSTANT_Object = 106; // Required for BoundMethodHandle arguments. | |
55 | 54 |
56 // JVM_CONSTANT_MethodHandle subtypes //FIXME: connect these to data structure | 55 // JVM_CONSTANT_MethodHandle subtypes //FIXME: connect these to data structure |
57 private static int JVM_REF_getField = 1; | 56 private static int JVM_REF_getField = 1; |
58 private static int JVM_REF_getStatic = 2; | 57 private static int JVM_REF_getStatic = 2; |
59 private static int JVM_REF_putField = 3; | 58 private static int JVM_REF_putField = 3; |
94 } | 93 } |
95 public boolean isUnresolveKlassInError() { return tag == JVM_CONSTANT_UnresolvedClassInError; } | 94 public boolean isUnresolveKlassInError() { return tag == JVM_CONSTANT_UnresolvedClassInError; } |
96 public boolean isKlassIndex() { return tag == JVM_CONSTANT_ClassIndex; } | 95 public boolean isKlassIndex() { return tag == JVM_CONSTANT_ClassIndex; } |
97 public boolean isStringIndex() { return tag == JVM_CONSTANT_StringIndex; } | 96 public boolean isStringIndex() { return tag == JVM_CONSTANT_StringIndex; } |
98 | 97 |
99 public boolean isObject() { return tag == JVM_CONSTANT_Object; } | |
100 | |
101 public boolean isKlassReference() { return isKlassIndex() || isUnresolvedKlass(); } | 98 public boolean isKlassReference() { return isKlassIndex() || isUnresolvedKlass(); } |
102 public boolean isFieldOrMethod() { return isField() || isMethod() || isInterfaceMethod(); } | 99 public boolean isFieldOrMethod() { return isField() || isMethod() || isInterfaceMethod(); } |
103 public boolean isSymbol() { return isUtf8(); } | 100 public boolean isSymbol() { return isUtf8(); } |
104 | 101 |
105 public BasicType basicType() { | 102 public BasicType basicType() { |
121 case JVM_CONSTANT_MethodTypeInError : | 118 case JVM_CONSTANT_MethodTypeInError : |
122 case JVM_CONSTANT_ClassIndex : | 119 case JVM_CONSTANT_ClassIndex : |
123 case JVM_CONSTANT_StringIndex : | 120 case JVM_CONSTANT_StringIndex : |
124 case JVM_CONSTANT_MethodHandle : | 121 case JVM_CONSTANT_MethodHandle : |
125 case JVM_CONSTANT_MethodType : | 122 case JVM_CONSTANT_MethodType : |
126 case JVM_CONSTANT_Object : | |
127 return BasicType.T_OBJECT; | 123 return BasicType.T_OBJECT; |
128 default: | 124 default: |
129 throw new InternalError("unexpected tag: " + tag); | 125 throw new InternalError("unexpected tag: " + tag); |
130 } | 126 } |
131 } | 127 } |