Damien George
7e5fb24e3b
py: Reduce code size of compiler by a bit.
11 years ago
Damien George
e24b563796
py: Fix emitcpy so continue is compatible with CPython.
11 years ago
Damien George
cbddb279bb
py: Implement break/continue from an exception with finally.
Still todo: break/continue from within the finally block itself.
11 years ago
Damien George
a908202d60
unix: libffi include path now found using pkg-config.
Hopefully this works for other people as well :)
11 years ago
Damien George
6fcaea6ca8
Merge pull request #254 from pfalcon/config-modules
Add mpconfigport.mk file to configure which modules to include into build
11 years ago
Damien George
fb083ea986
py: mp_execute_byte_code has 2 arg arrays, for more efficient default params.
11 years ago
Paul Sokolovsky
ed1239fce6
Add mpconfigport.mk file to configure which modules to include into build.
Proof of concept, controls "ffi" module as one which requires external
dependencies.
11 years ago
Damien George
87413a4d0c
Merge branch 'fun-defargs' of github.com:pfalcon/micropython into pfalcon-fun-defargs
11 years ago
Damien George
382b3d00ed
Merge pull request #251 from pfalcon/return_unwind
Add exception stack unwind support for RETURN_VALUE.
11 years ago
Damien George
d71cd86dc1
Merge branch 'iabdalkader-master'
Conflicts:
stm/usb.c
stm/usb.h
11 years ago
Damien George
01156d510c
stm: Add support for ctrl-C to interrupt running Python.
Using PendSV interrupt at lowest priority, code can now raise an
exception during an interrupt by calling pendsv_nlr_jump. The exception
will be raised when all interrupts are finished. This is used to trap
ctrl-C from the USB VCP to break out of running Python code.
11 years ago
mux
565fdccfd2
Add usb_vcp_connected prototype to usb.h
11 years ago
Paul Sokolovsky
90750029df
Implement default function arguments (for Python functions).
TODO: Decide if we really need separate bytecode for creating functions
with default arguments - we would need same for closures, then there're
keywords arguments too. Having all combinations is a small exponential
explosion, likely we need just 2 cases - simplest (no defaults, no kw),
and full - defaults & kw.
11 years ago
Paul Sokolovsky
6472dea146
Add exception stack unwind support for RETURN_VALUE.
This properly implements return from try/finally block(s).
TODO: Consider if we need to do any value stack unwinding for RETURN_VALUE
case. Intuitively, this is "success" return, so value stack should be in
good shape, and unwinding shouldn't be required.
11 years ago
mux
b2269b610e
Detect VCP line state.
* Detect VCP line state, based on SET_CONTROL_LINE_STATE request
11 years ago
Damien George
532f2c30f6
Merge pull request #246 from pfalcon/exc_stack_entry
vm: Introduce structure for exception stack entry, record entry type.
11 years ago
Damien George
8b56beb1a1
py: Simplified rt_call_function_n_kw.
11 years ago
Damien George
f3b05449cc
Merge branch 'fix_str_call' of github.com:msiemens/micropython into msiemens-fix_str_call
11 years ago
Damien George
94f68300f9
py: Make str.replace do 2 passes over the string.
11 years ago
Damien George
1aa1c511dd
Merge branch 'master' of github.com:xbe/micropython into xbe-master
11 years ago
Markus Siemens
2c2a124e16
Fix SIGSEV when running "a"()
rt_call_function_n_kw did check for integers but not for strings
being called. Added a check so running "a"() won't SIGSEV but
throw an exception.
11 years ago
Paul Sokolovsky
c9887cbbe2
Add basic try-finally testcase.
It's mildly suprising these work without further changes to exception
handling code (the only change required was to handle SETUP_FINALLY).
11 years ago
Paul Sokolovsky
8519342c1a
Update VM stacks comments.
11 years ago
Paul Sokolovsky
c7a0b14df9
vm: Introduce structure for exception stack entry, record entry type.
Also, handle SETUP_FINALLY opcode.
11 years ago
Paul Sokolovsky
7ee8e46878
Dump 4 more bytecodes (loop and finally ones).
11 years ago
Paul Sokolovsky
027594e1a7
Typo fixes in comments.
11 years ago
Paul Sokolovsky
c92a56dc93
Add testcase with exception handler spread across functions.
11 years ago
xbe
480c15afb5
Implement str.replace and add tests for it.
11 years ago
xbe
65365778fd
Add tests for str.strip
11 years ago
Damien George
3f759b71c6
py: Add MICROPY_ENABLE_FLOAT around a float specific piece of code.
11 years ago
Damien George
28f93fbb48
Merge pull request #239 from pfalcon/end_finally
vm: Add basic implementation of END_FINALLY opcode.
11 years ago
Damien George
65ae601665
Merge pull request #240 from msiemens/windows_fix
windows: Make windows/main.c independent from unix/main.c
11 years ago
Damien George
39631bc312
Fix Makefiles: -O3 option was not being applied; mkdir for STM.
11 years ago
Markus Siemens
7e0dee0cbf
windows: Make windows/main.c independent from unix/main.c
Up to know changes unix/main.c were able to break the windows
build because windows/main.c simply included unix/main.c.
Now windows/main.c stands on it's own and won't break if
unix/main.c changes.
11 years ago
Paul Sokolovsky
382e8eeea2
vm: Add basic implementation of END_FINALLY opcode.
Allows to have nested try blocks with except filters.
TODO: Don't add END_FINALLY's exception re-raise points to traceback.
11 years ago
Damien George
09a0c64bce
py: Improve __bool__ and __len__ dispatch; add slots for them.
11 years ago
Damien George
b25711ea8f
Merge pull request #238 from pfalcon/bool_len
Implement __bool__ and __len__ via unary_op virtual method for all types.
11 years ago
Paul Sokolovsky
c1d9bbc345
Implement __bool__ and __len__ via unary_op virtual method for all types.
__bool__() and __len__() are just the same as __neg__() or __invert__(),
and require efficient dispatching implementation (not requiring search/lookup).
type->unary_op() is just the right choice for this short of adding
standalone virtual method(s) to already big mp_obj_type_t structure.
11 years ago
Paul Sokolovsky
cdd2c62e07
realloc(): Log original memory ptr too.
To alloc complete memory alloc flow tracing.
11 years ago
Damien George
4a74d31e70
run-tests can handle segfault.
11 years ago
Damien George
14b929f1d9
Merge branch 'master' of github.com:msiemens/micropython into msiemens-master
11 years ago
Damien George
62ad189a65
py: Add compile option to enable/disable source line numbers.
11 years ago
Damien George
2d15c1216d
stm: Add optional memory debugging output.
11 years ago
Damien George
d0691ccaec
py: Simplify fastn in VM; reduce size of unique code struct.
We still have FAST_[0,1,2] byte codes, but they now just access the
fastn array (before they had special local variables). It's now
simpler, a bit faster, and uses a bit less stack space (on STM at least,
which is most important).
The only reason now to keep FAST_[0,1,2] byte codes is for compressed
byte code size.
11 years ago
Damien George
01fa4a9164
stm: Fix gccollect ram range.
11 years ago
Damien George
0347fbd2d5
Merge branch 'master' of github.com:iabdalkader/micropython
11 years ago
Damien George
08d075592f
py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.
LOAD_METHOD bug was: emitbc did not correctly calculate the amount of
stack usage for a LOAD_METHOD operation.
small int bug was: int was being used to pass small ints, when it should
have been machine_int_t.
11 years ago
Damien George
1ba1facaaa
py: Msg in exception is no longer interned.
11 years ago
Damien George
4d5b28cd08
Add qstr_info() function and bindings for unix port.
11 years ago
mux
bfb01e9da6
Fix unused function warning in main
* Add SD card test to fix warning
11 years ago