1.1 --- a/micropython/ast.py Fri May 29 00:18:40 2009 +0200
1.2 +++ b/micropython/ast.py Sat May 30 20:27:20 2009 +0200
1.3 @@ -168,33 +168,21 @@
1.4
1.5 init_method = cls.get_init_method()
1.6
1.7 - # Fix the current frame to include a new storage slot at the beginning.
1.8 -
1.9 - self.new_op(AdjustFrame(-1))
1.10 -
1.11 - # Convert this frame back to being an invocation frame.
1.12 -
1.13 - self.new_op(RecoverFrame())
1.14 -
1.15 - # Make an object.
1.16 + # Make an object and store it in the unused first slot.
1.17
1.18 self.make_object(cls, len(cls.instance_attributes()))
1.19 - self.new_op(StoreFrame(0))
1.20 + self.new_op(StoreTemp(0))
1.21
1.22 # Invoke the appropriate initialiser.
1.23
1.24 self.new_op(LoadFunction(init_method))
1.25 self.new_op(LoadCallable())
1.26 - self.new_op(JumpWithFrame())
1.27 + self.new_op(JumpInFrame())
1.28
1.29 # Store the object as the result.
1.30
1.31 - self.new_op(LoadName(init_method.all_locals()["self"])) # load the context in the invocation frame
1.32 + self.new_op(LoadTemp(0)) # load the context from the locals
1.33 self.new_op(StoreResult())
1.34 -
1.35 - # Fix the current frame to release the storage slot at the beginning.
1.36 -
1.37 - self.new_op(AdjustFrame(1))
1.38 self.new_op(Return())
1.39
1.40 self.unit.blocks = self.blocks