[pypy-commit] [Git][pypy/pypy][branch/default] 14 commits: a branch where to introduce @error_value to be able to specify arbitrary...

Antonio Cuni foss at heptapod.net
Wed Dec 2 11:31:53 EST 2020



Antonio Cuni pushed to branch branch/default at PyPy / pypy


Commits:
c47532d7 by Antonio Cuni at 2020-11-18T13:52:50+01:00
a branch where to introduce @error_value to be able to specify arbitrary return values to use in case of exceptions (which is needed by hpy)

--HG--
branch : rpython-error_value

- - - - -
c711d9f8 by Antonio Cuni at 2020-11-18T14:09:50+01:00
add a test which checks that in case of exception the function returns a specific error value, and the llinterp machinerty to make it possible. The default case passes out of the box of course, while test_custom_error_value is WIP

--HG--
branch : rpython-error_value

- - - - -
3fcbb084 by Antonio Cuni at 2020-11-18T15:07:19+01:00
implement @ll_error_value and add a couple of test to ensure that it works correctly also in corner cases

--HG--
branch : rpython-error_value

- - - - -
b52af824 by Antonio Cuni at 2020-11-18T21:22:27+01:00
fix the case for exceptions raised by builtin ops

--HG--
branch : rpython-error_value

- - - - -
454729a7 by Antonio Cuni at 2020-11-18T21:25:32+01:00
document the branch

--HG--
branch : rpython-error_value

- - - - -
ef0de482 by Antonio Cuni at 2020-11-20T18:13:38+01:00
rename this test, else it's ungreppable

--HG--
branch : rpython-error_value

- - - - -
1cbed6f5 by Antonio Cuni at 2020-11-21T11:58:27+01:00
WIP: require the user to explicitly define which error_value to use when using @llhelper_can_raise, because this is what we need for HPy. However, this uncovers a problem, see test_llhelper_can_raise_custome_error_value

--HG--
branch : rpython-error_value

- - - - -
349cc6b1 by Antonio Cuni at 2020-11-30T18:08:58+00:00
temporary checkin to see whether disabling this breaks any test

--HG--
branch : rpython-error_value

- - - - -
cf646112 by Antonio Cuni at 2020-11-30T21:39:44+01:00
Refactor&simplify the approach:

1. declare that the return value of general RPython function is undefined and
   that you should not rely on it

2. merge @llhelper_can_raise and @ll_error_value into a combined
   @llhelper_error_value: this is the only case which we ultimately care about,
   and it's simpler to test/implement them together than separately

3. introduce a failing test (test_enforce_llhelper_error_value_in_case_of_nested_exception)
   which will be fixed in the next commit.

--HG--
branch : rpython-error_value

- - - - -
f6e51b8f by Antonio Cuni at 2020-11-30T21:40:01+01:00
merge heads

--HG--
branch : rpython-error_value

- - - - -
4a88a927 by Antonio Cuni at 2020-11-30T21:44:34+01:00
fix test_enforce_llhelper_error_value_in_case_of_nested_exception by disabling an optimization if the graph has @llhelper_error_value

--HG--
branch : rpython-error_value

- - - - -
90587a52 by Antonio Cuni at 2020-12-02T11:54:15+01:00
fix whatsnew

--HG--
branch : rpython-error_value

- - - - -
02c2f725 by Antonio Cuni at 2020-12-02T17:22:15+01:00
close merged branch

--HG--
branch : rpython-error_value

- - - - -
6add670f by Antonio Cuni at 2020-12-02T17:25:57+01:00
Merge the rpython-error_value branch.

This branch introduces a new decorator @llhelper_error_value, which
officializes the fact that you can raise RPython exceptions from llhelpers,
and makes it possible to specify what is the C value to return in case of
errors.

It is needed to implement correctly HPy exceptions (see also its sister
branch, hpy-error-value)

- - - - -


7 changed files:

- pypy/doc/whatsnew-head.rst
- rpython/rlib/objectmodel.py
- rpython/rtyper/llinterp.py
- rpython/rtyper/lltypesystem/ll2ctypes.py
- rpython/rtyper/lltypesystem/test/test_ll2ctypes.py
- rpython/translator/exceptiontransform.py
- rpython/translator/test/test_exceptiontransform.py


View it on GitLab: https://foss.heptapod.net/pypy/pypy/-/compare/8bbff48601c6aeb6f7d9708ea72cb046dafde659...6add670f28886f2003bb75cdaeca4a56ced13fbe

-- 
View it on Heptapod: https://foss.heptapod.net/pypy/pypy/-/compare/8bbff48601c6aeb6f7d9708ea72cb046dafde659...6add670f28886f2003bb75cdaeca4a56ced13fbe
You're receiving this email because of your account on foss.heptapod.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/pypy-commit/attachments/20201202/5e286f8d/attachment.html>


More information about the pypy-commit mailing list