# HG changeset patch # User Paul Boddie # Date 1489173390 -3600 # Node ID c7c355fcf9fba22d0327511b573f76f83d495bf9 # Parent e89a0ec1549469e948883cf29355dd46ffdc1ad6# Parent 734bddc017dbd357458ce2b9cfc4ccd46e9359d8 Merged changes from the default branch. diff -r e89a0ec15494 -r c7c355fcf9fb deducer.py --- a/deducer.py Fri Mar 10 17:27:18 2017 +0100 +++ b/deducer.py Fri Mar 10 20:16:30 2017 +0100 @@ -2474,10 +2474,15 @@ if remaining > 1 or final_method in ("access", "access-invoke", "assign"): + # Constrain instructions involving certain special + # attribute names. + + to_search = attrname == "__data__" and "object" or "any" + if assigning: - emit(("__check_and_store_via_any", accessor, attrname, "")) + emit(("__check_and_store_via_%s" % to_search, accessor, attrname, "")) else: - accessor = ("__check_and_load_via_any", accessor, attrname) + accessor = ("__check_and_load_via_%s" % to_search, accessor, attrname) remaining -= 1 diff -r e89a0ec15494 -r c7c355fcf9fb optimiser.py --- a/optimiser.py Fri Mar 10 17:27:18 2017 +0100 +++ b/optimiser.py Fri Mar 10 20:16:30 2017 +0100 @@ -435,8 +435,22 @@ attrnames = filter(lambda x: not x.startswith("$t"), attrnames) self.all_attrs[(objkind, name)] = attrnames - self.locations = get_allocated_locations(self.all_attrs, - get_attributes_and_sizes, self.existing_locations) + try: + self.locations = get_allocated_locations(self.all_attrs, + get_attributes_and_sizes, self.existing_locations) + + # Uphold positioning conflicts only if the existing locations were + # explicitly specified. + + except OptimiseError: + if self.locations_filename: + raise + + # Otherwise, reposition attributes, causing the program to be + # regenerated. + + self.locations = get_allocated_locations(self.all_attrs, + get_attributes_and_sizes) def populate_parameters(self):