| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Document more info about the benefits of configuring without
pymalloc when running valgrind
|
|
|
|
|
|
| |
Also converted a bunch of assert(0) to SystemError's.
There are still printfs, etc that need to be cleaned up.
|
|
|
|
| |
with symtable.c
|
|
|
|
|
|
| |
(Call symtable_exit_block or compiler_exit_scope as appropriate)
Use PyMem_Free on c_future since it was allocated with PyMem_Malloc
|
| |
|
|
|
|
|
| |
allocated by compiler_enter_scope(). Change return type for
compiler_exit_scope() to be void.
|
| |
|
|
|
|
| |
fixing problems with EXTENDED_ARG
|
| |
|
|
|
|
| |
the scope of names can be correctly determined.
|
| |
|
|
|
|
|
| |
historically been looked up using LOAD_NAME, not LOAD_GLOBAL.
looked up by LOAD_NAME, not
|
|
|
|
| |
part. Fixes one bug from #1333982.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.
The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
|
| |
|
|
|
|
|
| |
method still needs to support string exceptions, and allow None for the
third argument. Documentation updates are needed, too.
|
| |
|
|
|
|
| |
``class C(): pass`` is no longer a syntax error.
|
|
|
|
| |
with || expressions. Also clarifies intend of 'if' conditional.
|
| |
|
|
|
|
|
|
| |
Add a test in case the underlying assumptions ever change (i.e. the
compiler starts generating code blocks that are not punctuated by
RETURN_VALUE).
|
|
|
|
|
| |
Afterwards, -0.5 loads in a single step and no longer requires a runtime
UNARY_NEGATIVE operation.
|
| |
|
| |
|
|
|
|
| |
of a "in" or "not in" test.
|
|
|
|
|
| |
Inspired by Skip's idea to recognize the throw-away nature of sequences
in this context and to transform their type to one with better performance.
|
|
|
|
| |
Saves space in the presence of code like: (None,)*10000
|
|
|
|
|
| |
bytecodes from the previously saved .pyc files. Fixed by disabling the static
optimization of BINARY_DIVIDE between two constants.
|
| |
|
|
|
|
| |
There is no test for this change, because there is no way to provoke memory errors on demand. Test suite passes, though.
|
|
|
|
|
|
| |
everytime a LOAD_CONSTANT is encountered, created, or overwritten.
Added two tests to cover cases affected by the patch.
|
|
|
|
| |
No longer assumes that the input is NOP free.
|
| |
|
|
|
|
|
|
|
|
| |
* Use simpler, faster two pass algorithm for markblocks().
* Free the blocks variable if not NULL and exiting without change.
* Verify that the rest of the compiler has not set an exception.
* Make the test for tuple of constants less restrictive.
* Embellish the comment for chained conditional jumps.
|
|
|
|
|
|
|
| |
Peepholer could be fooled into misidentifying a tuple_of_constants.
Added code to count consecutive occurrences of LOAD_CONST.
Use the count to weed out the misidentified cases.
Added a unittest.
|
| |
|
|
|
|
|
| |
Rather than introduce new logic, took the approach of making the message
itself more general.
|
| |
|
|
|
|
| |
(Suggested by Michael Hudson.)
|
|
|
|
|
|
|
|
| |
Example:
>>> import dis
>>> dis.dis(compile('1,2,3', '', 'eval'))
0 0 LOAD_CONST 3 ((1, 2, 3))
3 RETURN_VALUE
|
|
|
|
|
| |
"from blah import (foo, bar
baz, bongo)"
|
|
|
|
|
|
|
|
| |
Allows the lineno fixup code to remain simple and not have to deal with
multibyte codings.
* Add an assertion to that effect.
* Remove the XXX comment on the subject.
|
| |
|
|
|
|
| |
(Suggested by Neal Norwitz.)
|
|
|
|
|
|
|
|
|
| |
* Perform the code length check earlier.
* Eliminate the extra PyMem_Free() upon hitting an EXTENDED_ARG.
* Assert that the NOP count used in jump retargeting matches the NOPs
eliminated in the final step.
* Add an XXX note to indicate that more work is being to done to
handle linenotab with intervals > 255.
|
|
|
|
|
|
|
|
|
| |
* Make a pass to eliminate NOPs. Produce code that is more readable,
more compact, and a tiny bit faster. Makes the peepholer more flexible
in the scope of allowable transformations.
* With Guido's okay, bumped up the magic number so that this patch gets
widely exercised before the alpha goes out.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
files and not re-optimized upon import. Saves a bit of startup time while
still remaining decoupled from the rest of the compiler.
As a side benefit, handcoded bytecode is not run through the optimizer
when new code objects are created. Hopefully, a handcoder has already
created exactly what they want to have run.
(Idea suggested by Armin Rigo and Michael Hudson. Initially avoided
because of worries about compiler coupling; however, only the nexus
point needed to be moved so there won't be a conflict when the AST
branch is loaded.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ 1009560 ] Fix @decorator evaluation order
From the description:
Changes in this patch:
- Change Grammar/Grammar to require
newlines between adjacent decorators.
- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers
- Add better order of evaluation check
to test_decorators.py (test_eval_order)
- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)
and the comment:
Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)
(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
|