Dennis Sweeney
a458be3263
gh-93061: Mark as artificial: backwards jump after async for (GH-93062)
2022-05-23 13:58:41 +01:00
Mark Shannon
22a1db378c
GH-92236: Remove spurious "line" event when starting coroutine or generator. (GH-92722)
2022-05-13 11:24:45 +01:00
Dennis Sweeney
8cf2906828
gh-92311: Add tests for frame_setlineno jumping over listcomps ( #92741 )
2022-05-12 17:43:54 -04:00
Dennis Sweeney
37c6db60f9
gh-91869: Fix tracing of specialized instructions with extended args (GH-91945)
2022-04-27 22:36:34 -06:00
Christian Heimes
deeaac49e2
bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)
...
- Add requires_fork and requires_subprocess to more tests
- Skip extension import tests if dlopen is not available
- Don't assume that _testcapi is a shared extension
- Skip a lot of socket tests that don't work on Emscripten
- Skip mmap tests, mmap emulation is incomplete
- venv does not work yet
- Cannot get libc from executable
The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
2022-03-22 03:04:36 -07:00
Irit Katriel
3d2ce34716
bpo-46458: emit code for else of a try block immediately after the try body (GH-30751)
2022-01-27 13:40:44 +00:00
Irit Katriel
9c2ebb906d
bpo-46344: Fix trace bug in else of try and try-star blocks (GH-30544)
2022-01-13 12:34:38 +00:00
Mark Shannon
bd04fac7eb
bpo-46331: Do not set line number of instruction storing doc-string. (GH-30518)
2022-01-11 11:28:30 +00:00
Mark Shannon
ec0c392f34
bpo-46314: Remove extra RESUME when compiling a lamdba. (GH-30513)
2022-01-10 12:29:02 +00:00
Irit Katriel
d60457a667
bpo-45292: [PEP-654] add except* (GH-29581)
2021-12-14 16:48:15 +00:00
Irit Katriel
a310fd83a0
bpo-45890: Add tests for tracing try-except-finally blocks (GH-29746)
2021-12-07 10:50:37 +00:00
Mark Shannon
337cb480e9
bpo-45709: Fix tracing when exception is handled. (GH-29638)
2021-11-19 15:16:49 +00:00
Mark Shannon
b854557b49
bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656)
2021-08-09 10:18:59 +01:00
Mark Shannon
a86f7dae0a
bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138)
2021-07-15 17:46:55 +01:00
Mark Shannon
e5862f79c1
bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109)
2021-07-14 10:08:38 +01:00
Mark Shannon
da6414f0ac
bpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068)
2021-07-08 19:21:09 +01:00
Mark Shannon
937cebc93b
bpo-44298: Fix line numbers for early exits in with statements. (GH-26513)
2021-06-03 16:45:58 +01:00
Mark Shannon
cb6f3d7163
bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26054)
2021-05-12 11:25:44 +01:00
Mark Shannon
adcd220556
bpo-40222: "Zero cost" exception handling (GH-25729)
...
"Zero cost" exception handling.
* Uses a lookup table to determine how to handle exceptions.
* Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements.
* Reduces the size of the frame object by about 60%.
2021-05-07 15:19:19 +01:00
Mark Shannon
5979e81a21
bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719)
...
* Set line number of __exit__ call in a with statement to be that of the with keyword.
2021-04-30 14:32:47 +01:00
Mark Shannon
e56d54e447
Mark instructions at end of class scope as artificial. (GH-24222)
2021-01-15 13:52:00 +00:00
Mark Shannon
3bd6035b6b
bpo-42908: Mark cleanup code at end of try-except and with artificial ( #24202 )
...
* Mark bytecodes at end of try-except as artificial.
* Make sure that the CFG is consistent throughout optimiization.
* Extend line-number propagation logic so that implicit returns after 'try-except' or 'with' have the correct line numbers.
* Update importlib
2021-01-13 12:05:43 +00:00
Mark Shannon
127dde5916
bpo-42810: Mark jumps at end of if and try statements as artificial. (GH-24091)
...
* Mark jumps at end of if and try statements as artificial.
* Update importlib
* Add comment explaining the purpose of ADDOP_JUMP_NOLINE.
2021-01-04 18:06:55 +00:00
Mark Shannon
28b75c80dc
bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896)
2020-12-23 11:43:10 +00:00
Mark Shannon
f2dbfd7e20
bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)
...
* Mark reraise after except blocks as artificial.
* Update importlib
* Update dis test.
2020-12-21 13:53:50 +00:00
Mark Shannon
5274b682bc
bpo-42645: Make sure that return/break/continue are only traced once when exiting via a finally block. (GH-23780)
...
* Make sure that return/break/continue are only traced once when exiting via a finally block.
* Add test for return in try-finally.
* Update importlib
2020-12-16 13:07:01 +00:00
Mark Shannon
8473cf89bd
bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if statements conform to PEP 626. (GH-23743)
2020-12-15 11:07:50 +00:00
Mark Shannon
f5e97b72fe
bpo-42635: Mark JUMP_ABSOLUTE at end of 'for' loop as artificial to avoid spurious line events. (GH-23761)
2020-12-14 11:28:39 +00:00
Mark Shannon
56aa20f9eb
Don't generate spurious line number in try-except-finally. ( #23760 )
2020-12-14 10:19:10 +00:00
Mark Shannon
cc75ab791d
bpo-42246: Eliminate jumps to exit blocks by copying those blocks. ( #23251 )
...
* Compiler: eliminate jumps to short exit blocks by copying.
2020-11-12 19:49:33 +00:00
Mark Shannon
877df851c3
bpo-42246: Partial implementation of PEP 626. (GH-23113)
...
* Implement new line number table format, as defined in PEP 626.
2020-11-12 09:43:29 +00:00
Mark Shannon
17b5be0c0a
bpo-41670: Remove outdated predict macro invocation. (GH-22026)
...
Remove PREDICTion of POP_BLOCK from FOR_ITER.
2020-09-29 10:09:13 +01:00
Mark Shannon
6e8128f02e
bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)
...
* Move 'peephole' optimizations into compile.c and perform them directly on the CFG.
2020-07-30 10:03:00 +01:00
Mark Shannon
57697245e1
bpo-40228: More robust frame.setlineno. (GH-19437)
...
More robust frame.setlineno. Makes no assumptions about source->bytecode translation.
2020-04-29 16:49:45 +01:00
Pablo Galindo
4c53e63cc9
bpo-39166: Fix trace of last iteration of async for loops ( #17800 )
2020-01-10 09:24:22 +00:00
Pablo Galindo
04ec7a1f7a
bpo-39114: Fix tracing of except handlers with name binding (GH-17769)
...
When producing the bytecode of exception handlers with name binding (like `except Exception as e`) we need to produce a try-finally block to make sure that the name is deleted after the handler is executed to prevent cycles in the stack frame objects. The bytecode associated with this try-finally block does not have source lines associated and it was causing problems when the tracing functionality was running over it.
2020-01-02 11:38:44 +00:00
Mark Shannon
fee552669f
Produce cleaner bytecode for 'with' and 'async with' by generating separate code for normal and exceptional paths. ( #6641 )
...
Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication.
Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
2019-11-21 09:11:43 +00:00
Pablo Galindo
293dd23477
Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246)
...
Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles.
See for example GH-13135
2019-11-19 21:34:03 +00:00
Pablo Galindo
18c5f9d44d
bpo-37500: Make sure dead code does not generate bytecode but also detect syntax errors (GH-14612)
...
https://bugs.python.org/issue37500
Add a new field to the compiler structure that allows to be configured
so no bytecode is emitted. In this way is possible to detect errors by
walking the nodes while preserving optimizations.
https://bugs.python.org/issue37500
2019-07-15 02:15:01 -07:00
Brett Cannon
8425de4147
bpo-33562: Check the global asyncio event loop policy isn't set after any tests (GH-7328)
2018-06-01 20:34:09 -07:00
Serhiy Storchaka
397466dfd9
bpo-30953: Improve error messages and add tests for jumping (GH-6196)
...
into/out of an except block.
2018-03-23 14:46:45 +02:00
Serhiy Storchaka
702f8f3611
bpo-33041: Rework compiling an "async for" loop. ( #6142 )
...
* Added new opcode END_ASYNC_FOR.
* Setting global StopAsyncIteration no longer breaks "async for" loops.
* Jumping into an "async for" loop is now disabled.
* Jumping out of an "async for" loop no longer corrupts the stack.
* Simplify the compiler.
2018-03-23 14:34:35 +02:00
Serhiy Storchaka
bc300ce205
bpo-33041: Add tests for jumps in/out of 'async with' blocks. ( #6110 )
2018-03-18 09:53:08 +02:00
xdegaye
b8e9d6c5cd
bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6107)
...
(cherry picked from commit e32bbaf376
)
2018-03-13 19:31:31 +02:00
Serhiy Storchaka
26c9f565d0
bpo-33026: Fix jumping out of "with" block by setting f_lineno. ( #6026 )
2018-03-11 08:32:47 +02:00
Serhiy Storchaka
520b7ae27e
bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter to compiler. (GH-5006)
...
Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Antoine Pitrou <antoine@python.org>
2018-02-22 23:33:30 +02:00
Serhiy Storchaka
e8ed96550c
bpo-32416: Add two new tests in test_sys_settrace. ( #5072 )
...
Move other test to more proper place.
2018-01-01 19:39:38 +02:00
gfyoung
531dd7e27e
Fix minor spelling error in test_sys_settrace.py. ( #5025 )
2017-12-28 10:28:25 +02:00
Serhiy Storchaka
53f9135667
bpo-32416: Refactor tests for the f_lineno setter and add new tests. ( #4991 )
2017-12-27 00:38:56 +02:00
Mike
53f7a7c281
bpo-32297: Few misspellings found in Python source code comments. ( #4803 )
...
* Fix multiple typos in code comments
* Add spacing in comments (test_logging.py, test_math.py)
* Fix spaces at the beginning of comments in test_logging.py
2017-12-14 13:04:53 +02:00