[pypy-svn] r75621 - in pypy/trunk/pypy: rlib/rsre/test translator/c/gcc translator/c/src

agaynor at codespeak.net agaynor at codespeak.net
Sat Jun 26 01:28:07 CEST 2010


Author: agaynor
Date: Sat Jun 26 01:28:05 2010
New Revision: 75621

Modified:
   pypy/trunk/pypy/rlib/rsre/test/targetrsre.py
   pypy/trunk/pypy/translator/c/gcc/instruction.py
   pypy/trunk/pypy/translator/c/gcc/trackgcroot.py
   pypy/trunk/pypy/translator/c/src/mem.h
Log:
Add a shebang to targetrsre for convenience.

Modified: pypy/trunk/pypy/rlib/rsre/test/targetrsre.py
==============================================================================
--- pypy/trunk/pypy/rlib/rsre/test/targetrsre.py	(original)
+++ pypy/trunk/pypy/rlib/rsre/test/targetrsre.py	Sat Jun 26 01:28:05 2010
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 from pypy.rlib.rarithmetic import intmask
 from pypy.rlib.rsre import rsre
 import os, time

Modified: pypy/trunk/pypy/translator/c/gcc/instruction.py
==============================================================================
--- pypy/trunk/pypy/translator/c/gcc/instruction.py	(original)
+++ pypy/trunk/pypy/translator/c/gcc/instruction.py	Sat Jun 26 01:28:05 2010
@@ -1,3 +1,5 @@
+import sys
+
 LOC_REG       = 0
 LOC_ESP_PLUS  = 1
 LOC_EBP_PLUS  = 2

Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py
==============================================================================
--- pypy/trunk/pypy/translator/c/gcc/trackgcroot.py	(original)
+++ pypy/trunk/pypy/translator/c/gcc/trackgcroot.py	Sat Jun 26 01:28:05 2010
@@ -17,6 +17,7 @@
 
 class FunctionGcRootTracker(object):
     skip = 0
+    COMMENT = "([#;].*)?"
 
     @classmethod
     def init_regexp(cls):
@@ -25,10 +26,10 @@
         cls.r_globllabel    = re.compile(cls.LABEL+r"=[.][+]%d\s*$"%cls.OFFSET_LABELS)
 
         cls.r_insn          = re.compile(r"\t([a-z]\w*)\s")
-        cls.r_unaryinsn     = re.compile(r"\t[a-z]\w*\s+("+cls.OPERAND+")\s*$")
+        cls.r_unaryinsn     = re.compile(r"\t[a-z]\w*\s+("+cls.OPERAND+")\s*" + cls.COMMENT + "$")
         cls.r_binaryinsn    = re.compile(r"\t[a-z]\w*\s+(?P<source>"+cls.OPERAND+"),\s*(?P<target>"+cls.OPERAND+")\s*$")
 
-        cls.r_jump          = re.compile(r"\tj\w+\s+"+cls.LABEL+"\s*$")
+        cls.r_jump          = re.compile(r"\tj\w+\s+"+cls.LABEL+"\s*" + cls.COMMENT + "$")
         cls.r_jmp_switch    = re.compile(r"\tjmp\t[*]"+cls.LABEL+"[(]")
         cls.r_jmp_source    = re.compile(r"\d*[(](%[\w]+)[,)]")
 
@@ -616,6 +617,9 @@
             # tail-calls are equivalent to RET for us
             return InsnRet(self.CALLEE_SAVE_REGISTERS)
         return InsnStop()
+    
+    def visit_jmpl(self, *args, **kwargs):
+        return self.visit_jmp(*args, **kwargs)
 
     def register_jump_to(self, label):
         if not isinstance(self.insns[-1], InsnStop):

Modified: pypy/trunk/pypy/translator/c/src/mem.h
==============================================================================
--- pypy/trunk/pypy/translator/c/src/mem.h	(original)
+++ pypy/trunk/pypy/translator/c/src/mem.h	Sat Jun 26 01:28:05 2010
@@ -29,7 +29,7 @@
    dependency that we want. */
 
 #define pypy_asm_gcroot(p) ({void*_r; \
-               asm ("/* GCROOT %0 */" : "=g" (_r) : \
+               asm ("/* GCROOT %0 */" : "=r" (_r) : \
                     "0" (p), "m" (__gcnoreorderhack)); \
                _r; })
 



More information about the Pypy-commit mailing list