summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-02-21cc3200/mods/modwlan: Allow antenna diversity to be fully compiled out.Damien George
2017-02-21cc3200/mods/modwlan: Make multi-threaded a proper compile-time option.Damien George
2017-02-21cc3200/mods/modwlan: Remove unused header includes; simplify others.Damien George
2017-02-21cc3200: Remove util/std.h, can just use stdio.h instead.Damien George
2017-02-21cc3200: Use simplelink API instead of emulated BSD API.Damien George
Most of cc3200 uses explicit simplelink calls anyway, and this means there are no longer any clashes with macros from the C stdlib.
2017-02-21cc3200: Move stoupper to ftp.c and define in terms of unichar_toupper.Damien George
ftp.c is the only user of this function so making it static in that file allows it to be inlined. Also, reusing unichar_toupper means we no longer depend on the C stdlib for toupper, saving about 300 bytes of code space.
2017-02-20tests/cpydiff: Add a test for storing iterable to a list slice.Damien George
2017-02-20docs: Modify Makefile and indexes to generate cPy-differences pages.Rami Ali
2017-02-20tools: Add gen-cpydiff.py to generate docs differences.Rami Ali
This patch introduces the a small framework to track differences between uPy and CPython. The framework consists of: - A set of "tests" which test for an individual feature that differs between uPy and CPy. Each test is like a normal uPy test in the test suite, but has a special comment at the start with some meta-data: a category (eg syntax, core language), a human-readable description of the difference, a cause, and a workaround. Following the meta-data there is a short code snippet which demonstrates the difference. See tests/cpydiff directory for the initial set of tests. - A program (this patch) which runs all the tests (on uPy and CPy) and generates nicely-formated .rst documenting the differences. - Integration into the docs build so that everything is automatic, and the differences appear in a way that is easy for users to read/reference (see latter commits). The idea with using this new framework is: - When a new difference is found it's easy to write a short test for it, along with a description, and add it to the existing ones. It's also easy for contributors to submit tests for differences they find. - When something is no longer different the tool will give an error and difference can be removed (or promoted to a proper feature test).
2017-02-20tests/cpydiff: Add initial set of tests for uPy-CPython differences.Rami Ali
These tests are intended to fail, as they provide a programatic record of differences between uPy and CPython. They also contain a special comment at the start of the file which has meta-data describing the difference, including known causes and known workarounds.
2017-02-20py/objlist: For list slice assignment, allow RHS to be a tuple or list.Damien George
Before this patch, assigning anything other than a list would lead to a crash. Fixes issue #2886.
2017-02-20tests/heapalloc_exc_raise.py: Heap alloc test for raising/catching exc.Paul Sokolovsky
2017-02-17zephyr/README: Network startup issues with frdm_k64f resolved.Paul Sokolovsky
But leave a generic warning that users should be aware of Zephyr's limitations/issues for a board they use.
2017-02-17docs/library/lcd160cr: Mention the valid values for set_power() method.Damien George
2017-02-17drivers/display/lcd160cr: Use correct variable in set_power().Stephan Brauer
2017-02-17windows/.gitignore: Ignore VC.db and VC.opendb files from VS2015stijn
Since VS2015 update 2 .db files are used for storing browsing info, instead of .sdf files. If users don't specify a location for these files excplicitly they end up in the project directory so ignore them.
2017-02-17teensy/main: Remove unnecessary header includes.Damien George
2017-02-17stmhal/main: Remove unnecessary header includes.Damien George
2017-02-17py/grammar: Remove unused rule.Damien George
Since the recent changes to string/bytes literal concatenation, this rule is no longer used.
2017-02-17py/lexer: Convert mp_uint_t to size_t where appropriate.Damien George
2017-02-17tests/basics/string_join: Add more tests for string concatenation.Damien George
2017-02-17tests/cmdline/cmd_parsetree: Update to work with changes to grammar.Damien George
2017-02-17py: Do adjacent str/bytes literal concatenation in lexer, not compiler.Damien George
It's much more efficient in RAM and code size to do implicit literal string concatenation in the lexer, as opposed to the compiler. RAM usage is reduced because the concatenation can be done right away in the tokeniser by just accumulating the string/bytes literals into the lexer's vstr. Prior to this patch adjacent strings/bytes would create a parse tree (one node per string/bytes) and then in the compiler a whole new chunk of memory was allocated to store the concatenated string, which used more than double the memory compared to just accumulating in the lexer. This patch also significantly reduces code size: bare-arm: -204 minimal: -204 unix x64: -328 stmhal: -208 esp8266: -284 cc3200: -224
2017-02-17py/lexer: Simplify handling of line-continuation error.Damien George
Previous to this patch there was an explicit check for errors with line continuation (where backslash was not immediately followed by a newline). But this check is not necessary: if there is an error then the remaining logic of the tokeniser will reject the backslash and correctly produce a syntax error.
2017-02-17py/lexer: Use strcmp to make keyword searching more efficient.Damien George
Since the table of keywords is sorted, we can use strcmp to do the search and stop part way through the search if the comparison is less-than. Because all tokens that are names are subject to this search, this optimisation will improve the overall speed of the lexer when processing a script. The change also decreases code size by a little bit because we now use strcmp instead of the custom str_strn_equal function.
2017-02-17py/lexer: Move check for keyword to name-tokenising block.Damien George
Keywords only needs to be searched for if the token is a MP_TOKEN_NAME, so we can move the seach to the part of the code that does the tokenising for MP_TOKEN_NAME.
2017-02-17py/lexer: Simplify handling of indenting of very first token.Damien George
2017-02-17minimal: Update frozentest.mpy file for new .mpy version.Damien George
2017-02-17gitattributes: Remove obsolete lines.Damien George
2017-02-17gitattributes: Add .mpy files to list of binary files.Damien George
2017-02-17py/persistentcode: Bump .mpy version due to change in bytecode.Damien George
2017-02-16py/lexer: Don't generate string representation for period or ellipsis.Damien George
It's not needed.
2017-02-16tests/cmdline: Update cmd_parsetree test for changes to grammar order.Damien George
2017-02-16py/grammar: Group no-compile grammar rules together to shrink tables.Damien George
Grammar rules have 2 variants: ones that are attached to a specific compile function which is called to compile that grammar node, and ones that don't have a compile function and are instead just inspected to see what form they take. In the compiler there is a table of all grammar rules, with each entry having a pointer to the associated compile function. Those rules with no compile function have a null pointer. There are 120 such rules, so that's 120 words of essentially wasted code space. By grouping together the compile vs no-compile rules we can put all the no-compile rules at the end of the list of rules, and then we don't need to store the null pointers. We just have a truncated table and it's guaranteed that when indexing this table we only index the first half, the half with populated pointers. This patch implements such a grouping by having a specific macro for the compile vs no-compile grammar rules (DEF_RULE vs DEF_RULE_NC). It saves around 460 bytes of code on 32-bit archs.
2017-02-16tests/micropython/heapalloc_iter: Add tests for contains and unpack.Damien George
2017-02-16py: De-optimise some uses of mp_getiter, so they don't use the C stack.Damien George
In these cases the heap is anyway used to create a new object so no real need to use the C stack for iterating. It saves a few bytes of code size.
2017-02-16tests/micropython: Add test for iterating with the heap locked.Damien George
2017-02-16tests/cmdline/cmd_showbc: Update to work with recent changes.Damien George
2017-02-16py/compile: Optimise list/dict/set comprehensions to use stack iter.Damien George
2017-02-16tests/cmdline: Update tests to pass with latest changes to bytecode.Damien George
2017-02-16py/runtime: Optimise case of identity iterator so it doesn't alloc RAM.Damien George
2017-02-16py: Remove unused "use_stack" argument from for_iter_end emit function.Damien George
2017-02-16py: Optimise storage of iterator so it takes only 4 slots on Py stack.Damien George
2017-02-16py: Make FOR_ITER opcode pop 1+4 slots from the stack when finished.Damien George
The extra 4 slots correspond to the iterator object stored on the stack.
2017-02-16py: Allow bytecode/native to put iter_buf on stack for simple for loops.Damien George
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).
2017-02-16py: Add iter_buf to getiter type method.Damien George
Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
2017-02-16py/vm: Convert mp_uint_t to size_t where appropriate.Damien George
2017-02-16py/objint: Convert mp_uint_t to size_t where appropriate.Damien George
2017-02-16py/objexcept: Convert mp_uint_t to size_t where appropriate.Damien George
2017-02-16py/objclosure: Convert mp_uint_t to size_t where appropriate.Damien George