Mercurial > hg > graal-jvmci-8
comparison agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 6a991dcb52bb |
children | f16e75e0cf11 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2012, 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. |
45 // static final int JVM_CONSTANT_(unused) = 17; // JSR 292 early drafts only | 45 // static final int JVM_CONSTANT_(unused) = 17; // JSR 292 early drafts only |
46 private static final int JVM_CONSTANT_InvokeDynamic = 18; // JSR 292 | 46 private static final int JVM_CONSTANT_InvokeDynamic = 18; // JSR 292 |
47 private static final int JVM_CONSTANT_Invalid = 0; // For bad value initialization | 47 private static final int JVM_CONSTANT_Invalid = 0; // For bad value initialization |
48 private static final int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use | 48 private static final int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use |
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_UnresolvedString = 102; // Temporary tag until actual use | 50 private static final int JVM_CONSTANT_StringIndex = 102; // Temporary tag while constructing constant pool |
51 private static final int JVM_CONSTANT_StringIndex = 103; // Temporary tag while constructing constant pool | 51 private static final int JVM_CONSTANT_UnresolvedClassInError = 103; // Resolution failed |
52 private static final int JVM_CONSTANT_UnresolvedClassInError = 104; // Resolution failed | 52 private static final int JVM_CONSTANT_MethodHandleInError = 104; // Error tag due to resolution error |
53 private static final int JVM_CONSTANT_Object = 105; // Required for BoundMethodHandle arguments. | 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. | |
54 | 55 |
55 // JVM_CONSTANT_MethodHandle subtypes //FIXME: connect these to data structure | 56 // JVM_CONSTANT_MethodHandle subtypes //FIXME: connect these to data structure |
56 private static int JVM_REF_getField = 1; | 57 private static int JVM_REF_getField = 1; |
57 private static int JVM_REF_getStatic = 2; | 58 private static int JVM_REF_getStatic = 2; |
58 private static int JVM_REF_putField = 3; | 59 private static int JVM_REF_putField = 3; |
91 public boolean isUnresolvedKlass() { | 92 public boolean isUnresolvedKlass() { |
92 return tag == JVM_CONSTANT_UnresolvedClass || tag == JVM_CONSTANT_UnresolvedClassInError; | 93 return tag == JVM_CONSTANT_UnresolvedClass || tag == JVM_CONSTANT_UnresolvedClassInError; |
93 } | 94 } |
94 public boolean isUnresolveKlassInError() { return tag == JVM_CONSTANT_UnresolvedClassInError; } | 95 public boolean isUnresolveKlassInError() { return tag == JVM_CONSTANT_UnresolvedClassInError; } |
95 public boolean isKlassIndex() { return tag == JVM_CONSTANT_ClassIndex; } | 96 public boolean isKlassIndex() { return tag == JVM_CONSTANT_ClassIndex; } |
96 public boolean isUnresolvedString() { return tag == JVM_CONSTANT_UnresolvedString; } | |
97 public boolean isStringIndex() { return tag == JVM_CONSTANT_StringIndex; } | 97 public boolean isStringIndex() { return tag == JVM_CONSTANT_StringIndex; } |
98 | 98 |
99 public boolean isObject() { return tag == JVM_CONSTANT_Object; } | 99 public boolean isObject() { return tag == JVM_CONSTANT_Object; } |
100 | 100 |
101 public boolean isKlassReference() { return isKlassIndex() || isUnresolvedKlass(); } | 101 public boolean isKlassReference() { return isKlassIndex() || isUnresolvedKlass(); } |
115 | 115 |
116 case JVM_CONSTANT_Class : | 116 case JVM_CONSTANT_Class : |
117 case JVM_CONSTANT_String : | 117 case JVM_CONSTANT_String : |
118 case JVM_CONSTANT_UnresolvedClass : | 118 case JVM_CONSTANT_UnresolvedClass : |
119 case JVM_CONSTANT_UnresolvedClassInError : | 119 case JVM_CONSTANT_UnresolvedClassInError : |
120 case JVM_CONSTANT_MethodHandleInError : | |
121 case JVM_CONSTANT_MethodTypeInError : | |
120 case JVM_CONSTANT_ClassIndex : | 122 case JVM_CONSTANT_ClassIndex : |
121 case JVM_CONSTANT_UnresolvedString : | |
122 case JVM_CONSTANT_StringIndex : | 123 case JVM_CONSTANT_StringIndex : |
123 case JVM_CONSTANT_MethodHandle : | 124 case JVM_CONSTANT_MethodHandle : |
124 case JVM_CONSTANT_MethodType : | 125 case JVM_CONSTANT_MethodType : |
125 case JVM_CONSTANT_Object : | 126 case JVM_CONSTANT_Object : |
126 return BasicType.T_OBJECT; | 127 return BasicType.T_OBJECT; |
127 default: | 128 default: |
128 throw new InternalError("unexpected tag: " + tag); | 129 throw new InternalError("unexpected tag: " + tag); |
129 } | 130 } |
130 } | 131 } |
132 | |
133 public String toString() { | |
134 return "ConstantTag:" + Integer.toString(tag); | |
131 } | 135 } |
136 } |