| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| if (OPTIMIZATION_LEVEL(c)) { | ||
| return SUCCESS; | ||
| } | ||
| assert(!OPTIMIZATION_LEVEL(c)); |
There was a problem hiding this comment.
Left this here to convince ourselves of correctness. I'll remove it before committing.
Sorry, something went wrong.
| if (state->optimize) { | ||
| make_pass(node_); |
There was a problem hiding this comment.
Technically speaking, this is not the removal of the assert statement; it's replacement of assert with pass statement. Is it possible to completely remove the assert node? Or will it break some existing code?
Sorry, something went wrong.
There was a problem hiding this comment.
Pass becomes a NOP, which gets removed later. This is how we get rid of code. However, I did forget to wipe out the location information (a NOP is not removed if it's the only instruction from its line in the source code).
Sorry, something went wrong.
| if (optimize): | ||
| co = compile(source, '?', mode, optimize=optimize) | ||
| co_expected = compile('pass', '?', mode, optimize=optimize) | ||
| self.assertEqual(list(co.co_lines()), list(co_expected.co_lines())) |
There was a problem hiding this comment.
This looks like we no longer raise an error in optimized mode if there is an invalid await. That seems wrong and doesn't align with what we decided on in #121637.
Sorry, something went wrong.
There was a problem hiding this comment.
If we want to stick with this then we probably can't optimise the assertions in ast_opt.
Sorry, something went wrong.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.