bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def __init__(self, space, args_w, keywords=None, keywords_w=None, w_stararg=None, w_starstararg=None): self.space = space assert isinstance(args_w, list) self.arguments_w = args_w self.keywords = keywords self.keywords_w = keywords_w if keywords is not None: assert keywords_w is not None assert len(keywords_w) == len(k...
def __init__(self, space, args_w, keywords=None, keywords_w=None, w_stararg=None, w_starstararg=None): self.space = space assert isinstance(args_w, list) self.arguments_w = args_w self.keywords = keywords self.keywords_w = keywords_w if keywords is not None: assert keywords_w is not None assert len(keywords_w) == len(k...
453,000
def __init__(self, space, args_w, keywords=None, keywords_w=None, w_stararg=None, w_starstararg=None): self.space = space assert isinstance(args_w, list) self.arguments_w = args_w self.keywords = keywords self.keywords_w = keywords_w if keywords is not None: assert keywords_w is not None assert len(keywords_w) == len(k...
def __init__(self, space, args_w, keywords=None, keywords_w=None, w_stararg=None, w_starstararg=None): self.space = space assert isinstance(args_w, list) self.arguments_w = args_w self.keywords = keywords self.keywords_w = keywords_w if keywords is not None: assert keywords_w is not None assert len(keywords_w) == len(k...
453,001
def generic_call(self, FUNC, fnexpr, args_v, v_result, targets=None): args = [] assert len(args_v) == len(FUNC.TO.ARGS) for v, ARGTYPE in zip(args_v, FUNC.TO.ARGS): if ARGTYPE is Void: continue # skip 'void' argument args.append(self.expr(v)) # special case for rctypes: by-value container args: # XXX is this still n...
def generic_call(self, FUNC, fnexpr, args_v, v_result, targets=None): args = [] assert len(args_v) == len(FUNC.TO.ARGS) for v, ARGTYPE in zip(args_v, FUNC.TO.ARGS): if ARGTYPE is Void: continue # skip 'void' argument args.append(self.expr(v)) # special case for rctypes: by-value container args: # XXX is this still n...
453,002
def OP_DIRECT_CALL(self, op): fn = op.args[0] return self.generic_call(fn.concretetype, self.expr(fn), op.args[1:], op.result, [fn.value])
def OP_DIRECT_CALL(self, op): fn = op.args[0] return self.generic_call(fn.concretetype, self.expr(fn), op.args[1:], op.result, [fn.value])
453,003
def unwrap_value(space, push_func, add_arg, argdesc, letter, w_arg): w = space.wrap if letter in TYPEMAP_PTR_LETTERS: # check for NULL ptr datainstance = space.interpclass_w(w_arg) if isinstance(datainstance, W_DataInstance): ptr = datainstance.ll_buffer else: ptr = unwrap_truncate_int(rffi.VOIDP, space, w_arg) push_fu...
def unwrap_value(space, push_func, add_arg, argdesc, letter, w_arg): w = space.wrap if letter in TYPEMAP_PTR_LETTERS: # check for NULL ptr datainstance = space.interpclass_w(w_arg) if isinstance(datainstance, W_DataInstance): ptr = datainstance.ll_buffer else: ptr = unwrap_truncate_int(rffi.VOIDP, space, w_arg) push_fu...
453,004
def test_print_function(self): import __builtin__ import sys import StringIO pr = getattr(__builtin__, "print") save = sys.stdout out = sys.stdout = StringIO.StringIO() try: pr("Hello,", "person!") finally: sys.stdout = save assert out.getvalue() == "Hello, person!\n" out = StringIO.StringIO() pr("Hello,", "person!", f...
def test_print_function(self): import __builtin__ import sys import StringIO pr = getattr(__builtin__, "print") save = sys.stdout out = sys.stdout = StringIO.StringIO() try: pr("Hello,", "person!") finally: sys.stdout = save assert out.getvalue() == "Hello, person!\n" out = StringIO.StringIO() pr("Hello,", "person!", f...
453,005
def set_vtable(self, loc, loc_vtable): if self.cpu.vtable_offset is not None: assert isinstance(loc, RegLoc) assert isinstance(loc_vtable, ImmedLoc) self.mc.MOV_mi((loc.value, self.cpu.vtable_offset), loc_vtable.value)
def set_vtable(self, loc, loc_vtable): if self.cpu.vtable_offset is not None: assert isinstance(loc, RegLoc) assert isinstance(loc_vtable, ImmedLoc) self.mc.MOV_mi((loc.value, self.cpu.vtable_offset), loc_vtable.value)
453,006
def optimize_loop(self, ops, optops): loop = self.parse(ops) # self.loop = loop metainterp_sd = FakeMetaInterpStaticData(self.cpu) if hasattr(self, 'vrefinfo'): metainterp_sd.virtualref_info = self.vrefinfo # # XXX list the exact optimizations that are needed for each test from pypy.jit.metainterp.optimizeopt import (O...
def optimize_loop(self, ops, optops): loop = self.parse(ops) # self.loop = loop metainterp_sd = FakeMetaInterpStaticData(self.cpu) if hasattr(self, 'vrefinfo'): metainterp_sd.virtualref_info = self.vrefinfo # # XXX list the exact optimizations that are needed for each test from pypy.jit.metainterp.optimizeopt import (O...
453,007
def test_interp2app_unwrap_spec_path(self): space = self.space def g(space, p): return p
def test_interp2app_unwrap_spec_path(self, monkeypatch): space = self.space def g(space, p): return p
453,008
def descr_new_zipimporter(space, w_type, name): w = space.wrap w_ZipImportError = space.getattr(space.getbuiltinmodule('zipimport'), w('ZipImportError')) ok = False parts = name.split(os.path.sep) filename = "" # make annotator happy for i in range(1, len(parts) + 1): filename = os.path.sep.join(parts[:i]) if not filen...
def descr_new_zipimporter(space, w_type, name): w = space.wrap w_ZipImportError = space.getattr(space.getbuiltinmodule('zipimport'), w('ZipImportError')) ok = False parts_ends = [i for i in range(0, len(name)) if name[i] == os.path.sep or name[i] == ZIPSEP] parts_ends.append(len(name)) filename = "" # make annotator ha...
453,009
def descr_new_zipimporter(space, w_type, name): w = space.wrap w_ZipImportError = space.getattr(space.getbuiltinmodule('zipimport'), w('ZipImportError')) ok = False parts = name.split(os.path.sep) filename = "" # make annotator happy for i in range(1, len(parts) + 1): filename = os.path.sep.join(parts[:i]) if not filen...
def descr_new_zipimporter(space, w_type, name): w = space.wrap w_ZipImportError = space.getattr(space.getbuiltinmodule('zipimport'), w('ZipImportError')) ok = False parts = name.split(os.path.sep) filename = "" # make annotator happy for i in parts_ends: filename = name[:i] if not filename: filename = os.path.sep try: ...
453,010
'typedef unsigned __int32 uint32_t;',
'typedef unsigned __int32 uint32_t;',
453,011
'typedef unsigned __int32 uint32_t;',
'typedef unsigned __int32 uint32_t;',
453,012
def external_c(name, args, result): return rffi.llexternal(name, args, result, compilation_info=eci, calling_conv='c')
def external_c(name, args, result): return rffi.llexternal(name, args, result, compilation_info=eci, calling_conv='c')
453,013
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
453,014
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
453,015
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
453,016
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
453,017
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
453,018
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
def setup(self): """Called at run-time to initialize the GC.""" # # Hack: MovingGCBase.setup() sets up stuff related to id(), which # we implement differently anyway. So directly call GCBase.setup(). GCBase.setup(self) # # A list of all raw_malloced objects (the objects too large) self.rawmalloced_objects = self.Addre...
453,019
def _emit_guard(self, op, regalloc, fcond, save_exc=False): descr = op.getdescr() assert isinstance(descr, AbstractFailDescr) if hasattr(op, 'getfailargs'): print 'Failargs: ', op.getfailargs()
def _emit_guard(self, op, regalloc, fcond, save_exc=False): descr = op.getdescr() assert isinstance(descr, AbstractFailDescr) if not we_are_translated() and hasattr(op, 'getfailargs'): print 'Failargs: ', op.getfailargs()
453,020
def emit_op_guard_nonnull_class(self, op, regalloc, fcond): locs = self._prepare_guard_class(op, regalloc, fcond) self.mc.CMP_ri(locs[0].value, 0) self._emit_guard(op, regalloc, c.NE) self._cmp_guard_class(op, locs, regalloc, fcond) return fcond
def emit_op_guard_nonnull_class(self, op, regalloc, fcond): locs = self._prepare_guard_class(op, regalloc, fcond) self.mc.CMP_ri(locs[0].value, 0) if offset is not None: self.mc.ADD_ri(r.pc.value, r.pc.value, 2*WORD, cond=c.EQ) else: raise NotImplementedError self._cmp_guard_class(op, locs, regalloc, fcond) return fcon...
453,021
def emit_op_strlen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box]
def emit_op_strlen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box]
453,022
def emit_op_strlen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box]
def emit_op_strlen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box]
453,023
def emit_op_unicodelen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box] res = regalloc.force_allocate_reg(op.result, boxes) boxes.append(op.result) basesize, itemsize, ofs_length = symbolic.get_array_token(rstr.UNICODE, self.cpu.translate_support_code) imm_ofs = se...
def emit_op_unicodelen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box] res = regalloc.force_allocate_reg(op.result, boxes) boxes.append(op.result) basesize, itemsize, ofs_length = symbolic.get_array_token(rstr.UNICODE, self.cpu.translate_support_code) imm_ofs = se...
453,024
def emit_op_unicodelen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box] res = regalloc.force_allocate_reg(op.result, boxes) boxes.append(op.result) basesize, itemsize, ofs_length = symbolic.get_array_token(rstr.UNICODE, self.cpu.translate_support_code) imm_ofs = se...
def emit_op_unicodelen(self, op, regalloc, fcond): l0, box = self._ensure_value_is_boxed(op.getarg(0), regalloc) boxes = [box] res = regalloc.force_allocate_reg(op.result, boxes) boxes.append(op.result) basesize, itemsize, ofs_length = symbolic.get_array_token(rstr.UNICODE, self.cpu.translate_support_code) imm_ofs = se...
453,025
def _malloc_varsize(self, ofs_items, ofs_length, scale, v, res_v, regalloc): tempbox = TempBox() size_loc = regalloc.force_allocate_reg(tempbox) self.mc.gen_load_int(size_loc.value, ofs_items + (v.getint() << scale)) self._emit_call(self.malloc_func_addr, [tempbox], regalloc, result=res_v) loc = regalloc.make_sure_var_...
def _malloc_varsize(self, ofs_items, ofs_length, scale, v, res_v, regalloc): tempbox = TempBox() size_loc = regalloc.force_allocate_reg(tempbox) self.mc.gen_load_int(size_loc.value, ofs_items + (v.getint() << scale)) self._emit_call(self.malloc_func_addr, [tempbox], regalloc, result=res_v) loc = regalloc.make_sure_var_...
453,026
def f(): raise "test"
def f(): raise "test"
453,027
def test_more_precise_instancearg(self): try: raise Exception, SystemError(1, 2) except SystemError, e: assert e.args[0] == 1 assert e.args[1] == 2
def test_more_precise_instancearg(self): try: raise Exception, SystemError(1, 2) except SystemError, e: assert e.args[0] == 1 assert e.args[1] == 2
453,028
def test_vref_nonvirtual_escape(self): ops = """ [p1] p2 = virtual_ref(p1, 5) escape(p2) virtual_ref_finish(p2, p1) jump(p1) """ expected = """ [p1] i0 = force_token() p2 = new_with_vtable(ConstClass(jit_virtual_ref_vtable)) setfield_gc(p2, i0, descr=virtualtokendescr) setfield_gc(p2, 5, descr=virtualrefindexdescr) esc...
def test_vref_nonvirtual_escape(self): ops = """ [p1] p2 = virtual_ref(p1, 5) escape(p2) virtual_ref_finish(p2, p1) jump(p1) """ expected = """ [p1] i0 = force_token() p2 = new_with_vtable(ConstClass(jit_virtual_ref_vtable)) setfield_gc(p2, i0, descr=virtualtokendescr) setfield_gc(p2, 5, descr=virtualrefindexdescr) esc...
453,029
def test_vref_virtual_1(self): ops = """ [p0, i1] # p1 = new_with_vtable(ConstClass(node_vtable)) p1b = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1b, 252, descr=valuedescr) setfield_gc(p1, p1b, descr=nextdescr) # p2 = virtual_ref(p1, 3) setfield_gc(p0, p2, descr=nextdescr) call_may_force(i1, descr=mayforcev...
def test_vref_virtual_1(self): ops = """ [p0, i1] # p1 = new_with_vtable(ConstClass(node_vtable)) p1b = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1b, 252, descr=valuedescr) setfield_gc(p1, p1b, descr=nextdescr) # p2 = virtual_ref(p1, 3) setfield_gc(p0, p2, descr=nextdescr) call_may_force(i1, descr=mayforcev...
453,030
def test_vref_virtual_2(self): self.make_fail_descr() ops = """ [p0, i1] # p1 = new_with_vtable(ConstClass(node_vtable)) p1b = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1b, i1, descr=valuedescr) setfield_gc(p1, p1b, descr=nextdescr) # p2 = virtual_ref(p1, 2) setfield_gc(p0, p2, descr=nextdescr) call_may_for...
def test_vref_virtual_2(self): self.make_fail_descr() ops = """ [p0, i1] # p1 = new_with_vtable(ConstClass(node_vtable)) p1b = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1b, i1, descr=valuedescr) setfield_gc(p1, p1b, descr=nextdescr) # p2 = virtual_ref(p1, 2) setfield_gc(p0, p2, descr=nextdescr) call_may_for...
453,031
def str_join__Bytearray_ANY(space, w_self, w_list): list_w = space.listview(w_list) if not list_w: return W_BytearrayObject([]) data = w_self.data reslen = 0 for i in range(len(list_w)): w_s = list_w[i] if not (space.is_true(space.isinstance(w_s, space.w_str)) or space.is_true(space.isinstance(w_s, space.w_bytearray)))...
def str_join__Bytearray_ANY(space, w_self, w_list): list_w = space.listview(w_list) if not list_w: return W_BytearrayObject([]) data = w_self.data reslen = 0 for i in range(len(list_w)): w_s = list_w[i] if not (space.is_true(space.isinstance(w_s, space.w_str)) or space.is_true(space.isinstance(w_s, space.w_bytearray)))...
453,032
def inline(self, loop_operations, loop_args, jump_args): self.argmap = argmap = {} assert len(loop_args) == len(jump_args) for i in range(len(loop_args)): argmap[loop_args[i]] = jump_args[i]
def inline(self, loop_operations, loop_args, jump_args): self.argmap = argmap = {} assert len(loop_args) == len(jump_args) for i in range(len(loop_args)): argmap[loop_args[i]] = jump_args[i]
453,033
def inline(self, loop_operations, loop_args, jump_args): self.argmap = argmap = {} assert len(loop_args) == len(jump_args) for i in range(len(loop_args)): argmap[loop_args[i]] = jump_args[i]
def inline(self, loop_operations, loop_args, jump_args): self.argmap = argmap = {} assert len(loop_args) == len(jump_args) for i in range(len(loop_args)): argmap[loop_args[i]] = jump_args[i]
453,034
def inline_snapshot(self, snapshot): if snapshot in self.snapshot_map: return self.snapshot_map[snapshot] boxes = [] for a in snapshot.boxes: if isinstance(a, Const): boxes.append(a) else: boxes.append(self.inline_arg(a)) return Snapshot(self.inline_snapshot(snapshot.prev), boxes)
def inline_snapshot(self, snapshot): if snapshot in self.snapshot_map: return self.snapshot_map[snapshot] boxes = [] for a in snapshot.boxes: if isinstance(a, Const): boxes.append(a) else: boxes.append(self.inline_arg(a)) new_snapshot = Snapshot(self.inline_snapshot(snapshot.prev), boxes[:]) self.snapshot_map[snapshot]...
453,035
def cmdexec(cmd): """ return output of executing 'cmd' in a separate process. raise cmdexec.ExecutionFailed exeception if the command failed. the exception will provide an 'err' attribute containing the error-output from the command. """ process = subprocess.Popen(cmd, shell=True, universal_newlines=True, stdout=subpr...
def cmdexec(cmd): """ return output of executing 'cmd' in a separate process. raise cmdexec.ExecutionFailed exeception if the command failed. the exception will provide an 'err' attribute containing the error-output from the command. """ process = subprocess.Popen(cmd, shell=True, universal_newlines=True, stdout=subpr...
453,036
def test_byval_argument(self): """ struct Point { long x; long y; };
deftest_byval_argument(self):"""structPoint{longx;longy;};
453,037
def test_byval_argument(self): """ struct Point { long x; long y; };
def test_byval_argument(self): """ struct Point { long x; long y; };
453,038
def fdopenstream(self, stream, fd, mode): self.fd = fd self.mode = mode self.stream = stream if stream.flushable(): getopenstreams(self.space)[stream] = None
def fdopenstream(self, stream, fd, mode, w_name=None): self.fd = fd self.mode = mode self.stream = stream if stream.flushable(): getopenstreams(self.space)[stream] = None
453,039
def f(i): return 4*i
def f(i): return 4*i
453,040
def g(i): return 4*i
def g(i): return 4*i
453,041
def getinitialpath(prefix): from pypy.module.sys.version import CPYTHON_VERSION dirname = '%d.%d.%d' % (CPYTHON_VERSION[0], CPYTHON_VERSION[1], CPYTHON_VERSION[2]) lib_python = os.path.join(prefix, 'lib-python') python_std_lib = os.path.join(lib_python, dirname) checkdir(python_std_lib) python_std_lib_modified = os.pat...
def getinitialpath(prefix): from pypy.module.sys.version import CPYTHON_VERSION dirname = '%d.%d.%d' % (CPYTHON_VERSION[0], CPYTHON_VERSION[1], CPYTHON_VERSION[2]) lib_python = os.path.join(prefix, 'lib-python') python_std_lib = os.path.join(lib_python, dirname) checkdir(python_std_lib) python_std_lib_modified = os.pat...
453,042
def optimize_default(self, op): if op.is_always_pure(): for arg in op.args: if self.get_constant_box(arg) is None: break else: # all constant arguments: constant-fold away argboxes = [self.get_constant_box(arg) for arg in op.args] resbox = execute_nonspec(self.cpu, None, op.opnum, argboxes, op.descr) self.make_constant...
def optimize_default(self, op): if op.is_always_pure(): for arg in op.args: if self.get_constant_box(arg) is None: break else: # all constant arguments: constant-fold away argboxes = [self.get_constant_box(arg) for arg in op.args] resbox = execute_nonspec(self.cpu, None, op.opnum, argboxes, op.descr) self.make_constant...
453,043
def find_rewriteable_bool(self, op, args): try: oldopnum = opboolinvers[op.opnum] targs = [args[0], args[1], ConstInt(oldopnum)] if self.try_boolinvers(op, targs): return True except KeyError: pass
def find_rewritable_bool(self, op, args): try: oldopnum = opboolinvers[op.opnum] targs = [args[0], args[1], ConstInt(oldopnum)] if self.try_boolinvers(op, targs): return True except KeyError: pass
453,044
def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue(n_args + (2 * n_kwargs)) w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) n = n_args + (w_self is not None) if not n_kwargs: try:...
def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue(n_args + (2 * n_kwargs)) w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) n = n_args + (w_self is not None) if not n_kwargs: try:...
453,045
def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue(n_args + (2 * n_kwargs)) w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) n = n_args + (w_self is not None) if not n_kwargs: try:...
def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue(n_args + (2 * n_kwargs)) w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) n = n_args + (w_self is not None) if not n_kwargs: try:...
453,046
def rtype_method_encode(self, hop): if not hop.args_s[1].is_constant(): raise TyperError("encoding must be constant") encoding = hop.args_s[1].const if encoding == "ascii": expect = self.lowleveltype # can be a UniChar else: expect = self.repr # must be a regular unicode string v_self = hop.inputarg(expect,...
def rtype_method_encode(self, hop): if not hop.args_s[1].is_constant(): raise TyperError("encoding must be constant") encoding = hop.args_s[1].const if encoding == "ascii" and self.lowleveltype == UniChar: expect = UniChar # can be a UniChar else: expect = self.repr # must be a regular unicode string v_self...
453,047
def external(name, args, result): return rffi.llexternal(name, args, result, compilation_info=CConfig._compilation_info_)
def external(name, args, result): return rffi.llexternal(name, args, result, compilation_info=CConfig._compilation_info_, sandboxsafe=True, threadsafe=True)
453,048
def winexternal(name, args, result): return rffi.llexternal(name, args, result, compilation_info=CConfig._compilation_info_, calling_conv='win')
def winexternal(name, args, result): return rffi.llexternal(name, args, result, compilation_info=CConfig._compilation_info_, calling_conv='win', sandboxsafe=True, threadsafe=True)
453,049
from pypy.interpreter.typedef import TypeDef, interp_attrproperty
from pypy.interpreter.typedef import TypeDef, interp_attrproperty
453,050
def descr_new(space, w_subtype, __args__): self = space.allocate_instance(W_Type, w_subtype) W_Type.__init__(self, space) return space.wrap(self)
def descr_new(space, w_subtype, __args__): self = space.allocate_instance(W_Type, w_subtype) W_Type.__init__(self, space) return space.wrap(self)
453,051
def descr_init(self, space, w_errno, w_strerror, written=0): W_IOError.descr_init(self, space, [w_errno, w_strerror]) self.written = written
def descr_init(self, space, w_errno, w_strerror, written=0): W_IOError.descr_init(self, space, [w_errno, w_strerror]) self.written = written
453,052
def alloc_buffer(count): """ Returns a (raw_buffer, gc_buffer) pair, allocated with count bytes. The raw_buffer can be safely passed to a native function which expects it to not move. Call str_from_buffer with the returned values to get a safe high-level string. When the garbage collector cooperates, this allows for th...
def alloc_buffer(count): """ Returns a (raw_buffer, gc_buffer) pair, allocated with count bytes. The raw_buffer can be safely passed to a native function which expects it to not move. Call str_from_buffer with the returned values to get a safe high-level string. When the garbage collector cooperates, this allows for th...
453,053
def optimize_loop(self, ops, spectext, optops, checkspecnodes=True, expected_preamble=None): loop = self.parse(ops) # if checkspecnodes: # verify that 'spectext' is indeed what optimizefindnode would # compute for this loop cpu = self.cpu perfect_specialization_finder = PerfectSpecializationFinder(cpu) perfect_speciali...
def optimize_loop(self, ops, spectext, optops, expected_preamble=None): loop = self.parse(ops) # if checkspecnodes: # verify that 'spectext' is indeed what optimizefindnode would # compute for this loop cpu = self.cpu perfect_specialization_finder = PerfectSpecializationFinder(cpu) perfect_specialization_finder.find_no...
453,054
def optimize_loop(self, ops, spectext, optops, checkspecnodes=True, expected_preamble=None): loop = self.parse(ops) # if checkspecnodes: # verify that 'spectext' is indeed what optimizefindnode would # compute for this loop cpu = self.cpu perfect_specialization_finder = PerfectSpecializationFinder(cpu) perfect_speciali...
def optimize_loop(self, ops, spectext, optops, checkspecnodes=True, expected_preamble=None): loop = self.parse(ops) # if checkspecnodes: # verify that 'spectext' is indeed what optimizefindnode would # compute for this loop cpu = self.cpu perfect_specialization_finder = PerfectSpecializationFinder(cpu) perfect_speciali...
453,055
def optimize_loop(self, ops, spectext, optops, checkspecnodes=True, expected_preamble=None): loop = self.parse(ops) # if checkspecnodes: # verify that 'spectext' is indeed what optimizefindnode would # compute for this loop cpu = self.cpu perfect_specialization_finder = PerfectSpecializationFinder(cpu) perfect_speciali...
def optimize_loop(self, ops, spectext, optops, checkspecnodes=True, expected_preamble=None): loop = self.parse(ops) # if checkspecnodes: # verify that 'spectext' is indeed what optimizefindnode would # compute for this loop cpu = self.cpu perfect_specialization_finder = PerfectSpecializationFinder(cpu) perfect_speciali...
453,056
def optimize_loop(self, ops, spectext, optops, checkspecnodes=True, expected_preamble=None): loop = self.parse(ops) # if checkspecnodes: # verify that 'spectext' is indeed what optimizefindnode would # compute for this loop cpu = self.cpu perfect_specialization_finder = PerfectSpecializationFinder(cpu) perfect_speciali...
defoptimize_loop(self,ops,spectext,optops,checkspecnodes=True,expected_preamble=None):loop=self.parse(ops)#ifcheckspecnodes:#verifythat'spectext'isindeedwhatoptimizefindnodewould#computeforthisloopcpu=self.cpuperfect_specialization_finder=PerfectSpecializationFinder(cpu)perfect_specialization_finder.find_nodes_loop(loo...
453,057
def test_constant_boolrewrite_lt(self): ops = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] i2 = int_ge(i0, 0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_lt(self): ops = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] i2 = int_ge(i0, 0) guard_false(i2) [] jump(i0) """ preamble = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,058
def test_constant_boolrewrite_lt(self): ops = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] i2 = int_ge(i0, 0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_lt(self): ops = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] i2 = int_ge(i0, 0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_lt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,059
def test_constant_boolrewrite_gt(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_le(i0, 0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_gt(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_le(i0, 0) guard_false(i2) [] jump(i0) """ preamble = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,060
def test_constant_boolrewrite_gt(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_le(i0, 0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_gt(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_le(i0, 0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,061
def test_constant_boolrewrite_reflex(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_lt(0, i0) guard_true(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_reflex(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_lt(0, i0) guard_true(i2) [] jump(i0) """ preamble = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,062
def test_constant_boolrewrite_reflex(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_lt(0, i0) guard_true(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_reflex(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_lt(0, i0) guard_true(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,063
def test_constant_boolrewrite_reflex_invers(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_ge(0, i0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_reflex_invers(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_ge(0, i0) guard_false(i2) [] jump(i0) """ preamble = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,064
def test_constant_boolrewrite_reflex_invers(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_ge(0, i0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_constant_boolrewrite_reflex_invers(self): ops = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] i2 = int_ge(0, i0) guard_false(i2) [] jump(i0) """ expected = """ [i0] i1 = int_gt(i0, 0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,065
def test_remove_guard_value_if_constant(self): ops = """ [p1] guard_value(p1, ConstPtr(myptr)) [] jump(ConstPtr(myptr)) """ expected = """ [] jump() """ self.optimize_loop(ops, 'Constant(myptr)', expected)
def test_remove_guard_value_if_constant(self): ops = """ [p1] guard_value(p1, ConstPtr(myptr)) [] jump(p1) """ expected = """ [] jump() """ self.optimize_loop(ops, 'Constant(myptr)', expected)
453,066
def test_remove_guard_value_if_constant(self): ops = """ [p1] guard_value(p1, ConstPtr(myptr)) [] jump(ConstPtr(myptr)) """ expected = """ [] jump() """ self.optimize_loop(ops, 'Constant(myptr)', expected)
def test_remove_guard_value_if_constant(self): ops = """ [p1] guard_value(p1, ConstPtr(myptr)) [] jump(ConstPtr(myptr)) """ expected = """ [] jump() """ self.optimize_loop(ops, 'Constant(myptr)', expected)
453,067
def test_ooisnull_oononnull_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] guard_nonnull(p0) [] jump(p0) """ expected = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
def test_ooisnull_oononnull_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] guard_nonnull(p0) [] jump(p0) """ preamble = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
453,068
def test_ooisnull_oononnull_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] guard_nonnull(p0) [] jump(p0) """ expected = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
def test_ooisnull_oononnull_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] guard_nonnull(p0) [] jump(p0) """ expected = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
453,069
def test_int_is_true_1(self): ops = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] i2 = int_is_true(i0) guard_true(i2) [] jump(i0) """ expected = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_int_is_true_1(self): ops = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] i2 = int_is_true(i0) guard_true(i2) [] jump(i0) """ preamble = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,070
def test_int_is_true_1(self): ops = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] i2 = int_is_true(i0) guard_true(i2) [] jump(i0) """ expected = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
def test_int_is_true_1(self): ops = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] i2 = int_is_true(i0) guard_true(i2) [] jump(i0) """ expected = """ [i0] i1 = int_is_true(i0) guard_true(i1) [] jump(i0) """ self.optimize_loop(ops, 'Not', expected)
453,071
def test_ooisnull_oononnull_2(self): ops = """ [p0] guard_nonnull(p0) [] guard_nonnull(p0) [] jump(p0) """ expected = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
def test_ooisnull_oononnull_2(self): ops = """ [p0] guard_nonnull(p0) [] guard_nonnull(p0) [] jump(p0) """ preamble = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
453,072
def test_ooisnull_oononnull_2(self): ops = """ [p0] guard_nonnull(p0) [] guard_nonnull(p0) [] jump(p0) """ expected = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
def test_ooisnull_oononnull_2(self): ops = """ [p0] guard_nonnull(p0) [] guard_nonnull(p0) [] jump(p0) """ expected = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'Not', expected)
453,073
def test_ooisnull_oononnull_via_virtual(self): ops = """ [p0] pv = new_with_vtable(ConstClass(node_vtable)) setfield_gc(pv, p0, descr=valuedescr) guard_nonnull(p0) [] p1 = getfield_gc(pv, descr=valuedescr) guard_nonnull(p1) [] jump(p0) """ expected = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'N...
def test_ooisnull_oononnull_via_virtual(self): ops = """ [p0] pv = new_with_vtable(ConstClass(node_vtable)) setfield_gc(pv, p0, descr=valuedescr) guard_nonnull(p0) [] p1 = getfield_gc(pv, descr=valuedescr) guard_nonnull(p1) [] jump(p0) """ preamble = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'N...
453,074
def test_ooisnull_oononnull_via_virtual(self): ops = """ [p0] pv = new_with_vtable(ConstClass(node_vtable)) setfield_gc(pv, p0, descr=valuedescr) guard_nonnull(p0) [] p1 = getfield_gc(pv, descr=valuedescr) guard_nonnull(p1) [] jump(p0) """ expected = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'N...
def test_ooisnull_oononnull_via_virtual(self): ops = """ [p0] pv = new_with_vtable(ConstClass(node_vtable)) setfield_gc(pv, p0, descr=valuedescr) guard_nonnull(p0) [] p1 = getfield_gc(pv, descr=valuedescr) guard_nonnull(p1) [] jump(p0) """ expected = """ [p0] guard_nonnull(p0) [] jump(p0) """ self.optimize_loop(ops, 'N...
453,075
def test_oois_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] i0 = ptr_ne(p0, NULL) guard_true(i0) [] i1 = ptr_eq(p0, NULL) guard_false(i1) [] i2 = ptr_ne(NULL, p0) guard_true(i0) [] i3 = ptr_eq(NULL, p0) guard_false(i1) [] jump(p0) """ expected = """ [p0] guard_class(p0, ConstClass(node_vtable)) []...
def test_oois_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] i0 = ptr_ne(p0, NULL) guard_true(i0) [] i1 = ptr_eq(p0, NULL) guard_false(i1) [] i2 = ptr_ne(NULL, p0) guard_true(i0) [] i3 = ptr_eq(NULL, p0) guard_false(i1) [] jump(p0) """ preamble = """ [p0] guard_class(p0, ConstClass(node_vtable)) []...
453,076
def test_oois_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] i0 = ptr_ne(p0, NULL) guard_true(i0) [] i1 = ptr_eq(p0, NULL) guard_false(i1) [] i2 = ptr_ne(NULL, p0) guard_true(i0) [] i3 = ptr_eq(NULL, p0) guard_false(i1) [] jump(p0) """ expected = """ [p0] guard_class(p0, ConstClass(node_vtable)) []...
def test_oois_1(self): ops = """ [p0] guard_class(p0, ConstClass(node_vtable)) [] i0 = ptr_ne(p0, NULL) guard_true(i0) [] i1 = ptr_eq(p0, NULL) guard_false(i1) [] i2 = ptr_ne(NULL, p0) guard_true(i0) [] i3 = ptr_eq(NULL, p0) guard_false(i1) [] jump(p0) """ expected = """ [p0] guard_class(p0, ConstClass(node_vtable)) []...
453,077
def test_guard_value_to_guard_true(self): ops = """ [i] i1 = int_lt(i, 3) guard_value(i1, 1) [i] jump(i) """ expected = """ [i] i1 = int_lt(i, 3) guard_true(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
def test_guard_value_to_guard_true(self): ops = """ [i] i1 = int_lt(i, 3) guard_value(i1, 1) [i] jump(i) """ preamble = """ [i] i1 = int_lt(i, 3) guard_true(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
453,078
def test_guard_value_to_guard_true(self): ops = """ [i] i1 = int_lt(i, 3) guard_value(i1, 1) [i] jump(i) """ expected = """ [i] i1 = int_lt(i, 3) guard_true(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
def test_guard_value_to_guard_true(self): ops = """ [i] i1 = int_lt(i, 3) guard_value(i1, 1) [i] jump(i) """ expected = """ [i] i1 = int_lt(i, 3) guard_true(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
453,079
def test_guard_value_to_guard_false(self): ops = """ [i] i1 = int_is_true(i) guard_value(i1, 0) [i] jump(i) """ expected = """ [i] i1 = int_is_true(i) guard_false(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
def test_guard_value_to_guard_false(self): ops = """ [i] i1 = int_is_true(i) guard_value(i1, 0) [i] jump(i) """ preamble = """ [i] i1 = int_is_true(i) guard_false(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
453,080
def test_guard_value_to_guard_false(self): ops = """ [i] i1 = int_is_true(i) guard_value(i1, 0) [i] jump(i) """ expected = """ [i] i1 = int_is_true(i) guard_false(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
def test_guard_value_to_guard_false(self): ops = """ [i] i1 = int_is_true(i) guard_value(i1, 0) [i] jump(i) """ expected = """ [i] i1 = int_is_true(i) guard_false(i1) [i] jump(i) """ self.optimize_loop(ops, 'Not', expected)
453,081
def test_guard_value_on_nonbool(self): ops = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(i) """ expected = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(-3) """ self.optimize_loop(ops, 'Not', expected)
def test_guard_value_on_nonbool(self): ops = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(i) """ preamble = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(-3) """ self.optimize_loop(ops, 'Not', expected)
453,082
def test_guard_value_on_nonbool(self): ops = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(i) """ expected = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(-3) """ self.optimize_loop(ops, 'Not', expected)
def test_guard_value_on_nonbool(self): ops = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(i) """ expected = """ [i] i1 = int_add(i, 3) guard_value(i1, 0) [i] jump(-3) """ self.optimize_loop(ops, 'Not', expected)
453,083
def test_int_is_true_of_bool(self): ops = """ [i0, i1] i2 = int_gt(i0, i1) i3 = int_is_true(i2) i4 = int_is_true(i3) guard_value(i4, 0) [i0, i1] jump(i0, i1) """ expected = """ [i0, i1] i2 = int_gt(i0, i1) guard_false(i2) [i0, i1] jump(i0, i1) """ self.optimize_loop(ops, 'Not, Not', expected)
def test_int_is_true_of_bool(self): ops = """ [i0, i1] i2 = int_gt(i0, i1) i3 = int_is_true(i2) i4 = int_is_true(i3) guard_value(i4, 0) [i0, i1] jump(i0, i1) """ preamble = """ [i0, i1] i2 = int_gt(i0, i1) guard_false(i2) [i0, i1] jump(i0, i1) """ self.optimize_loop(ops, 'Not, Not', expected)
453,084
def test_int_is_true_of_bool(self): ops = """ [i0, i1] i2 = int_gt(i0, i1) i3 = int_is_true(i2) i4 = int_is_true(i3) guard_value(i4, 0) [i0, i1] jump(i0, i1) """ expected = """ [i0, i1] i2 = int_gt(i0, i1) guard_false(i2) [i0, i1] jump(i0, i1) """ self.optimize_loop(ops, 'Not, Not', expected)
def test_int_is_true_of_bool(self): ops = """ [i0, i1] i2 = int_gt(i0, i1) i3 = int_is_true(i2) i4 = int_is_true(i3) guard_value(i4, 0) [i0, i1] jump(i0, i1) """ expected = """ [i0, i1] i2 = int_gt(i0, i1) guard_false(i2) [i0, i1] jump(i0, i1) """ self.optimize_loop(ops, 'Not, Not', expected)
453,085
def test_p123_simple(self): ops = """ [i1, p2, p3] i3 = getfield_gc(p3, descr=valuedescr) escape(i3) p1 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1, i1, descr=valuedescr) jump(i1, p1, p2) """ # We cannot track virtuals that survive for more than two iterations. self.optimize_loop(ops, 'Not, Not, Not', ops...
def test_p123_simple(self): ops = """ [i1, p2, p3] i3 = getfield_gc(p3, descr=valuedescr) escape(i3) p1 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1, i1, descr=valuedescr) jump(i1, p1, p2) """ # We cannot track virtuals that survive for more than two iterations. self.optimize_loop(ops, 'Not, Not, Not', ops...
453,086
def test_p123_nested(self): ops = """ [i1, p2, p3] i3 = getfield_gc(p3, descr=valuedescr) escape(i3) p1 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1, i1, descr=valuedescr) p1sub = new_with_vtable(ConstClass(node_vtable2)) setfield_gc(p1sub, i1, descr=valuedescr) setfield_gc(p1, p1sub, descr=nextdescr) jump...
def test_p123_nested(self): ops = """ [i1, p2, p3] i3 = getfield_gc(p3, descr=valuedescr) escape(i3) p1 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1, i1, descr=valuedescr) p1sub = new_with_vtable(ConstClass(node_vtable2)) setfield_gc(p1sub, i1, descr=valuedescr) setfield_gc(p1, p1sub, descr=nextdescr) jump...
453,087
def test_p123_anti_nested(self): ops = """ [i1, p2, p3] p3sub = getfield_gc(p3, descr=nextdescr) i3 = getfield_gc(p3sub, descr=valuedescr) escape(i3) p1 = new_with_vtable(ConstClass(node_vtable)) p2sub = new_with_vtable(ConstClass(node_vtable2)) setfield_gc(p2sub, i1, descr=valuedescr) setfield_gc(p2, p2sub, descr=next...
def test_p123_anti_nested(self): ops = """ [i1, p2, p3] p3sub = getfield_gc(p3, descr=nextdescr) i3 = getfield_gc(p3sub, descr=valuedescr) escape(i3) p1 = new_with_vtable(ConstClass(node_vtable)) p2sub = new_with_vtable(ConstClass(node_vtable2)) setfield_gc(p2sub, i1, descr=valuedescr) setfield_gc(p2, p2sub, descr=next...
453,088
def cfunction_descr_call(space, w_self, __args__): self = space.interp_w(W_PyCFunctionObject, w_self) args_w, kw_w = __args__.unpack() null = lltype.nullptr(PyObject.TO) # XXX for the moment # Call the C function result = self.ml.c_ml_meth(null, null) try: ret = from_ref(space, result) except RuntimeError: if not we_a...
def cfunction_descr_call(space, w_self, __args__): self = space.interp_w(W_PyCFunctionObject, w_self) args_w, kw_w = __args__.unpack() null = lltype.nullptr(PyObject.TO) # XXX for the moment # Call the C function result = self.ml.c_ml_meth(null, null) try: ret = from_ref(space, result) except RuntimeError: if not we_a...
453,089
def w_get_suboffsets(space, self): if isinstance(self.buf, buffer.SubBuffer): offset = self.buf.offset elif isinstance(self.buf, buffer.RWSubBuffer): offset = self.buf.offset else: offset = 0 return space.newtuple([space.wrap(offset)])
def w_get_suboffsets(space, self): buf = self.buf if isinstance(buf, buffer.SubBuffer): offset = buf.offset elif isinstance(buf, buffer.RWSubBuffer): offset = buf.offset else: offset = 0 return space.newtuple([space.wrap(offset)])
453,090
def dispatch_bytecode(self, co_code, next_instr, ec): space = self.space while True: self.last_instr = intmask(next_instr) if not jit.we_are_jitted(): ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if space.config.objspace.logbytecodes: space.bytecodecount...
def dispatch_bytecode(self, co_code, next_instr, ec): space = self.space while True: self.last_instr = intmask(next_instr) if not jit.we_are_jitted(): ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if space.config.objspace.logbytecodes: space.bytecodecount...
453,091
def dispatch_bytecode(self, co_code, next_instr, ec): space = self.space while True: self.last_instr = intmask(next_instr) if not jit.we_are_jitted(): ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if space.config.objspace.logbytecodes: space.bytecodecount...
def dispatch_bytecode(self, co_code, next_instr, ec): space = self.space while True: self.last_instr = intmask(next_instr) if not jit.we_are_jitted(): ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if space.config.objspace.logbytecodes: space.bytecodecount...
453,092
def JUMP_IF_TRUE(f, stepby, next_instr, *ignored): w_cond = f.peekvalue() if f.space.is_true(w_cond): next_instr += stepby return next_instr
def JUMP_IF_TRUE(f, stepby, next_instr, *ignored): w_cond = f.peekvalue() if f.space.is_true(w_cond): next_instr += stepby return next_instr
453,093
def WITH_CLEANUP(f, *ignored): # see comment in END_FINALLY for stack state w_exitfunc = f.popvalue() w_unroller = f.peekvalue(2) unroller = f.space.interpclass_w(w_unroller) if isinstance(unroller, SApplicationException): operr = unroller.operr w_result = f.space.call_function(w_exitfunc, operr.w_type, operr.get_w_val...
def def YIELD_VALUE(f, oparg, next_instr): raise Yield def RETURN_VALUE(self, oparg, next_instr): w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) ret...
453,094
def call_function(f, oparg, w_star=None, w_starstar=None): from pypy.rlib import rstack # for resume points from pypy.interpreter.function import is_builtin_code n_arguments = oparg & 0xff n_keywords = (oparg>>8) & 0xff if n_keywords: keywords = [None] * n_keywords keywords_w = [None] * n_keywords while True: n_keywor...
def call_function(f, oparg, w_star=None, w_starstar=None): from pypy.rlib import rstack # for resume points from pypy.interpreter.function import is_builtin_code n_arguments = oparg & 0xff n_keywords = (oparg>>8) & 0xff if n_keywords: keywords = [None] * n_keywords keywords_w = [None] * n_keywords while True: n_keywor...
453,095
def PyErr_WarnEx(space, w_category, message_ptr, stacklevel): """Issue a warning message. The category argument is a warning category (see below) or NULL; the message argument is a message string. stacklevel is a positive number giving a number of stack frames; the warning will be issued from the currently executing...
def PyErr_WarnEx(space, w_category, message_ptr, stacklevel): """Issue a warning message. The category argument is a warning category (see below) or NULL; the message argument is a message string. stacklevel is a positive number giving a number of stack frames; the warning will be issued from the currently executing...
453,096
def entry_point(argv): args = %s res = function(*args) print res return 0
def entry_point(argv): args = %s res = function(*args) print res return 0
453,097
def hash(space, w_obj): w_hash = space.lookup(w_obj, '__hash__') if w_hash is None: # xxx there used to be logic about "do we have __eq__ or __cmp__" # here, but it does not really make sense, as 'object' has a # default __hash__. This path should only be taken under very # obscure circumstances. return default_identi...
def hash(space, w_obj): w_hash = space.lookup(w_obj, '__hash__') if w_hash is None: # xxx there used to be logic about "do we have __eq__ or __cmp__" # here, but it does not really make sense, as 'object' has a # default __hash__.This path should only be taken under very # obscure circumstances. return default_identity...
453,098
def __init__(self, space): pass
def __init__(self, space): pass
453,099