798 // Will jump to the compiled code just as if compiled code was doing it. |
798 // Will jump to the compiled code just as if compiled code was doing it. |
799 // Pre-load the register-jump target early, to schedule it better. |
799 // Pre-load the register-jump target early, to schedule it better. |
800 __ movptr(r11, Address(rbx, in_bytes(Method::from_compiled_offset()))); |
800 __ movptr(r11, Address(rbx, in_bytes(Method::from_compiled_offset()))); |
801 |
801 |
802 #if INCLUDE_JVMCI |
802 #if INCLUDE_JVMCI |
803 if (EnableJVMCI) { |
803 if (EnableJVMCI || UseAOT) { |
804 // check if this call should be routed towards a specific entry point |
804 // check if this call should be routed towards a specific entry point |
805 __ cmpptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0); |
805 __ cmpptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0); |
806 Label no_alternative_target; |
806 Label no_alternative_target; |
807 __ jcc(Assembler::equal, no_alternative_target); |
807 __ jcc(Assembler::equal, no_alternative_target); |
808 __ movptr(r11, Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); |
808 __ movptr(r11, Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); |
2756 // Allocate space for the code |
2756 // Allocate space for the code |
2757 ResourceMark rm; |
2757 ResourceMark rm; |
2758 // Setup code generation tools |
2758 // Setup code generation tools |
2759 int pad = 0; |
2759 int pad = 0; |
2760 #if INCLUDE_JVMCI |
2760 #if INCLUDE_JVMCI |
2761 if (EnableJVMCI) { |
2761 if (EnableJVMCI || UseAOT) { |
2762 pad += 512; // Increase the buffer size when compiling for JVMCI |
2762 pad += 512; // Increase the buffer size when compiling for JVMCI |
2763 } |
2763 } |
2764 #endif |
2764 #endif |
2765 CodeBuffer buffer("deopt_blob", 2048+pad, 1024); |
2765 CodeBuffer buffer("deopt_blob", 2048+pad, 1024); |
2766 MacroAssembler* masm = new MacroAssembler(&buffer); |
2766 MacroAssembler* masm = new MacroAssembler(&buffer); |
2830 #if INCLUDE_JVMCI |
2830 #if INCLUDE_JVMCI |
2831 Label after_fetch_unroll_info_call; |
2831 Label after_fetch_unroll_info_call; |
2832 int implicit_exception_uncommon_trap_offset = 0; |
2832 int implicit_exception_uncommon_trap_offset = 0; |
2833 int uncommon_trap_offset = 0; |
2833 int uncommon_trap_offset = 0; |
2834 |
2834 |
2835 if (EnableJVMCI) { |
2835 if (EnableJVMCI || UseAOT) { |
2836 implicit_exception_uncommon_trap_offset = __ pc() - start; |
2836 implicit_exception_uncommon_trap_offset = __ pc() - start; |
2837 |
2837 |
2838 __ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); |
2838 __ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); |
2839 __ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())), (int32_t)NULL_WORD); |
2839 __ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())), (int32_t)NULL_WORD); |
2840 |
2840 |
3110 masm->flush(); |
3110 masm->flush(); |
3111 |
3111 |
3112 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); |
3112 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); |
3113 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); |
3113 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); |
3114 #if INCLUDE_JVMCI |
3114 #if INCLUDE_JVMCI |
3115 if (EnableJVMCI) { |
3115 if (EnableJVMCI || UseAOT) { |
3116 _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); |
3116 _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); |
3117 _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset); |
3117 _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset); |
3118 } |
3118 } |
3119 #endif |
3119 #endif |
3120 } |
3120 } |