[pypy-commit] pypy asmmemmgr-for-code-only: Test fix, comments

arigo pypy.commits at gmail.com
Wed Aug 17 12:01:13 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: asmmemmgr-for-code-only
Changeset: r86252:b8f4377bbbb5
Date: 2016-08-17 18:00 +0200
http://bitbucket.org/pypy/pypy/changeset/b8f4377bbbb5/

Log:	Test fix, comments

diff --git a/rpython/jit/backend/llsupport/assembler.py b/rpython/jit/backend/llsupport/assembler.py
--- a/rpython/jit/backend/llsupport/assembler.py
+++ b/rpython/jit/backend/llsupport/assembler.py
@@ -178,6 +178,14 @@
         return clt.asmmemmgr_gcreftracers
 
     def malloc_aligned(self, size, alignment=WORD):
+        """Return a pointer (as an integer) to a malloc()ed piece of
+        data of the given size, with the given alignment (a power of
+        two).  An entry is added to self.allblocks, which should be
+        get_asmmemmgr_blocks(looptoken), so the memory is free()d when
+        the looptoken is freed.  Should be suitable for very small
+        allocations, e.g. two or three WORDs, because the management
+        data saved is only one WORD.
+        """
         p1 = lltype.malloc(rffi.CCHARP.TO, size, flavor='raw',
                            track_allocation=False)
         s1 = s2 = rffi.cast(lltype.Signed, p1)
diff --git a/rpython/jit/backend/model.py b/rpython/jit/backend/model.py
--- a/rpython/jit/backend/model.py
+++ b/rpython/jit/backend/model.py
@@ -290,8 +290,8 @@
     # asmmemmgr_blocks is a list of integers with the following structure:
     #  - a pointer, which is an even number
     #  - optionally an end-pointer minus 1, which is an odd number
-    # If a pointer is followed by a size, together they describe the
-    # start and stop of a piece of code.  In the other case, it is
+    # If a pointer is followed by an end-pointer, together they describe
+    # the start and stop of a piece of code.  In the other case, it is
     # simply a piece of data that must be free()d.
 
     def __init__(self, cpu, number):
diff --git a/rpython/jit/backend/x86/test/test_assembler.py b/rpython/jit/backend/x86/test/test_assembler.py
--- a/rpython/jit/backend/x86/test/test_assembler.py
+++ b/rpython/jit/backend/x86/test/test_assembler.py
@@ -57,7 +57,7 @@
         self.xrm = X86XMMRegisterManager(None, assembler=asm)
         callback(asm)
         asm.mc.RET()
-        rawstart = asm.materialize_loop(looptoken)
+        rawstart = asm.materialize_loop()
         #
         F = ctypes.CFUNCTYPE(ctypes.c_long)
         fn = ctypes.cast(rawstart, F)


More information about the pypy-commit mailing list