summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py: Small simplifications in tuple and list accessors.Damien George2014-08-30
|
* py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.Damien George2014-08-30
| | | | Part of code cleanup, working towards resolving issue #50.
* py: Remove use of int type in obj.h.Damien George2014-08-30
| | | | Part of code cleanup, working towards resolving issue #50.
* py: Change all uint to mp_uint_t in obj.h.Damien George2014-08-30
| | | | Part of code cleanup, working towards resolving issue #50.
* py: Make tuple and list use mp_int_t/mp_uint_t.Damien George2014-08-30
| | | | Part of code cleanup, to resolve issue #50.
* py: Make map, dict, set use mp_int_t/mp_uint_t exclusively.Damien George2014-08-30
| | | | Part of code cleanup, towards resolving issue #50.
* py: Save about 200 bytes of ROM by using smaller type for static table.Damien George2014-08-30
|
* Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George2014-08-30
| | | | Addressing issue #50, still some way to go yet.
* py: Use memmove instead of memcpy when appropriate.Damien George2014-08-29
| | | | | Found this bug by running unix/ tests with DEBUG=1 enabled when compiling.
* py: Fix 2 bugs in native emitter: jump_or_pop and stack settling.Damien George2014-08-29
| | | | Addresses issue #838.
* py: Add compiler optimisation for conditions in parenthesis.Damien George2014-08-29
| | | | | | | Optimises: if () -> if False if (x,...) -> if True if (a and b) -> if a and b
* py: Move native glue code from runtime.c to new file nativeglue.c.v1.3.1Damien George2014-08-28
| | | | | | | | This way, the native glue code is only compiled if native code is enabled (which makes complete sense; thanks to Paul Sokolovsky for the idea). Should fix issue #834.
* Merge pull request #833 from Vogtinator/arm-nativeDamien George2014-08-28
|\ | | | | Basic native ARM emitter
| * Clarify copyright on asmarm filesFabian Vogt2014-08-28
| |
| * Basic native ARM emitterFabian Vogt2014-08-27
| |
* | py, gc: Further reduce heap fragmentation with new, faster gc alloc.Damien George2014-08-28
| | | | | | | | | | | | | | | | | | | | | | The heap allocation is now exactly as it was before the "faster gc alloc" patch, but it's still nearly as fast. It is fixed by being careful to always update the "last free block" pointer whenever the heap changes (eg free or realloc). Tested on all tests by enabling EXTENSIVE_HEAP_PROFILING in py/gc.c: old and new allocator have exactly the same behaviour, just the new one is much faster.
* | py: Reduce fragmentation of GC heap.Damien George2014-08-28
|/ | | | | | | | | | | Recent speed up of GC allocation made the GC have a fragmented heap. This patch restores "original fragmentation behaviour" whilst still retaining relatively fast allocation. This patch works because there is always going to be a single block allocated now and then, which advances the gc_last_free_atb_index pointer often enough so that the whole heap doesn't need scanning. Should address issue #836.
* py: Improve efficiency of MP_OBJ_IS_STR_OR_BYTES.Damien George2014-08-27
| | | | | Saves ROM (16 on stmhal, 240 on 64-bit unix) and should be quicker since there is 1 less branch.
* Merge branch 'int-bytes' of https://github.com/dhylands/micropython into ↵Damien George2014-08-27
|\ | | | | | | dhylands-int-bytes
| * Make int(b'123') work properly.Dave Hylands2014-08-26
| |
* | py: Fix line number printing for file with 1 line.Damien George2014-08-26
|/ | | | | | | | | | With a file with 1 line (and an error on that line), used to show the line as number 0. Now shows it correctly as line number 1. But, when line numbers are disabled, it now prints line number 1 for any line that has an error (instead of 0 as previously). This might end up being confusing, but requires extra RAM and/or hack logic to make it print something special in the case of no line numbers.
* py: Add dispatch for user defined ==, >, <=, >=.Damien George2014-08-26
| | | | Addresses issue #827.
* stmhal: Make enable_irq and disable_irq inline functions.Damien George2014-08-25
| | | | | | | | | | | | These functions are generally 1 machine instruction, and are used in critical code, so makes sense to have them inline. Also leave these functions uninverted (ie 0 means enable, 1 means disable) and provide macro constants if you really need to distinguish the states. This makes for smaller code as well (combined with inlining). Applied to teensy port as well.
* Add save/restore_irqDave Hylands2014-08-25
| | | | Factored irq functions into a separate file.
* py: Consolidate min/max functions into one, and add key= argument.Damien George2014-08-24
| | | | Addresses issue #811.
* py: Fix bug where GC collected native/viper/asm function data.Damien George2014-08-24
| | | | | | | | Because (for Thumb) a function pointer has the LSB set, pointers to dynamic functions in RAM (eg native, viper or asm functions) were not being traced by the GC. This patch is a comprehensive fix for this. Addresses issue #820.
* py: Change hash and len members of str from 16 bit to full word.Damien George2014-08-22
| | | | | This allows to make strings longer than 64k. It doesn't use any more RAM with current GC because a str object still fits in a GC block.
* py: Small cleanup in stream.c.Damien George2014-08-22
|
* py: Speed up GC allocation.Damien George2014-08-22
| | | | | | | | | This simple patch gives a very significant speed up for memory allocation with the GC. Eg, on PYBv1.0: tests/basics/dict_del.py: 3.55 seconds -> 1.19 seconds tests/misc/rge_sm.py: 15.3 seconds -> 2.48 seconds
* py: Code clean-up in native emitter; improve thumb native calls.Damien George2014-08-16
|
* py: Viper can call functions with native types, and raise exceptions.Damien George2014-08-16
|
* py: Put SystemExit in builtin namespace.Damien George2014-08-16
| | | | Also fix unix port so that SystemExit with no arg exits with value 0.
* py: Viper can now store to global.Damien George2014-08-15
|
* py: Fix typing of viper locals; allow default types in annotation.Damien George2014-08-15
|
* py: Allow viper to have type annotations.Damien George2014-08-15
| | | | | | | | | Viper functions can now be annotated with the type of their arguments and return value. Eg: @micropython.viper def f(x:int) -> int: return x + 1
* py: Clean up and simplify functions in scope; add STATIC in compiler.Damien George2014-08-15
| | | | | Some small code clean-ups that result in about 80 bytes ROM saving for stmhal.
* py: Fix mult by negative number of tuple, list, str, bytes.Damien George2014-08-13
| | | | | | | Multiplication of a tuple, list, str or bytes now yields an empty sequence (instead of crashing). Addresses issue #799 Also added ability to mult bytes on LHS by integer.
* modzlibd: Decompress part of "zlib" module, based on miniz tinfl.c .Paul Sokolovsky2014-08-13
|
* py: #if guard qstrs that are optional.Damien George2014-08-12
| | | | Also disable gc module on bare-arm port.
* py: Add .real and .imag attributes to complex numbers.Damien George2014-08-12
|
* py: Improve range: add len, subscr, proper print.Damien George2014-08-12
| | | | | | | | Can now index ranges with integers and slices, and reverse ranges (although reversing is not very efficient). Not sure how useful this stuff is, but gets us closer to having all of Python's builtins.
* py: Implement builtin reversed() function.Damien George2014-08-12
| | | | | | | | reversed function now implemented, and works for tuple, list, str, bytes and user objects with __len__ and __getitem__. Renamed mp_builtin_len to mp_obj_len to make it publically available (eg for reversed).
* py: Make a function static; replace NULL with MP_OBJ_NULL.Damien George2014-08-12
|
* py, objstr: Optimise bytes subscr when unicode is enabled.Damien George2014-08-11
| | | | Saves code bytes and makes it faster, so why not?
* py, modcmath: Fix doc comment, and add some more of them.Damien George2014-08-11
|
* objstr: Make sure that bytes are indexed as bytes, not as unicode.Paul Sokolovsky2014-08-11
| | | | Fixes #795.
* objstr: split(): check arg type consistency (str vs bytes).Paul Sokolovsky2014-08-10
| | | | Similar to other methods and following CPython3 strictness.
* py: binary.c: Properly implement alignment for native unpacked structs.Paul Sokolovsky2014-08-10
|
* doc: Fix up a few docs in sys module.Damien George2014-08-10
|
* doc: Document gc, sys, math, cmath.Damien George2014-08-10
|