1. 03 Mar, 2017 3 commits
  2. 02 Mar, 2017 8 commits
  3. 28 Feb, 2017 1 commit
  4. 27 Feb, 2017 7 commits
  5. 25 Feb, 2017 1 commit
  6. 24 Feb, 2017 9 commits
    • Paul Sokolovsky's avatar
      extmod/modurandom: Use mp_raise_ValueError(). · 09828846
      Paul Sokolovsky authored
      For the standard unix x86_64 build, this saves 11 bytes on object file
      level, but no difference in executable size due to (bloaty) code alignment.
      09828846
    • Paul Sokolovsky's avatar
      py/runtime: mp_raise_msg(): Accept NULL argument for message. · 4b3da603
      Paul Sokolovsky authored
      In this case, raise an exception without a message.
      
      This would allow to shove few code bytes comparing to currently used
      mp_raise_msg(..., "") pattern. (Actual savings depend on function code
      alignment used by a particular platform.)
      4b3da603
    • Damien George's avatar
      6771adc7
    • Damien George's avatar
    • Paul Sokolovsky's avatar
      cc3200/moduos: Remove uos.sep, as it's strictly optional. · f5ee4d95
      Paul Sokolovsky authored
      In MicroPython, the path separator is guaranteed to be "/", extra unneeded
      things take precious code space (in the port which doesn't have basic things
      like floating-port support).
      f5ee4d95
    • Damien George's avatar
      py/parse: Simplify handling of errors by raising them directly. · f615d82d
      Damien George authored
      The parser was originally written to work without raising any exceptions
      and instead return an error value to the caller.  But it's now required
      that a call to the parser be wrapped in an nlr handler, so we may as well
      make use of that fact and simplify the parser so that it doesn't need to
      keep track of any memory errors that it had.  The parser anyway explicitly
      raises an exception at the end if there was an error.
      
      This patch simplifies the parser by letting the underlying memory
      allocation functions raise an exception if they fail to allocate any
      memory.  And if there is an error parsing the "<id> = const(<val>)" pattern
      then that also raises an exception right away instead of trying to recover
      gracefully and then raise.
      f615d82d
    • Damien George's avatar
      py: Create str/bytes objects in the parser, not the compiler. · 5255255f
      Damien George authored
      Previous to this patch any non-interned str/bytes objects would create a
      special parse node that held a copy of the str/bytes data.  Then in the
      compiler this data would be turned into a str/bytes object.  This actually
      lead to 2 copies of the data, one in the parse node and one in the object.
      The parse node's copy of the data would be freed at the end of the compile
      stage but nevertheless it meant that the peak memory usage of the
      parse/compile stage was higher than it needed to be (by an amount equal to
      the number of bytes in all the non-interned str/bytes objects).
      
      This patch changes the behaviour so that str/bytes objects are created
      directly in the parser and the object stored in a const-object parse node
      (which already exists for bignum, float and complex const objects).  This
      reduces peak RAM usage of the parse/compile stage, simplifies the parser
      and compiler, and reduces code size by about 170 bytes on Thumb2 archs,
      and by about 300 bytes on Xtensa archs.
      5255255f
    • Damien George's avatar
      f62503dc
    • Damien George's avatar
      py/parse: Allow parser/compiler consts to be bignums. · 74f4d2c6
      Damien George authored
      This patch allows uPy consts to be bignums, eg:
      
          X = const(1 << 100)
      
      The infrastructure for consts to be a bignum (rather than restricted to
      small integers) has been in place for a while, ever since constant folding
      was upgraded to allow bignums.  It just required a small change (in this
      patch) to enable it.
      74f4d2c6
  7. 22 Feb, 2017 9 commits
  8. 21 Feb, 2017 2 commits