1.1 --- a/TO_DO.txt Thu Jan 13 23:58:12 2011 +0100
1.2 +++ b/TO_DO.txt Sat Jan 29 21:07:27 2011 +0100
1.3 @@ -1,28 +1,29 @@
1.4 +Permit __class__ as being differently defined for classes and instances. Since __class__
1.5 +is always defined, no shadowing may occur for the attribute exposing it at different
1.6 +levels.
1.7 +
1.8 + The type class should be exposed as each class's __class__ attribute.
1.9 +
1.10 + The object-relative definition of __class__ should be stored in the object table.
1.11 +
1.12 + Note that object table information will not be able to reflect the class-type
1.13 + relationship, but isinstance will need to check for instances and classes, anyway.
1.14 +
1.15 +Tuple references to stack locations in a merged stack/heap memory model.
1.16 +
1.17 +Attribute Usage
1.18 +===============
1.19 +
1.20 Consider attribute assignment observations, along with the possibility of class attribute
1.21 assignment.
1.22
1.23 -Local assignment detection plus frame re-use. Example: slice.__init__ calls
1.24 -xrange.__init__ with the same arguments which are unchanged in xrange.__init__. There is
1.25 -therefore no need to build a new frame for this call.
1.26 -
1.27 Consider attribute usage observations being suspended inside blocks where AttributeError
1.28 may be caught (although this doesn't anticipate such exceptions being caught outside a
1.29 function altogether).
1.30
1.31 -Fix object table entries for attributes not provided by any known object, or provide an
1.32 -error, potentially overridden by options. For example, the augmented assignment methods
1.33 -are not supported by the built-in objects and thus the operator module functions cause
1.34 -the compilation to fail. Alternatively, just supply the methods since something has to do
1.35 -so in the builtins.
1.36 -
1.37 Consider type deduction and its consequences where types belong to the same hierarchy
1.38 and where a guard could be generated for the most general type.
1.39
1.40 -Consider attribute merging where many attributes are just aliases for the same underlying
1.41 -definition.
1.42 -
1.43 -Consider merging the InspectedModule.store tests with the scope conflict handling.
1.44 -
1.45 Consider permitting multiple class alternatives where the attributes are all identical.
1.46
1.47 Support class attribute positioning similar to instance attribute positioning, potentially
1.48 @@ -30,10 +31,52 @@
1.49 the class attribute could be exposed at a similar relative position to the class (and
1.50 potentially accessible using a LoadAttr-style instruction).
1.51
1.52 +**** Constant attribute users need not maintain usage since they are already resolved. ****
1.53 +
1.54 +Loop entry points should capture usage to update later assignments in the loop.
1.55 +The continue and break statements should affect usage propagation.
1.56 +
1.57 +Consider handling CallFunc in micropython.inspect in order to produce instances of specific classes.
1.58 +Then, consider adding support for guard removal/verification where known instances are involved.
1.59 +Consider handling branches of values within namespaces in order to support more precise value usage.
1.60 +
1.61 +Frame Optimisations
1.62 +===================
1.63 +
1.64 +Stack frame replacement where a local frame is unused after a call, such as in a tail call
1.65 +situation.
1.66 +
1.67 +Local assignment detection plus frame re-use. Example: slice.__init__ calls
1.68 +xrange.__init__ with the same arguments which are unchanged in xrange.__init__. There is
1.69 +therefore no need to build a new frame for this call.
1.70 +
1.71 +Function Specialisation
1.72 +=======================
1.73 +
1.74 +Specialisation of certain functions, such as isinstance(x, cls) where cls is a known
1.75 +constant.
1.76 +
1.77 +Structure and Object Table Optimisations
1.78 +========================================
1.79 +
1.80 +Fix object table entries for attributes not provided by any known object, or provide an
1.81 +error, potentially overridden by options. For example, the augmented assignment methods
1.82 +are not supported by the built-in objects and thus the operator module functions cause
1.83 +the compilation to fail. Alternatively, just supply the methods since something has to do
1.84 +so in the builtins.
1.85 +
1.86 +Consider attribute merging where many attributes are just aliases for the same underlying
1.87 +definition.
1.88 +
1.89 Consider references to defaults as occurring only within the context of a particular
1.90 function, thus eliminating default value classes if such functions are not themselves
1.91 invoked.
1.92
1.93 +Scope Handling
1.94 +==============
1.95 +
1.96 +Consider merging the InspectedModule.store tests with the scope conflict handling.
1.97 +
1.98 Consider labelling _scope on assignments and dealing with the assignment of removed
1.99 attributes, possibly removing the entire assignment, and distinguishing between such cases
1.100 and unknown names.
1.101 @@ -49,19 +92,16 @@
1.102 set # could be confused by the local definition at run-time
1.103 ----
1.104
1.105 +Object Coverage
1.106 +===============
1.107 +
1.108 Support __init__ traversal (and other implicit names) more effectively.
1.109
1.110 +Other
1.111 +=====
1.112 +
1.113 Check context_value initialisation (avoiding or handling None effectively).
1.114
1.115 __getitem__ could be written in Python, using a native method only to access fragments.
1.116
1.117 Consider better "macro" support where new expressions need to be generated and processed.
1.118 -
1.119 -**** Constant attribute users need not maintain usage since they are already resolved. ****
1.120 -
1.121 -Loop entry points should capture usage to update later assignments in the loop.
1.122 -The continue and break statements should affect usage propagation.
1.123 -
1.124 -Consider handling CallFunc in micropython.inspect in order to produce instances of specific classes.
1.125 -Then, consider adding support for guard removal/verification where known instances are involved.
1.126 -Consider handling branches of values within namespaces in order to support more precise value usage.