Skip to content
Snippets Groups Projects
  1. Sep 19, 2016
    • Damien George's avatar
      py/vstr: Remove vstr.had_error flag and inline basic vstr functions. · 5da0d29d
      Damien George authored
      The vstr.had_error flag was a relic from the very early days which assumed
      that the malloc functions (eg m_new, m_renew) returned NULL if they failed
      to allocate.  But that's no longer the case: these functions will raise an
      exception if they fail.
      
      Since it was impossible for had_error to be set, this patch introduces no
      change in behaviour.
      
      An alternative option would be to change the malloc calls to the _maybe
      variants, which return NULL instead of raising, but then a lot of code
      will need to explicitly check if the vstr had an error and raise if it
      did.
      
      The code-size savings for this patch are, in bytes: bare-arm:188,
      minimal:456, unix(NDEBUG,x86-64):368, stmhal:228, esp8266:360.
      5da0d29d
    • Damien George's avatar
      py: Combine 3 comprehension opcodes (list/dict/set) into 1. · adaf0d86
      Damien George authored
      With the previous patch combining 3 emit functions into 1, it now makes
      sense to also combine the corresponding VM opcodes, which is what this
      patch does.  This eliminates 2 opcodes which simplifies the VM and reduces
      code size, in bytes: bare-arm:44, minimal:64, unix(NDEBUG,x86-64):272,
      stmhal:92, esp8266:200.  Profiling (with a simple script that creates many
      list/dict/set comprehensions) shows no measurable change in performance.
      adaf0d86
    • Damien George's avatar
      py: Combine 3 comprehension emit functions (list/dict/set) into 1. · a5624bf3
      Damien George authored
      The 3 kinds of comprehensions are similar enough that merging their emit
      functions reduces code size.  Decreases in code size in bytes are:
      bare-arm:24, minimal:96, unix(NDEBUG,x86-64):328, stmhal:80, esp8266:76.
      a5624bf3
  2. Sep 18, 2016
  3. Sep 17, 2016
  4. Sep 16, 2016
  5. Sep 15, 2016
  6. Sep 14, 2016
  7. Sep 12, 2016
  8. Sep 10, 2016
  9. Sep 09, 2016
  10. Sep 08, 2016
  11. Sep 07, 2016
  12. Sep 06, 2016
  13. Sep 05, 2016
Loading