[pypy-commit] pypy py3.5-corowrapper: fix the test

2016-09-18 Thread arigo
Author: Armin Rigo 
Branch: py3.5-corowrapper
Changeset: r87212:b15c04df
Date: 2016-09-18 23:09 +0200
http://bitbucket.org/pypy/pypy/changeset/b15c04df/

Log:fix the test

diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -1153,20 +1153,21 @@
 operr.w_type,
 operr.get_w_value(self.space),
 w_traceback)
-self.last_exception = old_last_exception
+self.pushvalue(SApplicationException(old_last_exception))
 else:
 w_res = self.call_contextmanager_exit_function(
 w_exitfunc,
 self.space.w_None,
 self.space.w_None,
 self.space.w_None)
-self.pushvalue(w_unroller)
+self.pushvalue(self.space.w_None)
 self.pushvalue(w_res)
 
 def WITH_CLEANUP_FINISH(self, oparg, next_instr):
 w_suppress = self.popvalue()
 w_unroller = self.popvalue()
 if isinstance(w_unroller, SApplicationException):
+self.last_exception = w_unroller.operr
 if self.space.is_true(w_suppress):
 # __exit__() returned True -> Swallow the exception.
 self.settopvalue(self.space.w_None)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy py3.5-corowrapper: fix interp_jit

2016-09-18 Thread arigo
Author: Armin Rigo 
Branch: py3.5-corowrapper
Changeset: r87203:84a0a35f73d2
Date: 2016-09-18 18:37 +0200
http://bitbucket.org/pypy/pypy/changeset/84a0a35f73d2/

Log:fix interp_jit

diff --git a/pypy/module/pypyjit/interp_jit.py 
b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -15,7 +15,7 @@
 from pypy.interpreter.pycode import CO_GENERATOR, PyCode
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.interpreter.pyframe import PyFrame
-from pypy.interpreter.pyopcode import ExitFrame, Yield
+from pypy.interpreter.pyopcode import Yield
 from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app
@@ -60,7 +60,7 @@
 name, intmask(next_instr), opname)
 
 def should_unroll_one_iteration(next_instr, is_being_profiled, bytecode):
-return (bytecode.co_flags & CO_GENERATOR) != 0
+return (bytecode.co_flags & (CO_COROUTINE | CO_GENERATOR)) != 0
 
 class PyPyJitDriver(JitDriver):
 reds = ['frame', 'ec']
@@ -90,15 +90,9 @@
 self.valuestackdepth = hint(self.valuestackdepth, promote=True)
 next_instr = self.handle_bytecode(co_code, next_instr, ec)
 is_being_profiled = self.get_is_being_profiled()
-XXX XXX   # please fix, the base dispatch() changed
 except Yield:
-# preserve self.last_exception between generator yields
-w_result = self.popvalue()
 jit.hint(self, force_virtualizable=True)
-return w_result
-except ExitFrame:
-self.last_exception = None
-return self.popvalue()
+raise
 
 def jump_absolute(self, jumpto, ec):
 if we_are_jitted():
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy py3.5-corowrapper: fix the stack depth computation

2016-09-17 Thread arigo
Author: Armin Rigo 
Branch: py3.5-corowrapper
Changeset: r87194:ef22f59c45aa
Date: 2016-09-17 21:58 +0200
http://bitbucket.org/pypy/pypy/changeset/ef22f59c45aa/

Log:fix the stack depth computation

diff --git a/pypy/interpreter/astcompiler/assemble.py 
b/pypy/interpreter/astcompiler/assemble.py
--- a/pypy/interpreter/astcompiler/assemble.py
+++ b/pypy/interpreter/astcompiler/assemble.py
@@ -664,8 +664,8 @@
 ops.DELETE_DEREF: 0,
 
 ops.GET_AWAITABLE: 0,
-ops.SETUP_ASYNC_WITH: 2,
-ops.BEFORE_ASYNC_WITH: -1,
+ops.SETUP_ASYNC_WITH: 0,
+ops.BEFORE_ASYNC_WITH: 1,
 ops.GET_AITER: 0,
 ops.GET_ANEXT: 1,
 ops.GET_YIELD_FROM_ITER: 0,
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy py3.5-corowrapper: fix

2016-09-16 Thread arigo
Author: Armin Rigo 
Branch: py3.5-corowrapper
Changeset: r87144:fe2ec186aa1c
Date: 2016-09-16 17:51 +0200
http://bitbucket.org/pypy/pypy/changeset/fe2ec186aa1c/

Log:fix

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -124,6 +124,7 @@
 raise OperationError(space.w_StopIteration,
  space.newtuple([w_result]))
 else:
+assert w_result is not None
 return w_result # YIELDed
 
 def _invoke_execute_frame(self, frame, w_arg_or_err):
@@ -151,10 +152,14 @@
 # interpretation.
 space = self.space
 if self.w_yielded_from is not None:
-w_arg_or_err = self.next_yield_from(frame, w_arg_or_err)
+self.next_yield_from(frame, w_arg_or_err)
 # Normal case: the call above raises Yield.
 # We reach this point if the iterable is exhausted.
-elif isinstance(w_arg_or_err, SApplicationException):
+last_instr = jit.promote(frame.last_instr)
+assert last_instr >= 0
+return last_instr + 1
+
+if isinstance(w_arg_or_err, SApplicationException):
 ec = space.getexecutioncontext()
 return frame.handle_operation_error(ec, w_arg_or_err.operr)
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit