1.1 --- a/deducer.py Fri Mar 10 17:27:18 2017 +0100
1.2 +++ b/deducer.py Fri Mar 10 20:16:30 2017 +0100
1.3 @@ -2474,10 +2474,15 @@
1.4
1.5 if remaining > 1 or final_method in ("access", "access-invoke", "assign"):
1.6
1.7 + # Constrain instructions involving certain special
1.8 + # attribute names.
1.9 +
1.10 + to_search = attrname == "__data__" and "object" or "any"
1.11 +
1.12 if assigning:
1.13 - emit(("__check_and_store_via_any", accessor, attrname, "<assexpr>"))
1.14 + emit(("__check_and_store_via_%s" % to_search, accessor, attrname, "<assexpr>"))
1.15 else:
1.16 - accessor = ("__check_and_load_via_any", accessor, attrname)
1.17 + accessor = ("__check_and_load_via_%s" % to_search, accessor, attrname)
1.18
1.19 remaining -= 1
1.20
2.1 --- a/optimiser.py Fri Mar 10 17:27:18 2017 +0100
2.2 +++ b/optimiser.py Fri Mar 10 20:16:30 2017 +0100
2.3 @@ -435,8 +435,22 @@
2.4 attrnames = filter(lambda x: not x.startswith("$t"), attrnames)
2.5 self.all_attrs[(objkind, name)] = attrnames
2.6
2.7 - self.locations = get_allocated_locations(self.all_attrs,
2.8 - get_attributes_and_sizes, self.existing_locations)
2.9 + try:
2.10 + self.locations = get_allocated_locations(self.all_attrs,
2.11 + get_attributes_and_sizes, self.existing_locations)
2.12 +
2.13 + # Uphold positioning conflicts only if the existing locations were
2.14 + # explicitly specified.
2.15 +
2.16 + except OptimiseError:
2.17 + if self.locations_filename:
2.18 + raise
2.19 +
2.20 + # Otherwise, reposition attributes, causing the program to be
2.21 + # regenerated.
2.22 +
2.23 + self.locations = get_allocated_locations(self.all_attrs,
2.24 + get_attributes_and_sizes)
2.25
2.26 def populate_parameters(self):
2.27