137 do_klass(reflect_Parameter_klass, java_lang_reflect_Parameter, Opt ) \ |
137 do_klass(reflect_Parameter_klass, java_lang_reflect_Parameter, Opt ) \ |
138 do_klass(reflect_Method_klass, java_lang_reflect_Method, Pre ) \ |
138 do_klass(reflect_Method_klass, java_lang_reflect_Method, Pre ) \ |
139 do_klass(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre ) \ |
139 do_klass(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre ) \ |
140 \ |
140 \ |
141 /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \ |
141 /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \ |
142 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ |
|
143 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
142 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
144 do_klass(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt ) \ |
143 do_klass(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt ) \ |
145 do_klass(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ |
144 do_klass(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Pre ) \ |
146 do_klass(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ |
145 do_klass(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Pre ) \ |
147 do_klass(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt ) \ |
146 do_klass(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt ) \ |
148 do_klass(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15 ) \ |
147 do_klass(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt ) \ |
149 do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15 ) \ |
148 do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt ) \ |
150 do_klass(reflect_CallerSensitive_klass, sun_reflect_CallerSensitive, Opt ) \ |
149 do_klass(reflect_CallerSensitive_klass, sun_reflect_CallerSensitive, Opt ) \ |
151 \ |
150 \ |
152 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
151 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
153 do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle, Opt ) \ |
152 do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle, Opt ) \ |
154 do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre ) \ |
153 do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre ) \ |
167 do_klass(StringBuilder_klass, java_lang_StringBuilder, Pre ) \ |
166 do_klass(StringBuilder_klass, java_lang_StringBuilder, Pre ) \ |
168 do_klass(misc_Unsafe_klass, sun_misc_Unsafe, Pre ) \ |
167 do_klass(misc_Unsafe_klass, sun_misc_Unsafe, Pre ) \ |
169 \ |
168 \ |
170 /* It's NULL in non-1.4 JDKs. */ \ |
169 /* It's NULL in non-1.4 JDKs. */ \ |
171 do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \ |
170 do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \ |
172 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ |
|
173 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
171 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
174 do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ |
172 do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ |
175 \ |
173 \ |
176 /* Preload boxing klasses */ \ |
174 /* Preload boxing klasses */ \ |
177 do_klass(Boolean_klass, java_lang_Boolean, Pre ) \ |
175 do_klass(Boolean_klass, java_lang_Boolean, Pre ) \ |
207 |
205 |
208 // Order is significant. Options before this point require resolve_or_fail. |
206 // Order is significant. Options before this point require resolve_or_fail. |
209 // Options after this point will use resolve_or_null instead. |
207 // Options after this point will use resolve_or_null instead. |
210 |
208 |
211 Opt, // preload tried; NULL if not present |
209 Opt, // preload tried; NULL if not present |
212 Opt_Only_JDK14NewRef, // preload tried; use only with NewReflection |
|
213 Opt_Only_JDK15, // preload tried; use only with JDK1.5+ |
|
214 OPTION_LIMIT, |
210 OPTION_LIMIT, |
215 CEIL_LG_OPTION_LIMIT = 4 // OPTION_LIMIT <= (1<<CEIL_LG_OPTION_LIMIT) |
211 CEIL_LG_OPTION_LIMIT = 2 // OPTION_LIMIT <= (1<<CEIL_LG_OPTION_LIMIT) |
216 }; |
212 }; |
217 |
213 |
218 |
214 |
219 // Returns a class with a given class name and class loader. Loads the |
215 // Returns a class with a given class name and class loader. Loads the |
220 // class if needed. If not found a NoClassDefFoundError or a |
216 // class if needed. If not found a NoClassDefFoundError or a |
383 return k; |
379 return k; |
384 } |
380 } |
385 |
381 |
386 static Klass* check_klass_Pre( Klass* k) { return check_klass(k); } |
382 static Klass* check_klass_Pre( Klass* k) { return check_klass(k); } |
387 static Klass* check_klass_Opt( Klass* k) { return k; } |
383 static Klass* check_klass_Opt( Klass* k) { return k; } |
388 static Klass* check_klass_Opt_Only_JDK15(Klass* k) { |
|
389 assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); |
|
390 return k; |
|
391 } |
|
392 static Klass* check_klass_Opt_Only_JDK14NewRef(Klass* k) { |
|
393 assert(JDK_Version::is_gte_jdk14x_version(), "JDK 1.4 only"); |
|
394 // despite the optional loading, if you use this it must be present: |
|
395 return check_klass(k); |
|
396 } |
|
397 |
384 |
398 static bool initialize_wk_klass(WKID id, int init_opt, TRAPS); |
385 static bool initialize_wk_klass(WKID id, int init_opt, TRAPS); |
399 static void initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS); |
386 static void initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS); |
400 static void initialize_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) { |
387 static void initialize_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) { |
401 int limit = (int)end_id + 1; |
388 int limit = (int)end_id + 1; |