Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/javaClasses.cpp @ 2357:8033953d67ff
7012648: move JSR 292 to package java.lang.invoke and adjust names
Summary: package and class renaming only; delete unused methods and classes
Reviewed-by: twisti
author | jrose |
---|---|
date | Fri, 11 Mar 2011 22:34:57 -0800 |
parents | 72dee110246f |
children | c7f3d0b4570f |
comparison
equal
deleted
inserted
replaced
2356:72dee110246f | 2357:8033953d67ff |
---|---|
2196 | 2196 |
2197 SystemDictionary::SoftReference_klass()->long_field_put(offset, value); | 2197 SystemDictionary::SoftReference_klass()->long_field_put(offset, value); |
2198 } | 2198 } |
2199 | 2199 |
2200 | 2200 |
2201 // Support for java_dyn_MethodHandle | 2201 // Support for java_lang_invoke_MethodHandle |
2202 | 2202 |
2203 int java_dyn_MethodHandle::_type_offset; | 2203 int java_lang_invoke_MethodHandle::_type_offset; |
2204 int java_dyn_MethodHandle::_vmtarget_offset; | 2204 int java_lang_invoke_MethodHandle::_vmtarget_offset; |
2205 int java_dyn_MethodHandle::_vmentry_offset; | 2205 int java_lang_invoke_MethodHandle::_vmentry_offset; |
2206 int java_dyn_MethodHandle::_vmslots_offset; | 2206 int java_lang_invoke_MethodHandle::_vmslots_offset; |
2207 | 2207 |
2208 int sun_dyn_MemberName::_clazz_offset; | 2208 int java_lang_invoke_MemberName::_clazz_offset; |
2209 int sun_dyn_MemberName::_name_offset; | 2209 int java_lang_invoke_MemberName::_name_offset; |
2210 int sun_dyn_MemberName::_type_offset; | 2210 int java_lang_invoke_MemberName::_type_offset; |
2211 int sun_dyn_MemberName::_flags_offset; | 2211 int java_lang_invoke_MemberName::_flags_offset; |
2212 int sun_dyn_MemberName::_vmtarget_offset; | 2212 int java_lang_invoke_MemberName::_vmtarget_offset; |
2213 int sun_dyn_MemberName::_vmindex_offset; | 2213 int java_lang_invoke_MemberName::_vmindex_offset; |
2214 | 2214 |
2215 int sun_dyn_DirectMethodHandle::_vmindex_offset; | 2215 int java_lang_invoke_DirectMethodHandle::_vmindex_offset; |
2216 | 2216 |
2217 int sun_dyn_BoundMethodHandle::_argument_offset; | 2217 int java_lang_invoke_BoundMethodHandle::_argument_offset; |
2218 int sun_dyn_BoundMethodHandle::_vmargslot_offset; | 2218 int java_lang_invoke_BoundMethodHandle::_vmargslot_offset; |
2219 | 2219 |
2220 int sun_dyn_AdapterMethodHandle::_conversion_offset; | 2220 int java_lang_invoke_AdapterMethodHandle::_conversion_offset; |
2221 | 2221 |
2222 void java_dyn_MethodHandle::compute_offsets() { | 2222 void java_lang_invoke_MethodHandle::compute_offsets() { |
2223 klassOop k = SystemDictionary::MethodHandle_klass(); | 2223 klassOop k = SystemDictionary::MethodHandle_klass(); |
2224 if (k != NULL && EnableMethodHandles) { | 2224 if (k != NULL && EnableMethodHandles) { |
2225 bool allow_super = false; | 2225 bool allow_super = false; |
2226 if (AllowTransitionalJSR292) allow_super = true; // temporary, to access sun.dyn.MethodHandleImpl | 2226 if (AllowTransitionalJSR292) allow_super = true; // temporary, to access java.dyn.MethodHandleImpl |
2227 compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::java_dyn_MethodType_signature(), allow_super); | 2227 compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::java_lang_invoke_MethodType_signature(), allow_super); |
2228 compute_offset(_vmtarget_offset, k, vmSymbols::vmtarget_name(), vmSymbols::object_signature(), allow_super); | 2228 compute_offset(_vmtarget_offset, k, vmSymbols::vmtarget_name(), vmSymbols::object_signature(), allow_super); |
2229 compute_offset(_vmentry_offset, k, vmSymbols::vmentry_name(), vmSymbols::machine_word_signature(), allow_super); | 2229 compute_offset(_vmentry_offset, k, vmSymbols::vmentry_name(), vmSymbols::machine_word_signature(), allow_super); |
2230 | 2230 |
2231 // Note: MH.vmslots (if it is present) is a hoisted copy of MH.type.form.vmslots. | 2231 // Note: MH.vmslots (if it is present) is a hoisted copy of MH.type.form.vmslots. |
2232 // It is optional pending experiments to keep or toss. | 2232 // It is optional pending experiments to keep or toss. |
2233 compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), allow_super); | 2233 compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), allow_super); |
2234 } | 2234 } |
2235 } | 2235 } |
2236 | 2236 |
2237 void sun_dyn_MemberName::compute_offsets() { | 2237 void java_lang_invoke_MemberName::compute_offsets() { |
2238 klassOop k = SystemDictionary::MemberName_klass(); | 2238 klassOop k = SystemDictionary::MemberName_klass(); |
2239 if (k != NULL && EnableMethodHandles) { | 2239 if (k != NULL && EnableMethodHandles) { |
2240 compute_offset(_clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature()); | 2240 compute_offset(_clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature()); |
2241 compute_offset(_name_offset, k, vmSymbols::name_name(), vmSymbols::string_signature()); | 2241 compute_offset(_name_offset, k, vmSymbols::name_name(), vmSymbols::string_signature()); |
2242 compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::object_signature()); | 2242 compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::object_signature()); |
2244 compute_offset(_vmtarget_offset, k, vmSymbols::vmtarget_name(), vmSymbols::object_signature()); | 2244 compute_offset(_vmtarget_offset, k, vmSymbols::vmtarget_name(), vmSymbols::object_signature()); |
2245 compute_offset(_vmindex_offset, k, vmSymbols::vmindex_name(), vmSymbols::int_signature()); | 2245 compute_offset(_vmindex_offset, k, vmSymbols::vmindex_name(), vmSymbols::int_signature()); |
2246 } | 2246 } |
2247 } | 2247 } |
2248 | 2248 |
2249 void sun_dyn_DirectMethodHandle::compute_offsets() { | 2249 void java_lang_invoke_DirectMethodHandle::compute_offsets() { |
2250 klassOop k = SystemDictionary::DirectMethodHandle_klass(); | 2250 klassOop k = SystemDictionary::DirectMethodHandle_klass(); |
2251 if (k != NULL && EnableMethodHandles) { | 2251 if (k != NULL && EnableMethodHandles) { |
2252 compute_offset(_vmindex_offset, k, vmSymbols::vmindex_name(), vmSymbols::int_signature(), true); | 2252 compute_offset(_vmindex_offset, k, vmSymbols::vmindex_name(), vmSymbols::int_signature(), true); |
2253 } | 2253 } |
2254 } | 2254 } |
2255 | 2255 |
2256 void sun_dyn_BoundMethodHandle::compute_offsets() { | 2256 void java_lang_invoke_BoundMethodHandle::compute_offsets() { |
2257 klassOop k = SystemDictionary::BoundMethodHandle_klass(); | 2257 klassOop k = SystemDictionary::BoundMethodHandle_klass(); |
2258 if (k != NULL && EnableMethodHandles) { | 2258 if (k != NULL && EnableMethodHandles) { |
2259 compute_offset(_vmargslot_offset, k, vmSymbols::vmargslot_name(), vmSymbols::int_signature(), true); | 2259 compute_offset(_vmargslot_offset, k, vmSymbols::vmargslot_name(), vmSymbols::int_signature(), true); |
2260 compute_offset(_argument_offset, k, vmSymbols::argument_name(), vmSymbols::object_signature(), true); | 2260 compute_offset(_argument_offset, k, vmSymbols::argument_name(), vmSymbols::object_signature(), true); |
2261 } | 2261 } |
2262 } | 2262 } |
2263 | 2263 |
2264 void sun_dyn_AdapterMethodHandle::compute_offsets() { | 2264 void java_lang_invoke_AdapterMethodHandle::compute_offsets() { |
2265 klassOop k = SystemDictionary::AdapterMethodHandle_klass(); | 2265 klassOop k = SystemDictionary::AdapterMethodHandle_klass(); |
2266 if (k != NULL && EnableMethodHandles) { | 2266 if (k != NULL && EnableMethodHandles) { |
2267 compute_offset(_conversion_offset, k, vmSymbols::conversion_name(), vmSymbols::int_signature(), true); | 2267 compute_offset(_conversion_offset, k, vmSymbols::conversion_name(), vmSymbols::int_signature(), true); |
2268 } | 2268 } |
2269 } | 2269 } |
2270 | 2270 |
2271 oop java_dyn_MethodHandle::type(oop mh) { | 2271 oop java_lang_invoke_MethodHandle::type(oop mh) { |
2272 return mh->obj_field(_type_offset); | 2272 return mh->obj_field(_type_offset); |
2273 } | 2273 } |
2274 | 2274 |
2275 void java_dyn_MethodHandle::set_type(oop mh, oop mtype) { | 2275 void java_lang_invoke_MethodHandle::set_type(oop mh, oop mtype) { |
2276 mh->obj_field_put(_type_offset, mtype); | 2276 mh->obj_field_put(_type_offset, mtype); |
2277 } | 2277 } |
2278 | 2278 |
2279 int java_dyn_MethodHandle::vmslots(oop mh) { | 2279 int java_lang_invoke_MethodHandle::vmslots(oop mh) { |
2280 int vmslots_offset = _vmslots_offset; | 2280 int vmslots_offset = _vmslots_offset; |
2281 if (vmslots_offset != 0) { | 2281 if (vmslots_offset != 0) { |
2282 #ifdef ASSERT | 2282 #ifdef ASSERT |
2283 int x = mh->int_field(vmslots_offset); | 2283 int x = mh->int_field(vmslots_offset); |
2284 int y = compute_vmslots(mh); | 2284 int y = compute_vmslots(mh); |
2289 return compute_vmslots(mh); | 2289 return compute_vmslots(mh); |
2290 } | 2290 } |
2291 } | 2291 } |
2292 | 2292 |
2293 // if MH.vmslots exists, hoist into it the value of type.form.vmslots | 2293 // if MH.vmslots exists, hoist into it the value of type.form.vmslots |
2294 void java_dyn_MethodHandle::init_vmslots(oop mh) { | 2294 void java_lang_invoke_MethodHandle::init_vmslots(oop mh) { |
2295 int vmslots_offset = _vmslots_offset; | 2295 int vmslots_offset = _vmslots_offset; |
2296 if (vmslots_offset != 0) { | 2296 if (vmslots_offset != 0) { |
2297 mh->int_field_put(vmslots_offset, compute_vmslots(mh)); | 2297 mh->int_field_put(vmslots_offset, compute_vmslots(mh)); |
2298 } | 2298 } |
2299 } | 2299 } |
2300 | 2300 |
2301 // fetch type.form.vmslots, which is the number of JVM stack slots | 2301 // fetch type.form.vmslots, which is the number of JVM stack slots |
2302 // required to carry the arguments of this MH | 2302 // required to carry the arguments of this MH |
2303 int java_dyn_MethodHandle::compute_vmslots(oop mh) { | 2303 int java_lang_invoke_MethodHandle::compute_vmslots(oop mh) { |
2304 oop mtype = type(mh); | 2304 oop mtype = type(mh); |
2305 if (mtype == NULL) return 0; // Java code would get NPE | 2305 if (mtype == NULL) return 0; // Java code would get NPE |
2306 oop form = java_dyn_MethodType::form(mtype); | 2306 oop form = java_lang_invoke_MethodType::form(mtype); |
2307 if (form == NULL) return 0; // Java code would get NPE | 2307 if (form == NULL) return 0; // Java code would get NPE |
2308 return java_dyn_MethodTypeForm::vmslots(form); | 2308 return java_lang_invoke_MethodTypeForm::vmslots(form); |
2309 } | 2309 } |
2310 | 2310 |
2311 // fetch the low-level entry point for this mh | 2311 // fetch the low-level entry point for this mh |
2312 MethodHandleEntry* java_dyn_MethodHandle::vmentry(oop mh) { | 2312 MethodHandleEntry* java_lang_invoke_MethodHandle::vmentry(oop mh) { |
2313 return (MethodHandleEntry*) mh->address_field(_vmentry_offset); | 2313 return (MethodHandleEntry*) mh->address_field(_vmentry_offset); |
2314 } | 2314 } |
2315 | 2315 |
2316 void java_dyn_MethodHandle::set_vmentry(oop mh, MethodHandleEntry* me) { | 2316 void java_lang_invoke_MethodHandle::set_vmentry(oop mh, MethodHandleEntry* me) { |
2317 assert(_vmentry_offset != 0, "must be present"); | 2317 assert(_vmentry_offset != 0, "must be present"); |
2318 | 2318 |
2319 // This is always the final step that initializes a valid method handle: | 2319 // This is always the final step that initializes a valid method handle: |
2320 mh->release_address_field_put(_vmentry_offset, (address) me); | 2320 mh->release_address_field_put(_vmentry_offset, (address) me); |
2321 | 2321 |
2325 // But just in case, we use release_address_field_put. | 2325 // But just in case, we use release_address_field_put. |
2326 } | 2326 } |
2327 | 2327 |
2328 /// MemberName accessors | 2328 /// MemberName accessors |
2329 | 2329 |
2330 oop sun_dyn_MemberName::clazz(oop mname) { | 2330 oop java_lang_invoke_MemberName::clazz(oop mname) { |
2331 assert(is_instance(mname), "wrong type"); | 2331 assert(is_instance(mname), "wrong type"); |
2332 return mname->obj_field(_clazz_offset); | 2332 return mname->obj_field(_clazz_offset); |
2333 } | 2333 } |
2334 | 2334 |
2335 void sun_dyn_MemberName::set_clazz(oop mname, oop clazz) { | 2335 void java_lang_invoke_MemberName::set_clazz(oop mname, oop clazz) { |
2336 assert(is_instance(mname), "wrong type"); | 2336 assert(is_instance(mname), "wrong type"); |
2337 mname->obj_field_put(_clazz_offset, clazz); | 2337 mname->obj_field_put(_clazz_offset, clazz); |
2338 } | 2338 } |
2339 | 2339 |
2340 oop sun_dyn_MemberName::name(oop mname) { | 2340 oop java_lang_invoke_MemberName::name(oop mname) { |
2341 assert(is_instance(mname), "wrong type"); | 2341 assert(is_instance(mname), "wrong type"); |
2342 return mname->obj_field(_name_offset); | 2342 return mname->obj_field(_name_offset); |
2343 } | 2343 } |
2344 | 2344 |
2345 void sun_dyn_MemberName::set_name(oop mname, oop name) { | 2345 void java_lang_invoke_MemberName::set_name(oop mname, oop name) { |
2346 assert(is_instance(mname), "wrong type"); | 2346 assert(is_instance(mname), "wrong type"); |
2347 mname->obj_field_put(_name_offset, name); | 2347 mname->obj_field_put(_name_offset, name); |
2348 } | 2348 } |
2349 | 2349 |
2350 oop sun_dyn_MemberName::type(oop mname) { | 2350 oop java_lang_invoke_MemberName::type(oop mname) { |
2351 assert(is_instance(mname), "wrong type"); | 2351 assert(is_instance(mname), "wrong type"); |
2352 return mname->obj_field(_type_offset); | 2352 return mname->obj_field(_type_offset); |
2353 } | 2353 } |
2354 | 2354 |
2355 void sun_dyn_MemberName::set_type(oop mname, oop type) { | 2355 void java_lang_invoke_MemberName::set_type(oop mname, oop type) { |
2356 assert(is_instance(mname), "wrong type"); | 2356 assert(is_instance(mname), "wrong type"); |
2357 mname->obj_field_put(_type_offset, type); | 2357 mname->obj_field_put(_type_offset, type); |
2358 } | 2358 } |
2359 | 2359 |
2360 int sun_dyn_MemberName::flags(oop mname) { | 2360 int java_lang_invoke_MemberName::flags(oop mname) { |
2361 assert(is_instance(mname), "wrong type"); | 2361 assert(is_instance(mname), "wrong type"); |
2362 return mname->int_field(_flags_offset); | 2362 return mname->int_field(_flags_offset); |
2363 } | 2363 } |
2364 | 2364 |
2365 void sun_dyn_MemberName::set_flags(oop mname, int flags) { | 2365 void java_lang_invoke_MemberName::set_flags(oop mname, int flags) { |
2366 assert(is_instance(mname), "wrong type"); | 2366 assert(is_instance(mname), "wrong type"); |
2367 mname->int_field_put(_flags_offset, flags); | 2367 mname->int_field_put(_flags_offset, flags); |
2368 } | 2368 } |
2369 | 2369 |
2370 oop sun_dyn_MemberName::vmtarget(oop mname) { | 2370 oop java_lang_invoke_MemberName::vmtarget(oop mname) { |
2371 assert(is_instance(mname), "wrong type"); | 2371 assert(is_instance(mname), "wrong type"); |
2372 return mname->obj_field(_vmtarget_offset); | 2372 return mname->obj_field(_vmtarget_offset); |
2373 } | 2373 } |
2374 | 2374 |
2375 void sun_dyn_MemberName::set_vmtarget(oop mname, oop ref) { | 2375 void java_lang_invoke_MemberName::set_vmtarget(oop mname, oop ref) { |
2376 assert(is_instance(mname), "wrong type"); | 2376 assert(is_instance(mname), "wrong type"); |
2377 mname->obj_field_put(_vmtarget_offset, ref); | 2377 mname->obj_field_put(_vmtarget_offset, ref); |
2378 } | 2378 } |
2379 | 2379 |
2380 int sun_dyn_MemberName::vmindex(oop mname) { | 2380 int java_lang_invoke_MemberName::vmindex(oop mname) { |
2381 assert(is_instance(mname), "wrong type"); | 2381 assert(is_instance(mname), "wrong type"); |
2382 return mname->int_field(_vmindex_offset); | 2382 return mname->int_field(_vmindex_offset); |
2383 } | 2383 } |
2384 | 2384 |
2385 void sun_dyn_MemberName::set_vmindex(oop mname, int index) { | 2385 void java_lang_invoke_MemberName::set_vmindex(oop mname, int index) { |
2386 assert(is_instance(mname), "wrong type"); | 2386 assert(is_instance(mname), "wrong type"); |
2387 mname->int_field_put(_vmindex_offset, index); | 2387 mname->int_field_put(_vmindex_offset, index); |
2388 } | 2388 } |
2389 | 2389 |
2390 oop java_dyn_MethodHandle::vmtarget(oop mh) { | 2390 oop java_lang_invoke_MethodHandle::vmtarget(oop mh) { |
2391 assert(is_instance(mh), "MH only"); | 2391 assert(is_instance(mh), "MH only"); |
2392 return mh->obj_field(_vmtarget_offset); | 2392 return mh->obj_field(_vmtarget_offset); |
2393 } | 2393 } |
2394 | 2394 |
2395 void java_dyn_MethodHandle::set_vmtarget(oop mh, oop ref) { | 2395 void java_lang_invoke_MethodHandle::set_vmtarget(oop mh, oop ref) { |
2396 assert(is_instance(mh), "MH only"); | 2396 assert(is_instance(mh), "MH only"); |
2397 mh->obj_field_put(_vmtarget_offset, ref); | 2397 mh->obj_field_put(_vmtarget_offset, ref); |
2398 } | 2398 } |
2399 | 2399 |
2400 int sun_dyn_DirectMethodHandle::vmindex(oop mh) { | 2400 int java_lang_invoke_DirectMethodHandle::vmindex(oop mh) { |
2401 assert(is_instance(mh), "DMH only"); | 2401 assert(is_instance(mh), "DMH only"); |
2402 return mh->int_field(_vmindex_offset); | 2402 return mh->int_field(_vmindex_offset); |
2403 } | 2403 } |
2404 | 2404 |
2405 void sun_dyn_DirectMethodHandle::set_vmindex(oop mh, int index) { | 2405 void java_lang_invoke_DirectMethodHandle::set_vmindex(oop mh, int index) { |
2406 assert(is_instance(mh), "DMH only"); | 2406 assert(is_instance(mh), "DMH only"); |
2407 mh->int_field_put(_vmindex_offset, index); | 2407 mh->int_field_put(_vmindex_offset, index); |
2408 } | 2408 } |
2409 | 2409 |
2410 int sun_dyn_BoundMethodHandle::vmargslot(oop mh) { | 2410 int java_lang_invoke_BoundMethodHandle::vmargslot(oop mh) { |
2411 assert(is_instance(mh), "BMH only"); | 2411 assert(is_instance(mh), "BMH only"); |
2412 return mh->int_field(_vmargslot_offset); | 2412 return mh->int_field(_vmargslot_offset); |
2413 } | 2413 } |
2414 | 2414 |
2415 oop sun_dyn_BoundMethodHandle::argument(oop mh) { | 2415 oop java_lang_invoke_BoundMethodHandle::argument(oop mh) { |
2416 assert(is_instance(mh), "BMH only"); | 2416 assert(is_instance(mh), "BMH only"); |
2417 return mh->obj_field(_argument_offset); | 2417 return mh->obj_field(_argument_offset); |
2418 } | 2418 } |
2419 | 2419 |
2420 int sun_dyn_AdapterMethodHandle::conversion(oop mh) { | 2420 int java_lang_invoke_AdapterMethodHandle::conversion(oop mh) { |
2421 assert(is_instance(mh), "AMH only"); | 2421 assert(is_instance(mh), "AMH only"); |
2422 return mh->int_field(_conversion_offset); | 2422 return mh->int_field(_conversion_offset); |
2423 } | 2423 } |
2424 | 2424 |
2425 void sun_dyn_AdapterMethodHandle::set_conversion(oop mh, int conv) { | 2425 void java_lang_invoke_AdapterMethodHandle::set_conversion(oop mh, int conv) { |
2426 assert(is_instance(mh), "AMH only"); | 2426 assert(is_instance(mh), "AMH only"); |
2427 mh->int_field_put(_conversion_offset, conv); | 2427 mh->int_field_put(_conversion_offset, conv); |
2428 } | 2428 } |
2429 | 2429 |
2430 | 2430 |
2431 // Support for java_dyn_MethodType | 2431 // Support for java_lang_invoke_MethodType |
2432 | 2432 |
2433 int java_dyn_MethodType::_rtype_offset; | 2433 int java_lang_invoke_MethodType::_rtype_offset; |
2434 int java_dyn_MethodType::_ptypes_offset; | 2434 int java_lang_invoke_MethodType::_ptypes_offset; |
2435 int java_dyn_MethodType::_form_offset; | 2435 int java_lang_invoke_MethodType::_form_offset; |
2436 | 2436 |
2437 void java_dyn_MethodType::compute_offsets() { | 2437 void java_lang_invoke_MethodType::compute_offsets() { |
2438 klassOop k = SystemDictionary::MethodType_klass(); | 2438 klassOop k = SystemDictionary::MethodType_klass(); |
2439 if (k != NULL) { | 2439 if (k != NULL) { |
2440 compute_offset(_rtype_offset, k, vmSymbols::rtype_name(), vmSymbols::class_signature()); | 2440 compute_offset(_rtype_offset, k, vmSymbols::rtype_name(), vmSymbols::class_signature()); |
2441 compute_offset(_ptypes_offset, k, vmSymbols::ptypes_name(), vmSymbols::class_array_signature()); | 2441 compute_offset(_ptypes_offset, k, vmSymbols::ptypes_name(), vmSymbols::class_array_signature()); |
2442 compute_offset(_form_offset, k, vmSymbols::form_name(), vmSymbols::java_dyn_MethodTypeForm_signature()); | 2442 compute_offset(_form_offset, k, vmSymbols::form_name(), vmSymbols::java_lang_invoke_MethodTypeForm_signature()); |
2443 } | 2443 } |
2444 } | 2444 } |
2445 | 2445 |
2446 void java_dyn_MethodType::print_signature(oop mt, outputStream* st) { | 2446 void java_lang_invoke_MethodType::print_signature(oop mt, outputStream* st) { |
2447 st->print("("); | 2447 st->print("("); |
2448 objArrayOop pts = ptypes(mt); | 2448 objArrayOop pts = ptypes(mt); |
2449 for (int i = 0, limit = pts->length(); i < limit; i++) { | 2449 for (int i = 0, limit = pts->length(); i < limit; i++) { |
2450 java_lang_Class::print_signature(pts->obj_at(i), st); | 2450 java_lang_Class::print_signature(pts->obj_at(i), st); |
2451 } | 2451 } |
2452 st->print(")"); | 2452 st->print(")"); |
2453 java_lang_Class::print_signature(rtype(mt), st); | 2453 java_lang_Class::print_signature(rtype(mt), st); |
2454 } | 2454 } |
2455 | 2455 |
2456 Symbol* java_dyn_MethodType::as_signature(oop mt, bool intern_if_not_found, TRAPS) { | 2456 Symbol* java_lang_invoke_MethodType::as_signature(oop mt, bool intern_if_not_found, TRAPS) { |
2457 ResourceMark rm; | 2457 ResourceMark rm; |
2458 stringStream buffer(128); | 2458 stringStream buffer(128); |
2459 print_signature(mt, &buffer); | 2459 print_signature(mt, &buffer); |
2460 const char* sigstr = buffer.base(); | 2460 const char* sigstr = buffer.base(); |
2461 int siglen = (int) buffer.size(); | 2461 int siglen = (int) buffer.size(); |
2466 name = SymbolTable::new_symbol(sigstr, siglen, THREAD); | 2466 name = SymbolTable::new_symbol(sigstr, siglen, THREAD); |
2467 } | 2467 } |
2468 return name; | 2468 return name; |
2469 } | 2469 } |
2470 | 2470 |
2471 oop java_dyn_MethodType::rtype(oop mt) { | 2471 oop java_lang_invoke_MethodType::rtype(oop mt) { |
2472 assert(is_instance(mt), "must be a MethodType"); | 2472 assert(is_instance(mt), "must be a MethodType"); |
2473 return mt->obj_field(_rtype_offset); | 2473 return mt->obj_field(_rtype_offset); |
2474 } | 2474 } |
2475 | 2475 |
2476 objArrayOop java_dyn_MethodType::ptypes(oop mt) { | 2476 objArrayOop java_lang_invoke_MethodType::ptypes(oop mt) { |
2477 assert(is_instance(mt), "must be a MethodType"); | 2477 assert(is_instance(mt), "must be a MethodType"); |
2478 return (objArrayOop) mt->obj_field(_ptypes_offset); | 2478 return (objArrayOop) mt->obj_field(_ptypes_offset); |
2479 } | 2479 } |
2480 | 2480 |
2481 oop java_dyn_MethodType::form(oop mt) { | 2481 oop java_lang_invoke_MethodType::form(oop mt) { |
2482 assert(is_instance(mt), "must be a MethodType"); | 2482 assert(is_instance(mt), "must be a MethodType"); |
2483 return mt->obj_field(_form_offset); | 2483 return mt->obj_field(_form_offset); |
2484 } | 2484 } |
2485 | 2485 |
2486 oop java_dyn_MethodType::ptype(oop mt, int idx) { | 2486 oop java_lang_invoke_MethodType::ptype(oop mt, int idx) { |
2487 return ptypes(mt)->obj_at(idx); | 2487 return ptypes(mt)->obj_at(idx); |
2488 } | 2488 } |
2489 | 2489 |
2490 int java_dyn_MethodType::ptype_count(oop mt) { | 2490 int java_lang_invoke_MethodType::ptype_count(oop mt) { |
2491 return ptypes(mt)->length(); | 2491 return ptypes(mt)->length(); |
2492 } | 2492 } |
2493 | 2493 |
2494 | 2494 |
2495 | 2495 |
2496 // Support for java_dyn_MethodTypeForm | 2496 // Support for java_lang_invoke_MethodTypeForm |
2497 | 2497 |
2498 int java_dyn_MethodTypeForm::_vmslots_offset; | 2498 int java_lang_invoke_MethodTypeForm::_vmslots_offset; |
2499 int java_dyn_MethodTypeForm::_erasedType_offset; | 2499 int java_lang_invoke_MethodTypeForm::_erasedType_offset; |
2500 int java_dyn_MethodTypeForm::_genericInvoker_offset; | 2500 int java_lang_invoke_MethodTypeForm::_genericInvoker_offset; |
2501 | 2501 |
2502 void java_dyn_MethodTypeForm::compute_offsets() { | 2502 void java_lang_invoke_MethodTypeForm::compute_offsets() { |
2503 klassOop k = SystemDictionary::MethodTypeForm_klass(); | 2503 klassOop k = SystemDictionary::MethodTypeForm_klass(); |
2504 if (k != NULL) { | 2504 if (k != NULL) { |
2505 compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), true); | 2505 compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), true); |
2506 compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_dyn_MethodType_signature(), true); | 2506 compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_lang_invoke_MethodType_signature(), true); |
2507 compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_dyn_MethodHandle_signature(), true); | 2507 compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_lang_invoke_MethodHandle_signature(), true); |
2508 if (_genericInvoker_offset == 0) _genericInvoker_offset = -1; // set to explicit "empty" value | 2508 if (_genericInvoker_offset == 0) _genericInvoker_offset = -1; // set to explicit "empty" value |
2509 } | 2509 } |
2510 } | 2510 } |
2511 | 2511 |
2512 int java_dyn_MethodTypeForm::vmslots(oop mtform) { | 2512 int java_lang_invoke_MethodTypeForm::vmslots(oop mtform) { |
2513 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); | 2513 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); |
2514 return mtform->int_field(_vmslots_offset); | 2514 return mtform->int_field(_vmslots_offset); |
2515 } | 2515 } |
2516 | 2516 |
2517 oop java_dyn_MethodTypeForm::erasedType(oop mtform) { | 2517 oop java_lang_invoke_MethodTypeForm::erasedType(oop mtform) { |
2518 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); | 2518 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); |
2519 return mtform->obj_field(_erasedType_offset); | 2519 return mtform->obj_field(_erasedType_offset); |
2520 } | 2520 } |
2521 | 2521 |
2522 oop java_dyn_MethodTypeForm::genericInvoker(oop mtform) { | 2522 oop java_lang_invoke_MethodTypeForm::genericInvoker(oop mtform) { |
2523 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); | 2523 assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only"); |
2524 return mtform->obj_field(_genericInvoker_offset); | 2524 return mtform->obj_field(_genericInvoker_offset); |
2525 } | 2525 } |
2526 | 2526 |
2527 | 2527 |
2528 // Support for java_dyn_CallSite | 2528 // Support for java_lang_invoke_CallSite |
2529 | 2529 |
2530 int java_dyn_CallSite::_target_offset; | 2530 int java_lang_invoke_CallSite::_target_offset; |
2531 | 2531 |
2532 void java_dyn_CallSite::compute_offsets() { | 2532 void java_lang_invoke_CallSite::compute_offsets() { |
2533 if (!EnableInvokeDynamic) return; | 2533 if (!EnableInvokeDynamic) return; |
2534 klassOop k = SystemDictionary::CallSite_klass(); | 2534 klassOop k = SystemDictionary::CallSite_klass(); |
2535 if (k != NULL) { | 2535 if (k != NULL) { |
2536 compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature()); | 2536 compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature()); |
2537 } | 2537 } |
2538 } | 2538 } |
2539 | 2539 |
2540 oop java_dyn_CallSite::target(oop site) { | 2540 oop java_lang_invoke_CallSite::target(oop site) { |
2541 return site->obj_field(_target_offset); | 2541 return site->obj_field(_target_offset); |
2542 } | 2542 } |
2543 | 2543 |
2544 void java_dyn_CallSite::set_target(oop site, oop target) { | 2544 void java_lang_invoke_CallSite::set_target(oop site, oop target) { |
2545 site->obj_field_put(_target_offset, target); | 2545 site->obj_field_put(_target_offset, target); |
2546 } | 2546 } |
2547 | 2547 |
2548 | 2548 |
2549 // Support for java_security_AccessControlContext | 2549 // Support for java_security_AccessControlContext |
2879 java_lang_Class::compute_offsets(); | 2879 java_lang_Class::compute_offsets(); |
2880 java_lang_System::compute_offsets(); | 2880 java_lang_System::compute_offsets(); |
2881 java_lang_Thread::compute_offsets(); | 2881 java_lang_Thread::compute_offsets(); |
2882 java_lang_ThreadGroup::compute_offsets(); | 2882 java_lang_ThreadGroup::compute_offsets(); |
2883 if (EnableMethodHandles) { | 2883 if (EnableMethodHandles) { |
2884 java_dyn_MethodHandle::compute_offsets(); | 2884 java_lang_invoke_MethodHandle::compute_offsets(); |
2885 sun_dyn_MemberName::compute_offsets(); | 2885 java_lang_invoke_MemberName::compute_offsets(); |
2886 sun_dyn_DirectMethodHandle::compute_offsets(); | 2886 java_lang_invoke_DirectMethodHandle::compute_offsets(); |
2887 sun_dyn_BoundMethodHandle::compute_offsets(); | 2887 java_lang_invoke_BoundMethodHandle::compute_offsets(); |
2888 sun_dyn_AdapterMethodHandle::compute_offsets(); | 2888 java_lang_invoke_AdapterMethodHandle::compute_offsets(); |
2889 java_dyn_MethodType::compute_offsets(); | 2889 java_lang_invoke_MethodType::compute_offsets(); |
2890 java_dyn_MethodTypeForm::compute_offsets(); | 2890 java_lang_invoke_MethodTypeForm::compute_offsets(); |
2891 } | 2891 } |
2892 if (EnableInvokeDynamic) { | 2892 if (EnableInvokeDynamic) { |
2893 java_dyn_CallSite::compute_offsets(); | 2893 java_lang_invoke_CallSite::compute_offsets(); |
2894 } | 2894 } |
2895 java_security_AccessControlContext::compute_offsets(); | 2895 java_security_AccessControlContext::compute_offsets(); |
2896 // Initialize reflection classes. The layouts of these classes | 2896 // Initialize reflection classes. The layouts of these classes |
2897 // changed with the new reflection implementation in JDK 1.4, and | 2897 // changed with the new reflection implementation in JDK 1.4, and |
2898 // since the Universe doesn't know what JDK version it is until this | 2898 // since the Universe doesn't know what JDK version it is until this |