<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/parse.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-11-15T05:48:49+00:00</updated>
<entry>
<title>py/parse: Add code to fold logical constants in or/and/not operations.</title>
<updated>2016-11-15T05:48:49+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-11-13T04:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9b525134d1bf5b3f05b39fe90ddaa4bd33ea3e0d'/>
<id>urn:sha1:9b525134d1bf5b3f05b39fe90ddaa4bd33ea3e0d</id>
<content type='text'>
Adds about 200 bytes to the code size when constant folding is enabled.
</content>
</entry>
<entry>
<title>py/parse: Make mp_parse_node_new_leaf an inline function.</title>
<updated>2016-11-15T05:48:48+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-11-13T04:35:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ed9c93f0f13fe2b6b4b0fbc1155b1e38ee1be242'/>
<id>urn:sha1:ed9c93f0f13fe2b6b4b0fbc1155b1e38ee1be242</id>
<content type='text'>
It is split into 2 functions, one to make small ints and the other to make
a non-small-int leaf node.  This reduces code size by 32 bytes on
bare-arm, 64 bytes on unix (x64-64) and 144 bytes on stmhal.
</content>
</entry>
<entry>
<title>py/parse: Move function to check for const parse node to parse.[ch].</title>
<updated>2016-11-15T05:48:48+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-11-13T04:32:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b0cbfb0492028192a28f0514fba71ec954330108'/>
<id>urn:sha1:b0cbfb0492028192a28f0514fba71ec954330108</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Fix wrong assumption that m_renew will not move if shrinking</title>
<updated>2016-11-02T12:15:41+00:00</updated>
<author>
<name>Colin Hogben</name>
<email>colin@infinnovation.co.uk</email>
</author>
<published>2016-10-31T14:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f9b6b37cf65c4f65c4ad461d439fbf624c0f10c1'/>
<id>urn:sha1:f9b6b37cf65c4f65c4ad461d439fbf624c0f10c1</id>
<content type='text'>
In both parse.c and qstr.c, an internal chunking allocator tidies up
by calling m_renew to shrink an allocated chunk to the size used, and
assumes that the chunk will not move.  However, when MICROPY_ENABLE_GC
is false, m_renew calls the system realloc, which does not guarantee
this behaviour.  Environments where realloc may return a different
pointer include:

(1) mbed-os with MBED_HEAP_STATS_ENABLED (which adds a wrapper around
malloc &amp; friends; this is where I was hit by the bug);

(2) valgrind on linux (how I diagnosed it).

The fix is to call m_renew_maybe with allow_move=false.
</content>
</entry>
<entry>
<title>py/parse: Only replace constants that are standalone identifiers.</title>
<updated>2016-09-23T07:23:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-23T07:23:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6d310a5552f43b3f984a5d8020b41301ab7937a4'/>
<id>urn:sha1:6d310a5552f43b3f984a5d8020b41301ab7937a4</id>
<content type='text'>
This fixes constant substitution so that only standalone identifiers are
replaced with their constant value (if they have one).  I.e. don't
replace NAME in expressions like obj.NAME or NAME = expr.
</content>
</entry>
<entry>
<title>py/parse: Treat constants that start with underscore as private.</title>
<updated>2016-06-06T16:28:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-06-06T16:28:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b1533c43669c037d04c87d1756355cdc8edd5e0a'/>
<id>urn:sha1:b1533c43669c037d04c87d1756355cdc8edd5e0a</id>
<content type='text'>
Assignments of the form "_id = const(value)" are treated as private
(following a similar CPython convention) and code is no longer emitted
for the assignment to a global variable.

See issue #2111.
</content>
</entry>
<entry>
<title>py: Declare constant data as properly constant.</title>
<updated>2016-05-20T11:46:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-20T11:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3ff16ff52e45d4c0bf1df5fa650b72d6d835451b'/>
<id>urn:sha1:3ff16ff52e45d4c0bf1df5fa650b72d6d835451b</id>
<content type='text'>
Otherwise some compilers (eg without optimisation) will put this read-only
data in RAM instead of ROM.
</content>
</entry>
<entry>
<title>py/parse: Add uerrno to list of modules to look for constants in.</title>
<updated>2016-05-10T22:30:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-10T22:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e36ff98c80aa93a2f9fdd05800aaa6e75ead2b72'/>
<id>urn:sha1:e36ff98c80aa93a2f9fdd05800aaa6e75ead2b72</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Simplify "and" action within parser by making ident-rules explicit.</title>
<updated>2016-04-14T12:49:23+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-14T12:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0c1de1cdeea98e55710d27f7926da717086ac0fc'/>
<id>urn:sha1:0c1de1cdeea98e55710d27f7926da717086ac0fc</id>
<content type='text'>
Most grammar rules can optimise to the identity if they only have a single
argument, saving a lot of RAM building the parse tree.  Previous to this
patch, whether a given grammar rule could be optimised was defined (mostly
implicitly) by a complicated set of logic rules.  With this patch the
definition is always specified explicitly by using "and_ident" in the rule
definition in the grammar.  This simplifies the logic of the parser,
making it a bit smaller and faster.  RAM usage in unaffected.
</content>
</entry>
<entry>
<title>py: Fix constant folding and inline-asm to work with new async grammar.</title>
<updated>2016-04-13T14:26:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-13T14:21:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=eacbd7aeba3bdd634b56af544e40da87779f4a95'/>
<id>urn:sha1:eacbd7aeba3bdd634b56af544e40da87779f4a95</id>
<content type='text'>
</content>
</entry>
</feed>
