1. Pypy
  2. Untitled project
  3. pypy

Commits

tav  committed 16df517 Merge

merge heads

  • Participants
  • Parent commits 87c9a70, af69a87
  • Branches default

Comments (0)

Files changed (4)

File pypy/doc/config/confrest.py

View file
  • Ignore whitespace
 all_optiondescrs = [pypyoption.pypy_optiondescription,
                     translationoption.translation_optiondescription,
                    ]
-
 start_to_descr = dict([(descr._name, descr) for descr in all_optiondescrs])
 
 class PyPyPage(PyPyPage): 
     Page = PyPyPage 
 
     def get_content(self, txtpath, encoding):
-        if txtpath.basename == "commandline.txt":
+        if txtpath.basename == "commandline.rst":
             result = []
             for line in txtpath.read().splitlines():
                 if line.startswith('.. GENERATE:'):

File pypy/doc/config/generate.py

View file
  • Ignore whitespace
 for descr in all_optiondescrs:
     prefix = descr._name
     c = config.Config(descr)
-    thisdir.join(prefix + ".txt").ensure()
+    thisdir.join(prefix + ".rst").ensure()
     for p in c.getpaths(include_groups=True):
-        basename = prefix + "." + p + ".txt"
+        basename = prefix + "." + p + ".rst"
         f = thisdir.join(basename)
         f.ensure()

File pypy/jit/metainterp/optimizeopt/heap.py

View file
  • Ignore whitespace
             self.optimizer.pendingfields = self.force_lazy_setfields_for_guard()
             return
         opnum = op.getopnum()
-        if (opnum == rop.SETFIELD_GC or
-            opnum == rop.SETFIELD_RAW or
-            opnum == rop.SETARRAYITEM_GC or
-            opnum == rop.SETARRAYITEM_RAW or
-            opnum == rop.DEBUG_MERGE_POINT):
+        if (opnum == rop.SETFIELD_GC or        # handled specially
+            opnum == rop.SETFIELD_RAW or       # no effect on GC struct/array
+            opnum == rop.SETARRAYITEM_GC or    # handled specially
+            opnum == rop.SETARRAYITEM_RAW or   # no effect on GC struct
+            opnum == rop.STRSETITEM or         # no effect on GC struct/array
+            opnum == rop.UNICODESETITEM or     # no effect on GC struct/array
+            opnum == rop.DEBUG_MERGE_POINT or  # no effect whatsoever
+            opnum == rop.COPYSTRCONTENT or     # no effect on GC struct/array
+            opnum == rop.COPYUNICODECONTENT):  # no effect on GC struct/array
             return
         assert opnum != rop.CALL_PURE
         if (opnum == rop.CALL or
                     # ^^^ we only need to force this field; the other fields
                     # of virtualref_info and virtualizable_info are not gcptrs.
                 return
-            self.force_all_lazy_setfields()
-        elif op.is_final() or (not we_are_translated() and
-                               op.getopnum() < 0):   # escape() operations
-            self.force_all_lazy_setfields()
+        self.force_all_lazy_setfields()
         self.clean_caches()
 
 
         if len(newoperations) < 2:
             return
         lastop = newoperations[-1]
-        if lastop.getopnum() != rop.SETFIELD_GC:
+        if (lastop.getopnum() != rop.SETFIELD_GC and
+            lastop.getopnum() != rop.SETARRAYITEM_GC):
             return
         # - is_comparison() for cases like "int_eq/setfield_gc/guard_true"
         # - CALL_MAY_FORCE: "call_may_force/setfield_gc/guard_not_forced"
         newoperations[-1] = prevop
 
     def force_all_lazy_setfields(self):
-        if len(self._lazy_setfields) > 0:
-            for cf in self._lazy_setfields:
-                if not we_are_translated():
-                    assert cf in self.cached_fields.values()
-                cf.force_lazy_setfield(self)
-            del self._lazy_setfields[:]
+        for cf in self._lazy_setfields:
+            if not we_are_translated():
+                assert cf in self.cached_fields.values()
+            cf.force_lazy_setfield(self)
 
     def force_lazy_setfields_for_guard(self):
         pendingfields = []

File pypy/jit/metainterp/test/test_optimizeopt.py

View file
  • Ignore whitespace
         """
         self.optimize_loop(ops, expected)
 
+    def test_dont_force_setfield_around_copystrcontent(self):
+        ops = """
+        [p0, i0, p1, i1, i2]
+        setfield_gc(p0, i1, descr=valuedescr)
+        copystrcontent(p0, i0, p1, i1, i2)
+        escape()
+        jump(p0, i0, p1, i1, i2)
+        """
+        expected = """
+        [p0, i0, p1, i1, i2]
+        copystrcontent(p0, i0, p1, i1, i2)
+        setfield_gc(p0, i1, descr=valuedescr)
+        escape()
+        jump(p0, i0, p1, i1, i2)
+        """
+        self.optimize_loop(ops, expected)
+
     def test_duplicate_getarrayitem_1(self):
         ops = """
         [p1]