Hakan Ardo avatar Hakan Ardo committed 354177e

cleanups

Comments (0)

Files changed (4)

pypy/jit/metainterp/compile.py

         return res
 
 class ResumeAtPositionDescr(ResumeGuardDescr):
-    #def __init__(self, position):
-    #    self.position = position
-        
     def _clone_if_mutable(self):
         res = ResumeAtPositionDescr()
         self.copy_all_attrbutes_into(res)
         return res
 
-    def not_handle_fail(self, metainterp_sd, jitdriver_sd):
-        if True or self.must_compile(metainterp_sd, jitdriver_sd):
-            return self._trace_and_compile_from_bridge(metainterp_sd,
-                                                       jitdriver_sd)
-        else:
-            raise NotImplementedError
-            # FIXME: patch blackhole._prepare_resume_from_failure(self, opnum)
-            from pypy.jit.metainterp.blackhole import resume_in_blackhole
-            resume_in_blackhole(metainterp_sd, jitdriver_sd, self)
-            assert 0, "unreachable"
-
 class ResumeGuardForcedDescr(ResumeGuardDescr):
 
     def __init__(self, metainterp_sd, jitdriver_sd):
         # know exactly what we must do (ResumeGuardDescr/ResumeFromInterpDescr)
         prepare_last_operation(new_loop, target_loop_token)
         resumekey.compile_and_attach(metainterp, new_loop)
-        #compile_known_target_bridges(metainterp, new_loop)
         record_loop_or_bridge(metainterp_sd, new_loop)
     return target_loop_token
 
-# For backends that not supports emitting guards with preset jump
-# targets, emit mini-bridges containing the jump
-def compile_known_target_bridges(metainterp, bridge):
-    for op in bridge.operations:
-        if op.is_guard():
-            target = op.getjumptarget()
-            if target:
-                mini = create_empty_loop(metainterp, 'fallback')
-                mini.inputargs = op.getfailargs()[:]
-                jmp = ResOperation(rop.JUMP, mini.inputargs[:], None, target)
-                mini.operations = [jmp]
-                descr = op.getdescr()
-                assert isinstance(descr, ResumeGuardDescr)
-                mini.token = bridge.token
-                
-                #descr.compile_and_attach(metainterp, mini)
-                if not we_are_translated():
-                    descr._debug_suboperations = mini.operations
-                send_bridge_to_backend(metainterp.staticdata, descr,
-                                       mini.inputargs, mini.operations,
-                                       bridge.token)
-                record_loop_or_bridge(metainterp.staticdata, mini)
-
-
 def prepare_last_operation(new_loop, target_loop_token):
     op = new_loop.operations[-1]
     if not isinstance(target_loop_token, TerminatingLoopToken):

pypy/jit/metainterp/optimizeopt/optimizer.py

         self.newoperations.append(op)
 
     def store_final_boxes_in_guard(self, op):
-        ###pendingfields = self.heap_op_optimizer.force_lazy_setfields_for_guard()
-        if op.getjumptarget():
-            return op
         descr = op.getdescr()
         assert isinstance(descr, compile.ResumeGuardDescr)
         modifier = resume.ResumeDataVirtualAdder(descr, self.resumedata_memo)
         newboxes = modifier.finish(self.values, self.pendingfields)
-        descr.start_indexes = [...]
+        #descr.start_indexes = [self.getvalue(b).start_index for b in op.getfailargs()]
         if len(newboxes) > self.metainterp_sd.options.failargs_limit: # XXX be careful here
             compile.giveup()
         descr.store_final_boxes(op, newboxes)

pypy/jit/metainterp/optimizeopt/unroll.py

                     op = short[i]
                     if op.is_guard():
                         op = op.clone()
-                        #op.setfailargs(loop.preamble.inputargs)
-                        #op.setjumptarget(loop.preamble.token)
                         op.setfailargs(None)
                         op.setdescr(start_resumedescr.clone_if_mutable())
                         short[i] = op

pypy/jit/metainterp/resoperation.py

 class GuardResOp(ResOpWithDescr):
 
     _fail_args = None
-    _jump_target = None
 
     def getfailargs(self):
         return self._fail_args
     def setfailargs(self, fail_args):
         self._fail_args = fail_args
 
-    def getjumptarget(self):
-        return self._jump_target
-
-    def setjumptarget(self, jump_target):
-        self._jump_target = jump_target
-
     def copy_and_change(self, opnum, args=None, result=None, descr=None):
         newop = AbstractResOp.copy_and_change(self, opnum, args, result, descr)
         newop.setfailargs(self.getfailargs())
-        newop.setjumptarget(self.getjumptarget())
         return newop
 
     def clone(self):
         newop = AbstractResOp.clone(self)
         newop.setfailargs(self.getfailargs())
-        newop.setjumptarget(self.getjumptarget())        
         return newop
 
 
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.