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

Unified Diff: runtime/vm/resolver.cc

Issue 1195573006: Handle field-invocation and method-extraction in the runtime when --lazy_dispatchers=false. (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/parser.cc ('k') | tests/language/closure_self_reference_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/resolver.cc
diff --git a/runtime/vm/resolver.cc b/runtime/vm/resolver.cc
index 89d9ff6bebdc0f5dd7bfeb7718ce4d1f3fa193d2..954f34076d069794050032ec65bd8c87f0e6a889 100644
--- a/runtime/vm/resolver.cc
+++ b/runtime/vm/resolver.cc
@@ -14,7 +14,7 @@
namespace dart {
DEFINE_FLAG(bool, trace_resolving, false, "Trace resolving.");
-
+DECLARE_FLAG(bool, lazy_dispatchers);
// The actual names of named arguments are not checked by the dynamic resolver,
// but by the method entry code. It is important that the dynamic resolver
@@ -66,6 +66,7 @@ RawFunction* Resolver::ResolveDynamicForReceiverClass(
// owning method M.
static RawFunction* CreateMethodExtractor(const String& getter_name,
const Function& method) {
+ ASSERT(FLAG_lazy_dispatchers);
const Function& closure_function =
Function::Handle(method.ImplicitClosureFunction());
@@ -124,13 +125,15 @@ RawFunction* Resolver::ResolveDynamicAnyArgs(
return function.raw();
}
// Getter invocation might actually be a method extraction.
- if (is_getter && function.IsNull()) {
- function ^= cls.LookupDynamicFunction(field_name);
- if (!function.IsNull()) {
- // We were looking for the getter but found a method with the same name.
- // Create a method extractor and return it.
- function ^= CreateMethodExtractor(function_name, function);
- return function.raw();
+ if (FLAG_lazy_dispatchers) {
+ if (is_getter && function.IsNull()) {
+ function ^= cls.LookupDynamicFunction(field_name);
+ if (!function.IsNull()) {
+ // We were looking for the getter but found a method with the same
+ // name. Create a method extractor and return it.
+ function ^= CreateMethodExtractor(function_name, function);
+ return function.raw();
+ }
}
}
cls = cls.SuperClass();
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/language/closure_self_reference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698