# HG changeset patch # User Paul Boddie # Date 1209941006 -7200 # Node ID 6040897ede2c30c7ad0cb3ce7c476c3e3cdbdd42 # Parent 1f879e94c49f768a9f680ae61cbbf10fdd1160b8 Fixed instruction ordering in binary operator support, negating the need for the previous instruction sequence changes. diff -r 1f879e94c49f -r 6040897ede2c micropython/ast.py --- a/micropython/ast.py Mon May 05 00:37:53 2008 +0200 +++ b/micropython/ast.py Mon May 05 00:43:26 2008 +0200 @@ -752,17 +752,16 @@ # Get left method on temp1. self._generateAttr(node, left_method, (LoadAddress, LoadAttr, LoadAttrIndex)) - temp_method = self._optimise_temp_storage() # Add exception handling to the method acquisition instructions where # the attribute access cannot be resolved at compile-time. - if not self._optimise_known_target(temp_method): - self.capture_ops() + if not self._optimise_known_target(): self.dispatch(compiler.ast.Name("AttributeError")) - temp_method += self.get_captured_ops() - temp_method.append(CheckException()) - temp_method.append(JumpIfTrue(end_left_label)) + self.new_op(CheckException()) + self.new_op(JumpIfTrue(end_left_label)) + + temp_method = self._optimise_temp_storage() # Add arguments. @@ -793,17 +792,16 @@ # Get right method on temp2. self._generateAttr(node, right_method, (LoadAddress, LoadAttr, LoadAttrIndex)) - temp_method = self._optimise_temp_storage() # Add exception handling to the method acquisition instructions where # the attribute access cannot be resolved at compile-time. - if not self._optimise_known_target(temp_method): - self.capture_ops() + if not self._optimise_known_target(): self.dispatch(compiler.ast.Name("AttributeError")) - temp_method += self.get_captured_ops() - temp_method.append(CheckException()) - temp_method.append(JumpIfTrue(type_error_label)) + self.new_op(CheckException()) + self.new_op(JumpIfTrue(type_error_label)) + + temp_method = self._optimise_temp_storage() # Add arguments.