<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Lib/opcode.py, branch 3.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/opcode.py?h=3.1</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/opcode.py?h=3.1'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2009-02-25T02:25:04Z</updated>
<entry>
<title>http://bugs.python.org/issue4715</title>
<updated>2009-02-25T02:25:04Z</updated>
<author>
<name>Jeffrey Yasskin</name>
<email>jyasskin@gmail.com</email>
</author>
<published>2009-02-25T02:25:04Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9de7ec7868554e92700e4bda6c5f9d8fcad634dc'/>
<id>urn:sha1:9de7ec7868554e92700e4bda6c5f9d8fcad634dc</id>
<content type='text'>
This patch by Antoine Pitrou optimizes the bytecode for conditional branches by
merging the following "POP_TOP" instruction into the conditional jump.  For
example, the list comprehension "[x for x in l if not x]" produced the
following bytecode:

  1           0 BUILD_LIST               0
              3 LOAD_FAST                0 (.0)
        &gt;&gt;    6 FOR_ITER                23 (to 32)
              9 STORE_FAST               1 (x)
             12 LOAD_FAST                1 (x)
             15 JUMP_IF_TRUE            10 (to 28)
             18 POP_TOP
             19 LOAD_FAST                1 (x)
             22 LIST_APPEND              2
             25 JUMP_ABSOLUTE            6
        &gt;&gt;   28 POP_TOP
             29 JUMP_ABSOLUTE            6
        &gt;&gt;   32 RETURN_VALUE

but after the patch it produces the following bytecode:

  1           0 BUILD_LIST               0
              3 LOAD_FAST                0 (.0)
        &gt;&gt;    6 FOR_ITER                18 (to 27)
              9 STORE_FAST               1 (x)
             12 LOAD_FAST                1 (x)
             15 POP_JUMP_IF_TRUE         6
             18 LOAD_FAST                1 (x)
             21 LIST_APPEND              2
             24 JUMP_ABSOLUTE            6
        &gt;&gt;   27 RETURN_VALUE

Notice that not only the code is shorter, but the conditional jump
(POP_JUMP_IF_TRUE) jumps right to the start of the loop instead of going through
the JUMP_ABSOLUTE at the end. "continue" statements are helped
similarly.

Furthermore, the old jump opcodes (JUMP_IF_FALSE, JUMP_IF_TRUE) have been
replaced by two new opcodes:
- JUMP_IF_TRUE_OR_POP, which jumps if true and pops otherwise
- JUMP_IF_FALSE_OR_POP, which jumps if false and pops otherwise
</content>
</entry>
<entry>
<title>Merged revisions 67818 via svnmerge from</title>
<updated>2008-12-18T11:06:25Z</updated>
<author>
<name>Antoine Pitrou</name>
<email>solipsis@pitrou.net</email>
</author>
<published>2008-12-18T11:06:25Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=f289ae6f01683689dfd07785c9617175b40aea91'/>
<id>urn:sha1:f289ae6f01683689dfd07785c9617175b40aea91</id>
<content type='text'>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67818 | antoine.pitrou | 2008-12-17 01:38:28 +0100 (mer., 17 déc. 2008) | 3 lines

  Issue #2183: Simplify and optimize bytecode for list comprehensions.
........
</content>
</entry>
<entry>
<title>Remove MAKE_BYTES which is a leftover from the mutable byte literal time.</title>
<updated>2008-07-20T21:38:50Z</updated>
<author>
<name>Georg Brandl</name>
<email>georg@python.org</email>
</author>
<published>2008-07-20T21:38:50Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=dbdbf75983e57abfe4974ca790f352f878ab1360'/>
<id>urn:sha1:dbdbf75983e57abfe4974ca790f352f878ab1360</id>
<content type='text'>
</content>
</entry>
<entry>
<title>#3021: Antoine Pitrou's Lexical exception handlers</title>
<updated>2008-06-11T15:59:43Z</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2008-06-11T15:59:43Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=eec3d7137929611b98dd593cd2f122cd91b723b2'/>
<id>urn:sha1:eec3d7137929611b98dd593cd2f122cd91b723b2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add missing UNPACK_EX opcode.</title>
<updated>2008-03-18T20:13:50Z</updated>
<author>
<name>Thomas Wouters</name>
<email>thomas@python.org</email>
</author>
<published>2008-03-18T20:13:50Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e8c3d266c8cea759a0eb1c17b9c5f989f87bb135'/>
<id>urn:sha1:e8c3d266c8cea759a0eb1c17b9c5f989f87bb135</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merged revisions 59541-59561 via svnmerge from</title>
<updated>2007-12-19T02:07:34Z</updated>
<author>
<name>Christian Heimes</name>
<email>christian@cheimes.de</email>
</author>
<published>2007-12-19T02:07:34Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=99170a5dbf4cfee78b578672b6821e855f92594b'/>
<id>urn:sha1:99170a5dbf4cfee78b578672b6821e855f92594b</id>
<content type='text'>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r59544 | raymond.hettinger | 2007-12-18 01:13:45 +0100 (Tue, 18 Dec 2007) | 1 line

  Add more namedtuple() test cases.  Neaten the code and comments.
........
  r59545 | christian.heimes | 2007-12-18 04:38:03 +0100 (Tue, 18 Dec 2007) | 3 lines

  Fixed for #1601: IDLE not working correctly on Windows (Py30a2/IDLE30a1)

  Amaury's ideas works great. Should we build the Python core with WINVER=0x0500 and _WIN32_WINNT=0x0500, too?
........
  r59546 | christian.heimes | 2007-12-18 10:00:13 +0100 (Tue, 18 Dec 2007) | 1 line

  Make it a bit easier to test Tcl/Tk and idle from a build dir.
