1.1 --- a/docs/assignment.txt Thu Mar 05 00:45:42 2009 +0100
1.2 +++ b/docs/assignment.txt Thu Mar 19 23:05:55 2009 +0100
1.3 @@ -42,18 +42,16 @@
1.4
1.5 Access types:
1.6
1.7 - Access to stored value from... Effect on context Optimised instruction Unoptimised instruction
1.8 - ------------------------------ ----------------- --------------------- -----------------------
1.9 + Access to stored value from... Effect on context Optimised instruction Unoptimised instruction
1.10 + ------------------------------ ----------------- --------------------- -----------------------
1.11 local preserved LoadName
1.12 - global (module) preserved LoadAddress LoadAttrIndex
1.13 - class preserved LoadAddress LoadAttrIndex
1.14 - class via instance overridden LoadAddressContext (*) LoadAttrIndex (*)
1.15 - instance preserved LoadAttr LoadAttrIndex
1.16 + global (module) preserved LoadAddress LoadAttrIndex
1.17 + class preserved LoadAddress LoadAttrIndex
1.18 + class via instance overridden LoadAddressContext(Cond) LoadAttrIndexContext(Cond)
1.19 + instance preserved LoadAttr LoadAttrIndex
1.20
1.21 Access to a namespace may not preserve the stored context
1.22
1.23 - (*) Other modes of these instructions may exist for certain optimisations
1.24 -
1.25 Access to class attributes via instances:
1.26
1.27 Access to stored value with... Effect on context
1.28 @@ -63,21 +61,18 @@
1.29 null context preserved
1.30 other context (instance) preserved
1.31
1.32 - LoadAddressContext and LoadAttrIndex must therefore check whether the
1.33 - context must be overridden
1.34 -
1.35 -Optimisation possibilities:
1.36 +Optimisation possibilities for class attribute access via instances:
1.37
1.38 Class Class attribute Context of attribute Instruction
1.39 ----- --------------- -------------------- -----------
1.40 known constant preserved LoadAddress
1.41 known constant overridden LoadAddressContext
1.42 - known not constant preserved LoadAddress (attribute may always be preserved)
1.43 - known not constant overridden LoadAddressContext (attribute may always be overridden)
1.44 - known not constant not known LoadAddressContextCond
1.45 - not known not known preserved LoadAttrIndex (attribute may have preserved context in all classes)
1.46 - not known not known overridden LoadAttrIndexContext (attribute may have overridden context in all classes)
1.47 - not known not known not known LoadAttrIndexContextCond
1.48 + known not constant preserved LoadAddress (attribute may always be preserved)
1.49 + known not constant overridden LoadAddressContext (attribute may always be overridden)
1.50 + known not constant not known LoadAddressContextCond (perform context check)
1.51 + not known not known preserved LoadAttrIndex (attribute may have preserved context in all classes)
1.52 + not known not known overridden LoadAttrIndexContext (attribute may have overridden context in all classes)
1.53 + not known not known not known LoadAttrIndexContextCond (perform context check for class attribute access)
1.54
1.55 Since the object table encodes sufficient information (an instance must be
1.56 compatible to access the class attribute, and compatibility information is