예제 #1
0
파일: transform.py 프로젝트: yuyichao/pypy
 def inline_helpers(self, graph):
     if not self.prepared:
         raise Exception("Need to call prepare_inline_helpers first")
     if self.inline:
         raise_analyzer = RaiseAnalyzer(self.translator)
         to_enum = self.graph_dependencies.get(graph, self.graphs_to_inline)
         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)
예제 #2
0
파일: transform.py 프로젝트: mozillazg/pypy
 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)
예제 #3
0
파일: transform.py 프로젝트: Qointum/pypy
 def inline_helpers(self, graph):
     if not self.prepared:
         raise Exception("Need to call prepare_inline_helpers first")
     if self.inline:
         raise_analyzer = RaiseAnalyzer(self.translator)
         to_enum = self.graph_dependencies.get(graph, self.graphs_to_inline)
         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)
예제 #4
0
파일: transform.py 프로젝트: soIu/rpython
 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
예제 #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)