summaryrefslogtreecommitdiffstatshomepage
path: root/py/objfun.c
Commit message (Collapse)AuthorAge
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* stackctrl: Add "mp_" prefix.Paul Sokolovsky2014-07-01
|
* py: Add portable framework to query/check C stack usage.Paul Sokolovsky2014-06-27
| | | | | | | | Such mechanism is important to get stable Python functioning, because Python function calling is handled with C stack. The idea is to sprinkle STACK_CHECK() calls in places where there can be C recursion. TODO: Add more STACK_CHECK()'s.
* objfun: Remove no longer used mp_obj_fun_prepare_simple_args().Paul Sokolovsky2014-06-11
|
* objfun: Factor out mp_setup_code_state() function to set up code_state object.Paul Sokolovsky2014-06-11
| | | | It needs to be reused for generator functions, too.
* Merge branch 'alloca' of github.com:marcusva/micropython into marcusva-allocaDamien George2014-06-08
|\
| * - FreeBSD provides alloca() via stdlib.h, in contrast to Linux and WindowsMarcus von Appen2014-06-07
| | | | | | | | - Move the includes for alloca() intp mpconfigport.h
* | py: Simplify function call of a bytecode object.Damien George2014-06-08
| |
* | py: Implement default keyword only args.Damien George2014-06-07
| | | | | | | | Should finish addressing issue #524.
* | py: Merge mp_execute_bytecode into fun_bc_call.Damien George2014-06-07
|/ | | | | | This reduces stack usage by 16 words (64 bytes) for stmhal/ port. See issue #640.
* Rename bultins config variables to MICROPY_PY_BUILTINS_*.Damien George2014-06-01
| | | | | | | | | | This renames: MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT See issue #35 for discussion.
* objfun: Typo fixes in comments.Paul Sokolovsky2014-05-31
|
* py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL.Damien George2014-05-21
| | | | See issue #608 for justification.
* py: More const usage.Paul Sokolovsky2014-05-17
|
* py, unix: Add copyright for modules I worked closely on.Paul Sokolovsky2014-05-13
|
* py: Tidy up returning NULL which should be MP_OBJ_NOT_SUPPORTED.Damien George2014-05-10
|
* py: Combine native emitters to 1 glue function; distinguish viper.Damien George2014-05-10
| | | | | | | | This patch simplifies the glue between native emitter and runtime, and handles viper code like inline assember: return values are converted to Python objects. Fixes issue #531.
* py: Rename byte_code to bytecode everywhere.Damien George2014-05-10
| | | | bytecode is the more widely used. See issue #590.
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* Merge pull request #552 from stinos/mingw-allocaPaul Sokolovsky2014-05-03
|\ | | | | py: Use <alloca.h> for alloca()
| * py: Use <alloca.h> for alloca()stijn2014-05-03
| | | | | | | | | | | | | | | | alloca() is declared in alloca.h which als happens to be included by stdlib.h. On mingw however it resides in malloc.h only. So if we include alloca.h directly, and add an alloca.h for mingw in it's port directory we can get rid of the mingw-specific define to include malloc.h and the other ports are happy as well.
* | objclosure, objcell: Print detailed representation if was requested.Paul Sokolovsky2014-05-03
|/ | | | | Well, it is bound to "detailed error reporting", but that's closest what we have now without creating new entities.
* py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky2014-05-02
| | | | Specifically, nlr.h does.
* objfun: More debug logging.Paul Sokolovsky2014-05-01
|
* objgenerator: Fix check for too few args passed to gen function.Paul Sokolovsky2014-05-01
|
* objgenerator: .print(): Output real underlying function name.Paul Sokolovsky2014-05-01
|
* py: Add tentative scheme for error messages configuration.Paul Sokolovsky2014-05-01
|
* objfun: Add function name accessor and .print slot method.Paul Sokolovsky2014-05-01
|
* objfun: Factor out function to report positional args mismatch.Paul Sokolovsky2014-04-30
|
* py: Implement keyword-only args.Damien George2014-04-27
| | | | | | | Implements 'def f(*, a)' and 'def f(*a, b)', but not default keyword-only args, eg 'def f(*, a=1)'. Partially addresses issue #524.
* py: Add win32-specific header for alloca().Paul Sokolovsky2014-04-20
|
* py: Add arg checking helper functions.Damien George2014-04-20
| | | | | | | These are to assist in writing native C functions that take positional and keyword arguments. mp_arg_check_num is for just checking the number of arguments is correct. mp_arg_parse_all is for parsing positional and keyword arguments with default values.
* py: Allow to pass buffer protocol flags to get_buffer helper funcs.Damien George2014-04-18
|
* py: Add typecode to buffer protocol.Damien George2014-04-18
| | | | | | | When querying an object that supports the buffer protocol, that object must now return a typecode (as per binary.[ch]). This does not have to be honoured by the caller, but can be useful for determining element size.
* py: Tidy up function argument error messages.Damien George2014-04-18
| | | | We are not as verbose as CPython, and maybe a bit too cryptic sometimes.
* py: Simplify objfun/objgenerator connection, no need to call bc_get.Damien George2014-04-17
|
* objfun: Add local header.Paul Sokolovsky2014-04-17
| | | | | | | | | This follows pattern already used for objtuple, etc.: objfun.h's content is not public - each and every piece of code should not have access to it. It's not private either - with out architecture and implementation language (C) it doesn't make sense to keep implementation of each object strictly private and maintain cumbersome accessors. It's "local" - intended to be used by a small set of "friend" (in C++ terms) objects.
* py: Fix mp_get_buffer, and use it in more places.Damien George2014-04-13
| | | | | Must use mp_obj_get_type to get the type of an object. Can't assume mp_obj_t is castable to mp_obj_base_t.
* py: Provide more details for too few and too much args for Python fun calls.Paul Sokolovsky2014-04-13
|
* py: Big improvements to inline assembler.Damien George2014-04-13
| | | | | | | | | Improved the Thumb assembler back end. Added many more Thumb instructions to the inline assembler. Improved parsing of assembler instructions and arguments. Assembler functions can now be passed the address of any object that supports the buffer protocol (to get the address of the buffer). Added an example of how to sum numbers from an array in assembler.
* py: Change compile order for default positional and keyword args.Damien George2014-04-11
| | | | | | | | | | | This simplifies the compiler a little, since now it can do 1 pass over a function declaration, to determine default arguments. I would have done this originally, but CPython 3.3 somehow had the default keyword args compiled before the default position args (even though they appear in the other order in the text of the script), and I thought it was important to have the same order of execution when evaluating default arguments. CPython 3.4 has changed the order to the more obvious one, so we can also change.
* objfun: Fix default arguments filling loop, was broken in presense of kwargs.Paul Sokolovsky2014-04-10
|
* objfun: More debug logging when calling a bytecode function.Paul Sokolovsky2014-04-10
|
* py: Make globals and locals proper dictionary objects.Damien George2014-04-05
| | | | | | | | | | | Finishes addressing issue #424. In the end this was a very neat refactor that now makes things a lot more consistent across the py code base. It allowed some simplifications in certain places, now that everything is a dict object. Also converted builtins tables to dictionaries. This will be useful when we need to turn builtins into a proper module.
* py: Change nlr_jump to nlr_raise, to aid in debugging.Damien George2014-04-05
| | | | | | This does not affect code size or performance when debugging turned off. To address issue #420.
* objfun: Add equality support.Paul Sokolovsky2014-04-05
|
* py: Disable dump_args function call entirely when not debugging.Damien George2014-03-31
| | | | | Yes, I know, a good compiler will optimise this away, but I feel this is neater.
* objgenerator: Handle default args to generator functions.Paul Sokolovsky2014-03-30
| | | | Addresses #397.
* Merge map.h into obj.h.Damien George2014-03-30
| | | | | | Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.