[pypy-svn] r66724 - pypy/branch/pyjitpl5/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Sat Aug 1 20:27:22 CEST 2009


Author: arigo
Date: Sat Aug  1 20:27:20 2009
New Revision: 66724

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/TODO
   pypy/branch/pyjitpl5/pypy/jit/metainterp/resume.py
Log:
* Very minor space saving.
* Update the TODO about the need for major space savings here.


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/TODO
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/TODO	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/TODO	Sat Aug  1 20:27:20 2009
@@ -8,6 +8,6 @@
 
 * long term: memory management of the compiled code (free old code)
 
-* 'resume_info' should be shared (see pyjitpl.py)
+* save space on all the guard operations (see resume.py)
 
 * support threads again

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/resume.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/resume.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/resume.py	Sat Aug  1 20:27:20 2009
@@ -78,7 +78,7 @@
         self._make_virtual(virtualbox, vinfo, fieldboxes)
 
     def make_varray(self, virtualbox, arraydescr, itemboxes):
-        vinfo = VArrayInfo(arraydescr, len(itemboxes))
+        vinfo = VArrayInfo(arraydescr)
         self._make_virtual(virtualbox, vinfo, itemboxes)
 
     def _make_virtual(self, virtualbox, vinfo, fieldboxes):
@@ -167,18 +167,18 @@
                                              descr=self.typedescr)
 
 class VArrayInfo(AbstractVirtualInfo):
-    def __init__(self, arraydescr, length):
+    def __init__(self, arraydescr):
         self.arraydescr = arraydescr
-        self.length = length
         #self.fieldnums = ...
 
     def allocate(self, metainterp):
+        length = len(self.fieldnums)
         return metainterp.execute_and_record(rop.NEW_ARRAY,
-                                             [ConstInt(self.length)],
+                                             [ConstInt(length)],
                                              descr=self.arraydescr)
 
     def setfields(self, metainterp, box, fn_decode_box):
-        for i in range(self.length):
+        for i in range(len(self.fieldnums)):
             itembox = fn_decode_box(self.fieldnums[i])
             metainterp.execute_and_record(rop.SETARRAYITEM_GC,
                                           [box, ConstInt(i), itembox],



More information about the Pypy-commit mailing list