comparison src/share/vm/utilities/constantTag.hpp @ 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 ed69575596ac
children f16e75e0cf11
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
37 // Hotspot specific tags 37 // Hotspot specific tags
38 JVM_CONSTANT_Invalid = 0, // For bad value initialization 38 JVM_CONSTANT_Invalid = 0, // For bad value initialization
39 JVM_CONSTANT_InternalMin = 100, // First implementation tag (aside from bad value of course) 39 JVM_CONSTANT_InternalMin = 100, // First implementation tag (aside from bad value of course)
40 JVM_CONSTANT_UnresolvedClass = 100, // Temporary tag until actual use 40 JVM_CONSTANT_UnresolvedClass = 100, // Temporary tag until actual use
41 JVM_CONSTANT_ClassIndex = 101, // Temporary tag while constructing constant pool 41 JVM_CONSTANT_ClassIndex = 101, // Temporary tag while constructing constant pool
42 JVM_CONSTANT_UnresolvedString = 102, // Temporary tag until actual use 42 JVM_CONSTANT_StringIndex = 102, // Temporary tag while constructing constant pool
43 JVM_CONSTANT_StringIndex = 103, // Temporary tag while constructing constant pool 43 JVM_CONSTANT_UnresolvedClassInError = 103, // Error tag due to resolution error
44 JVM_CONSTANT_UnresolvedClassInError = 104, // Error tag due to resolution error 44 JVM_CONSTANT_MethodHandleInError = 104, // Error tag due to resolution error
45 JVM_CONSTANT_Object = 105, // Required for BoundMethodHandle arguments. 45 JVM_CONSTANT_MethodTypeInError = 105, // Error tag due to resolution error
46 JVM_CONSTANT_InternalMax = 105 // Last implementation tag 46 JVM_CONSTANT_Object = 106, // Required for BoundMethodHandle arguments.
47 JVM_CONSTANT_InternalMax = 106 // Last implementation tag
47 }; 48 };
48 49
49 50
50 class constantTag VALUE_OBJ_CLASS_SPEC { 51 class constantTag VALUE_OBJ_CLASS_SPEC {
51 private: 52 private:
71 72
72 bool is_unresolved_klass_in_error() const { 73 bool is_unresolved_klass_in_error() const {
73 return _tag == JVM_CONSTANT_UnresolvedClassInError; 74 return _tag == JVM_CONSTANT_UnresolvedClassInError;
74 } 75 }
75 76
77 bool is_method_handle_in_error() const {
78 return _tag == JVM_CONSTANT_MethodHandleInError;
79 }
80 bool is_method_type_in_error() const {
81 return _tag == JVM_CONSTANT_MethodTypeInError;
82 }
83
76 bool is_klass_index() const { return _tag == JVM_CONSTANT_ClassIndex; } 84 bool is_klass_index() const { return _tag == JVM_CONSTANT_ClassIndex; }
77 bool is_unresolved_string() const { return _tag == JVM_CONSTANT_UnresolvedString; }
78 bool is_string_index() const { return _tag == JVM_CONSTANT_StringIndex; } 85 bool is_string_index() const { return _tag == JVM_CONSTANT_StringIndex; }
79 86
80 bool is_object() const { return _tag == JVM_CONSTANT_Object; } 87 bool is_object() const { return _tag == JVM_CONSTANT_Object; }
81 88
82 bool is_klass_reference() const { return is_klass_index() || is_unresolved_klass(); } 89 bool is_klass_reference() const { return is_klass_index() || is_unresolved_klass(); }
89 bool is_invoke_dynamic() const { return _tag == JVM_CONSTANT_InvokeDynamic; } 96 bool is_invoke_dynamic() const { return _tag == JVM_CONSTANT_InvokeDynamic; }
90 97
91 bool is_loadable_constant() const { 98 bool is_loadable_constant() const {
92 return ((_tag >= JVM_CONSTANT_Integer && _tag <= JVM_CONSTANT_String) || 99 return ((_tag >= JVM_CONSTANT_Integer && _tag <= JVM_CONSTANT_String) ||
93 is_method_type() || is_method_handle() || 100 is_method_type() || is_method_handle() ||
94 is_unresolved_klass() || is_unresolved_string() || 101 is_unresolved_klass() || is_object());
95 is_object());
96 } 102 }
97 103
98 constantTag() { 104 constantTag() {
99 _tag = JVM_CONSTANT_Invalid; 105 _tag = JVM_CONSTANT_Invalid;
100 } 106 }