........
  r59547 | christian.heimes | 2007-12-18 10:12:10 +0100 (Tue, 18 Dec 2007) | 1 line

  Removed several unused files from the PCbuild9 directory. They are relics from the past.
........
  r59548 | raymond.hettinger | 2007-12-18 19:26:18 +0100 (Tue, 18 Dec 2007) | 29 lines

  Speed-up dictionary constructor by about 10%.

  New opcode, STORE_MAP saves the compiler from awkward stack manipulations
  and specializes for dicts using PyDict_SetItem instead of PyObject_SetItem.

  Old disassembly:
                0 BUILD_MAP                0
                3 DUP_TOP
                4 LOAD_CONST               1 (1)
                7 ROT_TWO
                8 LOAD_CONST               2 ('x')
               11 STORE_SUBSCR
               12 DUP_TOP
               13 LOAD_CONST               3 (2)
               16 ROT_TWO
               17 LOAD_CONST               4 ('y')
               20 STORE_SUBSCR

  New disassembly:
                0 BUILD_MAP                0
                3 LOAD_CONST               1 (1)
                6 LOAD_CONST               2 ('x')
                9 STORE_MAP
               10 LOAD_CONST               3 (2)
               13 LOAD_CONST               4 ('y')
               16 STORE_MAP
........
  r59549 | thomas.heller | 2007-12-18 20:00:34 +0100 (Tue, 18 Dec 2007) | 2 lines

  Issue #1642: Fix segfault in ctypes when trying to delete attributes.
........
  r59551 | guido.van.rossum | 2007-12-18 21:10:42 +0100 (Tue, 18 Dec 2007) | 2 lines

  Issue #1645 by Alberto Bertogli.  Fix a comment.
........
  r59553 | raymond.hettinger | 2007-12-18 22:24:09 +0100 (Tue, 18 Dec 2007) | 12 lines

  Give meaning to the oparg for BUILD_MAP:  estimated size of the dictionary.

  Allows dictionaries to be pre-sized (upto 255 elements) saving time lost
  to re-sizes with their attendant mallocs and re-insertions.

  Has zero effect on small dictionaries (5 elements or fewer), a slight
  benefit for dicts upto 22 elements (because they had to resize once
  anyway), and more benefit for dicts upto 255 elements (saving multiple
  resizes during the build-up and reducing the number of collisions on
  the first insertions).  Beyond 255 elements, there is no addional benefit.
........
  r59554 | christian.heimes | 2007-12-18 22:56:09 +0100 (Tue, 18 Dec 2007) | 1 line

  Fixed #1649: IDLE error: dictionary changed size during iteration
........
  r59557 | raymond.hettinger | 2007-12-18 23:21:27 +0100 (Tue, 18 Dec 2007) | 1 line

  Simplify and speedup _asdict() for named tuples.
........
  r59558 | christian.heimes | 2007-12-19 00:22:54 +0100 (Wed, 19 Dec 2007) | 3 lines

  Applied patch #1635: Float patch for inf and nan on Windows (and other platforms).

  The patch unifies float("inf") and repr(float("inf")) on all platforms.
........
  r59559 | raymond.hettinger | 2007-12-19 00:51:15 +0100 (Wed, 19 Dec 2007) | 1 line

  Users demand iterable input for named tuples. The author capitulates.
........
  r59560 | raymond.hettinger | 2007-12-19 01:21:06 +0100 (Wed, 19 Dec 2007) | 1 line

  Beef-up tests for dict literals
........
  r59561 | raymond.hettinger | 2007-12-19 01:27:21 +0100 (Wed, 19 Dec 2007) | 1 line

  Zap a duplicate line
........
</content>
</entry>
<entry>
<title>Remove the simple slicing API. All slicing is now done with slice objects.</title>
<updated>2007-08-30T22:57:53Z</updated>
<author>
<name>Thomas Wouters</name>
<email>thomas@python.org</email>
</author>
<published>2007-08-30T22:57:53Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d2cf20eea2338a0369d4a5707adb01b201f7dfb2'/>
<id>urn:sha1:d2cf20eea2338a0369d4a5707adb01b201f7dfb2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Hide list comp variables and support set comprehensions</title>
<updated>2007-04-15T12:05:43Z</updated>
<author>
<name>Nick Coghlan</name>
<email>ncoghlan@gmail.com</email>
</author>
<published>2007-04-15T12:05:43Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=650f0d06d3574f843f52edd1126ddd9ebd6fac7d'/>
<id>urn:sha1:650f0d06d3574f843f52edd1126ddd9ebd6fac7d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement PEP 3115 -- new metaclass syntax and semantics.</title>
<updated>2007-03-18T15:41:51Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2007-03-18T15:41:51Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=52cc1d838f4fee573e57b5b182d8e5f5db63240f'/>
<id>urn:sha1:52cc1d838f4fee573e57b5b182d8e5f5db63240f</id>
<content type='text'>
The compiler package hasn't been updated yet; test_compiler.py fails.
Otherwise all tests seem to be passing now.  There are no occurrences
of __metaclass__ left in the standard library.
Docs have not been updated.
</content>
</entry>
<entry>
<title>Bytes literal.</title>
<updated>2007-02-23T19:56:57Z</updated>
<author>
<name>Thomas Wouters</name>
<email>thomas@python.org</email>
</author>
<published>2007-02-23T19:56:57Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=00e41defe8801ef37548fb60abacb3be13156d2a'/>
<id>urn:sha1:00e41defe8801ef37548fb60abacb3be13156d2a</id>
<content type='text'>
</content>
</entry>
</feed>
