summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py: Don't allocate an extra parse node for power exponent.Damien George2016-03-16
| | | | | | Previous to this patch, the "**b" in "a**b" had its own parse node with just one item (the "b"). Now, the "b" is just the last element of the power parse-node. This saves (a tiny bit of) RAM when compiling.
* py/frozenmod: Allow port to override lexer to use for frozen modules.Paul Sokolovsky2016-03-16
|
* py/objfun: Allow inline-asm functions to be called with 4 arguments.Damien George2016-03-16
|
* py/formatfloat: Fix buffer overflow when formatting tiny numbers.Damien George2016-03-15
|
* py: For mp_buffer_info_t, change len type from mp_uint_t to size_t.Damien George2016-03-15
|
* py/objarray: Fix array slice assignment when array is reallocated.Damien George2016-03-14
| | | | Addresses issue #1898.
* py/parsenum: Fix compiler warnings for no decl and signed comparison.Damien George2016-03-14
|
* py: When printf'ing an object as a pointer, pass the concrete pointer.Damien George2016-03-14
|
* py: Fix passing of some wide int types to printf varg format list.Damien George2016-03-14
| | | | | | Passing an mp_uint_t to a %d printf format is incorrect for builds where mp_uint_t is larger than word size (eg a nanboxing build). This patch adds some simple casting to int in these cases.
* py/argcheck: Use size_t instead of mp_uint_t to count number of args.Damien George2016-03-14
|
* py/parsenum: Use size_t to count bytes, and int for type of base arg.Damien George2016-03-14
| | | | | size_t is the proper type to count number of bytes in a string. The base argument does not need to be a full mp_uint_t, int is enough.
* py: Use MP_SMALL_INT_POSITIVE_MASK to check if uint fits in a small int.Damien George2016-03-10
| | | | | Using the original WORD_MSBIT_HIGH-logic resulted in errors when the object model is not REPR_A or REPR_C.
* extmod/modlwip: Add dummy .makefile() method.Paul Sokolovsky2016-03-09
|
* py/objboundmeth: Allocate arg state on stack if heap alloc fails.Damien George2016-03-08
| | | | | | | | | | If the heap is locked, or memory allocation fails, then calling a bound method will still succeed by allocating the argument state on the stack. The new code also allocates less stack than before if less than 4 arguments are passed. It's also a tiny bit smaller in code size. This was done as part of the ESA project.
* extmod/modlwip: Implement dummy setsockopt().Paul Sokolovsky2016-03-08
|
* py/emitglue: Get persistent bytecode working on Linux ARM platform.Markus Fix2016-03-07
|
* py/stackctrl: Add mp_stack_set_top() to explicitly set stack top value.Paul Sokolovsky2016-03-07
| | | | Useful for embedded targets with fixed stack layout.
* extmod/vfs_fat: Add lexer, move from stmhal port for reuse.Paul Sokolovsky2016-03-03
|
* py/qstrdefs: Add mkdir and remove qstrs for user-mountable filesystems.Damien George2016-02-29
|
* extmod/vfs_fat: Add .rename() method.Paul Sokolovsky2016-02-29
|
* extmod/vfs_fat: Move listdir() method from stmhal for reuse.Paul Sokolovsky2016-02-28
|
* py: Add MICROPY_DYNAMIC_COMPILER option to config compiler at runtime.Damien George2016-02-25
| | | | | | | | | | | | | | This new compile-time option allows to make the bytecode compiler configurable at runtime by setting the fields in the mp_dynamic_compiler structure. By using this feature, the compiler can generate bytecode that targets any MicroPython runtime/VM, regardless of the host and target compile-time settings. Options so far that fall under this dynamic setting are: - maximum number of bits that a small int can hold; - whether caching of lookups is used in the bytecode; - whether to use unicode strings or not (lexer behaviour differs, and therefore generated string constants differ).
* py/emitinlinethumb: Use qstrs instead of char* for names of asm ops.Damien George2016-02-23
| | | | | | | | Reduces code size by 112 bytes on Thumb2 arch, and makes assembler faster because comparison can be a simple equals instead of a string compare. Not all ops have been converted, only those that were simple to convert and reduced code size.
* py/malloc: Provide a proper malloc-based implementation of realloc_ext.Damien George2016-02-23
|
* py/parse: Use m_renew_maybe to ensure that memory is shrunk in-place.Damien George2016-02-23
| | | | | | | The chunks of memory that the parser allocates contain parse nodes and are pointed to from many places, so these chunks cannot be relocated by the memory manager. This patch makes it so that when a chunk is shrunk to fit, it is not relocated.
* py/vm: Add macros to hook into various points in the VM.Damien George2016-02-17
| | | | | | | | | | | | | | | | | | | | These can be used to insert arbitrary checks, polling, etc into the VM. They are left general because the VM is a highly tuned loop and it should be up to a given port how that port wants to modify the VM internals. One common use would be to insert a polling check, but only done after a certain number of opcodes were executed, so as not to slow down the VM too much. For example: #define MICROPY_VM_HOOK_COUNT (30) #define MICROPY_VM_HOOK_INIT static uint vm_hook_divisor = MICROPY_VM_HOOK_COUNT #define MICROPY_VM_HOOK_POLL if (--vm_hook_divisor == 0) { \ vm_hook_divisor = MICROPY_VM_HOOK_COUNT; extern void vm_hook_function(void); vm_hook_function(); } #define MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_POLL #define MICROPY_VM_HOOK_RETURN MICROPY_VM_HOOK_POLL
* py/repl: Check for an identifier char after the keyword.Alex March2016-02-17
| | | | | - As described in the #1850. - Add cmdline tests.
* py/qstrdefs.h: qstrs for VfsFat.Paul Sokolovsky2016-02-15
|
* py/emitnative: Add check that RHS of viper store is of integral type.Damien George2016-02-15
|
* py/asmx64: Support all 16 regs in reg to memory move instructions.Damien George2016-02-15
|
* py/asmx64: Add helper macro for generating REX_[WRXB] bits from a reg64.Damien George2016-02-15
|
* extmod/vfs_fat_ffconf: Reusable FatFs module, move from stmhal/ffconf.Paul Sokolovsky2016-02-15
| | | | TODO: Probably merge into vfs_fat_diskio.
* extmod/vfs_fat_file: Reusable FatFs module, move from stmhal/file.Paul Sokolovsky2016-02-15
|
* extmod/vfs_fat_diskio: Reusable FatFs module, move from stmhal/diskio.Paul Sokolovsky2016-02-15
|
* py/mpstate.h: fs_user_mount is now standard, reusable uPy functionality.Paul Sokolovsky2016-02-15
|
* unix: Enable VfsFat support.Paul Sokolovsky2016-02-14
|
* py/obj.h: If not float support is enabled, define mp_obj_is_float(o) to false.Paul Sokolovsky2016-02-14
| | | | | We have so many configuration options, that finally having shortcuts like this is helpful and cuts on number of ifdef's.
* py/objarray: Implement "in" operator for bytearray.Paul Sokolovsky2016-02-14
|
* extmod/fsusermount: Expose umount as a public function.Damien George2016-02-10
|
* extmod/fsusermount: Change block protocol to support ioctl method.Damien George2016-02-10
| | | | | | | | | | | | | The new block protocol is: - readblocks(self, n, buf) - writeblocks(self, n, buf) - ioctl(self, cmd, arg) The new ioctl method handles the old sync and count methods, as well as a new "get sector size" method. The old protocol is still supported, and used if the device doesn't have the ioctl method.
* py/viper: Allow uint as index to load/store, and give better error msg.Damien George2016-02-09
|
* py/viper: Allow casting of Python integers to viper pointers.Damien George2016-02-09
| | | | | | | | | This allows you to pass a number (being an address) to a viper function that expects a pointer, and also allows casting of integers to pointers within viper functions. This was actually the original behaviour, but it regressed due to native type identifiers being promoted to 4 bits in width.
* py/mpz: Add commented-out mpz_pow3_inpl function, to compute (x**y)%z.Damien George2016-02-03
| | | | | | | This function computes (x**y)%z in an efficient way. For large arguments this operation is otherwise not computable by doing x**y and then %z. It's currently not used, but is added in case it's useful one day.
* py/mpz: Complete implementation of mpz_{and,or,xor} for negative args.Doug Currie2016-02-03
| | | | | | | | | | | | For these 3 bitwise operations there are now fast functions for positive-only arguments, and general functions for arbitrary sign arguments (the fast functions are the existing implementation). By default the fast functions are not used (to save space) and instead the general functions are used for all operations. Enable MICROPY_OPT_MPZ_BITWISE to use the fast functions for positive arguments.
* py: Extend native type-sig to use 4 bits, so uint is separate to ptr.Damien George2016-02-02
| | | | | | | Before this patch, the native types for uint and ptr/ptr8/ptr16/ptr32 all overlapped and it was possible to make a mistake in casting. Now, these types are all separate and any coding mistakes will be raised as runtime errors.
* py/objstr: Make mp_obj_str_format_helper static.Damien George2016-02-02
|
* py/objstr: For str.format, don't allocate on the heap for field name.Damien George2016-02-02
|
* py/objstr: For str.format, add nested/computed fields support.pohmelie2016-02-02
| | | | | | | Eg: '{:{}}'.format(123, '>20') @pohmelie was the original author of this patch, but @dpgeorge made significant changes to reduce code size and improve efficiency.
* py/vm: Fix popping of exception block in UNWIND_JUMP opcode.Damien George2016-02-01
| | | | Fixes issue #1812.
* py/mpprint: Fix sign extension when printf'ing %u, %x and %X.Damien George2016-02-01
|