<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/compile.h, branch 0.9.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=0.9.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=0.9.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-12-09T06:06:21+00:00</updated>
<entry>
<title>py: Allow inline-assembler emitter to be generic.</title>
<updated>2016-12-09T06:06:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-12-09T02:17:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ad297a1950c74c35c90dd655ae9a69d33ed28dc0'/>
<id>urn:sha1:ad297a1950c74c35c90dd655ae9a69d33ed28dc0</id>
<content type='text'>
This patch refactors some code so that it is easier to integrate new
inline assemblers for different architectures other than ARM Thumb.
</content>
</entry>
<entry>
<title>py/compile: Add mp_compile_to_raw_code() to return raw code object.</title>
<updated>2015-11-20T12:30:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-13T13:38:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d4dba8823655c2715867f4d64e407de390c9d29e'/>
<id>urn:sha1:d4dba8823655c2715867f4d64e407de390c9d29e</id>
<content type='text'>
This can then be passed to mp_raw_code_save_file to save a .mpy file.
</content>
</entry>
<entry>
<title>py: Allocate parse nodes in chunks to reduce fragmentation and RAM use.</title>
<updated>2015-10-01T23:11:11+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-09-23T09:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=58e0f4ac50b3dc732cbfe0d7b04bb41951ac1329'/>
<id>urn:sha1:58e0f4ac50b3dc732cbfe0d7b04bb41951ac1329</id>
<content type='text'>
With this patch parse nodes are allocated sequentially in chunks.  This
reduces fragmentation of the heap and prevents waste at the end of
individually allocated parse nodes.

Saves roughly 20% of RAM during parse stage.
</content>
</entry>
<entry>
<title>py: Protect mp_parse and mp_compile with nlr push/pop block.</title>
<updated>2015-02-07T18:33:58+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-07T18:33:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0bfc7638baa4c5a4a2351364ab770a188dcab302'/>
<id>urn:sha1:0bfc7638baa4c5a4a2351364ab770a188dcab302</id>
<content type='text'>
To enable parsing constants more efficiently, mp_parse should be allowed
to raise an exception, and mp_compile can already raise a MemoryError.
So these functions need to be protected by an nlr push/pop block.

This patch adds that feature in all places.  This allows to simplify how
mp_parse and mp_compile are called: they now raise an exception if they
have an error and so explicit checking is not needed anymore.
</content>
</entry>
<entry>
<title>py: Move to guarded includes for compile.h and related headers.</title>
<updated>2014-12-27T14:12:17+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2014-12-25T21:29:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8ab6f9067412d9f73fe88d42d81c0b4c4f1fd20b'/>
<id>urn:sha1:8ab6f9067412d9f73fe88d42d81c0b4c4f1fd20b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Implement proper context save/restore for eval/exec; factor code.</title>
<updated>2014-10-05T19:13:34+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-10-05T19:13:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c4d0868df1117ad243ee8f7238985a822b0f775d'/>
<id>urn:sha1:c4d0868df1117ad243ee8f7238985a822b0f775d</id>
<content type='text'>
This has benefits all round: code factoring for parse/compile/execute,
proper context save/restore for exec, allow to sepcify globals/locals
for eval, and reduced ROM usage by &gt;100 bytes on stmhal and unix.

Also, the call to mp_parse_compile_execute is tail call optimised for
the import code, so it doesn't increase stack memory usage.
</content>
</entry>
<entry>
<title>py: Free non-interned strings in the parser when not needed.</title>
<updated>2014-09-23T15:31:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-09-23T15:31:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=52b5d76a6b0c5e4c779211fdf7bca56d87a2f83e'/>
<id>urn:sha1:52b5d76a6b0c5e4c779211fdf7bca56d87a2f83e</id>
<content type='text'>
mp_parse_node_free now frees the memory associated with non-interned
strings.  And the parser calls mp_parse_node_free when discarding a
non-used node (such as a doc string).

Also, the compiler now frees the parse tree explicitly just before it
exits (as opposed to relying on the caller to do this).

Addresses issue #708 as best we can.
</content>
</entry>
<entry>
<title>py: Rename BYTE_CODE to BYTECODE (this was missed in previous rename).</title>
<updated>2014-05-12T21:35:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-05-12T21:35:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96f137b24a6c0b2e1e3c6f5fb8617b8a7f7896d6'/>
<id>urn:sha1:96f137b24a6c0b2e1e3c6f5fb8617b8a7f7896d6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add license header to (almost) all files.</title>
<updated>2014-05-03T22:27:38+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-05-03T22:27:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=04b9147e150d2d6fa3750f312fe328b6a71c1b28'/>
<id>urn:sha1:04b9147e150d2d6fa3750f312fe328b6a71c1b28</id>
<content type='text'>
Blanket wide to all .c and .h files.  Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.

Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
</content>
</entry>
<entry>
<title>py, compiler: Clean up and compress scope/compile structures.</title>
<updated>2014-04-09T11:27:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-04-09T11:27:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=78035b995ff7bd518cc1291aa70c966b53510fd9'/>
<id>urn:sha1:78035b995ff7bd518cc1291aa70c966b53510fd9</id>
<content type='text'>
Convert int types to uint where sensible, and then to uint8_t or
uint16_t where possible to reduce RAM usage.
</content>
</entry>
</feed>
