Skip to content
Snippets Groups Projects
  1. Mar 14, 2019
  2. Sep 20, 2018
  3. Jul 31, 2017
  4. Feb 24, 2017
    • 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
  5. Feb 16, 2017
    • Damien George's avatar
      py/grammar: Group no-compile grammar rules together to shrink tables. · 71019ae4
      Damien George authored
      Grammar rules have 2 variants: ones that are attached to a specific
      compile function which is called to compile that grammar node, and ones
      that don't have a compile function and are instead just inspected to see
      what form they take.
      
      In the compiler there is a table of all grammar rules, with each entry
      having a pointer to the associated compile function.  Those rules with no
      compile function have a null pointer.  There are 120 such rules, so that's
      120 words of essentially wasted code space.
      
      By grouping together the compile vs no-compile rules we can put all the
      no-compile rules at the end of the list of rules, and then we don't need
      to store the null pointers.  We just have a truncated table and it's
      guaranteed that when indexing this table we only index the first half,
      the half with populated pointers.
      
      This patch implements such a grouping by having a specific macro for the
      compile vs no-compile grammar rules (DEF_RULE vs DEF_RULE_NC).  It saves
      around 460 bytes of code on 32-bit archs.
      71019ae4
  6. Dec 09, 2016
  7. Nov 27, 2016
  8. Feb 23, 2016
  9. Jan 27, 2016
  10. Jan 07, 2016
  11. Dec 10, 2015
  12. Nov 29, 2015
  13. Nov 13, 2015
  14. Nov 09, 2015
  15. Oct 31, 2015
  16. Oct 19, 2015
  17. Oct 16, 2015
  18. Apr 19, 2015
  19. Apr 16, 2015
  20. Apr 11, 2015
  21. Apr 07, 2015
    • Damien George's avatar
      py: Implement full func arg passing for native emitter. · 9988618e
      Damien George authored
      This patch gets full function argument passing working with native
      emitter.  Includes named args, keyword args, default args, var args
      and var keyword args.  Fully Python compliant.
      
      It reuses the bytecode mp_setup_code_state function to do all the hard
      work.  This function is slightly adjusted to accommodate native calls,
      and the native emitter is forced a bit to emit similar prelude and
      code-info as bytecode.
      9988618e
  22. Mar 03, 2015
  23. Mar 02, 2015
  24. Feb 25, 2015
  25. Feb 24, 2015
  26. Feb 16, 2015
  27. Feb 13, 2015
  28. Feb 12, 2015
Loading