bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def startup(self, space): state = space.fromcache(State) from pypy.module.cpyext.typeobject import setup_new_method_def setup_new_method_def(space) if not we_are_translated(): space.setattr(space.wrap(self), space.wrap('api_lib'), space.wrap(state.api_lib)) else: state.init_r2w_from_w2r() | def startup(self, space): state = space.fromcache(State) from pypy.module.cpyext.typeobject import setup_new_method_def setup_new_method_def(space) if not we_are_translated(): space.setattr(space.wrap(self), space.wrap('api_lib'), space.wrap(state.api_lib)) else: state.init_r2w_from_w2r() | 452,500 |
def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | 452,501 |
def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | 452,502 |
def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | 452,503 |
def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | def str_decode_utf_32_helper(s, size, errors, final=True, errorhandler=None, byteorder="native"): if errorhandler is None: errorhandler = raise_unicode_exception_decode bo = 0 if BYTEORDER == 'little': iorder = [0, 1, 2, 3] else: iorder = [3, 2, 1, 0] # Check for BOM marks (U+FEFF) in the input and adjust current # ... | 452,504 |
def annotate(func, values, inline=None, backendoptimize=True, type_system="lltype"): # build the normal ll graphs for ll_function t = TranslationContext() annpolicy = AnnotatorPolicy() annpolicy.allow_someobjects = False a = t.buildannotator(policy=annpolicy) argtypes = getargtypes(a, values) a.build_types(func, argtyp... | def annotate(func, values, inline=None, backendoptimize=True, type_system="lltype"): # build the normal ll graphs for ll_function t = TranslationContext() annpolicy = AnnotatorPolicy() annpolicy.allow_someobjects = False a = t.buildannotator(policy=annpolicy) argtypes = getargtypes(a, values) a.build_types(func, argtyp... | 452,505 |
def write_w(self, space, w_data): self._check_init(space) self._check_closed(space, "write to closed file") data = space.str_w(w_data) size = len(data) | def write_w(self, space, w_data): self._check_init(space) self._check_closed(space, "write to closed file") data = space.str_w(w_data) size = len(data) | 452,506 |
def EnumKey(space, w_hkey, index): """string = EnumKey(key, index) - Enumerates subkeys of an open registry key. | def EnumKey(space, w_hkey, index): """string = EnumKey(key, index) - Enumerates subkeys of an open registry key. | 452,507 |
def __init__(self, space, args_w, repeat_w): self.space = space self.gears_w = [x for x in args_w] * repeat_w.intval self.num_gears = len(self.gears_w) # initialization of indicies to loop over self.indicies = [(0, len(self.gears_w[x].wrappeditems)) for x in range(0, self.num_gears)] self.cont = True | def __init__(self, space, args_w, repeat_w): self.space = space self.gears_w = [x for x in args_w] * repeat_w.intval self.num_gears = len(self.gears_w) # initialization of indicies to loop over self.indicies = [(0, space.int_w(space.len(w_gear))) for w_gear in self.gears_w] self.cont = True | 452,508 |
def next_w(self): if not self.cont: raise OperationError(self.space.w_StopIteration, self.space.w_None) l = [] for x in range(0, self.num_gears): index, limit = self.indicies[x] l.append(self.gears_w[x].wrappeditems[index]) self.roll_gears() return self.space.newtuple(l) | def next_w(self): if not self.cont: raise OperationError(self.space.w_StopIteration, self.space.w_None) l = [] for x in range(0, self.num_gears): index, limit = self.indicies[x] l.append(self.space.getitem(self.gears_w[x], self.space.wrap(index))) self.roll_gears() return self.space.newtuple(l) | 452,509 |
from pypy.interpreter.typedef import TypeDef, GetSetProperty | from pypy.interpreter.typedef import TypeDef, GetSetProperty | 452,510 |
from pypy.interpreter.typedef import TypeDef, GetSetProperty | from pypy.interpreter.typedef import TypeDef, GetSetProperty | 452,511 |
def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltyp, _ = converter if typ == member_type: result = rffi.cast(rffi.CArrayPtr(lltyp), addr) w_result = space.wrap(result[0])... | 452,512 |
def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | 452,513 |
def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | 452,514 |
def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | 452,515 |
def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | def PyMember_GetOne(space, obj, w_member): addr = rffi.cast(ADDR, obj) addr += w_member.c_offset member_type = rffi.cast(lltype.Signed, w_member.c_type) for converter in integer_converters: typ, lltype, _ = converter if typ == member_type result = rffi.cast(rffi.CArrayPtr(lltype), addr) w_result = space.wrap(result[0]... | 452,516 |
def __init__(self, space, args_w, repeat_w): self.space = space self.gears_w = [x for x in args_w] * repeat_w.intval self.num_gears = len(self.gears_w) # initialization of indicies to loop over self.indicies = [(0, space.int_w(space.len(w_gear))) for w_gear in self.gears_w] self.cont = True | def __init__(self, space, args_w, w_repeat): self.space = space self.gears_w = [x for x in args_w] * space.int_w(w_repeat) self.num_gears = len(self.gears_w) # initialization of indicies to loop over self.indicies = [(0, space.int_w(space.len(w_gear))) for w_gear in self.gears_w] self.cont = True | 452,517 |
def W_Product__new__(space, args_w): star_args_w, kw_args_w = args_w.unpack() if len(kw_args_w) > 1: raise OperationError(space.w_TypeError, space.wrap("product() takes at most 1 argument (%d given)" % len(kw_args_w))) repeat = kw_args_w.get('repeat', space.wrap(1)) return space.wrap(W_Product(space, star_args_w[1:], r... | def W_Product__new__(space, args_w): star_args_w, kw_args_w = args_w.unpack() if len(kw_args_w) > 1: raise OperationError(space.w_TypeError, space.wrap("product() takes at most 1 argument (%d given)" % len(kw_args_w))) w_repeat = kw_args_w.get('repeat', space.wrap(1)) return space.wrap(W_Product(space, star_args_w[1:],... | 452,518 |
from pypy.interpreter.typedef import TypeDef, GetSetProperty | from pypy.interpreter.typedef import TypeDef, GetSetProperty | 452,519 |
def do_send_string(self, space, buffer, offset, size): # Since str2charp copies the buffer anyway, always combine the # "header" and the "body" of the message and send them at once. message = lltype.malloc(rffi.CCHARP.TO, size + 4, flavor='raw') try: rffi.cast(rffi.UINTP, message)[0] = r_uint(size) # XXX htonl! i = siz... | def do_send_string(self, space, buffer, offset, size): # Since str2charp copies the buffer anyway, always combine the # "header" and the "body" of the message and send them at once. message = lltype.malloc(rffi.CCHARP.TO, size + 4, flavor='raw') try: rffi.cast(rffi.UINTP, message)[0] = rffi.r_uint(size) # XXX htonl! i ... | 452,520 |
def f(self, op, fcond): assert fcond is not None a0 = op.getarg(0) a1 = op.getarg(1) arg1 = self.make_sure_var_in_reg(a0, selected_reg=r.r0) arg2 = self.make_sure_var_in_reg(a1, selected_reg=r.r1) assert arg1 == r.r0 assert arg2 == r.r1 spilled = False if isinstance(a0, Box) and self.stays_alive(a0): spilled = True sel... | def f(self, op, fcond): assert fcond is not None a0 = op.getarg(0) a1 = op.getarg(1) arg1 = self.make_sure_var_in_reg(a0, selected_reg=r.r0) arg2 = self.make_sure_var_in_reg(a1, selected_reg=r.r1) assert arg1 == r.r0 assert arg2 == r.r1 if isinstance(a0, Box) and self.stays_alive(a0): spilled = True self.force_spill_va... | 452,521 |
def f(self, op, fcond): assert fcond is not None a0 = op.getarg(0) a1 = op.getarg(1) arg1 = self.make_sure_var_in_reg(a0, selected_reg=r.r0) arg2 = self.make_sure_var_in_reg(a1, selected_reg=r.r1) assert arg1 == r.r0 assert arg2 == r.r1 spilled = False if isinstance(a0, Box) and self.stays_alive(a0): spilled = True sel... | def f(self, op, fcond): assert fcond is not None a0 = op.getarg(0) a1 = op.getarg(1) arg1 = self.make_sure_var_in_reg(a0, selected_reg=r.r0) arg2 = self.make_sure_var_in_reg(a1, selected_reg=r.r1) assert arg1 == r.r0 assert arg2 == r.r1 spilled = False if isinstance(a0, Box) and self.stays_alive(a0): self.force_spill_v... | 452,522 |
def f(self, op, fcond): assert fcond is not None a0 = op.getarg(0) a1 = op.getarg(1) arg1 = self.make_sure_var_in_reg(a0, selected_reg=r.r0) arg2 = self.make_sure_var_in_reg(a1, selected_reg=r.r1) assert arg1 == r.r0 assert arg2 == r.r1 spilled = False if isinstance(a0, Box) and self.stays_alive(a0): spilled = True sel... | def f(self, op, fcond): assert fcond is not None a0 = op.getarg(0) a1 = op.getarg(1) arg1 = self.make_sure_var_in_reg(a0, selected_reg=r.r0) arg2 = self.make_sure_var_in_reg(a1, selected_reg=r.r1) assert arg1 == r.r0 assert arg2 == r.r1 spilled = False if isinstance(a0, Box) and self.stays_alive(a0): spilled = True sel... | 452,523 |
>>> def f(): | >>> def f(): | 452,524 |
>>> def f(): | >>> def f(): | 452,525 |
>>> def f(): | >>> def f(): | 452,526 |
... def f(i): | ... def f(i): | 452,527 |
>>> def f(): return lambda x=(yield): 1 | >>> def f(): return lambda x=(yield): 1 | 452,528 |
>>> def f(): x = yield = y | >>> def f(): x = yield = y | 452,529 |
>>> def throw(g,exc): | >>> def throw(g,exc): | 452,530 |
def test_syntax_error(self): parse = self.parse exc = py.test.raises(SyntaxError, parse, "name another for").value assert exc.msg == "invalid syntax" assert exc.lineno == 1 assert exc.offset == 5 assert exc.text.startswith("name another for") exc = py.test.raises(SyntaxError, parse, "\"blah").value assert exc.msg == "E... | def test_syntax_error(self): parse = self.parse exc = py.test.raises(SyntaxError, parse, "name another for").value assert exc.msg == "invalid syntax" assert exc.lineno == 1 assert exc.offset == 5 assert exc.text.startswith("name another for") exc = py.test.raises(SyntaxError, parse, "\"blah").value assert exc.msg == "E... | 452,531 |
def test_syntax_error(self): parse = self.parse exc = py.test.raises(SyntaxError, parse, "name another for").value assert exc.msg == "invalid syntax" assert exc.lineno == 1 assert exc.offset == 5 assert exc.text.startswith("name another for") exc = py.test.raises(SyntaxError, parse, "\"blah").value assert exc.msg == "E... | def test_syntax_error(self): parse = self.parse exc = py.test.raises(SyntaxError, parse, "name another for").value assert exc.msg == "invalid syntax" assert exc.lineno == 1 assert exc.offset == 5 assert exc.text.startswith("name another for") exc = py.test.raises(SyntaxError, parse, "\"blah").value assert exc.msg == "E... | 452,532 |
def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowedPair from pypy.module.cpyext.pyobject import NullPointerException # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_b... | def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowedPair from pypy.module.cpyext.pyobject import NullPointerException # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_b... | 452,533 |
def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowedPair from pypy.module.cpyext.pyobject import NullPointerException # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_b... | def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowedPair from pypy.module.cpyext.pyobject import NullPointerException # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_b... | 452,534 |
def test_array_of_pointers(self): # tests array item assignements & pointer.contents = ... A = POINTER(c_int) * 24 a = A() l = c_long(2) p = pointer(l) a[3] = p assert l._objects is None assert p._objects == {'1':l} assert a._objects == {'3':{'1':l}} | def test_array_of_pointers(self): # tests array item assignements & pointer.contents = ... A = POINTER(c_long) * 24 a = A() l = c_long(2) p = pointer(l) a[3] = p assert l._objects is None assert p._objects == {'1':l} assert a._objects == {'3':{'1':l}} | 452,535 |
def load_module(self, space, fullname): w = space.wrap w_modules = space.sys.get('modules') try: return space.getitem(w_modules, w(fullname)) except OperationError, e: pass filename = self.mangle(fullname) last_exc = None for compiled, is_package, ext in ENUMERATE_EXTS: fname = filename + ext try: zip_file = RZipFile(s... | def load_module(self, space, fullname): w = space.wrap filename = self.mangle(fullname) last_exc = None for compiled, is_package, ext in ENUMERATE_EXTS: fname = filename + ext try: zip_file = RZipFile(self.filename, 'r') try: buf = zip_file.read(fname) finally: zip_file.close() except (KeyError, OSError): pass else: if... | 452,536 |
def PyRun_String(space, str, start, w_globals, w_locals): """This is a simplified interface to PyRun_StringFlags() below, leaving flags set to NULL.""" source = rffi.charp2str(str) filename = "<string>" return run_string(space, source, filename, start, w_globals, w_locals) | def PyRun_String(space, source, start, w_globals, w_locals): """This is a simplified interface to PyRun_StringFlags() below, leaving flags set to NULL.""" source = rffi.charp2str(str) filename = "<string>" return run_string(space, source, filename, start, w_globals, w_locals) | 452,537 |
def PyRun_String(space, str, start, w_globals, w_locals): """This is a simplified interface to PyRun_StringFlags() below, leaving flags set to NULL.""" source = rffi.charp2str(str) filename = "<string>" return run_string(space, source, filename, start, w_globals, w_locals) | def PyRun_String(space, str, start, w_globals, w_locals): """This is a simplified interface to PyRun_StringFlags() below, leaving flags set to NULL.""" source = rffi.charp2str(source) filename = "<string>" return run_string(space, source, filename, start, w_globals, w_locals) | 452,538 |
def _emit_copystrcontent(self, op, regalloc, fcond, is_unicode): # compute the source address args = list(op.getarglist()) base_loc, box = self._ensure_value_is_boxed(args[0], regalloc, args) args.append(box) ofs_loc, box = self._ensure_value_is_boxed(args[2], regalloc, args) args.append(box) assert args[0] is not args... | def _emit_copystrcontent(self, op, regalloc, fcond, is_unicode): # compute the source address args = list(op.getarglist()) base_loc, box = self._ensure_value_is_boxed(args[0], regalloc, args) args.append(box) ofs_loc, box = self._ensure_value_is_boxed(args[2], regalloc, args) args.append(box) assert args[0] is not args... | 452,539 |
def _emit_copystrcontent(self, op, regalloc, fcond, is_unicode): # compute the source address args = list(op.getarglist()) base_loc, box = self._ensure_value_is_boxed(args[0], regalloc, args) args.append(box) ofs_loc, box = self._ensure_value_is_boxed(args[2], regalloc, args) args.append(box) assert args[0] is not args... | def _emit_copystrcontent(self, op, regalloc, fcond, is_unicode): # compute the source address args = list(op.getarglist()) base_loc, box = self._ensure_value_is_boxed(args[0], regalloc, args) args.append(box) ofs_loc, box = self._ensure_value_is_boxed(args[2], regalloc, args) args.append(box) assert args[0] is not args... | 452,540 |
def errorhandler(errors, enc, msg, t, startingpos, endingpos): called[0] += 1 if called[0] == 1: assert errors == "foo!" assert enc == encoding assert t is s assert start == startingpos assert stop == endingpos return u"42424242", stop return "", endingpos | def errorhandler(errors, enc, msg, t, startingpos, endingpos): called[0] += 1 if called[0] == 1: assert errors == "foo!" assert enc == encoding assert t is s assert start == startingpos assert stop == endingpos return u"42424242", stop return "", endingpos | 452,541 |
def decorated_func(func): func._annspecialcase_ = 'specialize:memo()' return func | def decorated_func(func): func._annspecialcase_ = 'specialize:memo' return func | 452,542 |
def decorated_func(func): func._annspecialcase_ = 'specialize:ll()' return func | def decorated_func(func): func._annspecialcase_ = 'specialize:ll' return func | 452,543 |
def compute(self, graph): self.links = {} dotgen = DotGen(str(graph.no)) # split over debug_merge_points counter = 0 lines = graph.content.split("\n") lines_so_far = [] for line in lines: line = re.sub('.\[.*\]', '', line) boxes = re.findall('([pif]\d+)', line) for box in boxes: self.links[box] = box if 'debug_merge_po... | def compute(self, graph): self.links = {} dotgen = DotGen(str(graph.no)) # split over debug_merge_points counter = 0 lines = graph.content.split("\n") lines_so_far = [] for line in lines: line = re.sub('.\[.*\]', '', line) boxes = re.findall('([pif]\d+)', line) for box in boxes: self.links[box] = box if 'debug_merge_po... | 452,544 |
def test_TypeCheck(self, space, api): assert api.PyObject_TypeCheck(space.wrap(1), space.w_int) assert api.PyObject_TypeCheck(space.wrap(1), api.PyInt_Type) assert api.PyObject_TypeCheck(space.wrap('foo'), space.w_str) assert api.PyObject_TypeCheck(space.wrap('foo'), api.PyString_Type) assert api.PyObject_TypeCheck(spa... | def test_TypeCheck(self, space, api): assert api.PyObject_TypeCheck(space.wrap(1), space.w_int) assert api.PyObject_TypeCheck(space.wrap(1), api.PyInt_Type) assert api.PyObject_TypeCheck(space.wrap('foo'), space.w_str) assert api.PyObject_TypeCheck(space.wrap('foo'), api.PyString_Type) assert api.PyObject_TypeCheck(spa... | 452,545 |
def test_file_fromstring(self, space, api): filename = rffi.str2charp(str(udir / "_test_file")) mode = rffi.str2charp("wb") w_file = api.PyFile_FromString(filename, mode) rffi.free_charp(filename) rffi.free_charp(mode) | def test_file_fromstring(self, space, api): filename = rffi.str2charp(str(udir / "_test_file")) mode = rffi.str2charp("wb") w_file = api.PyFile_FromString(filename, mode) rffi.free_charp(filename) rffi.free_charp(mode) | 452,546 |
def time_time_llimpl(): void = lltype.nullptr(rffi.VOIDP.TO) result = -1.0 if self.HAVE_GETTIMEOFDAY: t = lltype.malloc(self.TIMEVAL, flavor='raw') | def time_time_llimpl(): void = lltype.nullptr(rffi.VOIDP.TO) result = -1.0 if self.HAVE_GETTIMEOFDAY: t = lltype.malloc(self.TIMEVAL, flavor='raw') | 452,547 |
def _freeze_(self): from pypy.interpreter.gateway import BuiltinCode if isinstance(self.code, BuiltinCode): identifier = self.code.identifier if Function._all.get(identifier, self) is not self: print "builtin code identifier %s used twice: %s and %s" % ( identifier, self, Function._all[identifier]) # we have been seen ... | def _freeze_(self): from pypy.interpreter.gateway import BuiltinCode if isinstance(self.code, BuiltinCode): # we have been seen by other means so rtyping should not choke # on us Function._all[identifier] = self return False | 452,548 |
def _freeze_(self): from pypy.interpreter.gateway import BuiltinCode if isinstance(self.code, BuiltinCode): identifier = self.code.identifier if Function._all.get(identifier, self) is not self: print "builtin code identifier %s used twice: %s and %s" % ( identifier, self, Function._all[identifier]) # we have been seen ... | def _freeze_(self): from pypy.interpreter.gateway import BuiltinCode if isinstance(self.code, BuiltinCode): identifier = self.code.identifier if Function._all.get(identifier, self) is not self: print "builtin code identifier %s used twice: %s and %s" % ( identifier, self, Function._all[identifier]) # we have been seen ... | 452,549 |
def getdict(w_self): return w_self.space.wrap(w_self.val.__dict__) | def getdict(w_self): return w_self.space.wrap(w_self.val.__dict__) | 452,550 |
def f(n): i = 0 while i < n: mydriver.can_enter_jit(i=i, n=n) mydriver.jit_merge_point(i=i, n=n) i += 1 | def f(n): i = 0 while i < n: mydriver.can_enter_jit(i=i, n=n) mydriver.jit_merge_point(i=i, n=n) i += 1 | 452,551 |
def f(n): i = 0 while i < n: mydriver.can_enter_jit(i=i, n=n) mydriver.jit_merge_point(i=i, n=n) i += 1 | def f(n): i = 0 while i < n: mydriver.can_enter_jit(i=i, n=n) mydriver.jit_merge_point(i=i, n=n) i += 1 | 452,552 |
def test_virtual_adder_make_virtual(): b2s, b3s, b4s, b5s = [BoxPtr(), BoxInt(3), BoxPtr(), BoxPtr()] c1s = ConstInt(111) storage = Storage() memo = ResumeDataLoopMemo(FakeMetaInterpStaticData()) modifier = ResumeDataVirtualAdder(storage, memo) modifier.liveboxes_from_env = {} modifier.liveboxes = {} modifier.vfieldbox... | def test_virtual_adder_make_virtual(): b2s, b3s, b4s, b5s = [BoxPtr(), BoxInt(3), BoxPtr(), BoxPtr()] c1s = ConstInt(111) storage = Storage() memo = ResumeDataLoopMemo(FakeMetaInterpStaticData()) modifier = ResumeDataVirtualAdder(storage, memo) modifier.liveboxes_from_env = {} modifier.liveboxes = {} modifier.vfieldbox... | 452,553 |
def cpython_api(argtypes, restype, error=_NOT_SPECIFIED, external=True): """ Declares a function to be exported. - `argtypes`, `restype` are lltypes and describe the function signature. - `error` is the value returned when an applevel exception is raised. The special value 'CANNOT_FAIL' (also when restype is Void) turn... | def cpython_api(argtypes, restype, error=_NOT_SPECIFIED, external=True): """ Declares a function to be exported. - `argtypes`, `restype` are lltypes and describe the function signature. - `error` is the value returned when an applevel exception is raised. The special value 'CANNOT_FAIL' (also when restype is Void) turn... | 452,554 |
def unwrapper(space, *args): from pypy.module.cpyext.pyobject import Py_DecRef from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowPair newargs = () to_decref = [] assert len(args) == len(api_function.argtypes) for i, (ARG, is_wrapped) in types_names_enum_ui: input_a... | def unwrapper(space, *args): from pypy.module.cpyext.pyobject import Py_DecRef from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowPair newargs = () to_decref = [] assert len(args) == len(api_function.argtypes) for i, (ARG, is_wrapped) in types_names_enum_ui: input_a... | 452,555 |
def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowPair # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_bottom(lltype.Void) # marker for trackgcroot.py rffi.stackcoun... | def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowPair # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_bottom(lltype.Void) # marker for trackgcroot.py rffi.stackcoun... | 452,556 |
def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowPair # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_bottom(lltype.Void) # marker for trackgcroot.py rffi.stackcoun... | def wrapper(*args): from pypy.module.cpyext.pyobject import make_ref, from_ref from pypy.module.cpyext.pyobject import BorrowPair # we hope that malloc removal removes the newtuple() that is # inserted exactly here by the varargs specializer llop.gc_stack_bottom(lltype.Void) # marker for trackgcroot.py rffi.stackcoun... | 452,557 |
def test_debugger_on(self): from pypy.tool.logparser import parse_log_file, extract_category from pypy.rlib import debug loop = """ [i0] debug_merge_point('xyz', 0) i1 = int_add(i0, 1) i2 = int_ge(i1, 10) guard_false(i2) [] jump(i1) """ ops = parse(loop) debug._log = dlog = debug.DebugLog() try: self.cpu.assembler.set... | def test_debugger_on(self): from pypy.tool.logparser import parse_log_file, extract_category from pypy.rlib import debug loop = """ [i0] debug_merge_point('xyz', 0) i1 = int_add(i0, 1) i2 = int_ge(i1, 10) guard_false(i2) [] jump(i1) """ ops = parse(loop) debug._log = dlog = debug.DebugLog() try: self.cpu.assembler.set... | 452,558 |
def test_opaque_obj_2(self): FILEP = rffi.COpaquePtr('FILE') fopen = rffi.llexternal('fopen', [rffi.CCHARP, rffi.CCHARP], FILEP) fclose = rffi.llexternal('fopen', [FILEP], rffi.INT) tmppath = udir.join('test_ll2ctypes.test_opaque_obj_2') ll_file = fopen(str(tmppath), "w") assert ll_file fclose(ll_file) assert tmppath.c... | def test_opaque_obj_2(self): FILEP = rffi.COpaquePtr('FILE') fopen = rffi.llexternal('fopen', [rffi.CCHARP, rffi.CCHARP], FILEP) fclose = rffi.llexternal('fclose', [FILEP], rffi.INT) tmppath = udir.join('test_ll2ctypes.test_opaque_obj_2') ll_file = fopen(str(tmppath), "w") assert ll_file fclose(ll_file) assert tmppath.... | 452,559 |
def create_spec(space, w_arg): if isinstance(w_arg, Method): w_function = w_arg.w_function class_name = w_arg.w_class.getname(space, '?') if isinstance(w_function, Function): name = w_function.name else: name = '?' return "{method '%s' of '%s' objects}" % (name, class_name) elif isinstance(w_arg, Function): if w_arg.w_... | def create_spec(space, w_arg): if isinstance(w_arg, Method): w_function = w_arg.w_function class_name = space.type(w_arg).getname(space, '?') if isinstance(w_function, Function): name = w_function.name else: name = '?' return "{method '%s' of '%s' objects}" % (name, class_name) elif isinstance(w_arg, Function): if w_ar... | 452,560 |
def _emit_guard(self, op, arglocs, fcond, save_exc=False): descr = op.getdescr() assert isinstance(descr, AbstractFailDescr) self.guard_descrs.append(descr) if not we_are_translated() and hasattr(op, 'getfailargs'): print 'Failargs: ', op.getfailargs() | def _emit_guard(self, op, arglocs, fcond, save_exc=False): descr = op.getdescr() assert isinstance(descr, AbstractFailDescr) self.guard_descrs.append(descr) if not we_are_translated() and hasattr(op, 'getfailargs'): print 'Failargs: ', op.getfailargs() | 452,561 |
def _cmp_guard_class(self, op, locs, regalloc, fcond): offset = locs[2] if offset is not None: if offset.is_imm(): self.mc.LDR_ri(r.ip.value, locs[0].value, offset.value) else: assert offset.is_reg() self.mc.LDR_rr(r.ip.value, locs[0].value, offset.value) self.mc.CMP_rr(r.ip.value, locs[1].value) else: raise NotImpleme... | def _cmp_guard_class(self, op, locs, regalloc, fcond): offset = locs[2] if offset is not None: if offset.is_imm(): self.mc.LDR_ri(r.ip.value, locs[0].value, offset.value) else: assert offset.is_reg() self.mc.LDR_rr(r.ip.value, locs[0].value, offset.value) self.mc.CMP_rr(r.ip.value, locs[1].value) else: raise NotImpleme... | 452,562 |
def _emit_copystrcontent(self, op, regalloc, fcond, is_unicode): # compute the source address args = list(op.getarglist()) base_loc, box = self._ensure_value_is_boxed(args[0], regalloc, args) args.append(box) ofs_loc, box = self._ensure_value_is_boxed(args[2], regalloc, args) args.append(box) assert args[0] is not args... | def _emit_copystrcontent(self, op, regalloc, fcond, is_unicode): # compute the source address args = list(op.getarglist()) base_loc, box = self._ensure_value_is_boxed(args[0], regalloc, args) args.append(box) ofs_loc, box = self._ensure_value_is_boxed(args[2], regalloc, args) args.append(box) assert args[0] is not args... | 452,563 |
def convert_exportsymbols_to_file(self): if not self.export_symbols: return self num = 0 while 1: file_name = udir.join('dynamic-symbols-%i' % num) num += 1 if not file_name.check(): break | def convert_exportsymbols_to_file(self): if not self.export_symbols: return self num = 0 while 1: file_name = udir.join('dynamic-symbols-%i' % num) num += 1 if not file_name.check(): break | 452,564 |
def convert_exportsymbols_to_file(self): if not self.export_symbols: return self num = 0 while 1: file_name = udir.join('dynamic-symbols-%i' % num) num += 1 if not file_name.check(): break | def convert_exportsymbols_to_file(self): if not self.export_symbols: return self num = 0 while 1: file_name = udir.join('dynamic-symbols-%i' % num) num += 1 if not file_name.check(): break | 452,565 |
def test_export_function2(self): import sys init = """ if (Py_IsInitialized()) Py_InitModule("foo", methods); """ body = """ static PyObject* my_objects[1]; static PyObject* foo_cached_pi(PyObject* self, PyObject *args) { if (my_objects[0] == NULL) { my_objects[0] = PyFloat_FromDouble(3.14); Py_INCREF(my_objects[0]); }... | def test_export_function2(self): import sys init = """ if (Py_IsInitialized()) Py_InitModule("foo", methods); """ body = """ static PyObject* my_objects[1]; static PyObject* foo_cached_pi(PyObject* self, PyObject *args) { if (my_objects[0] == NULL) { my_objects[0] = PyFloat_FromDouble(3.14); Py_INCREF(my_objects[0]); }... | 452,566 |
def test_internal_exceptions(self): py.test.skip("Useful to see how programming errors look like") import sys init = """ if (Py_IsInitialized()) Py_InitModule("foo", methods); """ body = """ static PyObject* foo_crash1(PyObject* self, PyObject *args) { return PyPy_Crash1(); } static PyObject* foo_crash2(PyObject* self,... | def test_internal_exceptions(self): skip("Useful to see how programming errors look like") import sys init = """ if (Py_IsInitialized()) Py_InitModule("foo", methods); """ body = """ static PyObject* foo_crash1(PyObject* self, PyObject *args) { return PyPy_Crash1(); } static PyObject* foo_crash2(PyObject* self, PyObjec... | 452,567 |
def _getfilesystemencoding(space): if sys.platform == "win32": encoding = "mbcs" elif sys.platform == "darwin": encoding = "utf-8" else: encoding = None # CPython does this at startup time, I don't thing it matter that much if rlocale.HAVE_LANGINFO and rlocale.CODESET: oldlocale = rlocale.setlocale(rlocale.LC_CTYPE, No... | def _getfilesystemencoding(space): if sys.platform == "win32": encoding = "mbcs" elif sys.platform == "darwin": encoding = "utf-8" else: encoding = None # CPython does this at startup time, I don't thing it matter that much if rlocale.HAVE_LANGINFO and rlocale.CODESET: oldlocale = rlocale.setlocale(rlocale.LC_CTYPE, No... | 452,568 |
def _args_for_shared(self, args): return (self.shared_only + ['-bundle', '-undefined', 'dynamic_lookup'] + args) | def _args_for_shared(self, args): return (self.shared_only + ['-dynamiclib', '-undefined', 'dynamic_lookup'] + args) | 452,569 |
def library_dirs_for_libffi(self): return [] | def library_dirs_for_libffi(self): return [] | 452,570 |
def descr_set__bases__(space, w_type, w_value): # this assumes all app-level type objects are W_TypeObject from pypy.objspace.std.typeobject import W_TypeObject from pypy.objspace.std.typeobject import check_and_find_best_base from pypy.objspace.std.typeobject import get_parent_layout from pypy.objspace.std.typeobject ... | def descr_set__bases__(space, w_type, w_value): # this assumes all app-level type objects are W_TypeObject from pypy.objspace.std.typeobject import W_TypeObject from pypy.objspace.std.typeobject import check_and_find_best_base from pypy.objspace.std.typeobject import get_parent_layout from pypy.objspace.std.typeobject ... | 452,571 |
def normalize_exception(self, space): """Normalize the OperationError. In other words, fix w_type and/or w_value to make sure that the __class__ of w_value is exactly w_type. """ # # This method covers all ways in which the Python statement # "raise X, Y" can produce a valid exception type and instance. # # In the fol... | def normalize_exception(self, space): """Normalize the OperationError. In other words, fix w_type and/or w_value to make sure that the __class__ of w_value is exactly w_type. """ # # This method covers all ways in which the Python statement # "raise X, Y" can produce a valid exception type and instance. # # In the fol... | 452,572 |
def decorated_func(func): func._annspecialcase_ = 'args' + self._wrap(args) return func | def decorated_func(func): func._annspecialcase_ = 'arg' + self._wrap(args) return func | 452,573 |
def decorated_func(func): func._annspecialcase_ = 'argtypes' + self._wrap(args) return func | def decorated_func(func): func._annspecialcase_ = 'argtype' + self._wrap(args) return func | 452,574 |
def main(n): i = 0 while i < n+OFFSET: i = f(f(i)) return i | def main(n): i = 0 while i < n+OFFSET: i = f(f(i)) return i | 452,575 |
def main(n): i = 0 while i < n+OFFSET: i = f(f(i)) return i | def main(n): i = 0 while i < n+OFFSET: i = f(f(i)) return i | 452,576 |
def main(n): i = 0 while i < n+OFFSET: i = f(f(i)) return i | def main(n): i = 0 while i < n+OFFSET: i = f(f(i)) return i | 452,577 |
def compile_ast(self, node, filename, mode, flags): future_features = misc.parse_future(node) info = pyparse.CompileInfo(filename, mode, flags, future_flags) return self._compile_ast(node, info) | def compile_ast(self, node, filename, mode, flags): future_pos = misc.parse_future(node) info = pyparse.CompileInfo(filename, mode, flags, future_pos) return self._compile_ast(node, info) | 452,578 |
def check___thread(self): return True | def check___thread(self): return True | 452,579 |
def test_virtual_constant_isnull(self): ops = """ [i0] p0 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p0, NULL, descr=nextdescr) p2 = getfield_gc(p0, descr=nextdescr) i1 = ptr_eq(p2, NULL) jump(i1) """ expected = """ [i0] jump(1) """ self.optimize_loop(ops, 'Not', expected) | def test_virtual_constant_isnull(self): ops = """ [i0] p0 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p0, NULL, descr=nextdescr) p2 = getfield_gc(p0, descr=nextdescr) i1 = ptr_eq(p2, NULL) jump(i1) """ expected = """ [i0] jump(1) """ self.optimize_loop(ops, 'Not', expected) | 452,580 |
def test_virtual_constant_isnonnull(self): ops = """ [i0] p0 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p0, ConstPtr(myptr), descr=nextdescr) p2 = getfield_gc(p0, descr=nextdescr) i1 = ptr_eq(p2, NULL) jump(i1) """ expected = """ [i0] jump(0) """ self.optimize_loop(ops, 'Not', expected) | def test_virtual_constant_isnonnull(self): ops = """ [i0] p0 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p0, ConstPtr(myptr), descr=nextdescr) p2 = getfield_gc(p0, descr=nextdescr) i1 = ptr_eq(p2, NULL) jump(i1) """ preamble = """ [i0] jump() """ expected = """ [] jump() """ self.optimize_loop(ops, 'Not', ex... | 452,581 |
def test_nonvirtual_2(self): ops = """ [i, p0] i0 = getfield_gc(p0, descr=valuedescr) escape(p0) i1 = int_add(i0, i) p1 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1, i1, descr=valuedescr) jump(i, p1) """ expected = ops self.optimize_loop(ops, 'Not, Not', expected) | def test_nonvirtual_2(self): ops = """ [i, p0] i0 = getfield_gc(p0, descr=valuedescr) escape(p0) i1 = int_add(i0, i) p1 = new_with_vtable(ConstClass(node_vtable)) setfield_gc(p1, i1, descr=valuedescr) jump(i, p1) """ expected = ops self.optimize_loop(ops, 'Not, Not', expected) | 452,582 |
def test_getfield_gc_nonpure_2(self): ops = """ [i] i1 = getfield_gc(ConstPtr(myptr), descr=valuedescr) jump(i1) """ expected = ops self.optimize_loop(ops, 'Not', expected) | def test_getfield_gc_nonpure_2(self): ops = """ [i] i1 = getfield_gc(ConstPtr(myptr), descr=valuedescr) jump(i1) """ expected = ops self.optimize_loop(ops, 'Not', expected) | 452,583 |
def test_varray_alloc_and_set(self): ops = """ [i1] p1 = new_array(2, descr=arraydescr) setarrayitem_gc(p1, 0, 25, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) jump(i2) """ expected = """ [i1] jump(0) """ self.optimize_loop(ops, 'Not', expected) | def test_varray_alloc_and_set(self): ops = """ [i1] p1 = new_array(2, descr=arraydescr) setarrayitem_gc(p1, 0, 25, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) jump(i2) """ preamble = """ [i1] jump(0) """ self.optimize_loop(ops, 'Not', expected) | 452,584 |
def test_varray_alloc_and_set(self): ops = """ [i1] p1 = new_array(2, descr=arraydescr) setarrayitem_gc(p1, 0, 25, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) jump(i2) """ expected = """ [i1] jump(0) """ self.optimize_loop(ops, 'Not', expected) | def test_varray_alloc_and_set(self): ops = """ [i1] p1 = new_array(2, descr=arraydescr) setarrayitem_gc(p1, 0, 25, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) jump(i2) """ expected = """ [i1] jump(0) """ self.optimize_loop(ops, 'Not', expected) | 452,585 |
def test_varray_2(self): ops = """ [i0, p1] i1 = getarrayitem_gc(p1, 0, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) i3 = int_sub(i1, i2) guard_value(i3, 15) [] p2 = new_array(2, descr=arraydescr) setarrayitem_gc(p2, 1, i0, descr=arraydescr) setarrayitem_gc(p2, 0, 20, descr=arraydescr) jump(i0, p2) "... | def test_varray_2(self): ops = """ [i0, p1] i1 = getarrayitem_gc(p1, 0, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) i3 = int_sub(i1, i2) guard_value(i3, 15) [] p2 = new_array(2, descr=arraydescr) setarrayitem_gc(p2, 1, i0, descr=arraydescr) setarrayitem_gc(p2, 0, 20, descr=arraydescr) jump(i0, p2) "... | 452,586 |
def test_varray_2(self): ops = """ [i0, p1] i1 = getarrayitem_gc(p1, 0, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) i3 = int_sub(i1, i2) guard_value(i3, 15) [] p2 = new_array(2, descr=arraydescr) setarrayitem_gc(p2, 1, i0, descr=arraydescr) setarrayitem_gc(p2, 0, 20, descr=arraydescr) jump(i0, p2) "... | def test_varray_2(self): ops = """ [i0, p1] i1 = getarrayitem_gc(p1, 0, descr=arraydescr) i2 = getarrayitem_gc(p1, 1, descr=arraydescr) i3 = int_sub(i1, i2) guard_value(i3, 15) [] p2 = new_array(2, descr=arraydescr) setarrayitem_gc(p2, 1, i0, descr=arraydescr) setarrayitem_gc(p2, 0, 20, descr=arraydescr) jump(i0, p2) "... | 452,587 |
def target(self, driver, args): driver.exe_name = 'pypy-%(backend)s' | def target(self, driver, args): driver.exe_name = 'pypy-%(backend)s' | 452,588 |
def compile(self, filename=None, mode='exec', flag=generators.compiler_flag, dont_inherit=0, _genframe=None): """ return compiled code object. if filename is None invent an artificial filename which displays the source/line position of the caller frame. """ if not filename or py.path.local(filename).check(file=0): if _... | def compile(self, filename=None, mode='exec', flag=generators.compiler_flag, dont_inherit=0, _genframe=None): """ return compiled code object. if filename is None invent an artificial filename which displays the source/line position of the caller frame. """ if not filename or py.path.local(filename).check(file=0): if _... | 452,589 |
def compile(self, filename=None, mode='exec', flag=generators.compiler_flag, dont_inherit=0, _genframe=None): """ return compiled code object. if filename is None invent an artificial filename which displays the source/line position of the caller frame. """ if not filename or py.path.local(filename).check(file=0): if _... | def compile(self, filename=None, mode='exec', flag=generators.compiler_flag, dont_inherit=0, _genframe=None): """ return compiled code object. if filename is None invent an artificial filename which displays the source/line position of the caller frame. """ if not filename or py.path.local(filename).check(file=0): if _... | 452,590 |
def build_bridge(space): "NOT_RPYTHON" from pypy.module.cpyext.pyobject import make_ref export_symbols = list(FUNCTIONS) + SYMBOLS_C + list(GLOBALS) from pypy.translator.c.database import LowLevelDatabase db = LowLevelDatabase() generate_macros(export_symbols, rename=True, do_deref=True) # Structure declaration code... | def build_bridge(space): "NOT_RPYTHON" from pypy.module.cpyext.pyobject import make_ref export_symbols = list(FUNCTIONS) + SYMBOLS_C + list(GLOBALS) from pypy.translator.c.database import LowLevelDatabase db = LowLevelDatabase() generate_macros(export_symbols, rename=True, do_deref=True) # Structure declaration code... | 452,591 |
def f(a,b): if a < 0: return -1 return a-b | def f(a,b): if a < 0: return -1 return a-b | 452,592 |
def f(a,b): if a < 0: return -1 return a-b | def f(a,b): if a < 0: return -1 return a-b | 452,593 |
def B_offs(self, target_ofs, c=cond.AL): target = target_ofs-arch.PC_OFFSET/2 pos = self.currpos() if target_ofs > pos: raise NotImplementedError else: if target >= 0 and target <= 0xFF: pos = self.currpos() target_ofs = pos - target_ofs target = WORD + target_ofs + arch.PC_OFFSET/2 self.SUB_ri(reg.pc.value, reg.pc.val... | def B_offs(self, target_ofs, c=cond.AL): pos = self.currpos() if target_ofs > pos: raise NotImplementedError else: if target >= 0 and target <= 0xFF: pos = self.currpos() target_ofs = pos - target_ofs target = WORD + target_ofs + arch.PC_OFFSET/2 self.SUB_ri(reg.pc.value, reg.pc.value, target, cond=c) else: assert c ==... | 452,594 |
def B_offs(self, target_ofs, c=cond.AL): target = target_ofs-arch.PC_OFFSET/2 pos = self.currpos() if target_ofs > pos: raise NotImplementedError else: if target >= 0 and target <= 0xFF: pos = self.currpos() target_ofs = pos - target_ofs target = WORD + target_ofs + arch.PC_OFFSET/2 self.SUB_ri(reg.pc.value, reg.pc.val... | def B_offs(self, target_ofs, c=cond.AL): target = target_ofs-arch.PC_OFFSET/2 pos = self.currpos() if target_ofs > pos: raise NotImplementedError else: if target >= 0 and target <= 0xFF: self.SUB_ri(reg.pc.value, reg.pc.value, target, cond=c) else: assert c == cond.AL self.LDR_ri(reg.ip.value, reg.pc.value, cond=c) sel... | 452,595 |
def B_offs(self, target_ofs, c=cond.AL): target = target_ofs-arch.PC_OFFSET/2 pos = self.currpos() if target_ofs > pos: raise NotImplementedError else: if target >= 0 and target <= 0xFF: pos = self.currpos() target_ofs = pos - target_ofs target = WORD + target_ofs + arch.PC_OFFSET/2 self.SUB_ri(reg.pc.value, reg.pc.val... | def B_offs(self, target_ofs, c=cond.AL): target = target_ofs-arch.PC_OFFSET/2 pos = self.currpos() if target_ofs > pos: raise NotImplementedError else: if target >= 0 and target <= 0xFF: target += 2 * WORD self.SUB_ri(reg.pc.value, reg.pc.value, target, cond=c) else: assert c == cond.AL self.LDR_ri(reg.ip.value, reg.pc... | 452,596 |
def setup_class(cls): cls.space = space = gettestobjspace(usemodules=['cpyext', 'thread']) | def setup_class(cls): cls.space = space = gettestobjspace(usemodules=['cpyext', 'thread']) | 452,597 |
def test_get_rid_of_debug_merge_point(self): operations = [ ResOperation(rop.DEBUG_MERGE_POINT, ['dummy'], None), ] gc_ll_descr = self.gc_ll_descr gc_ll_descr.rewrite_assembler(None, operations) assert len(operations) == 0 | def test_get_rid_of_debug_merge_point(self): operations = [ ResOperation(rop.DEBUG_MERGE_POINT, ['dummy', 2], None), ] gc_ll_descr = self.gc_ll_descr gc_ll_descr.rewrite_assembler(None, operations) assert len(operations) == 0 | 452,598 |
def test_fromtimestamp(self, space, api): w_args = space.wrap((0,)) w_date = api.PyDate_FromTimestamp(w_args) assert space.unwrap(space.str(w_date)) == '1970-01-01' | def test_fromtimestamp(self, space, api): w_args = space.wrap((0,)) w_date = api.PyDate_FromTimestamp(w_args) assert space.unwrap(space.str(w_date)) == '1970-01-01' | 452,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.