1.1 --- a/micropython/trans.py Sat May 16 01:34:03 2009 +0200
1.2 +++ b/micropython/trans.py Sun May 17 00:58:27 2009 +0200
1.3 @@ -740,19 +740,10 @@
1.4
1.5 self._endCallFuncArgs(frame_size)
1.6
1.7 - # Or generate instructions to do this at run-time.
1.8 + # Or just set the frame size and have the function check the arguments.
1.9
1.10 else:
1.11 max_pos = max(max(employed_positions or [-1]), max_keyword_pos, frame_pos - 1)
1.12 -
1.13 - # Only check non-empty frames (using the callable's details).
1.14 -
1.15 - if employed_positions or max_pos >= 0:
1.16 - self.new_op(temp)
1.17 - self.new_op(CheckFrame(max_pos + 1))
1.18 -
1.19 - # Set the frame size.
1.20 -
1.21 self._endCallFuncArgs(max_pos + 1)
1.22
1.23 def _generateCallFuncDefaultArgs(self, target, temp, nargs_min, nargs_max, employed_positions):
1.24 @@ -788,13 +779,12 @@
1.25 # For classes, the target itself is used, since the instantiator will be
1.26 # obtained via the class.
1.27
1.28 - if isinstance(target, Class):
1.29 - self.new_op(LoadConst(target))
1.30 + if isinstance(target, (Class, Function)):
1.31 + self.new_op(JumpWithFrameDirect(target))
1.32 else:
1.33 self.new_op(instruction)
1.34 -
1.35 - self.new_op(LoadCallable())
1.36 - self.new_op(JumpWithFrame())
1.37 + self.new_op(LoadCallable())
1.38 + self.new_op(JumpWithFrame())
1.39
1.40 def _endCallFuncArgs(self, nargs):
1.41