Did I find the right examples for you? yes no

All Samples(638)  |  Call(566)  |  Derive(2)  |  Import(70)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/metainterp/executor.py   plexnet(Download)
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rlib.rarithmetic import ovfcheck, r_uint, intmask
from pypy.jit.metainterp.history import BoxInt, ConstInt, check_descr
from pypy.jit.metainterp.history import INT, REF, ConstFloat
from pypy.jit.metainterp import resoperation
def do_int_add(cpu, box1, box2):
    return ConstInt(intmask(box1.getint() + box2.getint()))
 
def do_int_sub(cpu, box1, box2):
    return ConstInt(intmask(box1.getint() - box2.getint()))
 
def do_int_mul(cpu, box1, box2):
    return ConstInt(intmask(box1.getint() * box2.getint()))
def do_int_floordiv(cpu, box1, box2):
    z = llop.int_floordiv(lltype.Signed, box1.getint(), box2.getint())
    return ConstInt(z)
 
def do_int_mod(cpu, box1, box2):

src/s/y/Sypy-HEAD/jit/metainterp/resume.py   Sypy(Download)
import sys, os
from pypy.jit.metainterp.history import Box, Const, ConstInt, getkind
from pypy.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat
from pypy.jit.metainterp.history import INT, REF, FLOAT, HOLE
from pypy.jit.metainterp.history import AbstractDescr
    def allocate_array(self, arraydescr, length):
        return self.metainterp.execute_and_record(rop.NEW_ARRAY,
                                                  arraydescr, ConstInt(length))
 
    def allocate_string(self, length):
        return self.metainterp.execute_and_record(rop.NEWSTR,
                                                  None, ConstInt(length))
    def string_setitem(self, strbox, index, charnum):
        charbox = self.decode_box(charnum, INT)
        self.metainterp.execute_and_record(rop.STRSETITEM, None,
                                           strbox, ConstInt(index), charbox)
 
        str2box = self.decode_box(str2num, REF)
        return self.metainterp.execute_and_record_varargs(
            rop.CALL, [ConstInt(func), str1box, str2box], calldescr)
 
    def slice_string(self, strnum, startnum, lengthnum):

src/s/y/Sypy-HEAD/jit/metainterp/compile.py   Sypy(Download)
from pypy.jit.metainterp.history import TreeLoop, Box, History, JitCellToken, TargetToken
from pypy.jit.metainterp.history import AbstractFailDescr, BoxInt
from pypy.jit.metainterp.history import BoxPtr, BoxObj, BoxFloat, Const, ConstInt
from pypy.jit.metainterp import history
from pypy.jit.metainterp.typesystem import llhelper, oohelper
            extra_ops.append(
                ResOperation(rop.GETARRAYITEM_GC,
                             [arraybox, ConstInt(index)],
                             box, descr=arraydescr))
            i += 1
        inputargs.append(box)
    k = jitdriver_sd.portal_runner_adr
    funcbox = history.ConstInt(heaptracker.adr2int(k))
    callargs = [funcbox] + greenboxes + inputargs
    #

src/s/y/Sypy-HEAD/jit/metainterp/optimizeopt/vstring.py   Sypy(Download)
from pypy.jit.codewriter.effectinfo import EffectInfo
from pypy.jit.metainterp.history import (BoxInt, Const, ConstInt, ConstPtr,
    get_const_ptr_for_string, get_const_ptr_for_unicode, BoxPtr, REF, INT)
from pypy.jit.metainterp.optimizeopt import optimizer, virtualize
from pypy.jit.metainterp.optimizeopt.optimizer import CONST_0, CONST_1
    def getstrlen(self, string_optimizer, mode, lengthbox):
        if mode is mode_string:
            s = self.get_constant_string_spec(mode_string)
            if s is not None:
                return ConstInt(len(s))
        else:
            s = self.get_constant_string_spec(mode_unicode)
            if s is not None:
                return ConstInt(len(s))
    def getstrlen(self, _, mode, lengthbox):
        if self._lengthbox is None:
            self._lengthbox = ConstInt(len(self._chars))
        return self._lengthbox
 
            return box2
        if isinstance(box2, ConstInt):
            return ConstInt(box1.value + box2.value)
    elif isinstance(box2, ConstInt) and box2.value == 0:
        return box1

