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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1067 const int num_locals = parsed_function().num_stack_locals(); | 1067 const int num_locals = parsed_function().num_stack_locals(); |
1068 StubCode* stub_code = isolate()->stub_code(); | 1068 StubCode* stub_code = isolate()->stub_code(); |
1069 | 1069 |
1070 // We check the number of passed arguments when we have to copy them due to | 1070 // We check the number of passed arguments when we have to copy them due to |
1071 // the presence of optional parameters. | 1071 // the presence of optional parameters. |
1072 // No such checking code is generated if only fixed parameters are declared, | 1072 // No such checking code is generated if only fixed parameters are declared, |
1073 // unless we are in debug mode or unless we are compiling a closure. | 1073 // unless we are in debug mode or unless we are compiling a closure. |
1074 if (num_copied_params == 0) { | 1074 if (num_copied_params == 0) { |
1075 #ifdef DEBUG | 1075 #ifdef DEBUG |
1076 ASSERT(!parsed_function().function().HasOptionalParameters()); | 1076 ASSERT(!parsed_function().function().HasOptionalParameters()); |
1077 const bool check_arguments = !flow_graph().IsCompiledForOsr(); | 1077 const bool check_arguments = !flow_graph().IsCompiledForOsr() && |
1078 !function.IsIrregexpFunction(); | |
Florian Schneider
2014/10/01 17:04:14
Is this necessary? IsClosureFunction implies !IsIr
jgruber1
2014/10/03 18:59:53
Done.
| |
1078 #else | 1079 #else |
1079 const bool check_arguments = | 1080 const bool check_arguments = |
1080 function.IsClosureFunction() && !flow_graph().IsCompiledForOsr(); | 1081 function.IsClosureFunction() && !flow_graph().IsCompiledForOsr() && |
1082 !function.IsIrregexpFunction(); | |
1081 #endif | 1083 #endif |
1082 if (check_arguments) { | 1084 if (check_arguments) { |
1083 __ TraceSimMsg("Check argument count"); | 1085 __ TraceSimMsg("Check argument count"); |
1084 __ Comment("Check argument count"); | 1086 __ Comment("Check argument count"); |
1085 // Check that exactly num_fixed arguments are passed in. | 1087 // Check that exactly num_fixed arguments are passed in. |
1086 Label correct_num_arguments, wrong_num_arguments; | 1088 Label correct_num_arguments, wrong_num_arguments; |
1087 __ lw(T0, FieldAddress(S4, ArgumentsDescriptor::count_offset())); | 1089 __ lw(T0, FieldAddress(S4, ArgumentsDescriptor::count_offset())); |
1088 __ BranchNotEqual(T0, Smi::RawValue(num_fixed_params), | 1090 __ BranchNotEqual(T0, Smi::RawValue(num_fixed_params), |
1089 &wrong_num_arguments); | 1091 &wrong_num_arguments); |
1090 | 1092 |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1799 __ AddImmediate(SP, kDoubleSize); | 1801 __ AddImmediate(SP, kDoubleSize); |
1800 } | 1802 } |
1801 | 1803 |
1802 | 1804 |
1803 #undef __ | 1805 #undef __ |
1804 | 1806 |
1805 | 1807 |
1806 } // namespace dart | 1808 } // namespace dart |
1807 | 1809 |
1808 #endif // defined TARGET_ARCH_MIPS | 1810 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |