| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 __ Bind(&next_parameter); | 539 __ Bind(&next_parameter); |
| 540 } | 540 } |
| 541 delete[] opt_param; | 541 delete[] opt_param; |
| 542 delete[] opt_param_position; | 542 delete[] opt_param_position; |
| 543 // Check that EDI now points to the null terminator in the array descriptor. | 543 // Check that EDI now points to the null terminator in the array descriptor. |
| 544 Label all_arguments_processed; | 544 Label all_arguments_processed; |
| 545 __ cmpl(Address(EDI, 0), raw_null); | 545 __ cmpl(Address(EDI, 0), raw_null); |
| 546 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); | 546 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); |
| 547 | 547 |
| 548 __ Bind(&wrong_num_arguments); | 548 __ Bind(&wrong_num_arguments); |
| 549 if (locals_space_size() != 0) { |
| 550 // We need to unwind the space we reserved for locals and copied |
| 551 // parmeters. The NoSuchMethodFunction stub does not expect to |
| 552 // see that area on the stack. |
| 553 __ addl(ESP, Immediate(locals_space_size())); |
| 554 } |
| 549 if (function.IsClosureFunction()) { | 555 if (function.IsClosureFunction()) { |
| 550 GenerateCallRuntime(AstNode::kNoId, | 556 GenerateCallRuntime(AstNode::kNoId, |
| 551 0, | 557 0, |
| 552 kClosureArgumentMismatchRuntimeEntry); | 558 kClosureArgumentMismatchRuntimeEntry); |
| 553 } else { | 559 } else { |
| 554 // Invoke noSuchMethod function. | 560 // Invoke noSuchMethod function. |
| 555 const int kNumArgsChecked = 1; | 561 const int kNumArgsChecked = 1; |
| 556 ICData& ic_data = ICData::ZoneHandle(); | 562 ICData& ic_data = ICData::ZoneHandle(); |
| 557 ic_data = ICData::New(parsed_function().function(), | 563 ic_data = ICData::New(parsed_function().function(), |
| 558 String::Handle(function.name()), | 564 String::Handle(function.name()), |
| (...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2959 const Error& error = Error::Handle( | 2965 const Error& error = Error::Handle( |
| 2960 Parser::FormatError(script, token_index, "Error", format, args)); | 2966 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2961 va_end(args); | 2967 va_end(args); |
| 2962 Isolate::Current()->long_jump_base()->Jump(1, error); | 2968 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2963 UNREACHABLE(); | 2969 UNREACHABLE(); |
| 2964 } | 2970 } |
| 2965 | 2971 |
| 2966 } // namespace dart | 2972 } // namespace dart |
| 2967 | 2973 |
| 2968 #endif // defined TARGET_ARCH_IA32 | 2974 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |