| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 delete[] opt_param; | 1421 delete[] opt_param; |
| 1422 delete[] opt_param_position; | 1422 delete[] opt_param_position; |
| 1423 // Check that RDI now points to the null terminator in the array descriptor. | 1423 // Check that RDI now points to the null terminator in the array descriptor. |
| 1424 const Immediate raw_null = | 1424 const Immediate raw_null = |
| 1425 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1425 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 1426 Label all_arguments_processed; | 1426 Label all_arguments_processed; |
| 1427 __ cmpq(Address(RDI, 0), raw_null); | 1427 __ cmpq(Address(RDI, 0), raw_null); |
| 1428 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); | 1428 __ j(EQUAL, &all_arguments_processed, Assembler::kNearJump); |
| 1429 | 1429 |
| 1430 __ Bind(&wrong_num_arguments); | 1430 __ Bind(&wrong_num_arguments); |
| 1431 if (StackSize() != 0) { |
| 1432 // We need to unwind the space we reserved for locals and copied parmeters. |
| 1433 // The NoSuchMethodFunction stub does not expect to see that area on the |
| 1434 // stack. |
| 1435 __ addq(RSP, Immediate(StackSize() * kWordSize)); |
| 1436 } |
| 1431 if (function.IsClosureFunction()) { | 1437 if (function.IsClosureFunction()) { |
| 1432 GenerateCallRuntime(AstNode::kNoId, | 1438 GenerateCallRuntime(AstNode::kNoId, |
| 1433 0, | 1439 0, |
| 1434 CatchClauseNode::kInvalidTryIndex, | 1440 CatchClauseNode::kInvalidTryIndex, |
| 1435 kClosureArgumentMismatchRuntimeEntry); | 1441 kClosureArgumentMismatchRuntimeEntry); |
| 1436 } else { | 1442 } else { |
| 1437 // Invoke noSuchMethod function. | 1443 // Invoke noSuchMethod function. |
| 1438 const int kNumArgsChecked = 1; | 1444 const int kNumArgsChecked = 1; |
| 1439 ICData& ic_data = ICData::ZoneHandle(); | 1445 ICData& ic_data = ICData::ZoneHandle(); |
| 1440 ic_data = ICData::New(parsed_function_.function(), | 1446 ic_data = ICData::New(parsed_function_.function(), |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 ASSERT(exception_handlers_list_ != NULL); | 1717 ASSERT(exception_handlers_list_ != NULL); |
| 1712 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( | 1718 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( |
| 1713 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); | 1719 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); |
| 1714 code.set_exception_handlers(handlers); | 1720 code.set_exception_handlers(handlers); |
| 1715 } | 1721 } |
| 1716 | 1722 |
| 1717 | 1723 |
| 1718 } // namespace dart | 1724 } // namespace dart |
| 1719 | 1725 |
| 1720 #endif // defined TARGET_ARCH_X64 | 1726 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |