hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
changeset 42650 1f304d0c888b
parent 41084 fc5db29fa08e
child 42874 973960866fa4
equal deleted inserted replaced
42649:28238583a459 42650:1f304d0c888b
   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 
  2945   oop_maps->add_gc_map(__ pc() - start, map);
  2945   oop_maps->add_gc_map(__ pc() - start, map);
  2946 
  2946 
  2947   __ reset_last_Java_frame(false);
  2947   __ reset_last_Java_frame(false);
  2948 
  2948 
  2949 #if INCLUDE_JVMCI
  2949 #if INCLUDE_JVMCI
  2950   if (EnableJVMCI) {
  2950   if (EnableJVMCI || UseAOT) {
  2951     __ bind(after_fetch_unroll_info_call);
  2951     __ bind(after_fetch_unroll_info_call);
  2952   }
  2952   }
  2953 #endif
  2953 #endif
  2954 
  2954 
  2955   // Load UnrollBlock* into rdi
  2955   // Load UnrollBlock* into rdi
  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 }