Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Side by Side Diff: runtime/vm/flow_graph_inliner.cc

Issue 2785623004: Fix #14144 confusing error message misusing a callable object (Closed)
Patch Set: Realized that doing .runtimeType == _Closure is unnecessary, doing 'is' now. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 (call->ArgumentCount() > target.NumParameters() ||
1266 call->ArgumentCount() < target.num_fixed_parameters()) {
1267 TRACE_INLINING(THR_Print(" Bailout: wrong parameter count\n"));
1268 continue;
1269 }
1270
1264 GrowableArray<Value*> arguments(call->ArgumentCount()); 1271 GrowableArray<Value*> arguments(call->ArgumentCount());
1265 for (int i = 0; i < call->ArgumentCount(); ++i) { 1272 for (int i = 0; i < call->ArgumentCount(); ++i) {
1266 arguments.Add(call->PushArgumentAt(i)->value()); 1273 arguments.Add(call->PushArgumentAt(i)->value());
1267 } 1274 }
1268 InlinedCallData call_data( 1275 InlinedCallData call_data(
1269 call, &arguments, call_info[call_idx].caller(), 1276 call, &arguments, call_info[call_idx].caller(),
1270 call_info[call_idx].caller_graph->inlining_id()); 1277 call_info[call_idx].caller_graph->inlining_id());
1271 if (TryInlining(target, call->argument_names(), &call_data)) { 1278 if (TryInlining(target, call->argument_names(), &call_data)) {
1272 InlineCall(&call_data); 1279 InlineCall(&call_data);
1273 } 1280 }
(...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after
3824 } 3831 }
3825 3832
3826 default: 3833 default:
3827 return false; 3834 return false;
3828 } 3835 }
3829 } 3836 }
3830 3837
3831 3838
3832 } // namespace dart 3839 } // namespace dart
3833 #endif // !defined(DART_PRECOMPILED_RUNTIME) 3840 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | tests/language/vm/no_such_args_error_message_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698