OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |