summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_peepholer.py
Commit message (Collapse)AuthorAgeFilesLines
* #5057: the peepholer no longer optimizes subscription on unicode literals ↵Ezio Melotti2012-11-041-6/+7
| | | | (e.g. u"foo"[0]) in order to produce compatible pyc files between narrow and wide builds.
* Issue #5057: fix a bug in the peepholer that led to non-portable pyc files ↵Ezio Melotti2011-04-151-0/+18
| | | | between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP chars (e.g. u"\U00012345"[0]).
* #7092 - Silence more py3k deprecation warnings, using ↵Florent Xicluna2010-03-211-11/+14
| | | | test_support.check_py3k_warnings() helper.
* use assert[Not]In where appropriateEzio Melotti2010-01-231-30/+30
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-17/+11
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-11/+17
| | | | Patch by flox
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-30/+30
|
* Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} withJeffrey Yasskin2009-02-281-6/+5
| | | | | | POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing a POP_TOP on each conditional and sometimes allows the peephole optimizer to skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
* Fix embarrassing typo and fix constantification of NoneRaymond Hettinger2007-03-021-0/+5
|
* Update the peephole optimizer to remove more dead code (jumps after returns)Neal Norwitz2006-10-141-0/+35
| | | | and inline jumps to returns.
* Teach the peepholer to fold unary operations on constants.Raymond Hettinger2005-02-201-0/+19
| | | | | Afterwards, -0.5 loads in a single step and no longer requires a runtime UNARY_NEGATIVE operation.
* Remove set conversion optimization test (backed out of Python/compile.c in rev.Brett Cannon2005-02-101-11/+0
| | | | 2.344).
* Adopt Skip's idea to optimize lists of constants in the contextRaymond Hettinger2005-02-071-1/+2
| | | | of a "in" or "not in" test.
* Transform "x in (1,2,3)" to "x in frozenset([1,2,3])".Raymond Hettinger2005-02-061-0/+10
| | | | | 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.
* Do not fold a constant if a large sequence will result.Raymond Hettinger2005-01-261-0/+4
| | | | Saves space in the presence of code like: (None,)*10000
* Remove test for BINARY_DIVIDE.Raymond Hettinger2005-01-071-1/+0
|
* Teach the peephole optimizer to fold simple constant expressions.Raymond Hettinger2005-01-021-0/+28
|
* Maintain peepholer's cumlc invariant by updating the running totalRaymond Hettinger2004-11-021-3/+5
| | | | | | everytime a LOAD_CONSTANT is encountered, created, or overwritten. Added two tests to cover cases affected by the patch.
* SF bug #1053819: Segfault in tuple_of_constantsRaymond Hettinger2004-10-261-0/+17
| | | | | | | 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.
* SF patch #1031667: Fold tuples of constants into a single constantRaymond Hettinger2004-09-221-3/+13
| | | | | | | | Example: >>> import dis >>> dis.dis(compile('1,2,3', '', 'eval')) 0 0 LOAD_CONST 3 ((1, 2, 3)) 3 RETURN_VALUE
* Whitespace normalization.Tim Peters2004-08-261-5/+5
|
* SF Patch #1013667: Cleanup Peepholer OutputRaymond Hettinger2004-08-231-0/+104
* 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.