Author: Alex Gaynor <[email protected]>
Branch: numpy-exp
Changeset: r44171:c22947443cc9
Date: 2011-05-14 16:27 -0500
http://bitbucket.org/pypy/pypy/changeset/c22947443cc9/
Log: Use alternative hack that arigato came up with.
diff --git a/pypy/module/micronumpy/interp_numarray.py
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -124,6 +124,8 @@
Intermediate class for performing binary operations.
"""
_immutable_fields_ = ["opcode", "left", "right"]
+ # Hack for test_zjit so the annotator doesn't see the bytecode as constant
+ opcode = "?"
def __init__(self, opcode, left, right):
VirtualArray.__init__(self)
diff --git a/pypy/module/micronumpy/test/test_zjit.py
b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -2,7 +2,6 @@
from pypy.module.micronumpy.interp_numarray import (SingleDimArray, BinOp,
FloatWrapper, Call)
from pypy.module.micronumpy.interp_ufuncs import negative_impl
-from pypy.rlib.nonconst import NonConstant
class FakeSpace(object):
@@ -18,7 +17,7 @@
def f(i):
ar = SingleDimArray(i)
if i:
- v = BinOp(NonConstant('a'), ar, ar)
+ v = BinOp('a', ar, ar)
else:
v = ar
return v.get_concrete().storage[3]
@@ -35,7 +34,7 @@
def f(i):
ar = SingleDimArray(i)
if i:
- v = BinOp(NonConstant('a'), ar, FloatWrapper(4.5))
+ v = BinOp('a', ar, FloatWrapper(4.5))
else:
v = ar
return v.get_concrete().storage[3]
@@ -69,7 +68,7 @@
space = self.space
def f(i):
ar = SingleDimArray(i)
- v1 = BinOp(NonConstant('a'), ar, ar)
+ v1 = BinOp('a', ar, ar)
v2 = Call(negative_impl, v1)
return v2.get_concrete().storage[3]
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit