< 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 

3536   // there is an initialize need. Otherwise, skip and go to the slow path.
3537   if (UseTLAB || allow_shared_alloc) {
3538     // The object is initialized before the header.  If the object size is
3539     // zero, go directly to the header initialization.
3540     __ bind(initialize_object);
3541     __ sub(r3, r3, sizeof(oopDesc));
3542     __ cbz(r3, initialize_header);
3543 
3544     // Initialize object fields
3545     {
3546       __ add(r2, r0, sizeof(oopDesc));
3547       Label loop;
3548       __ bind(loop);
3549       __ str(zr, Address(__ post(r2, BytesPerLong)));
3550       __ sub(r3, r3, BytesPerLong);
3551       __ cbnz(r3, loop);
3552     }
3553 
3554     // initialize object header only.
3555     __ bind(initialize_header);
3556     __ mov(rscratch1, (intptr_t)markWord::prototype().value());
3557     __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
3558     __ store_klass_gap(r0, zr);  // zero klass gap for compressed oops
3559     __ store_klass(r0, r4);      // store klass last
3560 
3561     {
3562       SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3563       // Trigger dtrace event for fastpath
3564       __ push(atos); // save the return value
3565       __ call_VM_leaf(
3566            CAST_FROM_FN_PTR(address, static_cast<int (*)(oopDesc*)>(SharedRuntime::dtrace_object_alloc)), r0);
3567       __ pop(atos); // restore the return value
3568 
3569     }
3570     __ b(done);
3571   }
3572 
3573   // slow case
3574   __ bind(slow_case);
3575   __ get_constant_pool(c_rarg1);
3576   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3577   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), c_rarg1, c_rarg2);
3578   __ verify_oop(r0);
3579 

3669   transition(atos, itos);
3670   Label done, is_null, ok_is_subtype, quicked, resolved;
3671   __ cbz(r0, is_null);
3672 
3673   // Get cpool & tags index
3674   __ get_cpool_and_tags(r2, r3); // r2=cpool, r3=tags array
3675   __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3676   // See if bytecode has already been quicked
3677   __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3678   __ lea(r1, Address(rscratch1, r19));
3679   __ ldarb(r1, r1);
3680   __ cmp(r1, (u1)JVM_CONSTANT_Class);
3681   __ br(Assembler::EQ, quicked);
3682 
3683   __ push(atos); // save receiver for result, and for GC
3684   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3685   // vm_result_2 has metadata result
3686   __ get_vm_result_2(r0, rthread);
3687   __ pop(r3); // restore receiver
3688   __ verify_oop(r3);
3689   __ load_klass(r3, r3);

3690   __ b(resolved);
3691 
3692   // Get superklass in r0 and subklass in r3
3693   __ bind(quicked);
3694   __ load_klass(r3, r0);
3695   __ load_resolved_klass_at_offset(r2, r19, r0, rscratch1);
3696 
3697   __ bind(resolved);
3698 
3699   // Generate subtype check.  Blows r2, r5
3700   // Superklass in r0.  Subklass in r3.
3701   __ gen_subtype_check(r3, ok_is_subtype);
3702 
3703   // Come here on failure
3704   __ mov(r0, 0);
3705   __ b(done);
3706   // Come here on success
3707   __ bind(ok_is_subtype);
3708   __ mov(r0, 1);
3709 

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 

3536   // there is an initialize need. Otherwise, skip and go to the slow path.
3537   if (UseTLAB || allow_shared_alloc) {
3538     // The object is initialized before the header.  If the object size is
3539     // zero, go directly to the header initialization.
3540     __ bind(initialize_object);
3541     __ sub(r3, r3, sizeof(oopDesc));
3542     __ cbz(r3, initialize_header);
3543 
3544     // Initialize object fields
3545     {
3546       __ add(r2, r0, sizeof(oopDesc));
3547       Label loop;
3548       __ bind(loop);
3549       __ str(zr, Address(__ post(r2, BytesPerLong)));
3550       __ sub(r3, r3, BytesPerLong);
3551       __ cbnz(r3, loop);
3552     }
3553 
3554     // initialize object header only.
3555     __ bind(initialize_header);
3556     __ ldr(rscratch1, Address(r4, Klass::prototype_header_offset()));
3557     __ str(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));


3558 
3559     {
3560       SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3561       // Trigger dtrace event for fastpath
3562       __ push(atos); // save the return value
3563       __ call_VM_leaf(
3564            CAST_FROM_FN_PTR(address, static_cast<int (*)(oopDesc*)>(SharedRuntime::dtrace_object_alloc)), r0);
3565       __ pop(atos); // restore the return value
3566 
3567     }
3568     __ b(done);
3569   }
3570 
3571   // slow case
3572   __ bind(slow_case);
3573   __ get_constant_pool(c_rarg1);
3574   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3575   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), c_rarg1, c_rarg2);
3576   __ verify_oop(r0);
3577 

3667   transition(atos, itos);
3668   Label done, is_null, ok_is_subtype, quicked, resolved;
3669   __ cbz(r0, is_null);
3670 
3671   // Get cpool & tags index
3672   __ get_cpool_and_tags(r2, r3); // r2=cpool, r3=tags array
3673   __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3674   // See if bytecode has already been quicked
3675   __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3676   __ lea(r1, Address(rscratch1, r19));
3677   __ ldarb(r1, r1);
3678   __ cmp(r1, (u1)JVM_CONSTANT_Class);
3679   __ br(Assembler::EQ, quicked);
3680 
3681   __ push(atos); // save receiver for result, and for GC
3682   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3683   // vm_result_2 has metadata result
3684   __ get_vm_result_2(r0, rthread);
3685   __ pop(r3); // restore receiver
3686   __ verify_oop(r3);
3687   __ load_klass(rscratch1, r3);
3688   __ mov(r3, rscratch1);
3689   __ b(resolved);
3690 
3691   // Get superklass in r0 and subklass in r3
3692   __ bind(quicked);
3693   __ load_klass(r3, r0);
3694   __ load_resolved_klass_at_offset(r2, r19, r0, rscratch1);
3695 
3696   __ bind(resolved);
3697 
3698   // Generate subtype check.  Blows r2, r5
3699   // Superklass in r0.  Subklass in r3.
3700   __ gen_subtype_check(r3, ok_is_subtype);
3701 
3702   // Come here on failure
3703   __ mov(r0, 0);
3704   __ b(done);
3705   // Come here on success
3706   __ bind(ok_is_subtype);
3707   __ mov(r0, 1);
3708 
< prev index next >