[pypy-commit] pypy win64-stage1: a few more int/long unifications.
ctismer
noreply at buildbot.pypy.org
Thu Nov 24 00:26:25 CET 2011
Author: Christian Tismer <tismer at stackless.com>
Branch: win64-stage1
Changeset: r49712:11e3b3558e79
Date: 2011-11-23 23:05 +0100
http://bitbucket.org/pypy/pypy/changeset/11e3b3558e79/
Log: a few more int/long unifications. XXX I think this should be
replaced by a range checking function.
diff --git a/pypy/annotation/builtin.py b/pypy/annotation/builtin.py
--- a/pypy/annotation/builtin.py
+++ b/pypy/annotation/builtin.py
@@ -163,7 +163,7 @@
r.const = False
return r
- assert not issubclass(typ, (int,long)) or typ in (bool, int), (
+ assert not issubclass(typ, (int, long)) or typ in (bool, int), (
"for integers only isinstance(.,int|r_uint) are supported")
if s_obj.is_constant():
diff --git a/pypy/jit/backend/test/runner_test.py b/pypy/jit/backend/test/runner_test.py
--- a/pypy/jit/backend/test/runner_test.py
+++ b/pypy/jit/backend/test/runner_test.py
@@ -454,7 +454,7 @@
if cpu.supports_floats:
def func(f, i):
assert isinstance(f, float)
- assert isinstance(i, int)
+ assert isinstance(i, (int, long))
return f - float(i)
FPTR = self.Ptr(self.FuncType([lltype.Float, lltype.Signed],
lltype.Float))
diff --git a/pypy/jit/backend/test/support.py b/pypy/jit/backend/test/support.py
--- a/pypy/jit/backend/test/support.py
+++ b/pypy/jit/backend/test/support.py
@@ -24,7 +24,7 @@
from pypy.annotation import model as annmodel
for arg in args:
- assert isinstance(arg, int)
+ assert isinstance(arg, (int, long))
self.pre_translation_hook()
t = self._get_TranslationContext()
diff --git a/pypy/jit/codewriter/test/test_longlong.py b/pypy/jit/codewriter/test/test_longlong.py
--- a/pypy/jit/codewriter/test/test_longlong.py
+++ b/pypy/jit/codewriter/test/test_longlong.py
@@ -32,7 +32,7 @@
def test_functions():
xll = longlong.getfloatstorage(3.5)
assert longlong.getrealfloat(xll) == 3.5
- assert isinstance(longlong.gethash(xll), int)
+ assert isinstance(longlong.gethash(xll), (int, long))
class TestLongLong:
diff --git a/pypy/jit/metainterp/executor.py b/pypy/jit/metainterp/executor.py
--- a/pypy/jit/metainterp/executor.py
+++ b/pypy/jit/metainterp/executor.py
@@ -248,7 +248,7 @@
def do_read_timestamp(cpu, _):
x = read_timestamp()
if longlong.is_64_bit:
- assert isinstance(x, int) # 64-bit
+ assert isinstance(x, (int, long)) # 64-bit
return BoxInt(x)
else:
assert isinstance(x, r_longlong) # 32-bit
diff --git a/pypy/jit/tl/tlc.py b/pypy/jit/tl/tlc.py
--- a/pypy/jit/tl/tlc.py
+++ b/pypy/jit/tl/tlc.py
@@ -219,7 +219,7 @@
class Frame(object):
def __init__(self, args, pc):
- assert isinstance(pc, int)
+ assert isinstance(pc, (int, long))
self.args = args
self.pc = pc
self.stack = []
@@ -239,7 +239,7 @@
return interp_eval(code, pc, args, pool).int_o()
def interp_eval(code, pc, args, pool):
- assert isinstance(pc, int)
+ assert isinstance(pc, (int, long))
frame = Frame(args, pc)
pc = frame.pc
diff --git a/pypy/rpython/llinterp.py b/pypy/rpython/llinterp.py
--- a/pypy/rpython/llinterp.py
+++ b/pypy/rpython/llinterp.py
@@ -1126,7 +1126,7 @@
def op_oonewarray(self, ARRAY, length):
assert isinstance(ARRAY, ootype.Array)
- assert isinstance(length, int)
+ assert isinstance(length, (int, long))
return ootype.oonewarray(ARRAY, length)
def op_runtimenew(self, class_):
diff --git a/pypy/rpython/memory/gc/markcompact.py b/pypy/rpython/memory/gc/markcompact.py
--- a/pypy/rpython/memory/gc/markcompact.py
+++ b/pypy/rpython/memory/gc/markcompact.py
@@ -353,7 +353,7 @@
# like header(), but asserts that we have a forwarding header
hdr = MovingGCBase.header(self, addr)
if not we_are_translated():
- assert isinstance(hdr.tid, int)
+ assert isinstance(hdr.tid, (int, long))
return hdr
def combine(self, typeid16, flags):
More information about the pypy-commit
mailing list