1. 21 Mar, 2015 1 commit
    • Damien George's avatar
      py: Combine duplicated code that converts members from a lookup. · 55b74d1f
      Damien George authored
      Despite initial guess, this code factoring does not hamper performance.
      In fact it seems to improve speed by a little: running pystone(1.2) on
      pyboard (which gives a very stable result) this patch takes pystones
      from 1729.51 up to 1742.16.  Also, pystones on x64 increase by around
      the same proportion (but it's much noisier).
      Taking a look at the generated machine code, stack usage with this patch
      is unchanged, and call is tail-optimised with all arguments in
      registers.  Code size decreases by about 50 bytes on Thumb2 archs.
  2. 07 Feb, 2015 1 commit
  3. 27 Jan, 2015 1 commit
    • Damien George's avatar
      py: Specify unary/binary op name in TypeError error message. · a5efcd47
      Damien George authored
      Eg, "() + 1" now tells you that __add__ is not supported for tuple and
      int types (before it just said the generic "binary operator").  We reuse
      the table of names for slot lookup because it would be a waste of code
      space to store the pretty name for each operator.
  4. 21 Jan, 2015 1 commit
  5. 20 Jan, 2015 1 commit
  6. 07 Jan, 2015 1 commit
  7. 01 Jan, 2015 2 commits
  8. 29 Dec, 2014 1 commit
  9. 06 Nov, 2014 1 commit
  10. 25 Oct, 2014 1 commit
    • Damien George's avatar
      py: Add mp_pending_exception global variable, for VM soft interrupt. · 124df6f8
      Damien George authored
      This allows to implement KeyboardInterrupt on unix, and a much safer
      ctrl-C in stmhal port.  First ctrl-C is a soft one, with hope that VM
      will notice it; second ctrl-C is a hard one that kills anything (for
      both unix and stmhal).
      One needs to check for a pending exception in the VM only for jump
      opcodes.  Others can't produce an infinite loop (infinite recursion is
      caught by stack check).
  11. 30 Aug, 2014 1 commit
  12. 24 Aug, 2014 1 commit
  13. 16 Aug, 2014 1 commit
  14. 15 Aug, 2014 1 commit
  15. 03 Jul, 2014 1 commit
  16. 07 Jun, 2014 1 commit
  17. 03 Jun, 2014 1 commit
  18. 28 May, 2014 1 commit
  19. 12 May, 2014 1 commit
    • Damien George's avatar
      py: Add support for __debug__ constant. · 97f9a281
      Damien George authored
      __debug__ now resolves to True or False.  Its value needs to be set by
      TODO: call mp_set_debug in unix/ port.
      TODO: optimise away "if False:" statements in compiler.
  20. 06 May, 2014 2 commits
  21. 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/.
  22. 26 Apr, 2014 1 commit
  23. 19 Apr, 2014 1 commit
    • Damien George's avatar
      py: Add arg checking helper functions. · a3f94e00
      Damien George authored
      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.
  24. 17 Apr, 2014 2 commits
  25. 13 Apr, 2014 2 commits
    • Damien George's avatar
      py: Remove unique_codes from emitglue.c. Replace with pointers. · df8127a1
      Damien George authored
      Attempt to address issue #386.  unique_code_id's have been removed and
      replaced with a pointer to the "raw code" information.  This pointer is
      stored in the actual byte code (aligned, so the GC can trace it), so
      that raw code (ie byte code, native code and inline assembler) is kept
      only for as long as it is needed.  In memory it's now like a tree: the
      outer module's byte code points directly to its children's raw code.  So
      when the outer code gets freed, if there are no remaining functions that
      need the raw code, then the children's code gets freed as well.
      This is pretty much like CPython does it, except that CPython stores
      indexes in the byte code rather than machine pointers.  These indices
      index the per-function constant table in order to find the relevant
    • Paul Sokolovsky's avatar
  26. 08 Apr, 2014 3 commits
  27. 06 Apr, 2014 1 commit
  28. 05 Apr, 2014 4 commits
  29. 31 Mar, 2014 3 commits