[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-12 Thread Mark Shannon
Mark Shannon added the comment: > How do we know `x` is falsey without calling `bool()` on it? We don't, but in `if x: pass`, it doesn't matter. Discounting side-effects in __bool__, the code does nothing regardless of the value of

[issue42634] Incorrect line number in bytecode for try-except-finally

2020-12-13 Thread Mark Shannon
New submission from Mark Shannon : The following code, when traced, produces a spurious line event for line 5: a, b, c = 1, 1, 1 try: a = 3 except: b = 5 finally: c = 7 assert a == 3 and b == 1 and c == 7 Bug reported by Ned Batchelder https://gist.github.com/nedbat

[issue42615] Redundant jump instructions due to deleted unreachable bytecode blocks

2020-12-16 Thread Mark Shannon
Mark Shannon added the comment: New changeset c71581c7a4192e6ba9a79eccc583aaadab300efa by Om G in branch 'master': bpo-42615: Delete redundant jump instructions that only bypass empty blocks (GH-23733) https://github.com/python/cpython/commit/c71581c7a4192e6ba9a79eccc583aaadab300efa

[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2020-12-16 Thread Mark Shannon
Mark Shannon added the comment: https://github.com/python/cpython/pull/23780 fixes the finally handling. The if-break case was fixed by earlier changes. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset 0332e569c12d3dc97171546c6dc10e42c27de34b by Mark Shannon in branch 'master': bpo-42990: Further refactoring of PyEval_ functions. (GH-24368) https://github.com/python/cpython/commit/0332e569c12d3dc97171546c6dc10e42c27de34b

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-01 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2021-01-26 Thread Mark Shannon
Mark Shannon added the comment: New changeset dea5bf9d15999bfcc58095b157c0678d45b00bdd by Irit Katriel in branch 'master': bpo-33387: update documentation for exception handling opcode changes (GH-24334) https://github.com/python/cpython/commit/dea5bf9d15999bfcc58095b157c0678d45b00bdd

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread Mark Shannon
Mark Shannon added the comment: New changeset c9b8e9c421b57acdcaf24fab0c93bc29b3ef7c67 by Victor Stinner in branch 'master': bpo-42979: Enhance abstract.c assertions checking slot result (GH-24352) https://github.com/python/cpython/commit/c9b8e9c421b57acdcaf24fab0c93bc29b3ef7c67

[issue43054] What does the existence of a struct in a header file imply about the C-API

2021-01-28 Thread Mark Shannon
New submission from Mark Shannon : Given the lack of explicit documentation on this subject, and differing opinions among core developers, I though it would be good to discuss how the existence of a struct in a header file constrains the C-API. Original PR provoking this discussion: https

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-02-02 Thread Mark Shannon
Mark Shannon added the comment: Option 3 with what semantics exactly? https://docs.python.org/3/reference/datamodel.html#object.__bool__ says that __bool__ should return True or False. If we don't allow the optimizer the freedom to assume that __bool__ is self-consistent and has no side

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-02-02 Thread Mark Shannon
Mark Shannon added the comment: It isn't a specific optimization at all, but the combination of several. I will change the behavior to match what appears to be the consensus. BUT, we need to define what the semantics should be. Otherwise implementing the compiler is just guesswork

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-02-02 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23232 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24417 ___ Python tracker <https://bugs.python.org/issu

[issue44338] Port LOAD_GLOBAL to adaptive interpreter

2021-06-14 Thread Mark Shannon
Mark Shannon added the comment: New changeset eecbc7c3900a7f40d8498b151db543a202c72f74 by Mark Shannon in branch 'main': bpo-44338: Port LOAD_GLOBAL to PEP 659 adaptive interpreter (GH-26638) https://github.com/python/cpython/commit/eecbc7c3900a7f40d8498b151db543a202c72f74

[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-14 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25306 pull_request: https://github.com/python/cpython/pull/26718 ___ Python tracker <https://bugs.python.org/issue44

[issue44417] bytecode<>line number mapping and f_lasti seem wrong in 3.10.0b2

2021-06-14 Thread Mark Shannon
Mark Shannon added the comment: What does "seem wrong" mean? What exactly is the problem? -- ___ Python tracker <https://bugs.python.org/issue44417> ___ __

[issue44283] Add jump table for certain safe match-case statements

2021-06-14 Thread Mark Shannon
Mark Shannon added the comment: This is going in the wrong direction. Rather than add more complex instructions for use only by pattern matching, we need to simplify the individual operations and re-use existing instructions. That way pattern matching can benefit from the general performance

[issue38211] clean up type_init()

2021-06-16 Thread Mark Shannon
Mark Shannon added the comment: New changeset ab030d6f9d73e7f6c2213c2e308d1ceb04761485 by Sergey Fedoseev in branch 'main': bpo-38211: Clean up type_init() (GH-16257) https://github.com/python/cpython/commit/ab030d6f9d73e7f6c2213c2e308d1ceb04761485 -- nosy: +Mark.Shannon

[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25344 pull_request: https://github.com/python/cpython/pull/26759 ___ Python tracker <https://bugs.python.org/issue44

[issue44187] Implement infrastructure for quickening and specializing

2021-06-07 Thread Mark Shannon
Mark Shannon added the comment: New changeset 001eb520b5757294dc455c900d94b7b153de6cdd by Mark Shannon in branch 'main': bpo-44187: Quickening infrastructure (GH-26264) https://github.com/python/cpython/commit/001eb520b5757294dc455c900d94b7b153de6cdd

[issue44338] Port LOAD_GLOBAL to adaptive interpreter

2021-06-07 Thread Mark Shannon
New submission from Mark Shannon : Port the implementation of LOAD_GLOBAL to the new adaptive interpreter Once this and https://bugs.python.org/issue44337 are implemented we can remove the old opcache. -- messages: 395272 nosy: Mark.Shannon priority: normal severity: normal status

[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-07 Thread Mark Shannon
New submission from Mark Shannon : Port the implementation of LOAD_ATTR to the new adaptive interpreter -- messages: 395271 nosy: Mark.Shannon priority: normal severity: normal status: open title: Port LOAD_ATTR to adaptive interpreter ___ Python

[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Mark Shannon
New submission from Mark Shannon : Running the buildbot for https://github.com/python/cpython/pull/26595 results in failures: https://buildbot.python.org/all/#/builders/581/builds/63 Which claim that the address calculation in `LOAD_ATTR_MODULE` is out of bounds. The tests pass with an added

[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +Mark.Shannon nosy_count: 9.0 -> 10.0 pull_requests: +25208 pull_request: https://github.com/python/cpython/pull/26623 ___ Python tracker <https://bugs.python.org/issu

[issue44206] Add a version number to dict keys.

2021-06-09 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44187] Implement infrastructure for quickening and specializing

2021-06-09 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25209 pull_request: https://github.com/python/cpython/pull/26624 ___ Python tracker <https://bugs.python.org/issue44

[issue44363] Likely false positive for address sanitizer after fork

2021-06-09 Thread Mark Shannon
Mark Shannon added the comment: If I run the following on main ./configure --with-address-sanitizer make clean make -j12 test I get 22 failures. So something is broken. test_lib2to3 does fork; at least it does when I run it under gdb

[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon
Mark Shannon added the comment: I still get quite a few failures on the main branch. It seems like ceval.c:1600 upsets the sanitizer, at least for gcc. There isn't anything wrong with that line, but as I plan to change it anyway I guess it doesn't matter: https://github.com/python/cpython

[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon
Mark Shannon added the comment: This line seems to be responsible for most of the failures: https://github.com/python/cpython/blob/main/Objects/frameobject.c#L985 Which does appear to be a true positive. -- ___ Python tracker <ht

[issue44187] Implement infrastructure for quickening and specializing

2021-06-09 Thread Mark Shannon
Mark Shannon added the comment: No, this is done -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon
Mark Shannon added the comment: What commit are you running that on? -- ___ Python tracker <https://bugs.python.org/issue44363> ___ ___ Python-bugs-list mailin

[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-10 Thread Mark Shannon
Mark Shannon added the comment: New changeset 54cb63863f19a7c64d9a3a5fd97bdfc0dd7ab374 by Mark Shannon in branch 'main': bpo-44348: Move trace-info to thread-state (GH-26623) https://github.com/python/cpython/commit/54cb63863f19a7c64d9a3a5fd97bdfc0dd7ab374

[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-10 Thread Mark Shannon
Mark Shannon added the comment: New changeset e117c0283705943189e6b1aef668a1f68f3f00a4 by Mark Shannon in branch 'main': bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter (GH-26595) https://github.com/python/cpython/commit/e117c0283705943189e6b1aef668a1f68f3f00a4

[issue44338] Port LOAD_GLOBAL to adaptive interpreter

2021-06-10 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25225 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26638 ___ Python tracker <https://bugs.python.org/issu

[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-10 Thread Mark Shannon
Mark Shannon added the comment: It looks like I've been a bit unfair to the address sanitizer. It does appear to produce incorrect locations sometimes, but that's not really a false positive and the reports are generally useful. -- ___ Python

[issue44313] Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports

2021-06-10 Thread Mark Shannon
Mark Shannon added the comment: Yes. Simpler is good. I think it will also be better for performance: In general, we don't know what X is in `from Y import X`. It could be a module or anything else. However, if we are accessing an attribute it is quite likely to be a module or class

[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-10 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-10 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25226 pull_request: https://github.com/python/cpython/pull/26639 ___ Python tracker <https://bugs.python.org/issue44

[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-06-17 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25357 pull_request: https://github.com/python/cpython/pull/26771 ___ Python tracker <https://bugs.python.org/issue44

[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue2> ___

[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon
Mark Shannon added the comment: No problem, I've added a simple test. -- stage: patch review -> ___ Python tracker <https://bugs.python.org/issue2> ___ _

[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-17 Thread Mark Shannon
Change by Mark Shannon : -- assignee: Mark.Shannon -> eric.snow ___ Python tracker <https://bugs.python.org/issue43693> ___ ___ Python-bugs-list mai

[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon
New submission from Mark Shannon : When calling frame.clear(), the globals (and builtins) are cleared. This is not the case in 3.10. We should restore the 3.10 behavior, as there is no reason not to. Victor, you've mentioned this problem. Did you have a specific example I can add as a test

[issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject

2021-06-17 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25355 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26768 ___ Python tracker <https://bugs.python.org/issu

[issue44297] Frame with -1 line number

2021-06-19 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25382 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26801 ___ Python tracker <https://bugs.python.org/issu

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-19 Thread Mark Shannon
Mark Shannon added the comment: Ned, is this a regression (does 3.9 do the right thing on Windows) or an inconsistency between Mac and Windows? I suspect this might have something to do with the PREDICT macros. If that the were the case 3.9 should show the same inconsistency between Windows

[issue44297] Frame with -1 line number

2021-06-19 Thread Mark Shannon
Mark Shannon added the comment: Thanks Anthony, that's a big help. -- ___ Python tracker <https://bugs.python.org/issue44297> ___ ___ Python-bugs-list mailin

[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-06-18 Thread Mark Shannon
Mark Shannon added the comment: New changeset 0982ded179f280176868c1c4eccf77bf70687816 by Mark Shannon in branch 'main': bpo-44032: Move pointer to code object from frame-object to frame specials array. (GH-26771) https://github.com/python/cpython/commit

[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-21 Thread Mark Shannon
Mark Shannon added the comment: This appears to be a duplicate of https://bugs.python.org/issue44297 -- ___ Python tracker <https://bugs.python.org/issue44

[issue44297] Frame with -1 line number

2021-06-21 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25402 pull_request: https://github.com/python/cpython/pull/26821 ___ Python tracker <https://bugs.python.org/issue44

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-21 Thread Mark Shannon
Mark Shannon added the comment: Hmm, I'm a bit puzzled by that. Did you test with 3.10b3 or the latest build from the 3.10 branch with the fix to https://bugs.python.org/issue44297 included? -- ___ Python tracker <https://bugs.python.

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-21 Thread Mark Shannon
Mark Shannon added the comment: I think this is a combination of https://bugs.python.org/issue44297 and the PREDICT macros. I don't have a windows machine to confirm this on, but I suspect that if you rewrite `doit` as: def doit(): o = ((1,2), (3,4)) o

[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-21 Thread Mark Shannon
Mark Shannon added the comment: New changeset fb68791a26e157ed3cdeb409c8d8b6cddc7535bd by Mark Shannon in branch 'main': bpo-44337: Improve LOAD_ATTR specialization (GH-26759) https://github.com/python/cpython/commit/fb68791a26e157ed3cdeb409c8d8b6cddc7535bd

[issue44297] Frame with -1 line number

2021-06-21 Thread Mark Shannon
Mark Shannon added the comment: New changeset 7674c83d81905d6afe989ca3f93f08b7939b057c by Mark Shannon in branch '3.10': bpo-44297: Fix missing line number in generator expressions (GH-26821) https://github.com/python/cpython/commit/7674c83d81905d6afe989ca3f93f08b7939b057c

[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-21 Thread Mark Shannon
Mark Shannon added the comment: With the latest 3.10, I get: File "/home/mark/test/test.py", line 13, in next(bar().__await__(), None) File "/home/mark/test/test.py", line 10, in bar return [chunk async for chunk in foo()] File "/home/mark/test/test.py&

[issue44486] Modules should alway have a dictionary

2021-06-23 Thread Mark Shannon
Mark Shannon added the comment: New changeset c3f52b4d707a78eb342372a2be00f3eb846a05b9 by Mark Shannon in branch 'main': bpo-44486: Make sure that modules always have a dictionary. (GH-26847) https://github.com/python/cpython/commit/c3f52b4d707a78eb342372a2be00f3eb846a05b9

[issue44500] Document changes to code object.

2021-06-23 Thread Mark Shannon
New submission from Mark Shannon : We are making lots of changes to the code object. We should clearly document all the changes in one place and explain the new design well before 3.11 beta. -- assignee: docs@python components: Documentation messages: 396432 nosy: Mark.Shannon, docs

[issue44486] Modules should alway have a dictionary

2021-06-23 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44297] Frame with -1 line number

2021-06-23 Thread Mark Shannon
Mark Shannon added the comment: Thanks for the reproducer. -- assignee: -> Mark.Shannon ___ Python tracker <https://bugs.python.org/issue44297> ___ ___ Py

[issue44486] Modules should alway have a dictionary

2021-06-22 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25428 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26847 ___ Python tracker <https://bugs.python.org/issu

[issue44486] Modules should alway have a dictionary

2021-06-22 Thread Mark Shannon
New submission from Mark Shannon : It is possible to create a module without a dictionary: m = types.ModuleType.__new__(types.ModuleType) But that is the only way to create to a module without a dict; all other means of creating a module, both in Python and in the C API, result in a fully

[issue44297] Frame with -1 line number

2021-06-21 Thread Mark Shannon
Mark Shannon added the comment: New changeset 82e5c28af7049c4f5343c808f172cbe2e145f49b by Mark Shannon in branch 'main': bpo-44297: Fix missing line number in generator expressions (GH-26801) https://github.com/python/cpython/commit/82e5c28af7049c4f5343c808f172cbe2e145f49b

[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-08 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25178 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26595 ___ Python tracker <https://bugs.python.org/issu

[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-08 Thread Mark Shannon
Mark Shannon added the comment: Pablo, Is there a bpo issue for the buildbot failures on Windows? The failures I've been seeing are C stack overflows. Long term, I expect to fix it by decoupling the C and Python stacks. In the short term I have a couple of changes that might get it working

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-13 Thread Mark Shannon
Mark Shannon added the comment: New changeset 0acdf255a51b836c0b44f3676797620322974af3 by Mark Shannon in branch '3.10': [3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26061) https://github.com/python/cpython/commit/0acdf255a51b836c0b44f3676797620322974af3

[issue44088] traced line number can be None

2021-05-12 Thread Mark Shannon
Mark Shannon added the comment: Duplicate of https://bugs.python.org/issue43933 -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40222] "Zero cost" exception handling

2021-05-11 Thread Mark Shannon
Mark Shannon added the comment: I know PyCode_NewWithPosOnlyArgs is declared as "PyAPI_FUNC" but that can't make it part of the ABI unless it has stable behavior. It can't have stable behavior because its inputs are complex, undefined, have altered semantics and are interlinked

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-12 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +24694 pull_request: https://github.com/python/cpython/pull/26054 ___ Python tracker <https://bugs.python.org/issue43

[issue40222] "Zero cost" exception handling

2021-05-12 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +24699 pull_request: https://github.com/python/cpython/pull/26059 ___ Python tracker <https://bugs.python.org/issue40

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-12 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +24702 pull_request: https://github.com/python/cpython/pull/26061 ___ Python tracker <https://bugs.python.org/issue43

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-10 Thread Mark Shannon
Change by Mark Shannon : -- Removed message: https://bugs.python.org/msg393388 ___ Python tracker <https://bugs.python.org/issue43933> ___ ___ Python-bugs-list m

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-05-10 Thread Mark Shannon
Mark Shannon added the comment: At yappi/_yappi.c:1261 sets an undocumented field on a CPython internal data structure. What did you believe that was supposed to do? use_tracing is not documented anywhere. We could add the field back and ignore it, but I doubt that would help you much

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-10 Thread Mark Shannon
Mark Shannon added the comment: If there is no C-API function that supports your needs, feel free to suggest one. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-05-10 Thread Mark Shannon
Mark Shannon added the comment: If there is no C-API function that supports your needs, feel free to suggest one. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-10 Thread Mark Shannon
Mark Shannon added the comment: Ned, no line numbers should never be None. (Except under very unusual circumstances, like the trace function raising an error) Taking a look at the disassembly of execsitecustomize, there is a return with no line number, which shouldn't happen

[issue40222] "Zero cost" exception handling

2021-05-10 Thread Mark Shannon
Mark Shannon added the comment: Thanks everyone for the triaging and fixing. -- ___ Python tracker <https://bugs.python.org/issue40222> ___ ___ Python-bug

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-05-10 Thread Mark Shannon
Mark Shannon added the comment: But what does "use it" mean? What does setting `tstate->use_tracing = 1` do? There is no documented behavior, so how do we know what assumptions people are making about what happens when they set some field to 1? As I said, we could keep the fie

[issue44056] Incorrect line number for syntax error.

2021-05-07 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> needs patch status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44056] Incorrect line number for syntax error.

2021-05-06 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +24606 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25939 ___ Python tracker <https://bugs.python.org/issu

[issue44056] Incorrect line number for syntax error.

2021-05-06 Thread Mark Shannon
New submission from Mark Shannon : Consider this function, which has a syntax error on line 4. >>> def f(): ... try: ... 1/0 ... except: ... pass ... except Exception: ... pass 3.9 reports an incorrect line number of 3. 3.10b reports an

[issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early

2021-05-17 Thread Mark Shannon
Mark Shannon added the comment: I have to admit that I find the truncated version more readable. Some sort of truncation is useful, as a regex could be thousands of character long. Adding the offset to the warning message seems like a useful addition. -- nosy: +Mark.Shannon

[issue40222] "Zero cost" exception handling

2021-05-11 Thread Mark Shannon
Mark Shannon added the comment: It is very little effort to add back the old function, so that isn't the problem. It won't work properly, but it never did anyway. So I guess that's sort of compatible. Maybe the best thing is to put a big red warning in the docs and hope that warns away

[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-12 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +24716 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26076 ___ Python tracker <https://bugs.python.org/issu

[issue44187] Implement infrastructure for quickening and specializing

2021-05-20 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +24868 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26264 ___ Python tracker <https://bugs.python.org/issu

[issue44187] Implement infrastructure for quickening and specializing

2021-05-20 Thread Mark Shannon
New submission from Mark Shannon : As described in PEP 659 (Specializing Adaptive Interpreter) the first part of implementing specialization is to implement the machinery to do the quickening. Conceptually, this is fairly simple: add a new field to the code object, which points to the first

[issue40222] "Zero cost" exception handling

2021-05-10 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +24671 pull_request: https://github.com/python/cpython/pull/26021 ___ Python tracker <https://bugs.python.org/issue40

[issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version

2021-05-26 Thread Mark Shannon
Mark Shannon added the comment: It is extremely unlikely, I agree. But not impossible. I plan to fix it for 3.11. Once I've done that we can decide if backports are worth it. -- ___ Python tracker <https://bugs.python.org/issue44

[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-05-26 Thread Mark Shannon
Mark Shannon added the comment: New changeset 6cc800d3634fdd002b986c3ffe6a3d5540f311a0 by Eric Snow in branch 'main': bpo-43693: Clean up the PyCodeObject fields. (GH-26364) https://github.com/python/cpython/commit/6cc800d3634fdd002b986c3ffe6a3d5540f311a0

[issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version

2021-05-26 Thread Mark Shannon
New submission from Mark Shannon : Should the tp_version overflow, and wrap around to a value previously used in the opcache for LOAD_ATTR, then LOAD_ATTR could produce the wrong value. It will take a fair bit of contrivance and a long time to do this, but it is possible: Run some code ~2000

[issue44206] Add a version number to dict keys.

2021-05-25 Thread Mark Shannon
Mark Shannon added the comment: Which optimizations? LOAD_GLOBAL: Using a keys version instead of a whole dict version means that LOAD_GLOBAL won't leak references. It also means that we can (in the future) remove the PEP 509 version and save 8 bytes per dict. LOAD_ATTR

[issue44206] Add a version number to dict keys.

2021-05-21 Thread Mark Shannon
New submission from Mark Shannon : Add a version number to dict keys. PEP 509 added a version number to dicts. Unfortunately this is no use for optimizing attribute loads and store on instances. We need to know whether the keys are as expected, not the dict as that is likely to be different

[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-21 Thread Mark Shannon
Mark Shannon added the comment: What's the test case, exactly? ref.py for the other issue doesn't crash if I change "func.py" to "ref.py" otherwise it just complains that "func.py" doesn't exist. -- ___ Python tra

[issue44207] Add a version number to Python functions

2021-05-21 Thread Mark Shannon
New submission from Mark Shannon : In order to specialize calls to Python functions, or to inline them, we need to know that the code object has not changed. It is also useful to know that the globals, builtins and various defaults haven't changed either. Rather than attempting to check

[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-21 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +24891 pull_request: https://github.com/python/cpython/pull/26285 ___ Python tracker <https://bugs.python.org/issue44

[issue44206] Add a version number to dict keys.

2021-05-28 Thread Mark Shannon
Mark Shannon added the comment: New changeset f8a95df84bcedebc0aa7132b3d1a4e8f000914bc by Mark Shannon in branch 'main': bpo-44206: Add a version number to dictionary keys (GH-26333) https://github.com/python/cpython/commit/f8a95df84bcedebc0aa7132b3d1a4e8f000914bc

[issue42349] Compiler front-end produces a broken CFG

2021-06-07 Thread Mark Shannon
Mark Shannon added the comment: Basic blocks have only a single exit, at the end. https://en.wikipedia.org/wiki/Basic_block If the devguide says otherwise it is wrong. -- ___ Python tracker <https://bugs.python.org/issue42

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Mark Shannon added the comment: For context, this behavior was introduced in https://bugs.python.org/issue43933 -- ___ Python tracker <https://bugs.python.org/issue44

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25109 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26513 ___ Python tracker <https://bugs.python.org/issu

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Mark Shannon added the comment: New changeset 937cebc93b4922583218e0cbf0a9a14705a595b2 by Mark Shannon in branch 'main': bpo-44298: Fix line numbers for early exits in with statements. (GH-26513) https://github.com/python/cpython/commit/937cebc93b4922583218e0cbf0a9a14705a595b2

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Mark Shannon added the comment: Why this occurs: with cm: A break translates to something like: ex = cm.__exit__; cm.__enter__() # with cm A ex(...) goto loop_end # break So, the break is traced after the exit call. However, this doesn't seem consistent with try

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25111 pull_request: https://github.com/python/cpython/pull/26516 ___ Python tracker <https://bugs.python.org/issue44

<    1   2   3   4   5   6   7   8   9   10   >