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

Unified Diff: runtime/vm/dart_entry.cc

Issue 1191813002: Port "Add flag to disable lazy compilation of invocation dispatchers." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/stack_frame_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 10c194bf8b265bdd7da6b422a6f62df679255c43..9a1ea76cde1e9b59be5b0b1699cae06e24070d08 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -16,6 +16,8 @@
namespace dart {
+DECLARE_FLAG(bool, lazy_dispatchers);
+
// A cache of VM heap allocated arguments descriptors.
RawArray* ArgumentsDescriptor::cached_args_descriptors_[kCachedDescriptorCount];
@@ -187,10 +189,19 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver,
const int kNumArguments = 2;
ArgumentsDescriptor args_desc(
Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
- const Function& function = Function::Handle(
+ Function& function = Function::Handle(
Resolver::ResolveDynamic(receiver,
Symbols::NoSuchMethod(),
args_desc));
+ if (function.IsNull()) {
+ ASSERT(!FLAG_lazy_dispatchers);
+ // If noSuchMethod(invocation) is not found, call Object::noSuchMethod.
+ Isolate* isolate = Isolate::Current();
+ function ^= Resolver::ResolveDynamicForReceiverClass(
+ Class::Handle(isolate, isolate->object_store()->object_class()),
+ Symbols::NoSuchMethod(),
+ args_desc);
+ }
ASSERT(!function.IsNull());
const Array& args = Array::Handle(Array::New(kNumArguments));
args.SetAt(0, receiver);
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/stack_frame_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698