@@ -2253,39 +2253,51 @@ JVM_END
2253
2253
// Reflection for the verifier /////////////////////////////////////////////////////////////////
2254
2254
2255
2255
// RedefineClasses support: bug 6214132 caused verification to fail.
2256
- // All functions from this section should call the jvmtiThreadSate function:
2257
- // Klass* class_to_verify_considering_redefinition(Klass* klass).
2258
- // The function returns a Klass* of the _scratch_class if the verifier
2259
- // was invoked in the middle of the class redefinition.
2260
- // Otherwise it returns its argument value which is the _the_class Klass*.
2261
- // Please, refer to the description in the jvmtiThreadState.hpp.
2256
+ // All functions from this section, unless noted otherwise, should call the functions
2257
+ // get_klass_considering_redefinition(), or
2258
+ // get_instance_klass_considering_redefinition()
2259
+ // These functions return JvmtiThreadState::_scratch_class if the verifier
2260
+ // was invoked in the middle of the redefinition of cls.
2261
+ // See jvmtiThreadState.hpp for details.
2262
+
2263
+ inline Klass* get_klass_considering_redefinition (jclass cls, JavaThread* thread) {
2264
+ Klass* k = java_lang_Class::as_Klass (JNIHandles::resolve_non_null (cls));
2265
+ if (k->is_instance_klass ()) {
2266
+ return JvmtiThreadState::class_to_verify_considering_redefinition (InstanceKlass::cast (k), thread);
2267
+ } else {
2268
+ return k;
2269
+ }
2270
+ }
2271
+
2272
+ inline InstanceKlass* get_instance_klass_considering_redefinition (jclass cls, JavaThread* thread) {
2273
+ InstanceKlass* ik = java_lang_Class::as_InstanceKlass (JNIHandles::resolve_non_null (cls));
2274
+ return JvmtiThreadState::class_to_verify_considering_redefinition (ik, thread);
2275
+ }
2262
2276
2263
2277
JVM_ENTRY (jboolean, JVM_IsInterface(JNIEnv *env, jclass cls))
2264
2278
oop mirror = JNIHandles::resolve_non_null(cls);
2265
2279
if (java_lang_Class::is_primitive(mirror)) {
2266
2280
return JNI_FALSE;
2267
2281
}
2268
2282
Klass* k = java_lang_Class::as_Klass(mirror);
2269
- // This isn't necessary since answer is the same since redefinition
2283
+ // This isn't necessary since answer is the same because redefinition
2270
2284
// has already checked this matches for the scratch class.
2271
- // k = JvmtiThreadState::class_to_verify_considering_redefinition(k , thread);
2285
+ // k = get_klass_considering_redefinition(cls , thread)
2272
2286
jboolean result = k->is_interface ();
2273
2287
assert (!result || k->is_instance_klass (),
2274
2288
"all interfaces are instance types");
2275
2289
return result;
2276
2290
JVM_END
2277
2291
2278
-
2279
2292
JVM_ENTRY (const char *, JVM_GetClassNameUTF(JNIEnv *env, jclass cls))
2293
+ // No need to call get_klass_considering_redefinition() as redefinition cannot change a class's name.
2280
2294
Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2281
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2282
2295
return k->name ()->as_utf8();
2283
2296
JVM_END
2284
2297
2285
2298
2286
2299
JVM_ENTRY (void , JVM_GetClassCPTypes(JNIEnv *env, jclass cls, unsigned char *types))
2287
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2288
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2300
+ Klass* k = get_klass_considering_redefinition(cls, thread);
2289
2301
// types will have length zero if this is not an InstanceKlass
2290
2302
// (length is determined by call to JVM_GetClassCPEntriesCount)
2291
2303
if (k->is_instance_klass ()) {
@@ -2299,22 +2311,19 @@ JVM_END
2299
2311
2300
2312
2301
2313
JVM_ENTRY (jint, JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cls))
2302
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2303
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2314
+ Klass* k = get_klass_considering_redefinition(cls, thread);
2304
2315
return (!k->is_instance_klass ()) ? 0 : InstanceKlass::cast(k)->constants()->length();
2305
2316
JVM_END
2306
2317
2307
2318
2308
2319
JVM_ENTRY (jint, JVM_GetClassFieldsCount(JNIEnv *env, jclass cls))
2309
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2310
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2320
+ Klass* k = get_klass_considering_redefinition(cls, thread);
2311
2321
return (!k->is_instance_klass ()) ? 0 : InstanceKlass::cast(k)->java_fields_count();
2312
2322
JVM_END
2313
2323
2314
2324
2315
2325
JVM_ENTRY (jint, JVM_GetClassMethodsCount(JNIEnv *env, jclass cls))
2316
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2317
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2326
+ Klass* k = get_klass_considering_redefinition(cls, thread);
2318
2327
return (!k->is_instance_klass ()) ? 0 : InstanceKlass::cast(k)->methods()->length();
2319
2328
JVM_END
2320
2329
@@ -2325,9 +2334,8 @@ JVM_END
2325
2334
// by the results of JVM_GetClass{Fields,Methods}Count, which return
2326
2335
// zero for arrays.
2327
2336
JVM_ENTRY (void , JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cls, jint method_index, unsigned short *exceptions))
2328
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2329
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2330
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2337
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2338
+ Method* method = ik->methods ()->at(method_index);
2331
2339
int length = method->checked_exceptions_length ();
2332
2340
if (length > 0 ) {
2333
2341
CheckedExceptionElement* table= method->checked_exceptions_start ();
@@ -2339,33 +2347,29 @@ JVM_END
2339
2347
2340
2348
2341
2349
JVM_ENTRY (jint, JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cls, jint method_index))
2342
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2343
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2344
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2350
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2351
+ Method* method = ik->methods ()->at(method_index);
2345
2352
return method->checked_exceptions_length ();
2346
2353
JVM_END
2347
2354
2348
2355
2349
2356
JVM_ENTRY (void , JVM_GetMethodIxByteCode(JNIEnv *env, jclass cls, jint method_index, unsigned char *code))
2350
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2351
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2352
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2357
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2358
+ Method* method = ik->methods ()->at(method_index);
2353
2359
memcpy (code, method->code_base (), method->code_size());
2354
2360
JVM_END
2355
2361
2356
2362
2357
2363
JVM_ENTRY (jint, JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cls, jint method_index))
2358
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2359
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2360
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2364
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2365
+ Method* method = ik->methods ()->at(method_index);
2361
2366
return method->code_size ();
2362
2367
JVM_END
2363
2368
2364
2369
2365
2370
JVM_ENTRY (void , JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cls, jint method_index, jint entry_index, JVM_ExceptionTableEntryType *entry))
2366
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2367
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2368
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2371
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2372
+ Method* method = ik->methods ()->at(method_index);
2369
2373
ExceptionTable extable (method);
2370
2374
entry->start_pc = extable.start_pc(entry_index);
2371
2375
entry->end_pc = extable.end_pc(entry_index);
@@ -2375,81 +2379,71 @@ JVM_END
2375
2379
2376
2380
2377
2381
JVM_ENTRY (jint, JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cls, int method_index))
2378
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2379
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2380
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2382
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2383
+ Method* method = ik->methods ()->at(method_index);
2381
2384
return method->exception_table_length ();
2382
2385
JVM_END
2383
2386
2384
2387
2385
2388
JVM_ENTRY (jint, JVM_GetMethodIxModifiers(JNIEnv *env, jclass cls, int method_index))
2386
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2387
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2388
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2389
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2390
+ Method* method = ik->methods ()->at(method_index);
2389
2391
return method->access_flags ().as_method_flags();
2390
2392
JVM_END
2391
2393
2392
2394
2393
2395
JVM_ENTRY (jint, JVM_GetFieldIxModifiers(JNIEnv *env, jclass cls, int field_index))
2394
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2395
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2396
- return InstanceKlass::cast(k)->field_access_flags (field_index);
2396
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2397
+ return ik->field_access_flags (field_index);
2397
2398
JVM_END
2398
2399
2399
2400
2400
2401
JVM_ENTRY (jint, JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cls, int method_index))
2401
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2402
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2403
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2402
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2403
+ Method* method = ik->methods ()->at(method_index);
2404
2404
return method->max_locals ();
2405
2405
JVM_END
2406
2406
2407
2407
2408
2408
JVM_ENTRY (jint, JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cls, int method_index))
2409
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2410
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2411
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2409
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2410
+ Method* method = ik->methods ()->at(method_index);
2412
2411
return method->size_of_parameters ();
2413
2412
JVM_END
2414
2413
2415
2414
2416
2415
JVM_ENTRY (jint, JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cls, int method_index))
2417
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2418
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2419
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2416
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2417
+ Method* method = ik->methods ()->at(method_index);
2420
2418
return method->verifier_max_stack ();
2421
2419
JVM_END
2422
2420
2423
2421
2424
2422
JVM_ENTRY (jboolean, JVM_IsConstructorIx(JNIEnv *env, jclass cls, int method_index))
2425
2423
ResourceMark rm(THREAD);
2426
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2427
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2428
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2424
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2425
+ Method* method = ik->methods ()->at(method_index);
2429
2426
return method->name () == vmSymbols::object_initializer_name();
2430
2427
JVM_END
2431
2428
2432
2429
2433
2430
JVM_ENTRY (jboolean, JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cls, int method_index))
2434
2431
ResourceMark rm(THREAD);
2435
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2436
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2437
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2432
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2433
+ Method* method = ik->methods ()->at(method_index);
2438
2434
return method->is_overpass ();
2439
2435
JVM_END
2440
2436
2441
2437
JVM_ENTRY (const char *, JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cls, jint method_index))
2442
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2443
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2444
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2438
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2439
+ Method* method = ik->methods ()->at(method_index);
2445
2440
return method->name ()->as_utf8();
2446
2441
JVM_END
2447
2442
2448
2443
2449
2444
JVM_ENTRY (const char *, JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cls, jint method_index))
2450
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2451
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2452
- Method* method = InstanceKlass::cast(k)->methods ()->at(method_index);
2445
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2446
+ Method* method = ik->methods ()->at(method_index);
2453
2447
return method->signature ()->as_utf8();
2454
2448
JVM_END
2455
2449
@@ -2462,9 +2456,8 @@ JVM_END
2462
2456
* constant pool, so we must use cp->uncached_x methods when appropriate.
2463
2457
*/
2464
2458
JVM_ENTRY (const char *, JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cls, jint cp_index))
2465
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2466
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2467
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2459
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2460
+ ConstantPool* cp = ik->constants ();
2468
2461
switch (cp->tag_at (cp_index).value()) {
2469
2462
case JVM_CONSTANT_Fieldref:
2470
2463
return cp->uncached_name_ref_at (cp_index)->as_utf8 ();
@@ -2477,9 +2470,8 @@ JVM_END
2477
2470
2478
2471
2479
2472
JVM_ENTRY (const char *, JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cls, jint cp_index))
2480
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2481
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2482
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2473
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2474
+ ConstantPool* cp = ik->constants ();
2483
2475
switch (cp->tag_at (cp_index).value()) {
2484
2476
case JVM_CONSTANT_InterfaceMethodref:
2485
2477
case JVM_CONSTANT_Methodref:
@@ -2493,9 +2485,8 @@ JVM_END
2493
2485
2494
2486
2495
2487
JVM_ENTRY (const char *, JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cls, jint cp_index))
2496
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2497
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2498
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2488
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2489
+ ConstantPool* cp = ik->constants ();
2499
2490
switch (cp->tag_at (cp_index).value()) {
2500
2491
case JVM_CONSTANT_InterfaceMethodref:
2501
2492
case JVM_CONSTANT_Methodref:
@@ -2509,9 +2500,8 @@ JVM_END
2509
2500
2510
2501
2511
2502
JVM_ENTRY (const char *, JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cls, jint cp_index))
2512
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2513
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2514
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2503
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2504
+ ConstantPool* cp = ik->constants ();
2515
2505
switch (cp->tag_at (cp_index).value()) {
2516
2506
case JVM_CONSTANT_Fieldref:
2517
2507
return cp->uncached_signature_ref_at (cp_index)->as_utf8 ();
@@ -2524,18 +2514,16 @@ JVM_END
2524
2514
2525
2515
2526
2516
JVM_ENTRY (const char *, JVM_GetCPClassNameUTF(JNIEnv *env, jclass cls, jint cp_index))
2527
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2528
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2529
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2517
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2518
+ ConstantPool* cp = ik->constants ();
2530
2519
Symbol* classname = cp->klass_name_at (cp_index);
2531
2520
return classname->as_utf8 ();
2532
2521
JVM_END
2533
2522
2534
2523
2535
2524
JVM_ENTRY (const char *, JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cls, jint cp_index))
2536
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2537
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2538
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2525
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2526
+ ConstantPool* cp = ik->constants ();
2539
2527
switch (cp->tag_at (cp_index).value()) {
2540
2528
case JVM_CONSTANT_Fieldref: {
2541
2529
int class_index = cp->uncached_klass_ref_index_at (cp_index);
@@ -2551,9 +2539,8 @@ JVM_END
2551
2539
2552
2540
2553
2541
JVM_ENTRY (const char *, JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cls, jint cp_index))
2554
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2555
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2556
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2542
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2543
+ ConstantPool* cp = ik->constants ();
2557
2544
switch (cp->tag_at (cp_index).value()) {
2558
2545
case JVM_CONSTANT_Methodref:
2559
2546
case JVM_CONSTANT_InterfaceMethodref: {
@@ -2570,18 +2557,15 @@ JVM_END
2570
2557
2571
2558
2572
2559
JVM_ENTRY (jint, JVM_GetCPFieldModifiers(JNIEnv *env, jclass cls, int cp_index, jclass called_cls))
2573
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2574
- Klass* k_called = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(called_cls));
2575
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2576
- k_called = JvmtiThreadState::class_to_verify_considering_redefinition(k_called, thread);
2577
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2578
- ConstantPool* cp_called = InstanceKlass::cast(k_called)->constants ();
2560
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2561
+ InstanceKlass* ik_called = get_instance_klass_considering_redefinition(called_cls, thread);
2562
+ ConstantPool* cp = ik->constants ();
2563
+ ConstantPool* cp_called = ik_called->constants ();
2579
2564
switch (cp->tag_at (cp_index).value()) {
2580
2565
case JVM_CONSTANT_Fieldref: {
2581
2566
Symbol* name = cp->uncached_name_ref_at (cp_index);
2582
2567
Symbol* signature = cp->uncached_signature_ref_at (cp_index);
2583
- InstanceKlass* ik = InstanceKlass::cast (k_called);
2584
- for (JavaFieldStream fs (ik); !fs.done (); fs.next ()) {
2568
+ for (JavaFieldStream fs (ik_called); !fs.done (); fs.next ()) {
2585
2569
if (fs.name () == name && fs.signature () == signature) {
2586
2570
return fs.access_flags ().as_field_flags ();
2587
2571
}
@@ -2597,17 +2581,15 @@ JVM_END
2597
2581
2598
2582
2599
2583
JVM_ENTRY (jint, JVM_GetCPMethodModifiers(JNIEnv *env, jclass cls, int cp_index, jclass called_cls))
2600
- Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
2601
- Klass* k_called = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(called_cls));
2602
- k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
2603
- k_called = JvmtiThreadState::class_to_verify_considering_redefinition(k_called, thread);
2604
- ConstantPool* cp = InstanceKlass::cast(k)->constants ();
2584
+ InstanceKlass* ik = get_instance_klass_considering_redefinition(cls, thread);
2585
+ InstanceKlass* ik_called = get_instance_klass_considering_redefinition(called_cls, thread);
2586
+ ConstantPool* cp = ik->constants ();
2605
2587
switch (cp->tag_at (cp_index).value()) {
2606
2588
case JVM_CONSTANT_Methodref:
2607
2589
case JVM_CONSTANT_InterfaceMethodref: {
2608
2590
Symbol* name = cp->uncached_name_ref_at (cp_index);
2609
2591
Symbol* signature = cp->uncached_signature_ref_at (cp_index);
2610
- Array<Method*>* methods = InstanceKlass::cast (k_called) ->methods ();
2592
+ Array<Method*>* methods = ik_called ->methods ();
2611
2593
int methods_count = methods->length ();
2612
2594
for (int i = 0 ; i < methods_count; i++) {
2613
2595
Method* method = methods->at (i);
0 commit comments