1.1 --- a/micropython/trans.py Sun Nov 22 21:21:41 2009 +0100
1.2 +++ b/micropython/trans.py Sun Nov 22 22:53:24 2009 +0100
1.3 @@ -336,12 +336,23 @@
1.4
1.5 after_test_block = self.new_block()
1.6
1.7 + self.new_op(LoadClass(attr))
1.8 + temp_target = self.optimiser.optimise_temp_storage()
1.9 +
1.10 + # Generate name is target (for classes).
1.11 +
1.12 + self.dispatch(compiler.ast.Name(name))
1.13 + self.new_op(TestIdentity())
1.14 + self.optimiser.set_source(temp_target)
1.15 +
1.16 + # Jump to the next guard or the code if successful.
1.17 +
1.18 + self.new_op(JumpIfTrue(after_test_block))
1.19 +
1.20 # Generate isinstance(name, target).
1.21
1.22 - self.new_op(LoadClass(attr))
1.23 - temp_target = self.optimiser.optimise_temp_storage()
1.24 self.dispatch(compiler.ast.Name(name))
1.25 - self.new_op(CheckSelf()) # NOTE: Should be CheckInstance.
1.26 + self.new_op(CheckInstance())
1.27 self.optimiser.set_source(temp_target)
1.28
1.29 # Jump to the next guard or the code if successful.
1.30 @@ -922,7 +933,7 @@
1.31 # Check the current value (the argument) against the known context
1.32 # (given as the source).
1.33
1.34 - self.new_op(CheckSelf())
1.35 + self.new_op(CheckInstance())
1.36 self.optimiser.set_source(temp_context)
1.37
1.38 self.new_op(JumpIfTrue(adjust_block))