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

Unified Diff: runtime/vm/code_generator.cc

Issue 1371453002: Precompile invoke-field-dispatchers for closures. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 00694f1417c927fd2d5df1de0a03f9fc3be56d11..c3624ce349b1e6dbe8c154e79cbed712002b4eea 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -737,7 +737,6 @@ static bool ResolveCallThroughGetter(const Instance& receiver,
const String& target_name,
const Array& arguments_descriptor,
Function* result) {
- ASSERT(FLAG_lazy_dispatchers);
// 1. Check if there is a getter with the same name.
const String& getter_name = String::Handle(Field::GetterName(target_name));
const int kNumArguments = 1;
@@ -761,8 +760,9 @@ static bool ResolveCallThroughGetter(const Instance& receiver,
Function::Handle(cache_class.GetInvocationDispatcher(
target_name,
arguments_descriptor,
- RawFunction::kInvokeFieldDispatcher));
- ASSERT(!target_function.IsNull());
+ RawFunction::kInvokeFieldDispatcher,
+ FLAG_lazy_dispatchers));
+ ASSERT(!target_function.IsNull() || !FLAG_lazy_dispatchers);
if (FLAG_trace_ic) {
OS::PrintErr("InvokeField IC miss: adding <%s> id:%" Pd " -> <%s>\n",
Class::Handle(receiver.clazz()).ToCString(),
@@ -778,10 +778,6 @@ static bool ResolveCallThroughGetter(const Instance& receiver,
RawFunction* InlineCacheMissHelper(
const Instance& receiver,
const ICData& ic_data) {
- if (!FLAG_lazy_dispatchers) {
- return Function::null(); // We'll handle it in the runtime.
- }
-
const Array& args_descriptor = Array::Handle(ic_data.arguments_descriptor());
const Class& receiver_class = Class::Handle(receiver.clazz());
@@ -798,7 +794,8 @@ RawFunction* InlineCacheMissHelper(
Function::Handle(receiver_class.GetInvocationDispatcher(
target_name,
args_descriptor,
- RawFunction::kNoSuchMethodDispatcher));
+ RawFunction::kNoSuchMethodDispatcher,
+ FLAG_lazy_dispatchers));
if (FLAG_trace_ic) {
OS::PrintErr("NoSuchMethod IC miss: adding <%s> id:%" Pd " -> <%s>\n",
Class::Handle(receiver.clazz()).ToCString(),
@@ -807,6 +804,9 @@ RawFunction* InlineCacheMissHelper(
}
result = target_function.raw();
}
+ // May be null if --no-lazy-dispatchers, in which case dispatch will be
+ // handled by InvokeNoSuchMethodDispatcher.
+ ASSERT(!result.IsNull() || !FLAG_lazy_dispatchers);
return result.raw();
}
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698