[pypy-svn] r69188 - pypy/branch/jit-log-class-func/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Wed Nov 11 18:08:29 CET 2009


Author: arigo
Date: Wed Nov 11 18:08:28 2009
New Revision: 69188

Modified:
   pypy/branch/jit-log-class-func/pypy/jit/metainterp/codewriter.py
   pypy/branch/jit-log-class-func/pypy/jit/metainterp/pyjitpl.py
Log:
Fix an issue that shows up translating pypy-c-jit.
This would be tested by a recursive "z" test, which we
don't have (and don't really want) any more...


Modified: pypy/branch/jit-log-class-func/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/jit-log-class-func/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/branch/jit-log-class-func/pypy/jit/metainterp/codewriter.py	Wed Nov 11 18:08:28 2009
@@ -175,7 +175,8 @@
 
         self.metainterp_sd.info_from_codewriter(portal_code, leave_code,
                                                 self.class_sizes,
-                                                self.list_of_addr2name)
+                                                self.list_of_addr2name,
+                                                portal_runner_ptr)
 
     def _start(self, metainterp_sd, portal_runner_ptr):
         self.metainterp_sd = metainterp_sd
@@ -347,10 +348,14 @@
 
     def register_known_function(self, func):
         if self.rtyper.type_system.name == 'lltypesystem':
-            if func._obj not in self._functions_addr_seen:
-                self._functions_addr_seen[func._obj] = True
+            try:
+                obj = func._obj
+            except lltype.DelayedPointer:   # probably ll_portal_runner
+                return
+            if obj not in self._functions_addr_seen:
+                self._functions_addr_seen[obj] = True
                 func_addr = llmemory.cast_ptr_to_adr(func)
-                self.list_of_addr2name.append((func_addr, func._obj._name))
+                self.list_of_addr2name.append((func_addr, obj._name))
 
 
 class BytecodeMaker(object):

Modified: pypy/branch/jit-log-class-func/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/jit-log-class-func/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/jit-log-class-func/pypy/jit/metainterp/pyjitpl.py	Wed Nov 11 18:08:28 2009
@@ -1030,12 +1030,13 @@
         return True
 
     def info_from_codewriter(self, portal_code, leave_code, class_sizes,
-                             list_of_addr2name=[]):
+                             list_of_addr2name, portal_runner_ptr):
         self.portal_code = portal_code
         self.leave_code = leave_code
         self._class_sizes = class_sizes
         self._addr2name_keys   = [key   for key, value in list_of_addr2name]
         self._addr2name_values = [value for key, value in list_of_addr2name]
+        self._portal_runner_ptr = portal_runner_ptr
 
     def finish_setup(self, optimizer=None):
         warmrunnerdesc = self.warmrunnerdesc
@@ -1076,7 +1077,8 @@
                 # Build the dictionary at run-time.  This is needed
                 # because the keys are function/class addresses, so they
                 # can change from run to run.
-                d = {}
+                k = llmemory.cast_ptr_to_adr(self._portal_runner_ptr)
+                d = {k: 'recursive call'}
                 keys = self._addr2name_keys
                 values = self._addr2name_values
                 for i in range(len(keys)):



More information about the Pypy-commit mailing list