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

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

Issue 1684913002: Resolve correct noSuchMethod (fixes #25671, #25737). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comment Created 4 years, 10 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
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 4424 matching lines...) Expand 10 before | Expand all | Expand 10 after
4435 LocalVariable* temp = NULL; 4435 LocalVariable* temp = NULL;
4436 if (save_last_arg) { 4436 if (save_last_arg) {
4437 temp = owner()->parsed_function().expression_temp_var(); 4437 temp = owner()->parsed_function().expression_temp_var();
4438 } 4438 }
4439 ArgumentListNode* args = 4439 ArgumentListNode* args =
4440 Parser::BuildNoSuchMethodArguments(args_pos, 4440 Parser::BuildNoSuchMethodArguments(args_pos,
4441 method_name, 4441 method_name,
4442 *method_arguments, 4442 *method_arguments,
4443 temp, 4443 temp,
4444 is_super_invocation); 4444 is_super_invocation);
4445 const Function& no_such_method_func = Function::ZoneHandle(Z, 4445 // Make sure we resolve to a compatible noSuchMethod, otherwise call
4446 Resolver::ResolveDynamicAnyArgs(target_class, Symbols::NoSuchMethod())); 4446 // noSuchMethod of class Object.
4447 const int kNumArguments = 2;
4448 ArgumentsDescriptor args_desc(
4449 Array::ZoneHandle(Z, ArgumentsDescriptor::New(kNumArguments)));
4450 Function& no_such_method_func = Function::ZoneHandle(Z,
4451 Resolver::ResolveDynamicForReceiverClass(target_class,
4452 Symbols::NoSuchMethod(),
4453 args_desc));
4454 if (no_such_method_func.IsNull()) {
4455 const Class& object_class =
4456 Class::ZoneHandle(Z, isolate()->object_store()->object_class());
4457 no_such_method_func =
4458 Resolver::ResolveDynamicForReceiverClass(object_class,
4459 Symbols::NoSuchMethod(),
4460 args_desc);
4461 }
4447 // We are guaranteed to find noSuchMethod of class Object. 4462 // We are guaranteed to find noSuchMethod of class Object.
4448 ASSERT(!no_such_method_func.IsNull()); 4463 ASSERT(!no_such_method_func.IsNull());
4449 ZoneGrowableArray<PushArgumentInstr*>* push_arguments = 4464 ZoneGrowableArray<PushArgumentInstr*>* push_arguments =
4450 new(Z) ZoneGrowableArray<PushArgumentInstr*>(2); 4465 new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
4451 BuildPushArguments(*args, push_arguments); 4466 BuildPushArguments(*args, push_arguments);
4452 return new(Z) StaticCallInstr(args_pos, 4467 return new(Z) StaticCallInstr(args_pos,
4453 no_such_method_func, 4468 no_such_method_func,
4454 Object::null_array(), 4469 Object::null_array(),
4455 push_arguments, 4470 push_arguments,
4456 owner()->ic_data_array()); 4471 owner()->ic_data_array());
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4668 Script::Handle(function.script()), 4683 Script::Handle(function.script()),
4669 function.token_pos(), 4684 function.token_pos(),
4670 Report::AtLocation, 4685 Report::AtLocation,
4671 "FlowGraphBuilder Bailout: %s %s", 4686 "FlowGraphBuilder Bailout: %s %s",
4672 String::Handle(function.name()).ToCString(), 4687 String::Handle(function.name()).ToCString(),
4673 reason); 4688 reason);
4674 UNREACHABLE(); 4689 UNREACHABLE();
4675 } 4690 }
4676 4691
4677 } // namespace dart 4692 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698