<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/emitbc.c, branch v1.4.1</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.1</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.1'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2015-03-26T16:52:45+00:00</updated>
<entry>
<title>py, compiler: When just bytecode, make explicit calls instead of table.</title>
<updated>2015-03-26T16:52:45+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-03-26T16:44:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4112590a602fa11b4d9a3df3ed5c55df56c0dc62'/>
<id>urn:sha1:4112590a602fa11b4d9a3df3ed5c55df56c0dc62</id>
<content type='text'>
When just the bytecode emitter is needed there is no need to have a
dynamic method table for the emitter back-end, and we can instead
directly call the mp_emit_bc_XXX functions.  This gives a significant
reduction in code size and a very slight performance boost for the
compiler.

This patch saves 1160 bytes code on Thumb2 and 972 bytes on x86, when
native emitters are disabled.

Overall savings in code over the last 3 commits are:

bare-arm: 1664 bytes.
minimal:  2136 bytes.
stmhal:    584 bytes (it has native emitter enabled).
cc3200:   1736 bytes.
</content>
</entry>
<entry>
<title>py, compiler: Remove emit_pass1 code, using emit_bc to do its job.</title>
<updated>2015-03-26T16:52:45+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-03-26T15:49:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a210c774f9cfbcde284f5b8a63442b4d6da1ae5b'/>
<id>urn:sha1:a210c774f9cfbcde284f5b8a63442b4d6da1ae5b</id>
<content type='text'>
First pass for the compiler is computing the scope (eg if an identifier
is local or not) and originally had an entire table of methods dedicated
to this, most of which did nothing.  With changes from previous commit,
this set of methods can be removed and the methods from the bytecode
emitter used instead, with very little modification -- this is what is
done in this commit.

This factoring has little to no impact on the speed of the compiler
(tested by compiling 3763 Python scripts and timing it).

This factoring reduces code size by about 270-300 bytes on Thumb2 archs,
and 400 bytes on x86.
</content>
</entry>
<entry>
<title>py, compiler: Refactor load/store/delete_id logic to reduce code size.</title>
<updated>2015-03-26T16:52:45+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-03-26T14:42:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=542bd6b4a1ead90fde42f24d01c82580f9d048de'/>
<id>urn:sha1:542bd6b4a1ead90fde42f24d01c82580f9d048de</id>
<content type='text'>
Saves around 230 bytes on Thumb2 and 750 bytes on x86.
</content>
</entry>
<entry>
<title>py: Combine emit functions for jump true/false to reduce code size.</title>
<updated>2015-02-28T15:04:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-28T15:04:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=63f3832e813442dcfc88be65d78ce465b053a33b'/>
<id>urn:sha1:63f3832e813442dcfc88be65d78ce465b053a33b</id>
<content type='text'>
Saves 116 bytes for stmhal and 56 bytes for cc3200 port.
</content>
</entry>
<entry>
<title>py: Parse big-int/float/imag constants directly in parser.</title>
<updated>2015-02-08T01:57:40+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-08T01:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7d414a1b52d193bab2c94cf56932e1eba23ba542'/>
<id>urn:sha1:7d414a1b52d193bab2c94cf56932e1eba23ba542</id>
<content type='text'>
Previous to this patch, a big-int, float or imag constant was interned
(made into a qstr) and then parsed at runtime to create an object each
time it was needed.  This is wasteful in RAM and not efficient.  Now,
these constants are parsed straight away in the parser and turned into
objects.  This allows constants with large numbers of digits (so
addresses issue #1103) and takes us a step closer to #722.
</content>
</entry>
<entry>
<title>py, unix: Allow to compile with -Wunused-parameter.</title>
<updated>2015-01-20T12:47:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-20T12:47:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ff8dd3f486afb0d6ff1427d8a6a8a8ed73baa660'/>
<id>urn:sha1:ff8dd3f486afb0d6ff1427d8a6a8a8ed73baa660</id>
<content type='text'>
See issue #699.
</content>
</entry>
<entry>
<title>py, unix: Allow to compile with -Wsign-compare.</title>
<updated>2015-01-16T17:47:07+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-16T17:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=963a5a3e82ded7ee75adae72ae7cb14796fa150e'/>
<id>urn:sha1:963a5a3e82ded7ee75adae72ae7cb14796fa150e</id>
<content type='text'>
See issue #699.
</content>
</entry>
<entry>
<title>py: Remove unnecessary id_flags argument from emitter's load_fast.</title>
<updated>2015-01-16T12:24:49+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-16T12:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0abb5609b01c1b59d229bde8a0b3fc1df6dce060'/>
<id>urn:sha1:0abb5609b01c1b59d229bde8a0b3fc1df6dce060</id>
<content type='text'>
Saves 24 bytes in bare-arm.
</content>
</entry>
<entry>
<title>py: Add "default" to switches to allow better code flow analysis.</title>
<updated>2015-01-14T21:32:42+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-14T21:32:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d2d64f00fb7f1487c1fa21a456e003a801d7e711'/>
<id>urn:sha1:d2d64f00fb7f1487c1fa21a456e003a801d7e711</id>
<content type='text'>
This helps compiler produce smaller code.  Saves 124 bytes on stmhal and
bare-arm.
</content>
</entry>
<entry>
<title>py: Add load_const_obj to emitter, add LOAD_CONST_OBJ to bytecode.</title>
<updated>2015-01-13T15:55:54+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-13T15:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dab1385177558f1d27c03b59e443b6fa25a2cdc0'/>
<id>urn:sha1:dab1385177558f1d27c03b59e443b6fa25a2cdc0</id>
<content type='text'>
This allows to directly load a Python object to the Python stack.  See
issue #722 for background.
</content>
</entry>
</feed>
