<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/runtime.c, branch v1.8.7</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.7</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.7'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-12-15T02:00:19+00:00</updated>
<entry>
<title>py: Add MICROPY_KBD_EXCEPTION config option to provide mp_kbd_exception.</title>
<updated>2016-12-15T02:00:19+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-15T02:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7f1da0a03b1559080ca4d054bd38f104bde168e6'/>
<id>urn:sha1:7f1da0a03b1559080ca4d054bd38f104bde168e6</id>
<content type='text'>
Defining and initialising mp_kbd_exception is boiler-plate code and so the
core runtime can provide it, instead of each port needing to do it
themselves.

The exception object is placed in the VM state rather than on the heap.
</content>
</entry>
<entry>
<title>py/runtime: Zero out fs_user_mount array in mp_init.</title>
<updated>2016-12-14T00:40:11+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-14T00:40:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e8f2db7da3f0e60901b09ee6eada99a9e875497f'/>
<id>urn:sha1:e8f2db7da3f0e60901b09ee6eada99a9e875497f</id>
<content type='text'>
There's no need to force ports to copy-and-paste this initialisation
code.  If FSUSERMOUNT is enabled then this zeroing out must be done.
</content>
</entry>
<entry>
<title>py/runtime: mp_resume: Fix exception handling for nanbox port.</title>
<updated>2016-11-14T22:41:22+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-11-14T22:40:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a0b2c6ad32230d679260eb2a545e5272234254ff'/>
<id>urn:sha1:a0b2c6ad32230d679260eb2a545e5272234254ff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/runtime: mp_resume: Handle exceptions in Python __next__().</title>
<updated>2016-11-14T22:10:34+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-11-14T22:10:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=79d996a57b351e0ef354eb1e2f644b194433cc73'/>
<id>urn:sha1:79d996a57b351e0ef354eb1e2f644b194433cc73</id>
<content type='text'>
This includes StopIteration and thus are important to make Python-coded
iterables work with yield from/await.

Exceptions in Python send() are still not handled and left for future
consideration and optimization.
</content>
</entry>
<entry>
<title>py: Specialise builtin funcs to use separate type for fixed arg count.</title>
<updated>2016-10-21T05:26:01+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-18T00:49:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=571e6f26dbd7e0e38441bc402f76d293303063b2'/>
<id>urn:sha1:571e6f26dbd7e0e38441bc402f76d293303063b2</id>
<content type='text'>
Builtin functions with a fixed number of arguments (0, 1, 2 or 3) are
quite common.  Before this patch the wrapper for such a function cost
3 machine words.  After this patch it only takes 2, which can reduce the
code size by quite a bit (and pays off even more, the more functions are
added).  It also makes function dispatch slightly more efficient in CPU
usage, and furthermore reduces stack usage for these cases.  On x86 and
Thumb archs the dispatch functions are now tail-call optimised by the
compiler.

The bare-arm port has its code size increase by 76 bytes, but stmhal drops
by 904 bytes.  Stack usage by these builtin functions is decreased by 48
bytes on Thumb2 archs.
</content>
</entry>
<entry>
<title>py: Use mp_raise_msg helper function where appropriate.</title>
<updated>2016-10-17T01:17:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-17T01:17:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7d0d7215d2575a2d36d34c9a13b58cade0610a28'/>
<id>urn:sha1:7d0d7215d2575a2d36d34c9a13b58cade0610a28</id>
<content type='text'>
Saves the following number of bytes of code space: 176 for bare-arm, 352
for minimal, 272 for unix x86-64, 140 for stmhal, 120 for esp8266.
</content>
</entry>
<entry>
<title>py: Add mp_raise_OSError(errno) helper function.</title>
<updated>2016-10-07T02:31:59+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-10-07T02:31:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3a0a7717304cc34a4d6ef55f767666c918c185b5'/>
<id>urn:sha1:3a0a7717304cc34a4d6ef55f767666c918c185b5</id>
<content type='text'>
This is an often used code pattern, and its use reduces code size of the
core by about 100 bytes.
</content>
</entry>
<entry>
<title>all: Remove 'name' member from mp_obj_module_t struct.</title>
<updated>2016-09-21T14:23:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-21T00:52:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=93c4a6a3f70e389b466fbc7a4f1ad2e1df87c93f'/>
<id>urn:sha1:93c4a6a3f70e389b466fbc7a4f1ad2e1df87c93f</id>
<content type='text'>
One can instead lookup __name__ in the modules dict to get the value.
</content>
</entry>
<entry>
<title>py: If str/bytes hash is 0 then explicitly compute it.</title>
<updated>2016-09-02T04:49:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-02T04:42:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5f3bda422a18d49fb282a93968b658c568343b7d'/>
<id>urn:sha1:5f3bda422a18d49fb282a93968b658c568343b7d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/runtime: Factor out exception raising helpers.</title>
<updated>2016-08-12T18:28:45+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-08-12T18:26:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9e1b61dedd82dffccbe4f20996eadaf79726d427'/>
<id>urn:sha1:9e1b61dedd82dffccbe4f20996eadaf79726d427</id>
<content type='text'>
Introduce mp_raise_msg(), mp_raise_ValueError(), mp_raise_TypeError()
instead of previous pattern nlr_raise(mp_obj_new_exception_msg(...)).
Save few bytes on each call, which are many.
</content>
</entry>
</feed>
