OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1036 const int num_locals = parsed_function().num_stack_locals(); | 1036 const int num_locals = parsed_function().num_stack_locals(); |
1037 StubCode* stub_code = isolate()->stub_code(); | 1037 StubCode* stub_code = isolate()->stub_code(); |
1038 | 1038 |
1039 // We check the number of passed arguments when we have to copy them due to | 1039 // We check the number of passed arguments when we have to copy them due to |
1040 // the presence of optional parameters. | 1040 // the presence of optional parameters. |
1041 // No such checking code is generated if only fixed parameters are declared, | 1041 // No such checking code is generated if only fixed parameters are declared, |
1042 // unless we are in debug mode or unless we are compiling a closure. | 1042 // unless we are in debug mode or unless we are compiling a closure. |
1043 if (num_copied_params == 0) { | 1043 if (num_copied_params == 0) { |
1044 #ifdef DEBUG | 1044 #ifdef DEBUG |
1045 ASSERT(!parsed_function().function().HasOptionalParameters()); | 1045 ASSERT(!parsed_function().function().HasOptionalParameters()); |
1046 const bool check_arguments = !flow_graph().IsCompiledForOsr(); | 1046 const bool check_arguments = !flow_graph().IsCompiledForOsr() && |
1047 !function.IsIrregexpFunction(); | |
Florian Schneider
2014/10/01 17:04:14
Is this necessary? IsClosureFunction implies !IsIr
jgruber1
2014/10/03 18:59:52
Done.
| |
1047 #else | 1048 #else |
1048 const bool check_arguments = | 1049 const bool check_arguments = |
1049 function.IsClosureFunction() && !flow_graph().IsCompiledForOsr(); | 1050 function.IsClosureFunction() && !flow_graph().IsCompiledForOsr() && |
1051 !function.IsIrregexpFunction(); | |
1050 #endif | 1052 #endif |
1051 if (check_arguments) { | 1053 if (check_arguments) { |
1052 __ Comment("Check argument count"); | 1054 __ Comment("Check argument count"); |
1053 // Check that exactly num_fixed arguments are passed in. | 1055 // Check that exactly num_fixed arguments are passed in. |
1054 Label correct_num_arguments, wrong_num_arguments; | 1056 Label correct_num_arguments, wrong_num_arguments; |
1055 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); | 1057 __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); |
1056 __ cmpl(EAX, Immediate(Smi::RawValue(num_fixed_params))); | 1058 __ cmpl(EAX, Immediate(Smi::RawValue(num_fixed_params))); |
1057 __ j(NOT_EQUAL, &wrong_num_arguments, Assembler::kNearJump); | 1059 __ j(NOT_EQUAL, &wrong_num_arguments, Assembler::kNearJump); |
1058 __ cmpl(EAX, | 1060 __ cmpl(EAX, |
1059 FieldAddress(EDX, | 1061 FieldAddress(EDX, |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1768 __ movups(reg, Address(ESP, 0)); | 1770 __ movups(reg, Address(ESP, 0)); |
1769 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1771 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1770 } | 1772 } |
1771 | 1773 |
1772 | 1774 |
1773 #undef __ | 1775 #undef __ |
1774 | 1776 |
1775 } // namespace dart | 1777 } // namespace dart |
1776 | 1778 |
1777 #endif // defined TARGET_ARCH_IA32 | 1779 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |