< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page

3218 
3219   const Register method = index;  // method must be rmethod
3220   assert(method == rmethod,
3221          "Method must be rmethod for interpreter calling convention");
3222 
3223   // do the call - the index is actually the method to call
3224   // that is, f2 is a vtable index if !is_vfinal, else f2 is a Method*
3225 
3226   // It's final, need a null check here!
3227   __ null_check(recv);
3228 
3229   // profile this call
3230   __ profile_final_call(r0);
3231   __ profile_arguments_type(r0, method, r4, true);
3232 
3233   __ jump_from_interpreted(method, r0);
3234 
3235   __ bind(notFinal);
3236 
3237   // get receiver klass
3238   __ null_check(recv, oopDesc::klass_offset_in_bytes());
3239   __ load_klass(r0, recv);
3240 
3241   // profile this call
3242   __ profile_virtual_call(r0, rlocals, r3);
3243 
3244   // get target Method & entry point
3245   __ lookup_virtual_method(r0, index, method);
3246   __ profile_arguments_type(r3, method, r4, true);
3247   // FIXME -- this looks completely redundant. is it?
3248   // __ ldr(r3, Address(method, Method::interpreter_entry_offset()));
3249   __ jump_from_interpreted(method, r3);
3250 }
3251 
3252 void TemplateTable::invokevirtual(int byte_no)
3253 {
3254   transition(vtos, vtos);
3255   assert(byte_no == f2_byte, "use this argument");
3256 
3257   prepare_invoke(byte_no, rmethod, noreg, r2, r3);
3258 

3308   // r3: flags
3309 
3310   // First check for Object case, then private interface method,
3311   // then regular interface method.
3312 
3313   // Special case of invokeinterface called for virtual method of
3314   // java.lang.Object.  See cpCache.cpp for details.
3315   Label notObjectMethod;
3316   __ tbz(r3, ConstantPoolCacheEntry::is_forced_virtual_shift, notObjectMethod);
3317 
3318   invokevirtual_helper(rmethod, r2, r3);
3319   __ bind(notObjectMethod);
3320 
3321   Label no_such_interface;
3322 
3323   // Check for private method invocation - indicated by vfinal
3324   Label notVFinal;
3325   __ tbz(r3, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal);
3326 
3327   // Get receiver klass into r3 - also a null check
3328   __ null_check(r2, oopDesc::klass_offset_in_bytes());
3329   __ load_klass(r3, r2);
3330 
3331   Label subtype;
3332   __ check_klass_subtype(r3, r0, r4, subtype);
3333   // If we get here the typecheck failed
3334   __ b(no_such_interface);
3335   __ bind(subtype);
3336 
3337   __ profile_final_call(r0);
3338   __ profile_arguments_type(r0, rmethod, r4, true);
3339   __ jump_from_interpreted(rmethod, r0);
3340 
3341   __ bind(notVFinal);
3342 
3343   // Get receiver klass into r3 - also a null check
3344   __ restore_locals();
3345   __ null_check(r2, oopDesc::klass_offset_in_bytes());
3346   __ load_klass(r3, r2);
3347 
3348   Label no_such_method;
3349 
3350   // Preserve method for throw_AbstractMethodErrorVerbose.
3351   __ mov(r16, rmethod);
3352   // Receiver subtype check against REFC.
3353   // Superklass in r0. Subklass in r3. Blows rscratch2, r13
3354   __ lookup_interface_method(// inputs: rec. class, interface, itable index
3355                              r3, r0, noreg,
3356                              // outputs: scan temp. reg, scan temp. reg
3357                              rscratch2, r13,
3358                              no_such_interface,
3359                              /*return_method=*/false);
3360 
3361   // profile this call
3362   __ profile_virtual_call(r3, r13, r19);
3363 
3364   // Get declaring interface class from method, and itable index
3365 

3513       __ b(initialize_header);
3514     }
3515 
3516     // The object is initialized before the header.  If the object size is
3517     // zero, go directly to the header initialization.
3518     __ sub(r3, r3, sizeof(oopDesc));
3519     __ cbz(r3, initialize_header);
3520 
3521     // Initialize object fields
3522     {
3523       __ add(r2, r0, sizeof(oopDesc));
3524       Label loop;
3525       __ bind(loop);
3526       __ str(zr, Address(__ post(r2, BytesPerLong)));
3527       __ sub(r3, r3, BytesPerLong);
3528       __ cbnz(r3, loop);
3529     }
3530 
3531     // initialize object header only.
3532     __ bind(initialize_header);
3533     __ mov(rscratch1, (intptr_t)markWord::prototype().value());
3534     __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3535     __ store_klass_gap(r0, zr);  // zero klass gap for compressed oops
3536     __ store_klass(r0, r4);      // store klass last
3537 
3538     {
3539       SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3540       // Trigger dtrace event for fastpath
3541       __ push(atos); // save the return value
3542       __ call_VM_leaf(
3543            CAST_FROM_FN_PTR(address, static_cast<int (*)(oopDesc*)>(SharedRuntime::dtrace_object_alloc)), r0);
3544       __ pop(atos); // restore the return value
3545 
3546     }
3547     __ b(done);
3548   }
3549 
3550   // slow case
3551   __ bind(slow_case);
3552   __ get_constant_pool(c_rarg1);
3553   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3554   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), c_rarg1, c_rarg2);
3555   __ verify_oop(r0);
3556 

