Commits

Armin Rigo committed 5bf5662

Introduce and use emit_no_collect().

  • Participants
  • Parent commits ae2989f
  • Branches emit-call-x86

Comments (0)

Files changed (3)

rpython/jit/backend/x86/assembler.py

                                      result_loc, result_type)
         cb.emit()
 
+    def simple_call_no_collect(self, fnloc, arglocs):
+        cb = callbuilder.CallBuilder(self, fnloc, arglocs)
+        cb.emit_no_collect()
+
     def _reload_frame_if_necessary(self, mc, align_stack=False):
         gcrootmap = self.cpu.gc_ll_descr.gcrootmap
         if gcrootmap:

rpython/jit/backend/x86/callbuilder.py

         self.restype = restype
         self.current_esp = 0
 
+    def emit_no_collect(self):
+        """Emit a call that cannot collect."""
+        self.prepare_arguments()
+        self.emit_raw_call()
+        self.restore_esp()
+        self.load_result()
+
     def emit(self):
         """Emit a regular call; not for CALL_RELEASE_GIL."""
         self.prepare_arguments()

rpython/jit/backend/x86/regalloc.py

         # call memcpy()
         self.rm.before_call()
         self.xrm.before_call()
-        self.assembler._emit_call(imm(self.assembler.memcpy_addr),
-                                  [dstaddr_loc, srcaddr_loc, length_loc],
-                                  can_collect=False)
+        self.assembler.simple_call_no_collect(imm(self.assembler.memcpy_addr),
+                                        [dstaddr_loc, srcaddr_loc, length_loc])
         self.rm.possibly_free_var(length_box)
         self.rm.possibly_free_var(dstaddr_box)
         self.rm.possibly_free_var(srcaddr_box)