Author: Maciej Fijalkowski <[email protected]>
Branch: optresult
Changeset: r77752:0308c512080c
Date: 2015-06-02 10:31 +0200
http://bitbucket.org/pypy/pypy/changeset/0308c512080c/
Log: fix RECORD_KNOWN_CLASS
diff --git a/rpython/jit/metainterp/optimizeopt/rewrite.py
b/rpython/jit/metainterp/optimizeopt/rewrite.py
--- a/rpython/jit/metainterp/optimizeopt/rewrite.py
+++ b/rpython/jit/metainterp/optimizeopt/rewrite.py
@@ -345,14 +345,15 @@
self.optimize_guard(op, CONST_0)
def optimize_RECORD_KNOWN_CLASS(self, op):
- value = self.getvalue(op.getarg(0))
+ opinfo = self.getptrinfo(op.getarg(0))
expectedclassbox = op.getarg(1)
assert isinstance(expectedclassbox, Const)
- realclassbox = value.get_constant_class(self.optimizer.cpu)
- if realclassbox is not None:
- assert realclassbox.same_constant(expectedclassbox)
- return
- value.make_constant_class(None, expectedclassbox)
+ if opinfo is not None:
+ realclassbox = opinfo.get_known_class(self.optimizer.cpu)
+ if realclassbox is not None:
+ assert realclassbox.same_constant(expectedclassbox)
+ return
+ self.make_constant_class(op.getarg(0), expectedclassbox)
def optimize_GUARD_CLASS(self, op):
expectedclassbox = op.getarg(1)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit