Example #1
0
    def build_guard_token(self,
                          op,
                          frame_depth,
                          arglocs,
                          offset,
                          fcond,
                          extra_offset=-1,
                          extra_cond=-1):
        descr = op.getdescr()
        assert isinstance(descr, AbstractFailDescr)

        gcmap = allocate_gcmap(self, frame_depth, JITFRAME_FIXED_SIZE)
        faildescrindex = self.get_gcref_from_faildescr(descr)
        token = GuardToken(self.cpu,
                           gcmap,
                           descr,
                           failargs=op.getfailargs(),
                           fail_locs=arglocs,
                           guard_opnum=op.getopnum(),
                           frame_depth=frame_depth,
                           faildescrindex=faildescrindex)
        token.fcond = fcond
        token.extra_offset = extra_offset
        token.extra_cond = extra_cond
        return token
Example #2
0
    def build_guard_token(
        self,
        op,
        frame_depth,
        arglocs,
        offset,
        fcond,
        save_exc,
        is_guard_not_invalidated=False,
        is_guard_not_forced=False,
    ):
        assert isinstance(save_exc, bool)
        assert isinstance(fcond, int)
        descr = op.getdescr()
        assert isinstance(descr, AbstractFailDescr)

        gcmap = allocate_gcmap(self, frame_depth, JITFRAME_FIXED_SIZE)
        token = ArmGuardToken(
            self.cpu,
            gcmap,
            descr,
            failargs=op.getfailargs(),
            fail_locs=arglocs,
            offset=offset,
            exc=save_exc,
            frame_depth=frame_depth,
            is_guard_not_invalidated=is_guard_not_invalidated,
            is_guard_not_forced=is_guard_not_forced,
            fcond=fcond,
        )
        return token
Example #3
0
 def build_guard_token(self, op, frame_depth, arglocs, fcond):
     descr = op.getdescr()
     gcmap = allocate_gcmap(self, frame_depth, r.JITFRAME_FIXED_SIZE)
     faildescrindex = self.get_gcref_from_faildescr(descr)
     token = ZARCHGuardToken(self.cpu, gcmap, descr, op.getfailargs(),
                           arglocs, op.getopnum(), frame_depth,
                           faildescrindex, fcond)
     #token._pool_offset = self.pool.get_descr_offset(descr)
     return token
Example #4
0
 def build_guard_token(self, op, frame_depth, arglocs, fcond):
     descr = op.getdescr()
     gcmap = allocate_gcmap(self, frame_depth, r.JITFRAME_FIXED_SIZE)
     faildescrindex = self.get_gcref_from_faildescr(descr)
     token = ZARCHGuardToken(self.cpu,
                             gcmap, descr, op.getfailargs(), arglocs,
                             op.getopnum(), frame_depth, faildescrindex,
                             fcond)
     #token._pool_offset = self.pool.get_descr_offset(descr)
     return token
Example #5
0
 def get_gcmap(self, forbidden_regs=[], noregs=False):
     frame_depth = self.fm.get_frame_depth()
     gcmap = allocate_gcmap(self.assembler, frame_depth,
                            JITFRAME_FIXED_SIZE)
     for box, loc in self.rm.reg_bindings.iteritems():
         if loc in forbidden_regs:
             continue
         if box.type == REF and self.rm.is_still_alive(box):
             assert not noregs
             assert loc.is_core_reg()
             val = loc.value
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     for box, loc in self.fm.bindings.iteritems():
         if box.type == REF and self.rm.is_still_alive(box):
             assert loc.is_stack()
             val = loc.position + JITFRAME_FIXED_SIZE
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     return gcmap
Example #6
0
 def get_gcmap(self, forbidden_regs=[], noregs=False):
     frame_depth = self.fm.get_frame_depth()
     gcmap = allocate_gcmap(self.assembler,
                     frame_depth, JITFRAME_FIXED_SIZE)
     for box, loc in self.rm.reg_bindings.iteritems():
         if loc in forbidden_regs:
             continue
         if box.type == REF and self.rm.is_still_alive(box):
             assert not noregs
             assert loc.is_core_reg()
             val = loc.value
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     for box, loc in self.fm.bindings.iteritems():
         if box.type == REF and self.rm.is_still_alive(box):
             assert loc.is_stack()
             val = loc.position + JITFRAME_FIXED_SIZE
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     return gcmap
Example #7
0
 def get_gcmap(self, forbidden_regs=[], noregs=False):
     frame_depth = self.fm.get_frame_depth()
     gcmap = allocate_gcmap(self.assembler, frame_depth,
                            r.JITFRAME_FIXED_SIZE)
     for box, loc in self.rm.reg_bindings.iteritems():
         if loc in forbidden_regs:
             continue
         if box.type == REF and self.rm.is_still_alive(box):
             assert not noregs
             assert loc.is_reg()
             val = self.assembler.cpu.all_reg_indexes[loc.value]
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     for box, loc in self.fm.bindings.iteritems():
         if box.type == REF and self.rm.is_still_alive(box):
             assert isinstance(loc, locations.StackLocation)
             val = loc.get_position() + r.JITFRAME_FIXED_SIZE
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     return gcmap
Example #8
0
 def get_gcmap(self, forbidden_regs=[], noregs=False):
     frame_depth = self.fm.get_frame_depth()
     gcmap = allocate_gcmap(self.assembler, frame_depth,
                            r.JITFRAME_FIXED_SIZE)
     for box, loc in self.rm.reg_bindings.iteritems():
         if loc in forbidden_regs:
             continue
         if box.type == REF and self.rm.is_still_alive(box):
             assert not noregs
             assert loc.is_reg()
             val = self.assembler.cpu.all_reg_indexes[loc.value]
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     for box, loc in self.fm.bindings.iteritems():
         if box.type == REF and self.rm.is_still_alive(box):
             assert isinstance(loc, locations.StackLocation)
             val = loc.get_position() + r.JITFRAME_FIXED_SIZE
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     return gcmap
Example #9
0
    def build_guard_token(self, op, frame_depth, arglocs, offset, fcond):
        assert isinstance(fcond, int)
        descr = op.getdescr()
        assert isinstance(descr, AbstractFailDescr)

        gcmap = allocate_gcmap(self, frame_depth, JITFRAME_FIXED_SIZE)
        token = ArmGuardToken(
            self.cpu,
            gcmap,
            descr,
            failargs=op.getfailargs(),
            fail_locs=arglocs,
            offset=offset,
            guard_opnum=op.getopnum(),
            frame_depth=frame_depth,
            fcond=fcond,
        )
        return token
Example #10
0
 def get_gcmap(self, forbidden_regs=[], noregs=False):
     frame_depth = self.fm.get_frame_depth()
     gcmap = allocate_gcmap(self.assembler, frame_depth,
                            JITFRAME_FIXED_SIZE)
     for box, loc in self.rm.reg_bindings.iteritems():
         if loc in forbidden_regs:
             continue
         if box.type == REF and self.rm.is_still_alive(box):
             assert not noregs
             assert loc.is_core_reg()
             #val = self.cpu.all_reg_indexes[loc.value]
             # ^^^ That is the correct way to write it down, but as a
             #     special case in the arm backend only, this is equivalent
             #     to just the line below:
             val = loc.value
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     for box, loc in self.fm.bindings.iteritems():
         if box.type == REF and self.rm.is_still_alive(box):
             assert loc.is_stack()
             val = loc.position + JITFRAME_FIXED_SIZE
             gcmap[val // WORD // 8] |= r_uint(1) << (val % (WORD * 8))
     return gcmap