1.1 --- a/micropython/ast.py Sun May 31 18:44:40 2009 +0200
1.2 +++ b/micropython/ast.py Mon Jun 01 02:41:57 2009 +0200
1.3 @@ -170,7 +170,7 @@
1.4
1.5 # Make an object and store it in the unused first slot.
1.6
1.7 - self.make_object(cls, len(cls.instance_attributes()))
1.8 + self.make_instance(cls, len(cls.instance_attributes()))
1.9 self.new_op(StoreTemp(0))
1.10
1.11 # Invoke the appropriate initialiser.
1.12 @@ -596,7 +596,7 @@
1.13 fn.body_block = self.new_block()
1.14 check_block = self.new_block()
1.15
1.16 - self._generateFunctionContextTest(node, check_block, fn.body_block)
1.17 + self._generateFunctionContextTest(node, check_block)
1.18
1.19 # Check the number of parameters and defaults.
1.20
1.21 @@ -604,7 +604,8 @@
1.22
1.23 self.new_op(CheckFrame((nparams, ndefaults, fn.has_star)))
1.24 if ndefaults > 0:
1.25 - self.new_op(FillDefaults((nparams, ndefaults, fn)))
1.26 + self.new_op(LoadFunction(fn))
1.27 + self.new_op(FillDefaults((nparams, ndefaults)))
1.28
1.29 # Produce the body.
1.30
1.31 @@ -673,7 +674,7 @@
1.32 fn.body_block = self.new_block()
1.33 check_block = self.new_block()
1.34
1.35 - self._generateFunctionContextTest(node, check_block, fn.body_block)
1.36 + self._generateFunctionContextTest(node, check_block)
1.37
1.38 # Check the number of parameters and defaults.
1.39
1.40 @@ -681,7 +682,8 @@
1.41
1.42 self.new_op(CheckFrame((nparams, ndefaults, fn.has_star)))
1.43 if ndefaults > 0:
1.44 - self.new_op(FillDefaults((nparams, ndefaults, fn)))
1.45 + self.new_op(LoadTemp(0)) # context provides storage
1.46 + self.new_op(FillDefaults((nparams, ndefaults)))
1.47
1.48 # Produce the body.
1.49