Example #1
0
 def prepare_inline_helpers(self, graphs):
     from rpython.translator.backendopt.inline import iter_callsites
     for graph in graphs:
         self.graph_dependencies[graph] = {}
         for called, block, i in iter_callsites(graph, None):
             if called in self.graphs_to_inline:
                 self.graph_dependencies[graph][called] = True
     self.prepared = True
Example #2
0
 def prepare_inline_helpers(self, graphs):
     from rpython.translator.backendopt.inline import iter_callsites
     for graph in graphs:
         self.graph_dependencies[graph] = {}
         for called, block, i in iter_callsites(graph, None):
             if called in self.graphs_to_inline:
                 self.graph_dependencies[graph][called] = True
     self.prepared = True
Example #3
0
 def inline_helpers(self, graphs):
     from rpython.translator.backendopt.inline import iter_callsites
     raise_analyzer = RaiseAnalyzer(self.translator)
     for graph in graphs:
         to_enum = []
         for called, block, i in iter_callsites(graph, None):
             if called in self.graphs_to_inline:
                 to_enum.append(called)
         must_constfold = False
         for inline_graph in to_enum:
             try:
                 inline.inline_function(self.translator, inline_graph, graph,
                                        self.lltype_to_classdef,
                                        raise_analyzer,
                                        cleanup=False)
                 must_constfold = True
             except inline.CannotInline as e:
                 print 'CANNOT INLINE:', e
                 print '\t%s into %s' % (inline_graph, graph)
         cleanup_graph(graph)
         if must_constfold:
             constant_fold_graph(graph)
Example #4
0
 def inline_helpers_into(self, graph):
     from rpython.translator.backendopt.inline import iter_callsites
     to_enum = []
     for called, block, i in iter_callsites(graph, None):
         if called in self.graphs_to_inline:
             to_enum.append(called)
     any_inlining = False
     for inline_graph in to_enum:
         try:
             inline.inline_function(self.translator, inline_graph, graph,
                                    self.lltype_to_classdef,
                                    self.raise_analyzer,
                                    cleanup=False)
             any_inlining = True
         except inline.CannotInline as e:
             print 'CANNOT INLINE:', e
             print '\t%s into %s' % (inline_graph, graph)
             raise      # for now, make it a fatal error
     cleanup_graph(graph)
     if any_inlining:
         constant_fold_graph(graph)
     return any_inlining
Example #5
0
 def inline_helpers(self, graphs):
     from rpython.translator.backendopt.inline import iter_callsites
     raise_analyzer = RaiseAnalyzer(self.translator)
     for graph in graphs:
         to_enum = []
         for called, block, i in iter_callsites(graph, None):
             if called in self.graphs_to_inline:
                 to_enum.append(called)
         must_constfold = False
         for inline_graph in to_enum:
             try:
                 inline.inline_function(self.translator,
                                        inline_graph,
                                        graph,
                                        self.lltype_to_classdef,
                                        raise_analyzer,
                                        cleanup=False)
                 must_constfold = True
             except inline.CannotInline, e:
                 print 'CANNOT INLINE:', e
                 print '\t%s into %s' % (inline_graph, graph)
         cleanup_graph(graph)
         if must_constfold:
             constant_fold_graph(graph)