<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cpython.git/Python/opcode_targets.h, branch v3.4.0a4</title>
<subtitle>https://github.com/python/cpython.git</subtitle>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/'/>
<entry>
<title>rather than passing locals to the class body, just execute the class body in the proper environment</title>
<updated>2013-05-16T19:37:25Z</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2013-05-16T19:37:25Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=e8e14591ebb729b4fa19626ce245fa0811cf6f32'/>
<id>e8e14591ebb729b4fa19626ce245fa0811cf6f32</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>check local class namespace before reaching for cells (closes #17853)</title>
<updated>2013-04-30T13:41:40Z</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2013-04-30T13:41:40Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=3b0431dc6019d2f9ffa9adcaa78ddd3f7b76a2f5'/>
<id>3b0431dc6019d2f9ffa9adcaa78ddd3f7b76a2f5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement PEP 380 - 'yield from' (closes #11682)</title>
<updated>2012-01-13T11:43:40Z</updated>
<author>
<name>Nick Coghlan</name>
<email>ncoghlan@gmail.com</email>
</author>
<published>2012-01-13T11:43:40Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=1f7ce62bd61488d5d721896a36a1b43befab88b5'/>
<id>1f7ce62bd61488d5d721896a36a1b43befab88b5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>#4617: Previously it was illegal to delete a name from the local</title>
<updated>2010-09-10T21:39:53Z</updated>
<author>
<name>Amaury Forgeot d'Arc</name>
<email>amauryfa@gmail.com</email>
</author>
<published>2010-09-10T21:39:53Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=ba117ef7e9b2f7f2fbec62a9fcfe371a68024769'/>
<id>ba117ef7e9b2f7f2fbec62a9fcfe371a68024769</id>
<content type='text'>
namespace if it occurs as a free variable in a nested block.  This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).

This sample was valid in 2.6, but fails to compile in 3.x without this change::

   &gt;&gt;&gt; def f():
   ...     def print_error():
   ...        print(e)
   ...     try:
   ...        something
   ...     except Exception as e:
   ...        print_error()
   ...        # implicit "del e" here


This sample has always been invalid in Python, and now works::

   &gt;&gt;&gt; def outer(x):
   ...     def inner():
   ...        return x
   ...     inner()
   ...     del x

There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
namespace if it occurs as a free variable in a nested block.  This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).

This sample was valid in 2.6, but fails to compile in 3.x without this change::

   &gt;&gt;&gt; def f():
   ...     def print_error():
   ...        print(e)
   ...     try:
   ...        something
   ...     except Exception as e:
   ...        print_error()
   ...        # implicit "del e" here


This sample has always been invalid in Python, and now works::

   &gt;&gt;&gt; def outer(x):
   ...     def inner():
   ...        return x
   ...     inner()
   ...     del x

There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced</title>
<updated>2010-09-04T18:43:52Z</updated>
<author>
<name>Antoine Pitrou</name>
<email>solipsis@pitrou.net</email>
</author>
<published>2010-09-04T18:43:52Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=74a69fa662fb844ad3c60eb27b09e5fa1e577305'/>
<id>74a69fa662fb844ad3c60eb27b09e5fa1e577305</id>
<content type='text'>
by the new (and simpler) DUP_TOP_TWO.  Performance isn't changed, but
our bytecode is a bit simplified.  Patch by Demur Rumed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
by the new (and simpler) DUP_TOP_TWO.  Performance isn't changed, but
our bytecode is a bit simplified.  Patch by Demur Rumed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Recorded merge of revisions 81029 via svnmerge from</title>
<updated>2010-05-09T15:52:27Z</updated>
<author>
<name>Antoine Pitrou</name>
<email>solipsis@pitrou.net</email>
</author>
<published>2010-05-09T15:52:27Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=f95a1b3c53bdd678b64aa608d4375660033460c3'/>
<id>f95a1b3c53bdd678b64aa608d4375660033460c3</id>
<content type='text'>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
</pre>
</div>
</content>
</entry>
<entry>
<title>Merged revisions 72912,72920,72940 via svnmerge from</title>
<updated>2009-06-28T03:18:59Z</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2009-06-28T03:18:59Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=876b2f286b9af1a69846c84d1229014b2a885c97'/>
<id>876b2f286b9af1a69846c84d1229014b2a885c97</id>
<content type='text'>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72912 | benjamin.peterson | 2009-05-25 08:13:44 -0500 (Mon, 25 May 2009) | 5 lines

  add a SETUP_WITH opcode

  It speeds up the with statement and correctly looks up the special
  methods involved.
........
  r72920 | benjamin.peterson | 2009-05-25 15:12:57 -0500 (Mon, 25 May 2009) | 1 line

  take into account the fact that SETUP_WITH pushes a finally block
........
  r72940 | benjamin.peterson | 2009-05-26 07:49:59 -0500 (Tue, 26 May 2009) | 1 line

  teach the peepholer about SETUP_WITH
........
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72912 | benjamin.peterson | 2009-05-25 08:13:44 -0500 (Mon, 25 May 2009) | 5 lines

  add a SETUP_WITH opcode

  It speeds up the with statement and correctly looks up the special
  methods involved.
........
  r72920 | benjamin.peterson | 2009-05-25 15:12:57 -0500 (Mon, 25 May 2009) | 1 line

  take into account the fact that SETUP_WITH pushes a finally block
........
  r72940 | benjamin.peterson | 2009-05-26 07:49:59 -0500 (Tue, 26 May 2009) | 1 line

  teach the peepholer about SETUP_WITH
........
</pre>
</div>
</content>
</entry>
<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://service.techsat.com/oss-git/cpython.git/commit/?id=9de7ec7868554e92700e4bda6c5f9d8fcad634dc'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #4753: By enabling a configure option named '--with-computed-gotos'</title>
<updated>2009-01-25T16:34:23Z</updated>
<author>
<name>Antoine Pitrou</name>
<email>solipsis@pitrou.net</email>
</author>
<published>2009-01-25T16:34:23Z</published>
<link rel='alternate' type='text/html' href='http://service.techsat.com/oss-git/cpython.git/commit/?id=b52ec78baf236272800017fdb2b7f243741c1851'/>
<id>b52ec78baf236272800017fdb2b7f243741c1851</id>
<content type='text'>
on compilers that support it (notably: gcc, SunPro, icc), the bytecode
evaluation loop is compiled with a new dispatch mechanism which gives
speedups of up to 20%, depending on the system, on various benchmarks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
on compilers that support it (notably: gcc, SunPro, icc), the bytecode
evaluation loop is compiled with a new dispatch mechanism which gives
speedups of up to 20%, depending on the system, on various benchmarks.
</pre>
</div>
</content>
</entry>
</feed>
