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