1.1 --- a/micropython/ast.py Sat Jul 19 21:26:47 2008 +0200
1.2 +++ b/micropython/ast.py Sun Jul 20 23:16:26 2008 +0200
1.3 @@ -310,7 +310,7 @@
1.4 "Return whether 'instruction' can use simple input from the current value."
1.5
1.6 return isinstance(instruction, (
1.7 - StoreTemp, StoreFrame, StoreResult, RaiseException, # as the value being stored
1.8 + StoreTemp, StoreFrame, StoreResult, StoreException, # as the value being stored
1.9 LoadAddressContext, LoadAttr, LoadAttrIndex, # as the object being referenced
1.10 StoreAttr, StoreAttrIndex # as the object being referenced
1.11 ))
1.12 @@ -780,6 +780,7 @@
1.13 self.new_op(LoadResult())
1.14
1.15 self.load_builtin("TypeError", node)
1.16 + self.new_op(StoreException())
1.17 self.new_op(RaiseException())
1.18 self.set_label(continue_label)
1.19
1.20 @@ -943,6 +944,7 @@
1.21 # Raise a TypeError.
1.22
1.23 self.load_builtin("TypeError", node)
1.24 + self.new_op(StoreException())
1.25 self.new_op(RaiseException())
1.26
1.27 self.set_label(end_label)
1.28 @@ -1068,6 +1070,7 @@
1.29
1.30 self.set_label(type_error_label)
1.31 self.load_builtin("TypeError", node)
1.32 + self.new_op(StoreException())
1.33 self.new_op(RaiseException())
1.34
1.35 self.set_label(end_label)
1.36 @@ -1439,6 +1442,7 @@
1.37
1.38 self.discard_temp(temp_arg)
1.39
1.40 + self.new_op(StoreException())
1.41 self.new_op(RaiseException())
1.42
1.43 def visitReturn(self, node):
1.44 @@ -1508,7 +1512,7 @@
1.45
1.46 # Unhandled exceptions.
1.47
1.48 - self.new_op(LoadException())
1.49 + #self.new_op(LoadException())
1.50 self.new_op(RaiseException())
1.51
1.52 # Optional else clause.
2.1 --- a/micropython/rsvp.py Sat Jul 19 21:26:47 2008 +0200
2.2 +++ b/micropython/rsvp.py Sun Jul 20 23:16:26 2008 +0200
2.3 @@ -152,31 +152,31 @@
2.4
2.5 # Access within an invocation frame.
2.6
2.7 -class LoadName(FR): "Load the object from the given local attribute/variable."
2.8 -class StoreName(FR): "Store the object in the given local attribute/variable."
2.9 -class LoadTemp(Immediate): "Load the object from the given temporary location."
2.10 -class StoreTemp(Immediate): "Store the object in the given temporary location."
2.11 +class LoadName(FR): "Load the current value from the given local attribute/variable."
2.12 +class StoreName(FR): "Store the source value into the given local attribute/variable."
2.13 +class LoadTemp(Immediate): "Load the current value from the given temporary location."
2.14 +class StoreTemp(Immediate): "Store the current value into the given temporary location."
2.15
2.16 # Access to static data.
2.17
2.18 -class LoadAddress(Address): "Load the object from the given fixed attribute address."
2.19 -class StoreAddress(Address): "Store an object in the given fixed attribute address."
2.20 -class LoadAddressContext(Address): "Load the object from the given fixed attribute address, changing the context."
2.21 +class LoadAddress(Address): "Load the current value from the given fixed attribute address."
2.22 +class StoreAddress(Address): "Store the source value into the given fixed attribute address."
2.23 +class LoadAddressContext(Address): "Load the current value from the given fixed attribute address, making the current value the context."
2.24 class MakeObject(Instruction): "Make a new object. There isn't a complementary DropObject."
2.25
2.26 # Access to address-relative data.
2.27
2.28 -class LoadAttr(AR): "Load the object from the given attribute."
2.29 -class StoreAttr(AR): "Store an object in the given attribute."
2.30 -class LoadAttrIndex(Immediate): "Load the object for the attribute with the given index."
2.31 +class LoadAttr(AR): "Load into the current value the given attribute of the object referenced by the current value."
2.32 +class StoreAttr(AR): "Store the source value into the given attribute of the object referenced by the current value."
2.33 +class LoadAttrIndex(Immediate): "Load into the current value the attribute of the current value with the given index."
2.34 class StoreAttrIndex(Immediate): "Store an object in the attribute with the given index."
2.35
2.36 # Access to invocation frames in preparation.
2.37
2.38 class MakeFrame(Instruction): "Make a new invocation frame."
2.39 class DropFrame(Instruction): "Drop an invocation frame."
2.40 -class StoreFrame(Immediate): "Store an argument for the parameter with the given position."
2.41 -class StoreFrameIndex(Immediate): "Store an argument for the parameter with the given index."
2.42 +class StoreFrame(Immediate): "Store the current value as an argument for the parameter with the given position."
2.43 +class StoreFrameIndex(Immediate): "Store the current value as an argument for the parameter with the given index."
2.44 class LoadCallable(Instruction): "Load the target of an invocation."
2.45 class LoadContext(Instruction): "Load the context of an invocation."
2.46 class CheckFrame(Instruction): "Check the invocation frame and context for the target."
2.47 @@ -186,8 +186,8 @@
2.48
2.49 class JumpWithFrame(Instruction): "Jump, adopting the invocation frame, to the callable found as the current value."
2.50 class Return(Instruction): "Return from a subprogram."
2.51 -class LoadResult(Instruction): "Load a returned value."
2.52 -class StoreResult(Instruction): "Store a value to be returned."
2.53 +class LoadResult(Instruction): "Load into the current value a returned value."
2.54 +class StoreResult(Instruction): "Store the current value as a value to be returned."
2.55
2.56 # Branch-related instructions.
2.57
2.58 @@ -198,10 +198,11 @@
2.59 # Exception-related instructions, using a special exception "register".
2.60
2.61 class LoadException(Instruction): "Load the raised exception."
2.62 -class RaiseException(Instruction): "Raise an exception."
2.63 -class CheckException(Instruction): "Check the raised exception against another."
2.64 +class StoreException(Instruction): "Store the current object in the exception register."
2.65 +class RaiseException(Instruction): "Raise an exception, jumping to the active handler."
2.66 class PushHandler(Address): "Push an exception handler onto the handler stack."
2.67 class PopHandler(Instruction): "Pop an exception handler from the handler stack."
2.68 +class CheckException(Instruction): "Check the raised exception against another."
2.69
2.70 # General instructions.
2.71