micropython

docs/optimisations.txt

211:4db18d4b2a85
2009-05-09 Paul Boddie Removed erroneous remark about __init__ and __call__ defaults. Added a test of __init__ defaults. Improved and renamed the invocation with non-constant defaults test.
     1 Optimisation                    Prerequisites and Effect
     2 ------------                    ------------------------
     3 
     4 constant_storage                value instruction references a constant;
     5 (guidance)                      storage instruction references a constant;
     6                               | indicate whether both instructions satisfy the
     7                               | preconditions and should be removed (although
     8                               | this currently involves just a single merged
     9                               | instruction)
    10 
    11 constant_accessor               value instruction references a constant;
    12 (guidance)                    | target name provided (for use in producing an
    13                               | address access instruction)
    14 
    15 known_target                    value instruction references a constant;
    16 (guidance)                    | target and context are provided (no instructions
    17                               | are removed)
    18 
    19 self_access                     value instruction references "self" in a method;
    20 (guidance)                      specified attribute name always has the same
    21                                 position;
    22                               | indicate whether an appropriate instruction can
    23                               | be generated for the access
    24 
    25 temp_storage                    value instruction is a simple input operation;
    26 (elimination)                   value instruction is the last instruction;
    27 (guidance)                    | remove the value instruction, provide the value
    28                               | instruction in place of a temporary storage
    29                               | reference
    30 
    31 load_operations                 value instruction is a simple input operation;
    32 (merge)                         value instruction is the last instruction;
    33                                 current instruction uses simple input;
    34                               | remove the value instruction, make the value
    35                               | instruction the input to the current instruction
    36 
    37 no_operations                   input to the current instruction loads from the
    38 (guidance)                      destination of the current instruction;
    39                               | indicate that the current instruction should be
    40                               | omitted
    41 
    42 unused_results                  value instruction is a simple input operation;
    43 (elimination)                   value instruction is the final instruction of a
    44                                 discarded expression;
    45                               | remove the value instruction