author | alanb |
Fri, 16 Dec 2016 05:47:58 +0000 | |
changeset 42822 | a84956e7ee4d |
parent 42407 | f3702cff2933 |
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 |
/* |
41637 | 2 |
* Copyright (c) 1999, 2016, 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; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
56 |
public final Name period; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
57 |
public final Name semicolon; |
12014 | 58 |
public final Name slash; |
59 |
public final Name slashequals; |
|
60 |
||
61 |
// keywords |
|
62 |
public final Name _class; |
|
63 |
public final Name _default; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
64 |
public final Name _super; |
12014 | 65 |
public final Name _this; |
36526 | 66 |
public final Name exports; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
67 |
public final Name opens; |
36526 | 68 |
public final Name module; |
69 |
public final Name provides; |
|
70 |
public final Name requires; |
|
71 |
public final Name to; |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
72 |
public final Name transitive; |
36526 | 73 |
public final Name uses; |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
74 |
public final Name open; |
36526 | 75 |
public final Name with; |
12014 | 76 |
|
77 |
// field and method names |
|
78 |
public final Name _name; |
|
79 |
public final Name addSuppressed; |
|
80 |
public final Name any; |
|
81 |
public final Name append; |
|
82 |
public final Name clinit; |
|
83 |
public final Name clone; |
|
84 |
public final Name close; |
|
85 |
public final Name compareTo; |
|
16300 | 86 |
public final Name deserializeLambda; |
12014 | 87 |
public final Name desiredAssertionStatus; |
88 |
public final Name equals; |
|
89 |
public final Name error; |
|
90 |
public final Name family; |
|
91 |
public final Name finalize; |
|
92 |
public final Name forName; |
|
41637 | 93 |
public final Name forRemoval; |
12014 | 94 |
public final Name getClass; |
95 |
public final Name getClassLoader; |
|
96 |
public final Name getComponentType; |
|
97 |
public final Name getDeclaringClass; |
|
98 |
public final Name getMessage; |
|
99 |
public final Name hasNext; |
|
100 |
public final Name hashCode; |
|
101 |
public final Name init; |
|
102 |
public final Name initCause; |
|
103 |
public final Name iterator; |
|
104 |
public final Name length; |
|
105 |
public final Name next; |
|
106 |
public final Name ordinal; |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
107 |
public final Name provider; |
12014 | 108 |
public final Name serialVersionUID; |
109 |
public final Name toString; |
|
110 |
public final Name value; |
|
111 |
public final Name valueOf; |
|
112 |
public final Name values; |
|
113 |
||
114 |
// class names |
|
115 |
public final Name java_io_Serializable; |
|
116 |
public final Name java_lang_AutoCloseable; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
117 |
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
|
118 |
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
|
119 |
public final Name java_lang_Enum; |
12014 | 120 |
public final Name java_lang_Object; |
8241
4161b56e0d20
7017414: before the move of JSR 292 to package java.lang.invoke, javac must recognize the new package
mcimadamore
parents:
8036
diff
changeset
|
121 |
public final Name java_lang_invoke_MethodHandle; |
12014 | 122 |
|
123 |
// names of builtin classes |
|
124 |
public final Name Array; |
|
125 |
public final Name Bound; |
|
126 |
public final Name Method; |
|
127 |
||
128 |
// package names |
|
129 |
public final Name java_lang; |
|
130 |
||
36526 | 131 |
// module names |
132 |
public final Name java_base; |
|
133 |
||
12014 | 134 |
// attribute names |
135 |
public final Name Annotation; |
|
136 |
public final Name AnnotationDefault; |
|
14052 | 137 |
public final Name BootstrapMethods; |
12014 | 138 |
public final Name Bridge; |
139 |
public final Name CharacterRangeTable; |
|
140 |
public final Name Code; |
|
141 |
public final Name CompilationID; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
142 |
public final Name ConstantValue; |
12014 | 143 |
public final Name Deprecated; |
144 |
public final Name EnclosingMethod; |
|
145 |
public final Name Enum; |
|
146 |
public final Name Exceptions; |
|
147 |
public final Name InnerClasses; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
148 |
public final Name LineNumberTable; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
149 |
public final Name LocalVariableTable; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
150 |
public final Name LocalVariableTypeTable; |
15031
c4fad55a5681
8004727: Add compiler support for parameter reflection
jjg
parents:
14365
diff
changeset
|
151 |
public final Name MethodParameters; |
36526 | 152 |
public final Name Module; |
42822
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42407
diff
changeset
|
153 |
public final Name ModuleResolution; |
12014 | 154 |
public final Name RuntimeInvisibleAnnotations; |
155 |
public final Name RuntimeInvisibleParameterAnnotations; |
|
156 |
public final Name RuntimeInvisibleTypeAnnotations; |
|
157 |
public final Name RuntimeVisibleAnnotations; |
|
158 |
public final Name RuntimeVisibleParameterAnnotations; |
|
159 |
public final Name RuntimeVisibleTypeAnnotations; |
|
160 |
public final Name Signature; |
|
161 |
public final Name SourceFile; |
|
162 |
public final Name SourceID; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
163 |
public final Name StackMap; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
164 |
public final Name StackMapTable; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
165 |
public final Name Synthetic; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
166 |
public final Name Value; |
12014 | 167 |
public final Name Varargs; |
168 |
||
169 |
// members of java.lang.annotation.ElementType |
|
170 |
public final Name ANNOTATION_TYPE; |
|
171 |
public final Name CONSTRUCTOR; |
|
172 |
public final Name FIELD; |
|
173 |
public final Name LOCAL_VARIABLE; |
|
174 |
public final Name METHOD; |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
175 |
public final Name MODULE; |
12014 | 176 |
public final Name PACKAGE; |
177 |
public final Name PARAMETER; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
178 |
public final Name TYPE; |
12014 | 179 |
public final Name TYPE_PARAMETER; |
3149 | 180 |
public final Name TYPE_USE; |
12014 | 181 |
|
182 |
// 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
|
183 |
public final Name CLASS; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
184 |
public final Name RUNTIME; |
12014 | 185 |
public final Name SOURCE; |
186 |
||
187 |
// other identifiers |
|
188 |
public final Name T; |
|
189 |
public final Name deprecated; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
190 |
public final Name ex; |
36526 | 191 |
public final Name module_info; |
12014 | 192 |
public final Name package_info; |
29295
5a367770a074
8073432: Object.getClass() throws stackless NPE, due to C2 intrinsic
mcimadamore
parents:
25874
diff
changeset
|
193 |
public final Name requireNonNull; |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
194 |
|
36526 | 195 |
// lambda-related |
14365
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
196 |
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
|
197 |
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
|
198 |
public final Name altMetafactory; |
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
29295
diff
changeset
|
199 |
public final Name dollarThis; |
14365
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
200 |
|
35424 | 201 |
// string concat |
202 |
public final Name makeConcat; |
|
203 |
public final Name makeConcatWithConstants; |
|
204 |
||
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
205 |
public final Name.Table table; |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
206 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
207 |
public Names(Context context) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
208 |
Options options = Options.instance(context); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
209 |
table = createTable(options); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
210 |
|
12014 | 211 |
// operators and punctuation |
212 |
asterisk = fromString("*"); |
|
213 |
comma = fromString(","); |
|
214 |
empty = fromString(""); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
215 |
hyphen = fromString("-"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
216 |
one = fromString("1"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
217 |
period = fromString("."); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
218 |
semicolon = fromString(";"); |
12014 | 219 |
slash = fromString("/"); |
220 |
slashequals = fromString("/="); |
|
221 |
||
222 |
// keywords |
|
223 |
_class = fromString("class"); |
|
224 |
_default = fromString("default"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
225 |
_super = fromString("super"); |
12014 | 226 |
_this = fromString("this"); |
36526 | 227 |
exports = fromString("exports"); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
228 |
opens = fromString("opens"); |
36526 | 229 |
module = fromString("module"); |
230 |
provides = fromString("provides"); |
|
231 |
requires = fromString("requires"); |
|
232 |
to = fromString("to"); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
233 |
transitive = fromString("transitive"); |
36526 | 234 |
uses = fromString("uses"); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
235 |
open = fromString("open"); |
36526 | 236 |
with = fromString("with"); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
237 |
|
12014 | 238 |
// field and method names |
239 |
_name = fromString("name"); |
|
240 |
addSuppressed = fromString("addSuppressed"); |
|
241 |
any = fromString("<any>"); |
|
242 |
append = fromString("append"); |
|
243 |
clinit = fromString("<clinit>"); |
|
244 |
clone = fromString("clone"); |
|
245 |
close = fromString("close"); |
|
246 |
compareTo = fromString("compareTo"); |
|
16300 | 247 |
deserializeLambda = fromString("$deserializeLambda$"); |
12014 | 248 |
desiredAssertionStatus = fromString("desiredAssertionStatus"); |
249 |
equals = fromString("equals"); |
|
250 |
error = fromString("<error>"); |
|
251 |
family = fromString("family"); |
|
252 |
finalize = fromString("finalize"); |
|
253 |
forName = fromString("forName"); |
|
41637 | 254 |
forRemoval = fromString("forRemoval"); |
12014 | 255 |
getClass = fromString("getClass"); |
256 |
getClassLoader = fromString("getClassLoader"); |
|
257 |
getComponentType = fromString("getComponentType"); |
|
258 |
getDeclaringClass = fromString("getDeclaringClass"); |
|
259 |
getMessage = fromString("getMessage"); |
|
260 |
hasNext = fromString("hasNext"); |
|
261 |
hashCode = fromString("hashCode"); |
|
262 |
init = fromString("<init>"); |
|
263 |
initCause = fromString("initCause"); |
|
264 |
iterator = fromString("iterator"); |
|
265 |
length = fromString("length"); |
|
266 |
next = fromString("next"); |
|
267 |
ordinal = fromString("ordinal"); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
268 |
provider = fromString("provider"); |
12014 | 269 |
serialVersionUID = fromString("serialVersionUID"); |
270 |
toString = fromString("toString"); |
|
271 |
value = fromString("value"); |
|
272 |
valueOf = fromString("valueOf"); |
|
273 |
values = fromString("values"); |
|
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
29295
diff
changeset
|
274 |
dollarThis = fromString("$this"); |
12014 | 275 |
|
276 |
// class names |
|
277 |
java_io_Serializable = fromString("java.io.Serializable"); |
|
278 |
java_lang_AutoCloseable = fromString("java.lang.AutoCloseable"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
279 |
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
|
280 |
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
|
281 |
java_lang_Enum = fromString("java.lang.Enum"); |
12014 | 282 |
java_lang_Object = fromString("java.lang.Object"); |
8241
4161b56e0d20
7017414: before the move of JSR 292 to package java.lang.invoke, javac must recognize the new package
mcimadamore
parents:
8036
diff
changeset
|
283 |
java_lang_invoke_MethodHandle = fromString("java.lang.invoke.MethodHandle"); |
12014 | 284 |
|
285 |
// names of builtin classes |
|
286 |
Array = fromString("Array"); |
|
287 |
Bound = fromString("Bound"); |
|
288 |
Method = fromString("Method"); |
|
289 |
||
290 |
// package names |
|
291 |
java_lang = fromString("java.lang"); |
|
292 |
||
36526 | 293 |
// module names |
294 |
java_base = fromString("java.base"); |
|
295 |
||
12014 | 296 |
// attribute names |
297 |
Annotation = fromString("Annotation"); |
|
298 |
AnnotationDefault = fromString("AnnotationDefault"); |
|
14052 | 299 |
BootstrapMethods = fromString("BootstrapMethods"); |
12014 | 300 |
Bridge = fromString("Bridge"); |
301 |
CharacterRangeTable = fromString("CharacterRangeTable"); |
|
302 |
Code = fromString("Code"); |
|
303 |
CompilationID = fromString("CompilationID"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
304 |
ConstantValue = fromString("ConstantValue"); |
12014 | 305 |
Deprecated = fromString("Deprecated"); |
306 |
EnclosingMethod = fromString("EnclosingMethod"); |
|
307 |
Enum = fromString("Enum"); |
|
308 |
Exceptions = fromString("Exceptions"); |
|
309 |
InnerClasses = fromString("InnerClasses"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
310 |
LineNumberTable = fromString("LineNumberTable"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
311 |
LocalVariableTable = fromString("LocalVariableTable"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
312 |
LocalVariableTypeTable = fromString("LocalVariableTypeTable"); |
15031
c4fad55a5681
8004727: Add compiler support for parameter reflection
jjg
parents:
14365
diff
changeset
|
313 |
MethodParameters = fromString("MethodParameters"); |
36526 | 314 |
Module = fromString("Module"); |
42822
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
42407
diff
changeset
|
315 |
ModuleResolution = fromString("ModuleResolution"); |
12014 | 316 |
RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations"); |
317 |
RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations"); |
|
318 |
RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations"); |
|
319 |
RuntimeVisibleAnnotations = fromString("RuntimeVisibleAnnotations"); |
|
320 |
RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations"); |
|
321 |
RuntimeVisibleTypeAnnotations = fromString("RuntimeVisibleTypeAnnotations"); |
|
322 |
Signature = fromString("Signature"); |
|
323 |
SourceFile = fromString("SourceFile"); |
|
324 |
SourceID = fromString("SourceID"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
325 |
StackMap = fromString("StackMap"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
326 |
StackMapTable = fromString("StackMapTable"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
327 |
Synthetic = fromString("Synthetic"); |
12014 | 328 |
Value = fromString("Value"); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
329 |
Varargs = fromString("Varargs"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
330 |
|
12014 | 331 |
// members of java.lang.annotation.ElementType |
332 |
ANNOTATION_TYPE = fromString("ANNOTATION_TYPE"); |
|
333 |
CONSTRUCTOR = fromString("CONSTRUCTOR"); |
|
334 |
FIELD = fromString("FIELD"); |
|
335 |
LOCAL_VARIABLE = fromString("LOCAL_VARIABLE"); |
|
336 |
METHOD = fromString("METHOD"); |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41637
diff
changeset
|
337 |
MODULE = fromString("MODULE"); |
12014 | 338 |
PACKAGE = fromString("PACKAGE"); |
339 |
PARAMETER = fromString("PARAMETER"); |
|
340 |
TYPE = fromString("TYPE"); |
|
341 |
TYPE_PARAMETER = fromString("TYPE_PARAMETER"); |
|
342 |
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
|
343 |
|
12014 | 344 |
// 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
|
345 |
CLASS = fromString("CLASS"); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
346 |
RUNTIME = fromString("RUNTIME"); |
12014 | 347 |
SOURCE = fromString("SOURCE"); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
348 |
|
12014 | 349 |
// other identifiers |
350 |
T = fromString("T"); |
|
351 |
deprecated = fromString("deprecated"); |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
352 |
ex = fromString("ex"); |
36526 | 353 |
module_info = fromString("module-info"); |
12014 | 354 |
package_info = fromString("package-info"); |
29295
5a367770a074
8073432: Object.getClass() throws stackless NPE, due to C2 intrinsic
mcimadamore
parents:
25874
diff
changeset
|
355 |
requireNonNull = fromString("requireNonNull"); |
14365
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
356 |
|
20f388573215
8000694: Add generation of lambda implementation code: invokedynamic call, lambda method, adaptor methods
rfield
parents:
14052
diff
changeset
|
357 |
//lambda-related |
16300 | 358 |
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
|
359 |
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
|
360 |
altMetafactory = fromString("altMetafactory"); |
35424 | 361 |
|
362 |
// string concat |
|
363 |
makeConcat = fromString("makeConcat"); |
|
364 |
makeConcatWithConstants = fromString("makeConcatWithConstants"); |
|
1260
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 |
protected Name.Table createTable(Options options) { |
6721 | 368 |
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
|
369 |
if (useUnsharedTable) |
24611
8848a1bca14f
7177211: SharedNameTable.create and .dispose are not used
pgovereau
parents:
22449
diff
changeset
|
370 |
return UnsharedNameTable.create(this); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
371 |
else |
24611
8848a1bca14f
7177211: SharedNameTable.create and .dispose are not used
pgovereau
parents:
22449
diff
changeset
|
372 |
return SharedNameTable.create(this); |
1260
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 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
375 |
public void dispose() { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
376 |
table.dispose(); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
377 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
378 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
379 |
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
|
380 |
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
|
381 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
382 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
383 |
public Name fromString(String s) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
384 |
return table.fromString(s); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
385 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
386 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
387 |
public Name fromUtf(byte[] cs) { |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
388 |
return table.fromUtf(cs); |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
389 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
390 |
|
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
391 |
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
|
392 |
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
|
393 |
} |
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
diff
changeset
|
394 |
} |