| 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 int num_opt_named_params = function.num_optional_named_parameters(); | 629 int num_opt_named_params = function.num_optional_named_parameters(); |
| 630 const int num_params = | 630 const int num_params = |
| 631 num_fixed_params + num_opt_pos_params + num_opt_named_params; | 631 num_fixed_params + num_opt_pos_params + num_opt_named_params; |
| 632 int implicit_this_param_pos = is_native_instance_closure ? -1 : 0; | 632 int implicit_this_param_pos = is_native_instance_closure ? -1 : 0; |
| 633 ASSERT(parsed_function().first_parameter_index() == | 633 ASSERT(parsed_function().first_parameter_index() == |
| 634 ParsedFunction::kFirstLocalSlotIndex + implicit_this_param_pos); | 634 ParsedFunction::kFirstLocalSlotIndex + implicit_this_param_pos); |
| 635 | 635 |
| 636 // Check that min_num_pos_args <= num_pos_args <= max_num_pos_args, | 636 // Check that min_num_pos_args <= num_pos_args <= max_num_pos_args, |
| 637 // where num_pos_args is the number of positional arguments passed in. | 637 // where num_pos_args is the number of positional arguments passed in. |
| 638 const int min_num_pos_args = num_fixed_params; | 638 const int min_num_pos_args = num_fixed_params; |
| 639 const int max_num_pos_args = num_fixed_params + num_opt_pos_params + | 639 const int max_num_pos_args = num_fixed_params + num_opt_pos_params; |
| 640 (FLAG_reject_named_argument_as_positional ? 0 : num_opt_named_params); | |
| 641 | 640 |
| 642 // Number of positional args is the second Smi in descriptor array (R10). | 641 // Number of positional args is the second Smi in descriptor array (R10). |
| 643 __ movq(RCX, FieldAddress(R10, Array::data_offset() + (1 * kWordSize))); | 642 __ movq(RCX, FieldAddress(R10, Array::data_offset() + (1 * kWordSize))); |
| 644 // Check that min_num_pos_args <= num_pos_args. | 643 // Check that min_num_pos_args <= num_pos_args. |
| 645 Label wrong_num_arguments; | 644 Label wrong_num_arguments; |
| 646 __ cmpq(RCX, Immediate(Smi::RawValue(min_num_pos_args))); | 645 __ cmpq(RCX, Immediate(Smi::RawValue(min_num_pos_args))); |
| 647 __ j(LESS, &wrong_num_arguments); | 646 __ j(LESS, &wrong_num_arguments); |
| 648 // Check that num_pos_args <= max_num_pos_args. | 647 // Check that num_pos_args <= max_num_pos_args. |
| 649 __ cmpq(RCX, Immediate(Smi::RawValue(max_num_pos_args))); | 648 __ cmpq(RCX, Immediate(Smi::RawValue(max_num_pos_args))); |
| 650 __ j(GREATER, &wrong_num_arguments); | 649 __ j(GREATER, &wrong_num_arguments); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { | 1366 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { |
| 1368 __ Exchange(mem1, mem2); | 1367 __ Exchange(mem1, mem2); |
| 1369 } | 1368 } |
| 1370 | 1369 |
| 1371 | 1370 |
| 1372 #undef __ | 1371 #undef __ |
| 1373 | 1372 |
| 1374 } // namespace dart | 1373 } // namespace dart |
| 1375 | 1374 |
| 1376 #endif // defined TARGET_ARCH_X64 | 1375 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |