<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/emitbc.c, branch 3.0.0-alpha.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=3.0.0-alpha.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=3.0.0-alpha.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-07-31T08:35:40+00:00</updated>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py,extmod: Some casts and minor refactors to quiet compiler warnings.</title>
<updated>2017-07-07T01:32:22+00:00</updated>
<author>
<name>Tom Collins</name>
<email>tom.collins@digi.com</email>
</author>
<published>2017-06-30T23:23:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=145796f037715e180b441b38c1ec1ba45ff77797'/>
<id>urn:sha1:145796f037715e180b441b38c1ec1ba45ff77797</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/emitbc: Fix bug with BC emitter computing Python stack size.</title>
<updated>2017-05-25T10:42:30+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-05-25T10:42:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8f064e469d551ab51a960cebf011e34af5e7fa58'/>
<id>urn:sha1:8f064e469d551ab51a960cebf011e34af5e7fa58</id>
<content type='text'>
Previous to this patch the mp_emit_bc_adjust_stack_size function would
adjust the current stack size but would not increase the maximum stack size
if the current size went above it.  This meant that certain Python code
(eg a try-finally block with no statements inside it) would not have enough
Python stack allocated to it.

This patch fixes the problem by always checking if the current stack size
goes above the maximum, and adjusting the latter if it does.
</content>
</entry>
<entry>
<title>py: Add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls.</title>
<updated>2017-04-22T13:39:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-18T23:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dd11af209d226b7d18d5148b239662e30ed60bad'/>
<id>urn:sha1:dd11af209d226b7d18d5148b239662e30ed60bad</id>
<content type='text'>
This patch allows the following code to run without allocating on the heap:

    super().foo(...)

Before this patch such a call would allocate a super object on the heap and
then load the foo method and call it right away.  The super object is only
needed to perform the lookup of the method and not needed after that.  This
patch makes an optimisation to allocate the super object on the C stack and
discard it right after use.

Changes in code size due to this patch are:

   bare-arm: +128
    minimal: +232
   unix x64: +416
unix nanbox: +364
     stmhal: +184
    esp8266: +340
     cc3200: +128
</content>
</entry>
<entry>
<title>py: Define and use MP_OBJ_ITER_BUF_NSLOTS to get size of stack iter buf.</title>
<updated>2017-03-23T05:36:08+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-03-23T05:36:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=60656eaea41df16557fbbdb51d9b8fc2cf7662a1'/>
<id>urn:sha1:60656eaea41df16557fbbdb51d9b8fc2cf7662a1</id>
<content type='text'>
It improves readability of code and reduces the chance to make a mistake.

This patch also fixes a bug with nan-boxing builds by rounding up the
calculation of the new NSLOTS variable, giving the correct number of slots
(being 4) even if mp_obj_t is larger than the native machine size.
</content>
</entry>
<entry>
<title>py: Remove unused "use_stack" argument from for_iter_end emit function.</title>
<updated>2017-02-16T07:38:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-01-17T04:30:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=30b42dd72d4aa310e8c96ccbaf75150f8649c262'/>
<id>urn:sha1:30b42dd72d4aa310e8c96ccbaf75150f8649c262</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Optimise storage of iterator so it takes only 4 slots on Py stack.</title>
<updated>2017-02-16T07:38:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-01-17T04:27:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=088740ecc40476fd0796a3ef6a68ee7c677eae64'/>
<id>urn:sha1:088740ecc40476fd0796a3ef6a68ee7c677eae64</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Make FOR_ITER opcode pop 1+4 slots from the stack when finished.</title>
<updated>2017-02-16T07:38:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-01-17T03:32:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6e769da0da2ae24cbdab50c57f0d088e137146e3'/>
<id>urn:sha1:6e769da0da2ae24cbdab50c57f0d088e137146e3</id>
<content type='text'>
The extra 4 slots correspond to the iterator object stored on the stack.
</content>
</entry>
<entry>
<title>py: Allow bytecode/native to put iter_buf on stack for simple for loops.</title>
<updated>2017-02-16T07:38:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-09T23:59:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f4df3aaa72a0460614b1ab8b7b8a7927a1165e31'/>
<id>urn:sha1:f4df3aaa72a0460614b1ab8b7b8a7927a1165e31</id>
<content type='text'>
So that the "for x in it: ..." statement can now work without using the
heap (so long as the iterator argument fits in an iter_buf structure).
</content>
</entry>
<entry>
<title>py/emitbc: Produce correct line number info for large bytecode chunks.</title>
<updated>2017-02-10T00:58:10+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-10T00:58:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cc2dbdd1fe4a5131a40b2ab73195786451314bf8'/>
<id>urn:sha1:cc2dbdd1fe4a5131a40b2ab73195786451314bf8</id>
<content type='text'>
Previous to this patch, for large chunks of bytecode that originated from
a single source-code line, the bytecode-line mapping would generate
something like (for 42 bytecode bytes and 1 line):

  BC_SKIP=31  LINE_SKIP=1
  BC_SKIP=11  LINE_SKIP=0

This would mean that any errors in the last 11 bytecode bytes would be
reported on the following line.  This patch fixes it to generate instead:

  BC_SKIP=31  LINE_SKIP=0
  BC_SKIP=11  LINE_SKIP=1
</content>
</entry>
</feed>
