src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6930772 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/c1_LIRAssembler_x86.cpp

Print this page




2773       case lir_dynamic_call:
2774         offset += NativeCall::displacement_offset;
2775         break;
2776       case lir_icvirtual_call:
2777         offset += NativeCall::displacement_offset + NativeMovConstReg::instruction_size;
2778       break;
2779       case lir_virtual_call:  // currently, sparc-specific for niagara
2780       default: ShouldNotReachHere();
2781     }
2782     while (offset++ % BytesPerWord != 0) {
2783       __ nop();
2784     }
2785   }
2786 }
2787 
2788 
2789 void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
2790   assert(!os::is_MP() || (__ offset() + NativeCall::displacement_offset) % BytesPerWord == 0,
2791          "must be aligned");
2792   __ call(AddressLiteral(op->addr(), rtype));
2793   add_call_info(code_offset(), op->info(), op->is_method_handle_invoke());
2794 }
2795 
2796 
2797 void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
2798   RelocationHolder rh = virtual_call_Relocation::spec(pc());
2799   __ movoop(IC_Klass, (jobject)Universe::non_oop_word());
2800   assert(!os::is_MP() ||
2801          (__ offset() + NativeCall::displacement_offset) % BytesPerWord == 0,
2802          "must be aligned");
2803   __ call(AddressLiteral(op->addr(), rh));
2804   add_call_info(code_offset(), op->info(), op->is_method_handle_invoke());
2805 }
2806 
2807 
2808 /* Currently, vtable-dispatch is only enabled for sparc platforms */
2809 void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
2810   ShouldNotReachHere();
2811 }
2812 
2813 
2814 void LIR_Assembler::preserve_SP(LIR_OpJavaCall* op) {
2815   __ movptr(FrameMap::method_handle_invoke_SP_save_opr()->as_register(), rsp);
2816 }
2817 
2818 
2819 void LIR_Assembler::restore_SP(LIR_OpJavaCall* op) {
2820   __ movptr(rsp, FrameMap::method_handle_invoke_SP_save_opr()->as_register());
2821 }
2822 
2823 
2824 void LIR_Assembler::emit_static_call_stub() {
2825   address call_pc = __ pc();
2826   address stub = __ start_a_stub(call_stub_size);
2827   if (stub == NULL) {
2828     bailout("static call stub overflow");
2829     return;
2830   }
2831 
2832   int start = __ offset();
2833   if (os::is_MP()) {
2834     // make sure that the displacement word of the call ends up word aligned
2835     int offset = __ offset() + NativeMovConstReg::instruction_size + NativeCall::displacement_offset;
2836     while (offset++ % BytesPerWord != 0) {
2837       __ nop();
2838     }
2839   }
2840   __ relocate(static_stub_Relocation::spec(call_pc));
2841   __ movoop(rbx, (jobject)NULL);
2842   // must be set to -1 at code generation time
2843   assert(!os::is_MP() || ((__ offset() + 1) % BytesPerWord) == 0, "must be aligned on MP");




2773       case lir_dynamic_call:
2774         offset += NativeCall::displacement_offset;
2775         break;
2776       case lir_icvirtual_call:
2777         offset += NativeCall::displacement_offset + NativeMovConstReg::instruction_size;
2778       break;
2779       case lir_virtual_call:  // currently, sparc-specific for niagara
2780       default: ShouldNotReachHere();
2781     }
2782     while (offset++ % BytesPerWord != 0) {
2783       __ nop();
2784     }
2785   }
2786 }
2787 
2788 
2789 void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
2790   assert(!os::is_MP() || (__ offset() + NativeCall::displacement_offset) % BytesPerWord == 0,
2791          "must be aligned");
2792   __ call(AddressLiteral(op->addr(), rtype));
2793   add_call_info(code_offset(), op->info());
2794 }
2795 
2796 
2797 void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
2798   RelocationHolder rh = virtual_call_Relocation::spec(pc());
2799   __ movoop(IC_Klass, (jobject)Universe::non_oop_word());
2800   assert(!os::is_MP() ||
2801          (__ offset() + NativeCall::displacement_offset) % BytesPerWord == 0,
2802          "must be aligned");
2803   __ call(AddressLiteral(op->addr(), rh));
2804   add_call_info(code_offset(), op->info());
2805 }
2806 
2807 
2808 /* Currently, vtable-dispatch is only enabled for sparc platforms */
2809 void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
2810   ShouldNotReachHere();
2811 }
2812 
2813 










2814 void LIR_Assembler::emit_static_call_stub() {
2815   address call_pc = __ pc();
2816   address stub = __ start_a_stub(call_stub_size);
2817   if (stub == NULL) {
2818     bailout("static call stub overflow");
2819     return;
2820   }
2821 
2822   int start = __ offset();
2823   if (os::is_MP()) {
2824     // make sure that the displacement word of the call ends up word aligned
2825     int offset = __ offset() + NativeMovConstReg::instruction_size + NativeCall::displacement_offset;
2826     while (offset++ % BytesPerWord != 0) {
2827       __ nop();
2828     }
2829   }
2830   __ relocate(static_stub_Relocation::spec(call_pc));
2831   __ movoop(rbx, (jobject)NULL);
2832   // must be set to -1 at code generation time
2833   assert(!os::is_MP() || ((__ offset() + 1) % BytesPerWord) == 0, "must be aligned on MP");


src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File