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 #if !defined(DART_PRECOMPILED_RUNTIME) | 4 #if !defined(DART_PRECOMPILED_RUNTIME) |
5 #include "vm/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
6 | 6 |
7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
8 #include "vm/precompiler.h" | 8 #include "vm/precompiler.h" |
9 #include "vm/block_scheduler.h" | 9 #include "vm/block_scheduler.h" |
10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1254 ConstantInstr* constant = | 1254 ConstantInstr* constant = |
1255 call->ArgumentAt(0)->OriginalDefinition()->AsConstant(); | 1255 call->ArgumentAt(0)->OriginalDefinition()->AsConstant(); |
1256 if ((constant != NULL) && constant->value().IsClosure()) { | 1256 if ((constant != NULL) && constant->value().IsClosure()) { |
1257 target ^= Closure::Cast(constant->value()).function(); | 1257 target ^= Closure::Cast(constant->value()).function(); |
1258 } | 1258 } |
1259 | 1259 |
1260 if (target.IsNull()) { | 1260 if (target.IsNull()) { |
1261 TRACE_INLINING(THR_Print(" Bailout: non-closure operator\n")); | 1261 TRACE_INLINING(THR_Print(" Bailout: non-closure operator\n")); |
1262 continue; | 1262 continue; |
1263 } | 1263 } |
1264 | |
1265 if (target.NumParameters() != call->ArgumentCount()) { | |
Florian Schneider
2017/03/30 20:18:05
Good catch!
Your fix is safe, but it could be imp
| |
1266 TRACE_INLINING(THR_Print(" Bailout: wrong parameter count\n")); | |
1267 continue; | |
1268 } | |
1269 | |
1264 GrowableArray<Value*> arguments(call->ArgumentCount()); | 1270 GrowableArray<Value*> arguments(call->ArgumentCount()); |
1265 for (int i = 0; i < call->ArgumentCount(); ++i) { | 1271 for (int i = 0; i < call->ArgumentCount(); ++i) { |
1266 arguments.Add(call->PushArgumentAt(i)->value()); | 1272 arguments.Add(call->PushArgumentAt(i)->value()); |
1267 } | 1273 } |
1268 InlinedCallData call_data( | 1274 InlinedCallData call_data( |
1269 call, &arguments, call_info[call_idx].caller(), | 1275 call, &arguments, call_info[call_idx].caller(), |
1270 call_info[call_idx].caller_graph->inlining_id()); | 1276 call_info[call_idx].caller_graph->inlining_id()); |
1271 if (TryInlining(target, call->argument_names(), &call_data)) { | 1277 if (TryInlining(target, call->argument_names(), &call_data)) { |
1272 InlineCall(&call_data); | 1278 InlineCall(&call_data); |
1273 } | 1279 } |
(...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3824 } | 3830 } |
3825 | 3831 |
3826 default: | 3832 default: |
3827 return false; | 3833 return false; |
3828 } | 3834 } |
3829 } | 3835 } |
3830 | 3836 |
3831 | 3837 |
3832 } // namespace dart | 3838 } // namespace dart |
3833 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3839 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |