1.1 --- a/micropython/opt.py Tue Jun 02 20:17:59 2009 +0200
1.2 +++ b/micropython/opt.py Wed Jun 03 00:48:57 2009 +0200
1.3 @@ -153,7 +153,7 @@
1.4 "Return whether 'instruction' provides a constant input."
1.5
1.6 return isinstance(instruction, LoadAddress) and instruction.attr.assignments == 1 or \
1.7 - isinstance(instruction, (LoadConst, LoadFunction))
1.8 + isinstance(instruction, (LoadConst, LoadClass, LoadFunction))
1.9
1.10 def is_constant_target(self, instruction):
1.11
1.12 @@ -173,7 +173,7 @@
1.13 a load operation from a CPU register or special memory location.
1.14 """
1.15
1.16 - return isinstance(instruction, (LoadConst, LoadFunction, LoadName, LoadTemp, LoadResult, LoadException, LoadAddress))
1.17 + return isinstance(instruction, (LoadConst, LoadClass, LoadFunction, LoadName, LoadTemp, LoadResult, LoadException, LoadAddress))
1.18
1.19 def is_simple_input_user(self, instruction):
1.20
1.21 @@ -275,7 +275,7 @@
1.22 # LoadResult cannot be relied upon in general since the result register
1.23 # could be updated since first being referenced.
1.24
1.25 - return isinstance(self.active_value, (LoadName, LoadTemp, LoadAddress, LoadConst, LoadFunction)) or \
1.26 + return isinstance(self.active_value, (LoadName, LoadTemp, LoadAddress, LoadConst, LoadClass, LoadFunction)) or \
1.27 isinstance(self.active_value, LoadResult) and self.active_value is self.active or \
1.28 isinstance(self.active_value, LoadException) and self.active_value is self.active
1.29