def __init__(self, metainterp_sd, jitdriver_sd, optimizations=None): self.metainterp_sd = metainterp_sd self.jitdriver_sd = jitdriver_sd self.cpu = metainterp_sd.cpu self.resumedata_memo = resume.ResumeDataLoopMemo(metainterp_sd) self.pendingfields = None # set temporarily to a list, normally by # heap.py, as we're about to generate a guard self.quasi_immutable_deps = None self.replaces_guard = {} self._newoperations = [] self._emittedoperations = {} self.optimizer = self self.optpure = None self.optheap = None self.optrewrite = None self.optearlyforce = None self.optunroll = None self._really_emitted_operation = None self._last_guard_op = None self.can_replace_guards = True self.set_optimizations(optimizations) self.setup()
def __init__(self, metainterp_sd, jitdriver_sd, loop, optimizations=None): self.metainterp_sd = metainterp_sd self.jitdriver_sd = jitdriver_sd self.cpu = metainterp_sd.cpu self.loop = loop self.values = {} self.interned_refs = self.cpu.ts.new_ref_dict() self.interned_ints = {} self.resumedata_memo = resume.ResumeDataLoopMemo(metainterp_sd) self.bool_boxes = {} self.producer = {} self.pendingfields = None # set temporarily to a list, normally by # heap.py, as we're about to generate a guard self.quasi_immutable_deps = None self.opaque_pointers = {} self.replaces_guard = {} self._newoperations = [] self.optimizer = self self.optpure = None self.optheap = None self.optearlyforce = None # the following two fields is the data kept for unrolling, # those are the operations that can go to the short_preamble if loop is not None: self.call_pure_results = loop.call_pure_results self.set_optimizations(optimizations) self.setup()