annotate src/share/vm/utilities/constantTag.cpp @ 20543:e7d0505c8a30

8059758: Footprint regressions with JDK-8038423 Summary: Changes in JDK-8038423 always initialize (zero out) virtual memory used for auxiliary data structures. This causes a footprint regression for G1 in startup benchmarks. This is because they do not touch that memory at all, so the operating system does not actually commit these pages. The fix is to, if the initialization value of the data structures matches the default value of just committed memory (=0), do not do anything. Reviewed-by: jwilhelm, brutisso
author tschatzl
date Fri, 10 Oct 2014 15:51:58 +0200
parents 78bbf4d43a14
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17937
78bbf4d43a14 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 12850
diff changeset
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. 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 *
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
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1660
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1660
diff changeset
26 #include "utilities/constantTag.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 void constantTag::print_on(outputStream* st) const {
17937
78bbf4d43a14 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 12850
diff changeset
31 st->print("%s", internal_name());
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
32 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
33
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
34 #endif // PRODUCT
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
35
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
36 BasicType constantTag::basic_type() const {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
37 switch (_tag) {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 case JVM_CONSTANT_Integer :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
39 return T_INT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
40 case JVM_CONSTANT_Float :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
41 return T_FLOAT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 case JVM_CONSTANT_Long :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
43 return T_LONG;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
44 case JVM_CONSTANT_Double :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
45 return T_DOUBLE;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
46
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
47 case JVM_CONSTANT_Class :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
48 case JVM_CONSTANT_String :
0
a61af66fc99e Initial load
duke
parents:
diff changeset
49 case JVM_CONSTANT_UnresolvedClass :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
50 case JVM_CONSTANT_UnresolvedClassInError :
0
a61af66fc99e Initial load
duke
parents:
diff changeset
51 case JVM_CONSTANT_ClassIndex :
a61af66fc99e Initial load
duke
parents:
diff changeset
52 case JVM_CONSTANT_StringIndex :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
53 case JVM_CONSTANT_MethodHandle :
12850
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
54 case JVM_CONSTANT_MethodHandleInError :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
55 case JVM_CONSTANT_MethodType :
12850
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
56 case JVM_CONSTANT_MethodTypeInError :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
57 return T_OBJECT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
58 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
59 ShouldNotReachHere();
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
60 return T_ILLEGAL;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
61 }
a61af66fc99e Initial load
duke
parents:
diff changeset
62 }
a61af66fc99e Initial load
duke
parents:
diff changeset
63
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
64
12850
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
65 jbyte constantTag::non_error_value() const {
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
66 switch (_tag) {
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
67 case JVM_CONSTANT_UnresolvedClassInError:
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
68 return JVM_CONSTANT_UnresolvedClass;
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
69 case JVM_CONSTANT_MethodHandleInError:
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
70 return JVM_CONSTANT_MethodHandle;
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
71 case JVM_CONSTANT_MethodTypeInError:
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
72 return JVM_CONSTANT_MethodType;
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
73 default:
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
74 return _tag;
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
75 }
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
76 }
28ca974cc21a 8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents: 8104
diff changeset
77
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
78
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
79 const char* constantTag::internal_name() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
80 switch (_tag) {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
81 case JVM_CONSTANT_Invalid :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
82 return "Invalid index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
83 case JVM_CONSTANT_Class :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
84 return "Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
85 case JVM_CONSTANT_Fieldref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
86 return "Field";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
87 case JVM_CONSTANT_Methodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
88 return "Method";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
89 case JVM_CONSTANT_InterfaceMethodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
90 return "InterfaceMethod";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
91 case JVM_CONSTANT_String :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
92 return "String";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
93 case JVM_CONSTANT_Integer :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
94 return "Integer";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
95 case JVM_CONSTANT_Float :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
96 return "Float";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
97 case JVM_CONSTANT_Long :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
98 return "Long";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
99 case JVM_CONSTANT_Double :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
100 return "Double";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
101 case JVM_CONSTANT_NameAndType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
102 return "NameAndType";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
103 case JVM_CONSTANT_MethodHandle :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
104 return "MethodHandle";
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
105 case JVM_CONSTANT_MethodHandleInError :
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
106 return "MethodHandle Error";
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
107 case JVM_CONSTANT_MethodType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
108 return "MethodType";
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
109 case JVM_CONSTANT_MethodTypeInError :
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
110 return "MethodType Error";
1660
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
111 case JVM_CONSTANT_InvokeDynamic :
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
112 return "InvokeDynamic";
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
113 case JVM_CONSTANT_Utf8 :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
114 return "Utf8";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
115 case JVM_CONSTANT_UnresolvedClass :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
116 return "Unresolved Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
117 case JVM_CONSTANT_UnresolvedClassInError :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
118 return "Unresolved Class Error";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
119 case JVM_CONSTANT_ClassIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
120 return "Unresolved Class Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
121 case JVM_CONSTANT_StringIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
122 return "Unresolved String Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
123 default:
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
124 ShouldNotReachHere();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
125 return "Illegal";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
126 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
127 }