< prev index next >

src/hotspot/cpu/aarch64/aarch64.ad

Print this page

 3701         ciEnv::current()->record_failure("CodeCache is full");
 3702         return;
 3703       }
 3704     } else {
 3705       int method_index = resolved_method_index(cbuf);
 3706       RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
 3707                                                   : static_call_Relocation::spec(method_index);
 3708       call = __ trampoline_call(Address(addr, rspec), &cbuf);
 3709       if (call == NULL) {
 3710         ciEnv::current()->record_failure("CodeCache is full");
 3711         return;
 3712       }
 3713       // Emit stub for static call
 3714       address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
 3715       if (stub == NULL) {
 3716         ciEnv::current()->record_failure("CodeCache is full");
 3717         return;
 3718       }
 3719     }
 3720 


 3721     // Only non uncommon_trap calls need to reinitialize ptrue.
 3722     if (Compile::current()->max_vector_size() > 0 && uncommon_trap_request() == 0) {
 3723       __ reinitialize_ptrue();
 3724     }
 3725   %}
 3726 
 3727   enc_class aarch64_enc_java_dynamic_call(method meth) %{
 3728     C2_MacroAssembler _masm(&cbuf);
 3729     int method_index = resolved_method_index(cbuf);
 3730     address call = __ ic_call((address)$meth$$method, method_index);

 3731     if (call == NULL) {
 3732       ciEnv::current()->record_failure("CodeCache is full");
 3733       return;
 3734     } else if (Compile::current()->max_vector_size() > 0) {
 3735       __ reinitialize_ptrue();
 3736     }
 3737   %}
 3738 
 3739   enc_class aarch64_enc_call_epilog() %{
 3740     C2_MacroAssembler _masm(&cbuf);
 3741     if (VerifyStackAtCalls) {
 3742       // Check that stack depth is unchanged: find majik cookie on stack
 3743       __ call_Unimplemented();
 3744     }
 3745   %}
 3746 
 3747   enc_class aarch64_enc_java_to_runtime(method meth) %{
 3748     C2_MacroAssembler _masm(&cbuf);
 3749 
 3750     // some calls to generated routines (arraycopy code) are scheduled
 3751     // by C2 as runtime calls. if so we can call them using a br (they
 3752     // will be in a reachable segment) otherwise we have to use a blr
 3753     // which loads the absolute address into a register.
 3754     address entry = (address)$meth$$method;
 3755     CodeBlob *cb = CodeCache::find_blob(entry);
 3756     if (cb) {
 3757       address call = __ trampoline_call(Address(entry, relocInfo::runtime_call_type));

 3758       if (call == NULL) {
 3759         ciEnv::current()->record_failure("CodeCache is full");
 3760         return;
 3761       }
 3762     } else {
 3763       Label retaddr;
 3764       __ adr(rscratch2, retaddr);
 3765       __ lea(rscratch1, RuntimeAddress(entry));
 3766       // Leave a breadcrumb for JavaFrameAnchor::capture_last_Java_pc()
 3767       __ stp(zr, rscratch2, Address(__ pre(sp, -2 * wordSize)));
 3768       __ blr(rscratch1);
 3769       __ bind(retaddr);

 3770       __ add(sp, sp, 2 * wordSize);
 3771     }
 3772     if (Compile::current()->max_vector_size() > 0) {
 3773       __ reinitialize_ptrue();
 3774     }
 3775   %}
 3776 
 3777   enc_class aarch64_enc_rethrow() %{
 3778     C2_MacroAssembler _masm(&cbuf);
 3779     __ far_jump(RuntimeAddress(OptoRuntime::rethrow_stub()));
 3780   %}
 3781 
 3782   enc_class aarch64_enc_ret() %{
 3783     C2_MacroAssembler _masm(&cbuf);
 3784 #ifdef ASSERT
 3785     if (Compile::current()->max_vector_size() > 0) {
 3786       __ verify_ptrue();
 3787     }
 3788 #endif
 3789     __ ret(lr);

 3701         ciEnv::current()->record_failure("CodeCache is full");
 3702         return;
 3703       }
 3704     } else {
 3705       int method_index = resolved_method_index(cbuf);
 3706       RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
 3707                                                   : static_call_Relocation::spec(method_index);
 3708       call = __ trampoline_call(Address(addr, rspec), &cbuf);
 3709       if (call == NULL) {
 3710         ciEnv::current()->record_failure("CodeCache is full");
 3711         return;
 3712       }
 3713       // Emit stub for static call
 3714       address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
 3715       if (stub == NULL) {
 3716         ciEnv::current()->record_failure("CodeCache is full");
 3717         return;
 3718       }
 3719     }
 3720 
 3721     __ post_call_nop();
 3722 
 3723     // Only non uncommon_trap calls need to reinitialize ptrue.
 3724     if (Compile::current()->max_vector_size() > 0 && uncommon_trap_request() == 0) {
 3725       __ reinitialize_ptrue();
 3726     }
 3727   %}
 3728 
 3729   enc_class aarch64_enc_java_dynamic_call(method meth) %{
 3730     C2_MacroAssembler _masm(&cbuf);
 3731     int method_index = resolved_method_index(cbuf);
 3732     address call = __ ic_call((address)$meth$$method, method_index);
 3733     __ post_call_nop();
 3734     if (call == NULL) {
 3735       ciEnv::current()->record_failure("CodeCache is full");
 3736       return;
 3737     } else if (Compile::current()->max_vector_size() > 0) {
 3738       __ reinitialize_ptrue();
 3739     }
 3740   %}
 3741 
 3742   enc_class aarch64_enc_call_epilog() %{
 3743     C2_MacroAssembler _masm(&cbuf);
 3744     if (VerifyStackAtCalls) {
 3745       // Check that stack depth is unchanged: find majik cookie on stack
 3746       __ call_Unimplemented();
 3747     }
 3748   %}
 3749 
 3750   enc_class aarch64_enc_java_to_runtime(method meth) %{
 3751     C2_MacroAssembler _masm(&cbuf);
 3752 
 3753     // some calls to generated routines (arraycopy code) are scheduled
 3754     // by C2 as runtime calls. if so we can call them using a br (they
 3755     // will be in a reachable segment) otherwise we have to use a blr
 3756     // which loads the absolute address into a register.
 3757     address entry = (address)$meth$$method;
 3758     CodeBlob *cb = CodeCache::find_blob(entry);
 3759     if (cb) {
 3760       address call = __ trampoline_call(Address(entry, relocInfo::runtime_call_type));
 3761       __ post_call_nop();
 3762       if (call == NULL) {
 3763         ciEnv::current()->record_failure("CodeCache is full");
 3764         return;
 3765       }
 3766     } else {
 3767       Label retaddr;
 3768       __ adr(rscratch2, retaddr);
 3769       __ lea(rscratch1, RuntimeAddress(entry));
 3770       // Leave a breadcrumb for JavaFrameAnchor::capture_last_Java_pc()
 3771       __ stp(zr, rscratch2, Address(__ pre(sp, -2 * wordSize)));
 3772       __ blr(rscratch1);
 3773       __ bind(retaddr);
 3774       // __ post_call_nop(); -- can we have one here? do we need one?
 3775       __ add(sp, sp, 2 * wordSize);
 3776     }
 3777     if (Compile::current()->max_vector_size() > 0) {
 3778       __ reinitialize_ptrue();
 3779     }
 3780   %}
 3781 
 3782   enc_class aarch64_enc_rethrow() %{
 3783     C2_MacroAssembler _masm(&cbuf);
 3784     __ far_jump(RuntimeAddress(OptoRuntime::rethrow_stub()));
 3785   %}
 3786 
 3787   enc_class aarch64_enc_ret() %{
 3788     C2_MacroAssembler _masm(&cbuf);
 3789 #ifdef ASSERT
 3790     if (Compile::current()->max_vector_size() > 0) {
 3791       __ verify_ptrue();
 3792     }
 3793 #endif
 3794     __ ret(lr);
< prev index next >