[pypy-commit] pypy llvm-translation-backend: Kill get_gc_field_values() methods of various GCPolicy subclasses.

mjacob pypy.commits at gmail.com
Sun Feb 28 09:24:46 EST 2016


Author: Manuel Jacob <me at manueljacob.de>
Branch: llvm-translation-backend
Changeset: r82599:2486e9444a13
Date: 2016-02-28 13:54 +0100
http://bitbucket.org/pypy/pypy/changeset/2486e9444a13/

Log:	Kill get_gc_field_values() methods of various GCPolicy subclasses.

diff --git a/rpython/translator/llvm/genllvm.py b/rpython/translator/llvm/genllvm.py
--- a/rpython/translator/llvm/genllvm.py
+++ b/rpython/translator/llvm/genllvm.py
@@ -511,7 +511,8 @@
         if self.is_zero(value):
             return 'zeroinitializer'
         if self.needs_gc_header:
-            data = database.genllvm.gcpolicy.get_gc_field_values(value)
+            gctransformer = database.genllvm.gcpolicy.gctransformer
+            data = [gctransformer.gcheader_initdata(value)]
             data.extend(getattr(value, fn) for _, fn in self.fields[1:])
         else:
             data = [getattr(value, fn) for _, fn in self.fields]
@@ -1684,12 +1685,6 @@
     def get_setup_ptr(self):
         return self.gctransformer.frameworkgc_setup_ptr.value
 
-    def get_gc_field_values(self, obj):
-        obj = lltype.top_container(obj)
-        needs_hash = self.gctransformer.get_prebuilt_hash(obj) is not None
-        hdr = self.gctransformer.gc_header_for(obj, needs_hash)
-        return [hdr._obj]
-
 
 class RefcountGCPolicy(GCPolicy):
     class RttiType(FuncType):
@@ -1707,10 +1702,6 @@
         GCPolicy.__init__(self, genllvm)
         self.gctransformer = RefcountingGCTransformer(genllvm.translator)
 
-    def get_gc_field_values(self, obj):
-        obj = lltype.top_container(obj)
-        return [self.gctransformer.gcheaderbuilder.header_of_object(obj)._obj]
-
 
 def extfunc(name, args, result, compilation_info):
     func_type = lltype.FuncType(args, result)


More information about the pypy-commit mailing list