1. 25 May, 2014 1 commit
    • Damien George's avatar
      py: Don't automatically intern strings in parser. · 5042bce8
      Damien George authored
      This completes non-automatic interning of strings in the parser, so that
      doc strings don't take up RAM.  It complicates the parser and compiler,
      and bloats stmhal by about 300 bytes.  It's complicated because now
      there are 2 kinds of parse-nodes that can be strings: interned leaves
      and non-interned structs.
      5042bce8
  2. 21 May, 2014 1 commit
    • Damien George's avatar
      Tidy up some configuration options. · 58ebde46
      Damien George authored
      MP_ALLOC_* -> MICROPY_ALLOC_*
      MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX
      MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL
      MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX
      MICROPY_EXTRA_* -> MICROPY_PORT_*
      
      See issue #35.
      58ebde46
  3. 10 May, 2014 1 commit
    • Damien George's avatar
      py: Improve handling of memory error in parser. · 1b82e9af
      Damien George authored
      Parser shouldn't raise exceptions, so needs to check when memory
      allocation fails.  This patch does that for the initial set up of the
      parser state.
      
      Also, we now put the parser object on the stack.  It's small enough to
      go there instead of on the heap.
      
      This partially addresses issue #558.
      1b82e9af
  4. 08 May, 2014 1 commit
  5. 06 May, 2014 1 commit
  6. 05 May, 2014 1 commit
    • Damien George's avatar
      py: Turn down amount of RAM parser and compiler use. · 66e18f04
      Damien George authored
      There are 2 locations in parser, and 1 in compiler, where memory
      allocation is not precise.  In the parser it's the rule stack and result
      stack, in the compiler it's the array for the identifiers in the current
      scope.  All other mallocs are exact (ie they don't allocate more than is
      needed).
      
      This patch adds tuning options (MP_ALLOC_*) to mpconfig.h for these 3
      inexact allocations.
      
      The inexact allocations in the parser should actually be close to
      logarithmic: you need an exponentially larger script (absent pathological
      cases) to use up more room on the rule and result stacks.  As such, the
      default allocation policy for these is now to start with a modest sized
      stack, but grow only in small increments.
      
      For the identifier arrays in the compiler, these now start out quite
      small (4 entries, since most functions don't have that many ids), and
      grow incrementally by 6 (since if you have more ids than 4, you probably
      have quite a few more, but it wouldn't be exponentially more).
      
      Partially addresses issue #560.
      66e18f04
  7. 03 May, 2014 1 commit
    • 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
  8. 10 Apr, 2014 1 commit
  9. 17 Mar, 2014 1 commit
    • xbe's avatar
      py: Clean up includes. · efe34223
      xbe authored
      Remove unnecessary includes. Add includes that improve portability.
      efe34223
  10. 01 Mar, 2014 1 commit
    • Damien George's avatar
      py: Implement bit-shift and not operations for mpz. · 06201ff3
      Damien George authored
      Implement not, shl and shr in mpz library.  Add function to create mpzs
      on the stack, used for memory efficiency when rhs is a small int.
      Factor out code to parse base-prefix of number into a dedicated function.
      06201ff3
  11. 22 Feb, 2014 1 commit
  12. 21 Feb, 2014 1 commit
  13. 15 Feb, 2014 1 commit
    • 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
  14. 12 Feb, 2014 1 commit
  15. 29 Jan, 2014 1 commit
  16. 25 Jan, 2014 2 commits
  17. 23 Jan, 2014 1 commit
  18. 21 Jan, 2014 1 commit
  19. 19 Jan, 2014 1 commit
  20. 18 Jan, 2014 1 commit
  21. 15 Jan, 2014 2 commits
  22. 12 Jan, 2014 2 commits
  23. 06 Jan, 2014 2 commits
  24. 30 Dec, 2013 1 commit
  25. 29 Dec, 2013 2 commits
  26. 21 Dec, 2013 1 commit
    • 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
  27. 02 Nov, 2013 1 commit
  28. 19 Oct, 2013 1 commit
  29. 18 Oct, 2013 1 commit
  30. 12 Oct, 2013 2 commits
  31. 09 Oct, 2013 1 commit
  32. 05 Oct, 2013 3 commits