[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-svn
Subject:    [pypy-svn] r66067 - pypy/branch/pyjitpl5/pypy/translator/c
From:       arigo () codespeak ! net
Date:       2009-06-30 14:39:24
Message-ID: 20090630143924.75914169E38 () codespeak ! net
[Download RAW message or body]

Author: arigo
Date: Tue Jun 30 16:39:24 2009
New Revision: 66067

Added:
   pypy/branch/pyjitpl5/pypy/translator/c/genc.py.merge.tmp
      - copied, changed from r66039, pypy/branch/pyjitpl5/pypy/translator/c/genc.py
Log:
merging of svn+ssh://codespeak.net/svn/pypy/trunk/pypy/translator/c/genc.py
revisions 62865 to 66039:

    ------------------------------------------------------------------------
    r66015 | fijal | 2009-06-28 20:38:02 +0200 (Sun, 28 Jun 2009) | 2 lines
    
    A minor hack that lets you compile a library using C backend
    
    ------------------------------------------------------------------------
    r64241 | pedronis | 2009-04-17 12:22:50 +0200 (Fri, 17 Apr 2009) | 1 line
    
    deal with the last llvm references
    ------------------------------------------------------------------------
    r63923 | getxsick | 2009-04-10 02:09:27 +0200 (Fri, 10 Apr 2009) | 1 line
    
    remove unused function and unnecessary import
    ------------------------------------------------------------------------
    r63039 | pedronis | 2009-03-18 16:34:25 +0100 (Wed, 18 Mar 2009) | 7 lines
    
    (iko, pedronis)
    
    fix the failure in test_ll_thread.py:TestUsingBoehm().test_gc_locking
    
    our "thread.h" needs to be included after gc.h and its controlling defines
    
    
    ------------------------------------------------------------------------
    r62988 | fijal | 2009-03-17 10:23:57 +0100 (Tue, 17 Mar 2009) | 3 lines
    
    (arigo, fijal)
    Fix the segfault by keeping alive the whole ModuleWithCleanup by Wrapper
    
    ------------------------------------------------------------------------


Copied: pypy/branch/pyjitpl5/pypy/translator/c/genc.py.merge.tmp (from r66039, \
pypy/branch/pyjitpl5/pypy/translator/c/genc.py) \
                ==============================================================================
                
--- pypy/branch/pyjitpl5/pypy/translator/c/genc.py	(original)
+++ pypy/branch/pyjitpl5/pypy/translator/c/genc.py.merge.tmp	Tue Jun 30 16:39:24 2009
@@ -7,7 +7,6 @@
 from pypy.translator.llsupport.wrapper import new_wrapper
 from pypy.translator.gensupp import uniquemodulename, NameManager
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.translator.tool.cbuild import check_under_under_thread
 from pypy.rpython.lltypesystem import lltype
 from pypy.tool.udir import udir
 from pypy.tool import isolate
@@ -106,7 +105,7 @@
     def __init__(self, translator, entrypoint, config, gcpolicy=None):
         self.translator = translator
         self.entrypoint = entrypoint
-        self.entrypoint_name = self.entrypoint.func_name
+        self.entrypoint_name = getattr(self.entrypoint, 'func_name', None)
         self.originalentrypoint = entrypoint
         self.config = config
         self.gcpolicy = gcpolicy    # for tests only, e.g. rpython/memory/
@@ -157,8 +156,13 @@
 
         # build entrypoint and eventually other things to expose
         pf = self.getentrypointptr()
-        pfname = db.get(pf)
-        self.c_entrypoint_name = pfname
+        if isinstance(pf, list):
+            for one_pf in pf:
+                db.get(one_pf)
+            self.c_entrypoint_name = None
+        else:
+            pfname = db.get(pf)
+            self.c_entrypoint_name = pfname
         db.complete()
 
         self.collect_compilation_info(db)
@@ -180,9 +184,7 @@
     def get_gcpolicyclass(self):
         if self.gcpolicy is None:
             name = self.config.translation.gctransformer
-            if self.config.translation.gcrootfinder == "llvmgc":
-                name = "%s+llvmgcroot" % (name,)
-            elif self.config.translation.gcrootfinder == "asmgcc":
+            if self.config.translation.gcrootfinder == "asmgcc":
                 name = "%s+asmgcroot" % (name,)
             return gc.name_to_gcpolicy[name]
         return self.gcpolicy
@@ -212,7 +214,6 @@
         if db is None:
             db = self.build_database()
         pf = self.getentrypointptr()
-        pfname = db.get(pf)
         if self.modulename is None:
             self.modulename = uniquemodulename('testing')
         modulename = self.modulename
@@ -232,6 +233,7 @@
                                                 self.eci,
                                                 defines = defines)
         else:
+            pfname = db.get(pf)
             if self.config.translation.instrument:
                 defines['INSTRUMENT'] = 1
             if CBuilder.have___thread:
@@ -265,12 +267,13 @@
     def __getattr__(self, name):
         mod = self.__dict__['mod']
         obj = getattr(mod, name)
+        parentself = self
         if callable(obj) and getattr(obj, '__module__', None) == mod.__name__:
             # The module must be kept alive with the function.
             # This wrapper avoids creating a cycle.
             class Wrapper:
                 def __init__(self, obj):
-                    self.mod = mod
+                    self.myself = parentself
                     self.func = obj
                 def __call__(self, *args, **kwargs):
                     return self.func(*args, **kwargs)
@@ -780,9 +783,9 @@
 
     print >> fi, '#define Py_BUILD_CORE  /* for Windows: avoid pulling libs in */'
     print >> fi, '#include "pyconfig.h"'
-    print >> fi, '#include "src/g_prerequisite.h"'
 
     eci.write_c_header(fi)
+    print >> fi, '#include "src/g_prerequisite.h"'
 
     fi.close()
 
@@ -832,9 +835,9 @@
         print >> fi, '#define %s %s' % (key, value)
 
     print >> fi, '#include "pyconfig.h"'
-    print >> fi, '#include "src/g_prerequisite.h"'
 
     eci.write_c_header(fi)
+    print >> fi, '#include "src/g_prerequisite.h"'
 
     fi.close()
 
_______________________________________________
pypy-svn mailing list
pypy-svn@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic