Commits

Armin Rigo committed 7a765de

Untested JIT support.

Comments (0)

Files changed (2)

pypy/config/translationoption.py

                default=False, cmdline="--tealet",
                requires=[("translation.type_system", "lltype"),
                          ("translation.gctransformer", "framework"),
-                         ("translation.gcrootfinder", "shadowstack"),
-                         ("translation.thread", False)]),    # XXX temporary
+                         ("translation.gcrootfinder", "shadowstack")]),
     ChoiceOption("type_system", "Type system to use when RTyping",
                  ["lltype", "ootype"], cmdline=None, default="lltype",
                  requires={

pypy/rpython/memory/gctransform/framework.py

             # for regular translation: pick the GC from the config
             GCClass, GC_PARAMS = choose_gc_from_config(translator.config)
 
-        self.root_stack_jit_hook = None
         if hasattr(translator, '_jit2gc'):
             self.layoutbuilder = translator._jit2gc['layoutbuilder']
-            try:
-                self.root_stack_jit_hook = translator._jit2gc['rootstackhook']
-            except KeyError:
-                pass
         else:
             self.layoutbuilder = TransformerLayoutBuilder(translator, GCClass)
         self.layoutbuilder.transformer = self
             return top
         self.decr_stack = decr_stack
 
-        self.rootstackhook = gctransformer.root_stack_jit_hook
-        if self.rootstackhook is None:
+        self.jit2gc = getattr(gctransformer.translator, '_jit2gc', {})
+        try:
+            self.rootstackhook = self.jit2gc['rootstackhook']
+        except KeyError:
             def collect_stack_root(callback, gc, addr):
                 if gc.points_to_valid_gc_object(addr):
                     callback(gc, addr)
             self.collect_stacks_from_other_threads(collect_stack_root)
 
     def need_tealet_support(self, gctransformer, getfn):
-        assert not gctransformer.translator.config.translation.jit, (
-            "XXX in-progress: tealet + jit + shadowstack")
-        assert not gctransformer.translator.config.translation.thread, (
-            "XXX check me: tealet + thread + shadowstack")
-        #
         GCPTR_ARRAY  = lltype.Ptr(lltype.GcArray(llmemory.GCREF))
         SIGNED_ARRAY = lltype.Ptr(lltype.GcArray(lltype.Signed))
         WALKER_PTR   = lltype.Ptr(lltype.Struct('walker',
                            ('gcptr_array', GCPTR_ARRAY),
                            ('signed_array', SIGNED_ARRAY)))
         gcdata = self.gcdata
+        jit_save_stack_roots = self.jit2gc.get('savestackhook')
+        jit_restore_stack_roots = self.jit2gc.get('restorestackhook')
         #
         def ll_save_stack_roots(walker):
+            if jit_save_stack_roots is not None:
+                jit_save_stack_roots(walker, gcdata)
+                return
             addr = gcdata.root_stack_base
             end = gcdata.root_stack_top
             count = (end - addr) // sizeofaddr
                 n += 1
         #
         def ll_restore_stack_roots(walker):
+            if jit_restore_stack_roots is not None:
+                jit_restore_stack_roots(walker, gcdata)
+                return
             array = walker.gcptr_array
             addr = gcdata.root_stack_base
             gcdata.root_stack_top = addr + len(array) * sizeofaddr
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.