3646   transition(atos, itos);
3647   Label done, is_null, ok_is_subtype, quicked, resolved;
3648   __ cbz(r0, is_null);
3649 
3650   // Get cpool & tags index
3651   __ get_cpool_and_tags(r2, r3); // r2=cpool, r3=tags array
3652   __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3653   // See if bytecode has already been quicked
3654   __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3655   __ lea(r1, Address(rscratch1, r19));
3656   __ ldarb(r1, r1);
3657   __ cmp(r1, (u1)JVM_CONSTANT_Class);
3658   __ br(Assembler::EQ, quicked);
3659 
3660   __ push(atos); // save receiver for result, and for GC
3661   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3662   // vm_result_2 has metadata result
3663   __ get_vm_result_2(r0, rthread);
3664   __ pop(r3); // restore receiver
3665   __ verify_oop(r3);
3666   __ load_klass(r3, r3);

3667   __ b(resolved);
3668 
3669   // Get superklass in r0 and subklass in r3
3670   __ bind(quicked);
3671   __ load_klass(r3, r0);
3672   __ load_resolved_klass_at_offset(r2, r19, r0, rscratch1);
3673 
3674   __ bind(resolved);
3675 
3676   // Generate subtype check.  Blows r2, r5
3677   // Superklass in r0.  Subklass in r3.
3678   __ gen_subtype_check(r3, ok_is_subtype);
3679 
3680   // Come here on failure
3681   __ mov(r0, 0);
3682   __ b(done);
3683   // Come here on success
3684   __ bind(ok_is_subtype);
3685   __ mov(r0, 1);
3686 

