Skip to content
Snippets Groups Projects
  1. Dec 06, 2018
    • Damien George's avatar
      py/objboundmeth: Support loading generic attrs from the method. · 113f00a9
      Damien George authored
      Instead of assuming that the method is a bytecode object, and only
      supporting load of __name__, make the operation generic by delegating the
      load to the method object itself.  Saves a bit of code size and fixes the
      case of attempting to load __name__ on a native method, see issue #4028.
      113f00a9
  2. Dec 11, 2017
  3. Jul 31, 2017
  4. Nov 21, 2016
  5. Mar 08, 2016
    • Damien George's avatar
      py/objboundmeth: Allocate arg state on stack if heap alloc fails. · dcdf8f2d
      Damien George authored
      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.
      dcdf8f2d
  6. Jan 11, 2016
  7. Nov 29, 2015
    • Damien George's avatar
      py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR. · 999cedb9
      Damien George authored
      This allows the mp_obj_t type to be configured to something other than a
      pointer-sized primitive type.
      
      This patch also includes additional changes to allow the code to compile
      when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of
      mp_uint_t, and various casts.
      999cedb9
  8. Apr 16, 2015
    • Damien George's avatar
      py: Overhaul and simplify printf/pfenv mechanism. · 7f9d1d6a
      Damien George authored
      Previous to this patch the printing mechanism was a bit of a tangled
      mess.  This patch attempts to consolidate printing into one interface.
      
      All (non-debug) printing now uses the mp_print* family of functions,
      mainly mp_printf.  All these functions take an mp_print_t structure as
      their first argument, and this structure defines the printing backend
      through the "print_strn" function of said structure.
      
      Printing from the uPy core can reach the platform-defined print code via
      two paths: either through mp_sys_stdout_obj (defined pert port) in
      conjunction with mp_stream_write; or through the mp_plat_print structure
      which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
      on the platform.  The former is only used when MICROPY_PY_IO is defined.
      
      With this new scheme printing is generally more efficient (less layers
      to go through, less arguments to pass), and, given an mp_print_t*
      structure, one can call mp_print_str for efficiency instead of
      mp_printf("%s", ...).  Code size is also reduced by around 200 bytes on
      Thumb2 archs.
      7f9d1d6a
  9. Apr 11, 2015
  10. Apr 09, 2015
  11. Apr 04, 2015
  12. Mar 20, 2015
  13. Jan 20, 2015
  14. Jan 01, 2015
  15. Dec 10, 2014
  16. Oct 03, 2014
  17. Aug 29, 2014
  18. May 10, 2014
  19. May 03, 2014
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      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/.
      04b9147e
  20. May 02, 2014
  21. Mar 30, 2014
    • Damien George's avatar
      Rename rt_* to mp_*. · d17926db
      Damien George authored
      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.
      d17926db
  22. Mar 17, 2014
    • xbe's avatar
      py: Clean up includes. · efe34223
      xbe authored
      Remove unnecessary includes. Add includes that improve portability.
      efe34223
  23. Feb 15, 2014
    • Damien George's avatar
      Implement proper exception type hierarchy. · c5966128
      Damien George authored
      Each built-in exception is now a type, with base type BaseException.
      C exceptions are created by passing a pointer to the exception type to
      make an instance of.  When raising an exception from the VM, an
      instance is created automatically if an exception type is raised (as
      opposed to an exception instance).
      
      Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper.
      
      Handling of parse error changed to match new exceptions.
      
      mp_const_type renamed to mp_type_type for consistency.
      c5966128
    • Damien George's avatar
      Change mp_obj_type_t.name from const char * to qstr. · a71c83a1
      Damien George authored
      Ultimately all static strings should be qstr.  This entry in the type
      structure is only used for printing error messages (to tell the type of
      the bad argument), and printing objects that don't supply a .print method.
      a71c83a1
  24. Jan 21, 2014
  25. Jan 18, 2014
    • Damien George's avatar
      Make VM stack grow upwards, and so no reversed args arrays. · 20006dbb
      Damien George authored
      Change state layout in VM so the stack starts at state[0] and grows
      upwards.  Locals are at the top end of the state and number downwards.
      This cleans up a lot of the interface connecting the VM to C: now all
      functions that take an array of Micro Python objects are in order (ie no
      longer in reverse).
      
      Also clean up C API with keyword arguments (call_n and call_n_kw
      replaced with single call method that takes keyword arguments).  And now
      make_new takes keyword arguments.
      
      emitnative.c has not yet been changed to comply with the new order of
      stack layout.
      20006dbb
  26. Jan 07, 2014
  27. Jan 06, 2014
  28. Jan 05, 2014
  29. Jan 04, 2014
  30. Dec 21, 2013
    • Damien's avatar
      Change object representation from 1 big union to individual structs. · d99b0528
      Damien authored
      A big change.  Micro Python objects are allocated as individual structs
      with the first element being a pointer to the type information (which
      is itself an object).  This scheme follows CPython.  Much more flexible,
      not necessarily slower, uses same heap memory, and can allocate objects
      statically.
      
      Also change name prefix, from py_ to mp_ (mp for Micro Python).
      d99b0528
Loading