< prev index next >

src/cpu/ppc/vm/ppc.ad

Print this page
rev 12037 : 8166562: C2: Suppress relocations in scratch emit.

@@ -1095,11 +1095,10 @@
   offsets.insts_call_instruction_offset = __ offset();
 
   // No entry point given, use the current pc.
   if (entry_point == NULL) entry_point = __ pc();
 
-  if (!Compile::current()->in_scratch_emit_size()) {
     // Put the entry point as a constant into the constant pool.
     const address entry_point_toc_addr   = __ address_constant(entry_point, RelocationHolder::none);
     if (entry_point_toc_addr == NULL) {
       ciEnv::current()->record_out_of_memory_failure();
       return offsets;

@@ -1108,11 +1107,10 @@
 
     // Emit the trampoline stub which will be related to the branch-and-link below.
     CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, offsets.insts_call_instruction_offset);
     if (ciEnv::current()->failing()) { return offsets; } // Code cache may be full.
     __ relocate(rtype);
-  }
 
   // Note: At this point we do not have the address of the trampoline
   // stub, and the entry point might be too far away for bl, so __ pc()
   // serves as dummy and the bl will be patched later.
   __ bl((address) __ pc());

@@ -2422,11 +2420,10 @@
     // TODO: PPC port $archOpcode(ppc64Opcode_ld);
 
     MacroAssembler _masm(&cbuf);
     int toc_offset = 0;
 
-    if (!ra_->C->in_scratch_emit_size()) {
       address const_toc_addr;
       // Create a non-oop constant, no relocation needed.
       // If it is an IC, it has a virtual_call_Relocation.
       const_toc_addr = __ long_constant((jlong)$src$$constant);
       if (const_toc_addr == NULL) {

@@ -2437,11 +2434,10 @@
       // Get the constant's TOC offset.
       toc_offset = __ offset_to_method_toc(const_toc_addr);
 
       // Keep the current instruction offset in mind.
       ((loadConLNode*)this)->_cbuf_insts_offset = __ offset();
-    }
 
     __ ld($dst$$Register, toc_offset, $toc$$Register);
   %}
 
   enc_class enc_load_long_constL_hi(iRegLdst dst, iRegLdst toc, immL src) %{

@@ -2574,11 +2570,10 @@
     // TODO: PPC port $archOpcode(ppc64Opcode_ld);
 
     MacroAssembler _masm(&cbuf);
     int toc_offset = 0;
 
-    if (!ra_->C->in_scratch_emit_size()) {
       intptr_t val = $src$$constant;
       relocInfo::relocType constant_reloc = $src->constant_reloc();  // src
       address const_toc_addr;
       if (constant_reloc == relocInfo::oop_type) {
         // Create an oop constant and a corresponding relocation.

@@ -2598,11 +2593,10 @@
         ciEnv::current()->record_out_of_memory_failure();
         return;
       }
       // Get the constant's TOC offset.
       toc_offset = __ offset_to_method_toc(const_toc_addr);
-    }
 
     __ ld($dst$$Register, toc_offset, $toc$$Register);
   %}
 
   enc_class enc_load_long_constP_hi(iRegLdst dst, immP src, iRegLdst toc) %{

@@ -3270,12 +3264,12 @@
       // A call to a runtime wrapper, e.g. new, new_typeArray_Java, uncommon_trap.
       emit_call_with_trampoline_stub(_masm, entry_point, relocInfo::runtime_call_type);
     } else {
       // Remember the offset not the address.
       const int start_offset = __ offset();
+
       // The trampoline stub.
-      if (!Compile::current()->in_scratch_emit_size()) {
         // No entry point given, use the current pc.
         // Make sure branch fits into
         if (entry_point == 0) entry_point = __ pc();
 
         // Put the entry point as a constant into the constant pool.

@@ -3284,18 +3278,16 @@
           ciEnv::current()->record_out_of_memory_failure();
           return;
         }
         const int     entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr);
 
-
         // Emit the trampoline stub which will be related to the branch-and-link below.
         CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset);
         if (ciEnv::current()->failing()) { return; } // Code cache may be full.
         int method_index = resolved_method_index(cbuf);
         __ relocate(_optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
                                        : static_call_Relocation::spec(method_index));
-      }
 
       // The real call.
       // Note: At this point we do not have the address of the trampoline
       // stub, and the entry point might be too far away for bl, so __ pc()
       // serves as dummy and the bl will be patched later.
< prev index next >