author | jlahoda |
Mon, 21 Oct 2019 15:38:26 +0200 | |
changeset 58713 | ad69fd32778e |
parent 55306 | ea43db53de91 |
permissions | -rw-r--r-- |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
1 |
/* |
55306 | 2 |
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
4 |
* |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
10 |
* |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
15 |
* accompanied this code). |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
16 |
* |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
20 |
* |
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
24 |
*/ |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
25 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
26 |
package com.sun.tools.javac.util; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
27 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
28 |
/** |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
29 |
* Access to the compiler's name table. STandard names are defined, |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
30 |
* as well as methods to create new names. |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
31 |
* |
5847
1908176fd6e3
6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
32 |
* <p><b>This is NOT part of any supported API. |
1908176fd6e3
6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
33 |
* If you write code that depends on this, you do so at your own risk. |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
34 |
* This code and its internal interfaces are subject to change or |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
35 |
* deletion without notice.</b> |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
36 |
*/ |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
37 |
public class Names { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
38 |
|
22163 | 39 |
public static final Context.Key<Names> namesKey = new Context.Key<>(); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
40 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
41 |
public static Names instance(Context context) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
42 |
Names instance = context.get(namesKey); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
43 |
if (instance == null) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
44 |
instance = new Names(context); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
45 |
context.put(namesKey, instance); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
46 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
47 |
return instance; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
48 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
49 |
|
12014 | 50 |
// operators and punctuation |
51 |
public final Name asterisk; |
|
52 |
public final Name comma; |
|
53 |
public final Name empty; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
54 |
public final Name hyphen; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
55 |
public final Name one; |
12014 | 56 |
public final Name slash; |
57 |
||
58 |
// keywords |
|
59 |
public final Name _class; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
60 |
public final Name _super; |
12014 | 61 |
public final Name _this; |
47268
48ec75306997
8177466: Add compiler support for local variable type-inference
mcimadamore
parents:
47216
diff
changeset
|
62 |
public final Name var; |
36526 | 63 |
public final Name exports; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
64 |
public final Name opens; |
36526 | 65 |
public final Name module; |
66 |
public final Name provides; |
|
67 |
public final Name requires; |
|
68 |
public final Name to; |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
69 |
public final Name transitive; |
36526 | 70 |
public final Name uses; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
71 |
public final Name open; |
36526 | 72 |
public final Name with; |
55306 | 73 |
public final Name yield; |
12014 | 74 |
|
75 |
// field and method names |
|
76 |
public final Name _name; |
|
77 |
public final Name addSuppressed; |
|
78 |
public final Name any; |
|
79 |
public final Name append; |
|
80 |
public final Name clinit; |
|
81 |
public final Name clone; |
|
82 |
public final Name close; |
|
16300 | 83 |
public final Name deserializeLambda; |
12014 | 84 |
public final Name desiredAssertionStatus; |
85 |
public final Name equals; |
|
86 |
public final Name error; |
|
87 |
public final Name finalize; |
|
41637 | 88 |
public final Name forRemoval; |
58713
ad69fd32778e
8226585: Improve javac messages for using a preview API
jlahoda
parents:
55306
diff
changeset
|
89 |
public final Name essentialAPI; |
12014 | 90 |
public final Name getClass; |
91 |
public final Name hasNext; |
|
92 |
public final Name hashCode; |
|
93 |
public final Name init; |
|
94 |
public final Name iterator; |
|
95 |
public final Name length; |
|
96 |
public final Name next; |
|
97 |
public final Name ordinal; |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
98 |
public final Name provider; |
12014 | 99 |
public final Name serialVersionUID; |
100 |
public final Name toString; |
|
101 |
public final Name value; |
|
102 |
public final Name valueOf; |
|
103 |
public final Name values; |
|
104 |
||
105 |
// class names |
|
106 |
public final Name java_io_Serializable; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
107 |
public final Name java_lang_Class; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
108 |
public final Name java_lang_Cloneable; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
109 |
public final Name java_lang_Enum; |
12014 | 110 |
public final Name java_lang_Object; |
111 |
||
112 |
// names of builtin classes |
|
113 |
public final Name Array; |
|
114 |
public final Name Bound; |
|
115 |
public final Name Method; |
|
116 |
||
117 |
// package names |
|
118 |
public final Name java_lang; |
|
119 |
||
36526 | 120 |
// module names |
121 |
public final Name java_base; |
|
122 |
||
12014 | 123 |
// attribute names |
124 |
public final Name Annotation; |
|
125 |
public final Name AnnotationDefault; |
|
14052 | 126 |
public final Name BootstrapMethods; |
12014 | 127 |
public final Name Bridge; |
128 |
public final Name CharacterRangeTable; |
|
129 |
public final Name Code; |
|
130 |
public final Name CompilationID; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
131 |
public final Name ConstantValue; |
12014 | 132 |
public final Name Deprecated; |
133 |
public final Name EnclosingMethod; |
|
134 |
public final Name Enum; |
|
135 |
public final Name Exceptions; |
|
136 |
public final Name InnerClasses; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
137 |
public final Name LineNumberTable; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
138 |
public final Name LocalVariableTable; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
139 |
public final Name LocalVariableTypeTable; |
15031
c4fad55a5681
8004727: Add compiler support for parameter reflection
jjg
parents:
14365
diff
changeset
|
140 |
public final Name MethodParameters; |
36526 | 141 |
public final Name Module; |
42822
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42407
diff
changeset
|
142 |
public final Name ModuleResolution; |
50735
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
47268
diff
changeset
|
143 |
public final Name NestHost; |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
47268
diff
changeset
|
144 |
public final Name NestMembers; |
12014 | 145 |
public final Name RuntimeInvisibleAnnotations; |
146 |
public final Name RuntimeInvisibleParameterAnnotations; |
|
147 |
public final Name RuntimeInvisibleTypeAnnotations; |
|
148 |
public final Name RuntimeVisibleAnnotations; |
|
149 |
public final Name RuntimeVisibleParameterAnnotations; |
|
150 |
public final Name RuntimeVisibleTypeAnnotations; |
|
151 |
public final Name Signature; |
|
152 |
public final Name SourceFile; |
|
153 |
public final Name SourceID; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
154 |
public final Name StackMap; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
155 |
public final Name StackMapTable; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
156 |
public final Name Synthetic; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
157 |
public final Name Value; |
12014 | 158 |
public final Name Varargs; |
159 |
||
160 |
// members of java.lang.annotation.ElementType |
|
161 |
public final Name ANNOTATION_TYPE; |
|
162 |
public final Name CONSTRUCTOR; |
|
163 |
public final Name FIELD; |
|
164 |
public final Name LOCAL_VARIABLE; |
|
165 |
public final Name METHOD; |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
166 |
public final Name MODULE; |
12014 | 167 |
public final Name PACKAGE; |
168 |
public final Name PARAMETER; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
169 |
public final Name TYPE; |
12014 | 170 |
public final Name TYPE_PARAMETER; |
3149 | 171 |
public final Name TYPE_USE; |
12014 | 172 |
|
173 |
// members of java.lang.annotation.RetentionPolicy |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
174 |
public final Name CLASS; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
175 |
public final Name RUNTIME; |
12014 | 176 |
public final Name SOURCE; |
177 |
||
178 |
// other identifiers |
|
179 |
public final Name T; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
180 |
public final Name ex; |
36526 | 181 |
public final Name module_info; |
12014 | 182 |
public final Name package_info; |
29295
5a367770a074
8073432: Object.getClass() throws stackless NPE, due to C2 intrinsic
mcimadamore
parents:
25874
diff
changeset
|
183 |
public final Name requireNonNull; |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
184 |
|
36526 | 185 |
// lambda-related |
14365
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
186 |
public final Name lambda; |
18730
95354d510139
8016281: The SAM method should be passed to the metafactory as a MethodType not a MethodHandle
mcimadamore
parents:
16300
diff
changeset
|
187 |
public final Name metafactory; |
95354d510139
8016281: The SAM method should be passed to the metafactory as a MethodType not a MethodHandle
mcimadamore
parents:
16300
diff
changeset
|
188 |
public final Name altMetafactory; |
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
29295
diff
changeset
|
189 |
public final Name dollarThis; |
14365
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
190 |
|
35424 | 191 |
// string concat |
192 |
public final Name makeConcat; |
|
193 |
public final Name makeConcatWithConstants; |
|
194 |
||
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
195 |
public final Name.Table table; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
196 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
197 |
public Names(Context context) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
198 |
Options options = Options.instance(context); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
199 |
table = createTable(options); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
200 |
|
12014 | 201 |
// operators and punctuation |
202 |
asterisk = fromString("*"); |
|
203 |
comma = fromString(","); |
|
204 |
empty = fromString(""); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
205 |
hyphen = fromString("-"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
206 |
one = fromString("1"); |
12014 | 207 |
slash = fromString("/"); |
208 |
||
209 |
// keywords |
|
210 |
_class = fromString("class"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
211 |
_super = fromString("super"); |
12014 | 212 |
_this = fromString("this"); |
47268
48ec75306997
8177466: Add compiler support for local variable type-inference
mcimadamore
parents:
47216
diff
changeset
|
213 |
var = fromString("var"); |
36526 | 214 |
exports = fromString("exports"); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
215 |
opens = fromString("opens"); |
36526 | 216 |
module = fromString("module"); |
217 |
provides = fromString("provides"); |
|
218 |
requires = fromString("requires"); |
|
219 |
to = fromString("to"); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
220 |
transitive = fromString("transitive"); |
36526 | 221 |
uses = fromString("uses"); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
222 |
open = fromString("open"); |
36526 | 223 |
with = fromString("with"); |
55306 | 224 |
yield = fromString("yield"); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
225 |
|
12014 | 226 |
// field and method names |
227 |
_name = fromString("name"); |
|
228 |
addSuppressed = fromString("addSuppressed"); |
|
229 |
any = fromString("<any>"); |
|
230 |
append = fromString("append"); |
|
231 |
clinit = fromString("<clinit>"); |
|
232 |
clone = fromString("clone"); |
|
233 |
close = fromString("close"); |
|
16300 | 234 |
deserializeLambda = fromString("$deserializeLambda$"); |
12014 | 235 |
desiredAssertionStatus = fromString("desiredAssertionStatus"); |
236 |
equals = fromString("equals"); |
|
237 |
error = fromString("<error>"); |
|
238 |
finalize = fromString("finalize"); |
|
41637 | 239 |
forRemoval = fromString("forRemoval"); |
58713
ad69fd32778e
8226585: Improve javac messages for using a preview API
jlahoda
parents:
55306
diff
changeset
|
240 |
essentialAPI = fromString("essentialAPI"); |
12014 | 241 |
getClass = fromString("getClass"); |
242 |
hasNext = fromString("hasNext"); |
|
243 |
hashCode = fromString("hashCode"); |
|
244 |
init = fromString("<init>"); |
|
245 |
iterator = fromString("iterator"); |
|
246 |
length = fromString("length"); |
|
247 |
next = fromString("next"); |
|
248 |
ordinal = fromString("ordinal"); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
249 |
provider = fromString("provider"); |
12014 | 250 |
serialVersionUID = fromString("serialVersionUID"); |
251 |
toString = fromString("toString"); |
|
252 |
value = fromString("value"); |
|
253 |
valueOf = fromString("valueOf"); |
|
254 |
values = fromString("values"); |
|
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
29295
diff
changeset
|
255 |
dollarThis = fromString("$this"); |
12014 | 256 |
|
257 |
// class names |
|
258 |
java_io_Serializable = fromString("java.io.Serializable"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
259 |
java_lang_Class = fromString("java.lang.Class"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
260 |
java_lang_Cloneable = fromString("java.lang.Cloneable"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
261 |
java_lang_Enum = fromString("java.lang.Enum"); |
12014 | 262 |
java_lang_Object = fromString("java.lang.Object"); |
263 |
||
264 |
// names of builtin classes |
|
265 |
Array = fromString("Array"); |
|
266 |
Bound = fromString("Bound"); |
|
267 |
Method = fromString("Method"); |
|
268 |
||
269 |
// package names |
|
270 |
java_lang = fromString("java.lang"); |
|
271 |
||
36526 | 272 |
// module names |
273 |
java_base = fromString("java.base"); |
|
274 |
||
12014 | 275 |
// attribute names |
276 |
Annotation = fromString("Annotation"); |
|
277 |
AnnotationDefault = fromString("AnnotationDefault"); |
|
14052 | 278 |
BootstrapMethods = fromString("BootstrapMethods"); |
12014 | 279 |
Bridge = fromString("Bridge"); |
280 |
CharacterRangeTable = fromString("CharacterRangeTable"); |
|
281 |
Code = fromString("Code"); |
|
282 |
CompilationID = fromString("CompilationID"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
283 |
ConstantValue = fromString("ConstantValue"); |
12014 | 284 |
Deprecated = fromString("Deprecated"); |
285 |
EnclosingMethod = fromString("EnclosingMethod"); |
|
286 |
Enum = fromString("Enum"); |
|
287 |
Exceptions = fromString("Exceptions"); |
|
288 |
InnerClasses = fromString("InnerClasses"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
289 |
LineNumberTable = fromString("LineNumberTable"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
290 |
LocalVariableTable = fromString("LocalVariableTable"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
291 |
LocalVariableTypeTable = fromString("LocalVariableTypeTable"); |
15031
c4fad55a5681
8004727: Add compiler support for parameter reflection
jjg
parents:
14365
diff
changeset
|
292 |
MethodParameters = fromString("MethodParameters"); |
36526 | 293 |
Module = fromString("Module"); |
42822
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42407
diff
changeset
|
294 |
ModuleResolution = fromString("ModuleResolution"); |
50735
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
47268
diff
changeset
|
295 |
NestHost = fromString("NestHost"); |
2f2af62dfac7
8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents:
47268
diff
changeset
|
296 |
NestMembers = fromString("NestMembers"); |
12014 | 297 |
RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations"); |
298 |
RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations"); |
|
299 |
RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations"); |
|
300 |
RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations"); |
|
301 |
RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations"); |
|
302 |
RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations"); |
|
303 |
Signature = fromString("Signature"); |
|
304 |
SourceFile = fromString("SourceFile"); |
|
305 |
SourceID = fromString("SourceID"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
306 |
StackMap = fromString("StackMap"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
307 |
StackMapTable = fromString("StackMapTable"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
308 |
Synthetic = fromString("Synthetic"); |
12014 | 309 |
Value = fromString("Value"); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
310 |
Varargs = fromString("Varargs"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
311 |
|
12014 | 312 |
// members of java.lang.annotation.ElementType |
313 |
ANNOTATION_TYPE = fromString("ANNOTATION_TYPE"); |
|
314 |
CONSTRUCTOR = fromString("CONSTRUCTOR"); |
|
315 |
FIELD = fromString("FIELD"); |
|
316 |
LOCAL_VARIABLE = fromString("LOCAL_VARIABLE"); |
|
317 |
METHOD = fromString("METHOD"); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
318 |
MODULE = fromString("MODULE"); |
12014 | 319 |
PACKAGE = fromString("PACKAGE"); |
320 |
PARAMETER = fromString("PARAMETER"); |
|
321 |
TYPE = fromString("TYPE"); |
|
322 |
TYPE_PARAMETER = fromString("TYPE_PARAMETER"); |
|
323 |
TYPE_USE = fromString("TYPE_USE"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
324 |
|
12014 | 325 |
// members of java.lang.annotation.RetentionPolicy |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
326 |
CLASS = fromString("CLASS"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
327 |
RUNTIME = fromString("RUNTIME"); |
12014 | 328 |
SOURCE = fromString("SOURCE"); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
329 |
|
12014 | 330 |
// other identifiers |
331 |
T = fromString("T"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
332 |
ex = fromString("ex"); |
36526 | 333 |
module_info = fromString("module-info"); |
12014 | 334 |
package_info = fromString("package-info"); |
29295
5a367770a074
8073432: Object.getClass() throws stackless NPE, due to C2 intrinsic
mcimadamore
parents:
25874
diff
changeset
|
335 |
requireNonNull = fromString("requireNonNull"); |
14365
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
336 |
|
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
337 |
//lambda-related |
16300 | 338 |
lambda = fromString("lambda$"); |
18730
95354d510139
8016281: The SAM method should be passed to the metafactory as a MethodType not a MethodHandle
mcimadamore
parents:
16300
diff
changeset
|
339 |
metafactory = fromString("metafactory"); |
95354d510139
8016281: The SAM method should be passed to the metafactory as a MethodType not a MethodHandle
mcimadamore
parents:
16300
diff
changeset
|
340 |
altMetafactory = fromString("altMetafactory"); |
35424 | 341 |
|
342 |
// string concat |
|
343 |
makeConcat = fromString("makeConcat"); |
|
344 |
makeConcatWithConstants = fromString("makeConcatWithConstants"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
345 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
346 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
347 |
protected Name.Table createTable(Options options) { |
6721 | 348 |
boolean useUnsharedTable = options.isSet("useUnsharedTable"); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
349 |
if (useUnsharedTable) |
24611
8848a1bca14f
7177211: SharedNameTable.create and .dispose are not used
pgovereau
parents:
22449
diff
changeset
|
350 |
return UnsharedNameTable.create(this); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
351 |
else |
24611
8848a1bca14f
7177211: SharedNameTable.create and .dispose are not used
pgovereau
parents:
22449
diff
changeset
|
352 |
return SharedNameTable.create(this); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
353 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
354 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
355 |
public void dispose() { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
356 |
table.dispose(); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
357 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
358 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
359 |
public Name fromChars(char[] cs, int start, int len) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
360 |
return table.fromChars(cs, start, len); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
361 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
362 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
363 |
public Name fromString(String s) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
364 |
return table.fromString(s); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
365 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
366 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
367 |
public Name fromUtf(byte[] cs) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
368 |
return table.fromUtf(cs); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
369 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
370 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
371 |
public Name fromUtf(byte[] cs, int start, int len) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
372 |
return table.fromUtf(cs, start, len); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
373 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
374 |
} |