paul@394 | 1 | Permit __class__ as being differently defined for classes and instances. Since __class__
|
paul@394 | 2 | is always defined, no shadowing may occur for the attribute exposing it at different
|
paul@394 | 3 | levels.
|
paul@394 | 4 |
|
paul@394 | 5 | The type class should be exposed as each class's __class__ attribute.
|
paul@394 | 6 |
|
paul@394 | 7 | The object-relative definition of __class__ should be stored in the object table.
|
paul@394 | 8 |
|
paul@394 | 9 | Note that object table information will not be able to reflect the class-type
|
paul@394 | 10 | relationship, but isinstance will need to check for instances and classes, anyway.
|
paul@394 | 11 |
|
paul@394 | 12 | Tuple references to stack locations in a merged stack/heap memory model.
|
paul@394 | 13 |
|
paul@394 | 14 | Attribute Usage
|
paul@394 | 15 | ===============
|
paul@394 | 16 |
|
paul@390 | 17 | Consider attribute assignment observations, along with the possibility of class attribute
|
paul@390 | 18 | assignment.
|
paul@372 | 19 |
|
paul@372 | 20 | Consider attribute usage observations being suspended inside blocks where AttributeError
|
paul@372 | 21 | may be caught (although this doesn't anticipate such exceptions being caught outside a
|
paul@372 | 22 | function altogether).
|
paul@372 | 23 |
|
paul@364 | 24 | Consider type deduction and its consequences where types belong to the same hierarchy
|
paul@364 | 25 | and where a guard could be generated for the most general type.
|
paul@364 | 26 |
|
paul@364 | 27 | Consider permitting multiple class alternatives where the attributes are all identical.
|
paul@364 | 28 |
|
paul@360 | 29 | Support class attribute positioning similar to instance attribute positioning, potentially
|
paul@360 | 30 | (for both) based on usage observations. For example, if __iter__ is used on two classes,
|
paul@360 | 31 | the class attribute could be exposed at a similar relative position to the class (and
|
paul@360 | 32 | potentially accessible using a LoadAttr-style instruction).
|
paul@360 | 33 |
|
paul@394 | 34 | **** Constant attribute users need not maintain usage since they are already resolved. ****
|
paul@394 | 35 |
|
paul@394 | 36 | Loop entry points should capture usage to update later assignments in the loop.
|
paul@394 | 37 | The continue and break statements should affect usage propagation.
|
paul@394 | 38 |
|
paul@394 | 39 | Consider handling CallFunc in micropython.inspect in order to produce instances of specific classes.
|
paul@394 | 40 | Then, consider adding support for guard removal/verification where known instances are involved.
|
paul@394 | 41 | Consider handling branches of values within namespaces in order to support more precise value usage.
|
paul@394 | 42 |
|
paul@394 | 43 | Frame Optimisations
|
paul@394 | 44 | ===================
|
paul@394 | 45 |
|
paul@394 | 46 | Stack frame replacement where a local frame is unused after a call, such as in a tail call
|
paul@394 | 47 | situation.
|
paul@394 | 48 |
|
paul@394 | 49 | Local assignment detection plus frame re-use. Example: slice.__init__ calls
|
paul@394 | 50 | xrange.__init__ with the same arguments which are unchanged in xrange.__init__. There is
|
paul@394 | 51 | therefore no need to build a new frame for this call.
|
paul@394 | 52 |
|
paul@394 | 53 | Function Specialisation
|
paul@394 | 54 | =======================
|
paul@394 | 55 |
|
paul@394 | 56 | Specialisation of certain functions, such as isinstance(x, cls) where cls is a known
|
paul@394 | 57 | constant.
|
paul@394 | 58 |
|
paul@394 | 59 | Structure and Object Table Optimisations
|
paul@394 | 60 | ========================================
|
paul@394 | 61 |
|
paul@394 | 62 | Fix object table entries for attributes not provided by any known object, or provide an
|
paul@394 | 63 | error, potentially overridden by options. For example, the augmented assignment methods
|
paul@394 | 64 | are not supported by the built-in objects and thus the operator module functions cause
|
paul@394 | 65 | the compilation to fail. Alternatively, just supply the methods since something has to do
|
paul@394 | 66 | so in the builtins.
|
paul@394 | 67 |
|
paul@394 | 68 | Consider attribute merging where many attributes are just aliases for the same underlying
|
paul@394 | 69 | definition.
|
paul@394 | 70 |
|
paul@349 | 71 | Consider references to defaults as occurring only within the context of a particular
|
paul@349 | 72 | function, thus eliminating default value classes if such functions are not themselves
|
paul@349 | 73 | invoked.
|
paul@349 | 74 |
|
paul@394 | 75 | Scope Handling
|
paul@394 | 76 | ==============
|
paul@394 | 77 |
|
paul@394 | 78 | Consider merging the InspectedModule.store tests with the scope conflict handling.
|
paul@394 | 79 |
|
paul@343 | 80 | Consider labelling _scope on assignments and dealing with the assignment of removed
|
paul@343 | 81 | attributes, possibly removing the entire assignment, and distinguishing between such cases
|
paul@343 | 82 | and unknown names.
|
paul@343 | 83 |
|
paul@342 | 84 | Check name origin where multiple branches could yield multiple scope interpretations:
|
paul@342 | 85 |
|
paul@342 | 86 | ----
|
paul@342 | 87 | try:
|
paul@342 | 88 | set # built-in name
|
paul@342 | 89 | except NameError:
|
paul@342 | 90 | from sets import Set as set # local definition of name
|
paul@342 | 91 |
|
paul@342 | 92 | set # could be confused by the local definition at run-time
|
paul@342 | 93 | ----
|
paul@342 | 94 |
|
paul@394 | 95 | Object Coverage
|
paul@394 | 96 | ===============
|
paul@394 | 97 |
|
paul@332 | 98 | Support __init__ traversal (and other implicit names) more effectively.
|
paul@332 | 99 |
|
paul@394 | 100 | Other
|
paul@394 | 101 | =====
|
paul@394 | 102 |
|
paul@332 | 103 | Check context_value initialisation (avoiding or handling None effectively).
|
paul@332 | 104 |
|
paul@342 | 105 | __getitem__ could be written in Python, using a native method only to access fragments.
|
paul@349 | 106 |
|
paul@342 | 107 | Consider better "macro" support where new expressions need to be generated and processed.
|