src/s/y/Sypy-HEAD/jit/backend/llsupport/rewrite.py   Sypy(Download)
import sys
from pypy.rlib.rarithmetic import ovfcheck
from pypy.jit.metainterp.history import ConstInt, BoxPtr, ConstPtr
from pypy.jit.metainterp.resoperation import ResOperation, rop
from pypy.jit.codewriter import heaptracker
    _op_malloc_nursery = None
    _v_last_malloced_nursery = None
    c_zero = ConstInt(0)
 
    def __init__(self, gc_ll_descr, cpu):
            if self.gc_ll_descr.fielddescr_vtable is not None:
                op = ResOperation(rop.SETFIELD_GC,
                                  [op.result, ConstInt(classint)], None,
                                  descr=self.gc_ll_descr.fielddescr_vtable)
                self.newops.append(op)
            assert (size & (WORD-1)) == 0, "size not aligned?"
            addr = self.gc_ll_descr.get_malloc_fn_addr('malloc_big_fixedsize')
            args = [ConstInt(addr), ConstInt(size), ConstInt(typeid)]
            descr = self.gc_ll_descr.malloc_big_fixedsize_descr
        else:                                            # Boehm

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/metainterp/warmstate.py   plexnet(Download)
        value = intmask(value)
    if in_const_box:
        return history.ConstInt(value)
    else:
        return history.BoxInt(value)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/metainterp/optimizeopt.py   plexnet(Download)
from pypy.jit.metainterp.history import Box, BoxInt, LoopToken, BoxFloat,\
     ConstFloat
from pypy.jit.metainterp.history import Const, ConstInt, ConstPtr, ConstObj, REF
from pypy.jit.metainterp.resoperation import rop, ResOperation
from pypy.jit.metainterp.jitprof import OPT_OPS, OPT_GUARDS, OPT_FORCINGS
        self.box = box
 
CONST_0      = ConstInt(0)
CONST_1      = ConstInt(1)
CVAL_ZERO    = ConstantValue(CONST_0)
                subbox = subvalue.force_box()
                op = ResOperation(rop.SETARRAYITEM_GC,
                                  [box, ConstInt(index), subbox], None,
                                  descr=self.arraydescr)
                newoperations.append(op)

src/s/y/Sypy-HEAD/jit/metainterp/pyjitpl.py   Sypy(Download)
 
from pypy.jit.metainterp import history, compile, resume
from pypy.jit.metainterp.history import Const, ConstInt, ConstPtr, ConstFloat
from pypy.jit.metainterp.history import Box, TargetToken
from pypy.jit.metainterp.resoperation import rop
    def opimpl_new_with_vtable(self, sizedescr):
        cpu = self.metainterp.cpu
        cls = heaptracker.descr2vtable(cpu, sizedescr)
        resbox = self.execute(rop.NEW_WITH_VTABLE, ConstInt(cls))
        self.metainterp.heapcache.new(resbox)
        arrayindex = vinfo.array_field_by_descrs[fdescr]
        result = vinfo.get_array_length(virtualizable, arrayindex)
        return ConstInt(result)
 
    @arguments("jitcode", "boxes")
    def do_recursive_call(self, targetjitdriver_sd, allboxes,
                          assembler_call=False):
        portal_code = targetjitdriver_sd.mainjitcode
        k = targetjitdriver_sd.portal_runner_adr
        funcbox = ConstInt(heaptracker.adr2int(k))
    def debug_merge_point(self, jitdriver_sd, jd_index, portal_call_depth, current_call_id, greenkey):
        # debugging: produce a DEBUG_MERGE_POINT operation
        loc = jitdriver_sd.warmstate.get_location_str(greenkey)
        debug_print(loc)
        args = [ConstInt(jd_index), ConstInt(portal_call_depth), ConstInt(current_call_id)] + greenkey

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/metainterp/pyjitpl.py   plexnet(Download)
 
from pypy.jit.metainterp import history, compile, resume
from pypy.jit.metainterp.history import Const, ConstInt, Box
from pypy.jit.metainterp.resoperation import rop
from pypy.jit.metainterp import codewriter, executor
    def opimpl_check_neg_index(self, pc, arraybox, arraydesc, indexbox):
        negbox = self.metainterp.execute_and_record(
            rop.INT_LT, None, indexbox, ConstInt(0))
        # xxx inefficient
        negbox = self.implement_guard_value(pc, negbox)
    def opimpl_check_resizable_neg_index(self, pc, listbox, lengthdesc,
                                         indexbox):
        negbox = self.metainterp.execute_and_record(
            rop.INT_LT, None, indexbox, ConstInt(0))
        # xxx inefficient
    def opimpl_check_zerodivisionerror(self, pc, box):
        nonzerobox = self.metainterp.execute_and_record(
            rop.INT_NE, None, box, ConstInt(0))
        # xxx inefficient
        nonzerobox = self.implement_guard_value(pc, nonzerobox)
    def opimpl_check_div_overflow(self, pc, box1, box2):
        # detect the combination "box1 = -sys.maxint-1, box2 = -1".
        import sys
        tmp1 = self.metainterp.execute_and_record(    # combination to detect:
            rop.INT_ADD, None, box1, ConstInt(sys.maxint))    # tmp1=-1, box2=-1

src/s/y/Sypy-HEAD/jit/metainterp/warmstate.py   Sypy(Download)
        value = intmask(value)
    if in_const_box:
        return history.ConstInt(value)
    else:
        return history.BoxInt(value)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8  Next