Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r69279:c9f9e30aac58 Date: 2014-02-23 09:08 +0100 http://bitbucket.org/pypy/pypy/changeset/c9f9e30aac58/
Log: Unsure if "instance_ptr_iszero" and "instance_ptr_nonzero" are meant to appear or not during codewriting. Right now they do, and then metainterp crashes because they are not actually implemented. Fix? diff --git a/rpython/jit/codewriter/jtransform.py b/rpython/jit/codewriter/jtransform.py --- a/rpython/jit/codewriter/jtransform.py +++ b/rpython/jit/codewriter/jtransform.py @@ -967,8 +967,7 @@ if self._is_rclass_instance(op.args[0]): assert self._is_rclass_instance(op.args[1]) op = SpaceOperation('instance_ptr_eq', op.args, op.result) - prefix = 'instance_' - op1 = self._rewrite_equality(op, prefix + 'ptr_iszero') + op1 = self._rewrite_equality(op, 'ptr_iszero') return self._rewrite_cmp_ptrs(op1) def rewrite_op_ptr_ne(self, op): @@ -976,8 +975,7 @@ if self._is_rclass_instance(op.args[0]): assert self._is_rclass_instance(op.args[1]) op = SpaceOperation('instance_ptr_ne', op.args, op.result) - prefix = 'instance_' - op1 = self._rewrite_equality(op, prefix + 'ptr_nonzero') + op1 = self._rewrite_equality(op, 'ptr_nonzero') return self._rewrite_cmp_ptrs(op1) rewrite_op_ptr_iszero = _rewrite_cmp_ptrs diff --git a/rpython/jit/codewriter/test/test_jtransform.py b/rpython/jit/codewriter/test/test_jtransform.py --- a/rpython/jit/codewriter/test/test_jtransform.py +++ b/rpython/jit/codewriter/test/test_jtransform.py @@ -705,8 +705,8 @@ c0 = const(lltype.nullptr(rclass.OBJECT)) for opname, newopname, reducedname in [ - ('ptr_eq', 'instance_ptr_eq', 'instance_ptr_iszero'), - ('ptr_ne', 'instance_ptr_ne', 'instance_ptr_nonzero') + ('ptr_eq', 'instance_ptr_eq', 'ptr_iszero'), + ('ptr_ne', 'instance_ptr_ne', 'ptr_nonzero') ]: op = SpaceOperation(opname, [v1, v2], v3) op1 = Transformer().rewrite_operation(op) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit