3277 |
3277 |
3278 void TemplateTable::invokeinterface(int byte_no) { |
3278 void TemplateTable::invokeinterface(int byte_no) { |
3279 transition(vtos, vtos); |
3279 transition(vtos, vtos); |
3280 assert(byte_no == f1_byte, "use this argument"); |
3280 assert(byte_no == f1_byte, "use this argument"); |
3281 |
3281 |
3282 prepare_invoke(byte_no, r0, rmethod, // get f1 Klass*, f2 itable index |
3282 prepare_invoke(byte_no, r0, rmethod, // get f1 Klass*, f2 Method* |
3283 r2, r3); // recv, flags |
3283 r2, r3); // recv, flags |
3284 |
3284 |
3285 // r0: interface klass (from f1) |
3285 // r0: interface klass (from f1) |
3286 // rmethod: itable index (from f2) |
3286 // rmethod: method (from f2) |
3287 // r2: receiver |
3287 // r2: receiver |
3288 // r3: flags |
3288 // r3: flags |
3289 |
3289 |
3290 // Special case of invokeinterface called for virtual method of |
3290 // Special case of invokeinterface called for virtual method of |
3291 // java.lang.Object. See cpCacheOop.cpp for details. |
3291 // java.lang.Object. See cpCacheOop.cpp for details. |
3300 // Get receiver klass into r3 - also a null check |
3300 // Get receiver klass into r3 - also a null check |
3301 __ restore_locals(); |
3301 __ restore_locals(); |
3302 __ null_check(r2, oopDesc::klass_offset_in_bytes()); |
3302 __ null_check(r2, oopDesc::klass_offset_in_bytes()); |
3303 __ load_klass(r3, r2); |
3303 __ load_klass(r3, r2); |
3304 |
3304 |
|
3305 Label no_such_interface, no_such_method; |
|
3306 |
|
3307 // Receiver subtype check against REFC. |
|
3308 // Superklass in r0. Subklass in r3. Blows rscratch2, r13 |
|
3309 __ lookup_interface_method(// inputs: rec. class, interface, itable index |
|
3310 r3, r0, noreg, |
|
3311 // outputs: scan temp. reg, scan temp. reg |
|
3312 rscratch2, r13, |
|
3313 no_such_interface, |
|
3314 /*return_method=*/false); |
|
3315 |
3305 // profile this call |
3316 // profile this call |
3306 __ profile_virtual_call(r3, r13, r19); |
3317 __ profile_virtual_call(r3, r13, r19); |
3307 |
3318 |
3308 Label no_such_interface, no_such_method; |
3319 // Get declaring interface class from method, and itable index |
|
3320 __ ldr(r0, Address(rmethod, Method::const_offset())); |
|
3321 __ ldr(r0, Address(r0, ConstMethod::constants_offset())); |
|
3322 __ ldr(r0, Address(r0, ConstantPool::pool_holder_offset_in_bytes())); |
|
3323 __ ldrw(rmethod, Address(rmethod, Method::itable_index_offset())); |
|
3324 __ subw(rmethod, rmethod, Method::itable_index_max); |
|
3325 __ negw(rmethod, rmethod); |
3309 |
3326 |
3310 __ lookup_interface_method(// inputs: rec. class, interface, itable index |
3327 __ lookup_interface_method(// inputs: rec. class, interface, itable index |
3311 r3, r0, rmethod, |
3328 r3, r0, rmethod, |
3312 // outputs: method, scan temp. reg |
3329 // outputs: method, scan temp. reg |
3313 rmethod, r13, |
3330 rmethod, r13, |