[pypy-commit] pypy translation-cleanup: Kill old implementations of WITH_CLEANUP in pyopcode.py
rlamy
noreply at buildbot.pypy.org
Sun Sep 23 19:48:01 CEST 2012
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: translation-cleanup
Changeset: r57487:3aaa14c0dc52
Date: 2012-09-23 18:47 +0100
http://bitbucket.org/pypy/pypy/changeset/3aaa14c0dc52/
Log: Kill old implementations of WITH_CLEANUP in pyopcode.py
It's only the translator that needs to know about old
implementations, not the interpreter.
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -942,21 +942,9 @@
def WITH_CLEANUP(self, oparg, next_instr):
# see comment in END_FINALLY for stack state
- # This opcode changed a lot between CPython versions
- if (self.pycode.magic >= 0xa0df2ef
- # Implementation since 2.7a0: 62191 (introduce SETUP_WITH)
- or self.pycode.magic >= 0xa0df2d1):
- # implementation since 2.6a1: 62161 (WITH_CLEANUP optimization)
- w_unroller = self.popvalue()
- w_exitfunc = self.popvalue()
- self.pushvalue(w_unroller)
- elif self.pycode.magic >= 0xa0df28c:
- # Implementation since 2.5a0: 62092 (changed WITH_CLEANUP opcode)
- w_exitfunc = self.popvalue()
- w_unroller = self.peekvalue(0)
- else:
- raise NotImplementedError("WITH_CLEANUP for CPython <= 2.4")
-
+ w_unroller = self.popvalue()
+ w_exitfunc = self.popvalue()
+ self.pushvalue(w_unroller)
unroller = self.space.interpclass_w(w_unroller)
is_app_exc = (unroller is not None and
isinstance(unroller, SApplicationException))
More information about the pypy-commit
mailing list