3218 
3219   const Register method = index;  // method must be rmethod
3220   assert(method == rmethod,
3221          "Method must be rmethod for interpreter calling convention");
3222 
3223   // do the call - the index is actually the method to call
3224   // that is, f2 is a vtable index if !is_vfinal, else f2 is a Method*
3225 
3226   // It's final, need a null check here!
3227   __ null_check(recv);
3228 
3229   // profile this call
3230   __ profile_final_call(r0);
3231   __ profile_arguments_type(r0, method, r4, true);
3232 
3233   __ jump_from_interpreted(method, r0);
3234 
3235   __ bind(notFinal);
3236 
3237   // get receiver klass
3238   __ null_check(recv, oopDesc::mark_offset_in_bytes());
3239   __ load_klass(r0, recv);
3240 
3241   // profile this call
3242   __ profile_virtual_call(r0, rlocals, r3);
3243 
3244   // get target Method & entry point
3245   __ lookup_virtual_method(r0, index, method);
3246   __ profile_arguments_type(r3, method, r4, true);
3247   // FIXME -- this looks completely redundant. is it?
3248   // __ ldr(r3, Address(method, Method::interpreter_entry_offset()));
3249   __ jump_from_interpreted(method, r3);
3250 }
3251 
3252 void TemplateTable::invokevirtual(int byte_no)
3253 {
3254   transition(vtos, vtos);
3255   assert(byte_no == f2_byte, "use this argument");
3256 
3257   prepare_invoke(byte_no, rmethod, noreg, r2, r3);
3258 

3308   // r3: flags
3309 
3310   // First check for Object case, then private interface method,
3311   // then regular interface method.
3312 
3313   // Special case of invokeinterface called for virtual method of
3314   // java.lang.Object.  See cpCache.cpp for details.
3315   Label notObjectMethod;
3316   __ tbz(r3, ConstantPoolCacheEntry::is_forced_virtual_shift, notObjectMethod);
3317 
3318   invokevirtual_helper(rmethod, r2, r3);
3319   __ bind(notObjectMethod);
3320 
3321   Label no_such_interface;
3322 
3323   // Check for private method invocation - indicated by vfinal
3324   Label notVFinal;
3325   __ tbz(r3, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal);
3326 
3327   // Get receiver klass into r3 - also a null check
3328   __ null_check(r2, oopDesc::mark_offset_in_bytes());
3329   __ load_klass(r3, r2);
3330 
3331   Label subtype;
3332   __ check_klass_subtype(r3, r0, r4, subtype);
3333   // If we get here the typecheck failed
3334   __ b(no_such_interface);
3335   __ bind(subtype);
3336 
3337   __ profile_final_call(r0);
3338   __ profile_arguments_type(r0, rmethod, r4, true);
3339   __ jump_from_interpreted(rmethod, r0);
3340 
3341   __ bind(notVFinal);
3342 
3343   // Get receiver klass into r3 - also a null check
3344   __ restore_locals();
3345   __ null_check(r2, oopDesc::mark_offset_in_bytes());
3346   __ load_klass(r3, r2);
3347 
3348   Label no_such_method;
3349 
3350   // Preserve method for throw_AbstractMethodErrorVerbose.
3351   __ mov(r16, rmethod);
3352   // Receiver subtype check against REFC.
3353   // Superklass in r0. Subklass in r3. Blows rscratch2, r13
3354   __ lookup_interface_method(// inputs: rec. class, interface, itable index
3355                              r3, r0, noreg,
3356                              // outputs: scan temp. reg, scan temp. reg
3357                              rscratch2, r13,
3358                              no_such_interface,
3359                              /*return_method=*/false);
3360 
3361   // profile this call
3362   __ profile_virtual_call(r3, r13, r19);
3363 
3364   // Get declaring interface class from method, and itable index
3365 

3513       __ b(initialize_header);
3514     }
3515 
3516     // The object is initialized before the header.  If the object size is
3517     // zero, go directly to the header initialization.
3518     __ sub(r3, r3, sizeof(oopDesc));
3519     __ cbz(r3, initialize_header);
3520 
3521     // Initialize object fields
3522     {
3523       __ add(r2, r0, sizeof(oopDesc));
3524       Label loop;
3525       __ bind(loop);
3526       __ str(zr, Address(__ post(r2, BytesPerLong)));
3527       __ sub(r3, r3, BytesPerLong);
3528       __ cbnz(r3, loop);
3529     }
3530 
3531     // initialize object header only.
3532     __ bind(initialize_header);
3533     __ ldr(rscratch1, Address(r4, Klass::prototype_header_offset()));
3534     __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));


3535 
3536     {
3537       SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3538       // Trigger dtrace event for fastpath
3539       __ push(atos); // save the return value
3540       __ call_VM_leaf(
3541            CAST_FROM_FN_PTR(address, static_cast<int (*)(oopDesc*)>(SharedRuntime::dtrace_object_alloc)), r0);
3542       __ pop(atos); // restore the return value
3543 
3544     }
3545     __ b(done);
3546   }
3547 
3548   // slow case
3549   __ bind(slow_case);
3550   __ get_constant_pool(c_rarg1);
3551   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3552   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), c_rarg1, c_rarg2);
3553   __ verify_oop(r0);
3554 

3644   transition(atos, itos);
3645   Label done, is_null, ok_is_subtype, quicked, resolved;
3646   __ cbz(r0, is_null);
3647 
3648   // Get cpool & tags index
3649   __ get_cpool_and_tags(r2, r3); // r2=cpool, r3=tags array
3650   __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3651   // See if bytecode has already been quicked
3652   __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3653   __ lea(r1, Address(rscratch1, r19));
3654   __ ldarb(r1, r1);
3655   __ cmp(r1, (u1)JVM_CONSTANT_Class);
3656   __ br(Assembler::EQ, quicked);
3657 
3658   __ push(atos); // save receiver for result, and for GC
3659   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3660   // vm_result_2 has metadata result
3661   __ get_vm_result_2(r0, rthread);
3662   __ pop(r3); // restore receiver
3663   __ verify_oop(r3);
3664   __ load_klass(rscratch1, r3);
3665   __ mov(r3, rscratch1);
3666   __ b(resolved);
3667 
3668   // Get superklass in r0 and subklass in r3
3669   __ bind(quicked);
3670   __ load_klass(r3, r0);
3671   __ load_resolved_klass_at_offset(r2, r19, r0, rscratch1);
3672 
3673   __ bind(resolved);
3674 
3675   // Generate subtype check.  Blows r2, r5
3676   // Superklass in r0.  Subklass in r3.
3677   __ gen_subtype_check(r3, ok_is_subtype);
3678 
3679   // Come here on failure
3680   __ mov(r0, 0);
3681   __ b(done);
3682   // Come here on success
3683   __ bind(ok_is_subtype);
3684   __ mov(r0, 1);
3685 
< prev index next >