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

Unified Diff: runtime/vm/precompiler.cc

Issue 1404163002: VM: Precompile method extractors for implicit and explicit closurization. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed missing precompiled functions with hash-closurization Created 5 years, 2 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/precompiler.h ('k') | runtime/vm/resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index f061da02c6905080a973bca7316e9dec985b45da..933e7e52f64fba9e28df5276010105d495d12361 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -509,7 +509,6 @@ void Precompiler::CheckForNewDynamicFunctions() {
Class& cls = Class::Handle(Z);
Array& functions = Array::Handle(Z);
Function& function = Function::Handle(Z);
- Function& function2 = Function::Handle(Z);
String& selector = String::Handle(Z);
String& selector2 = String::Handle(Z);
String& selector3 = String::Handle(Z);
@@ -581,6 +580,8 @@ void Precompiler::CheckForNewDynamicFunctions() {
// Call-through-getter.
// Function is get:foo and somewhere foo is called.
AddFunction(function);
+
+ AddImplicitClosure(function, selector3);
rmacnak 2015/10/14 17:07:33 This one wants an invoke-field dispatcher, not a m
Florian Schneider 2015/10/14 17:55:54 Yes, I wrongly thought I missed a case here, but I
}
selector3 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
selector2);
@@ -589,8 +590,7 @@ void Precompiler::CheckForNewDynamicFunctions() {
// Function is get:foo and somewhere get:#foo is called.
AddFunction(function);
- function2 = function.ImplicitClosureFunction();
- AddFunction(function2);
+ AddImplicitClosure(function, selector3);
}
} else if (Field::IsSetterName(selector)) {
selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
@@ -600,24 +600,21 @@ void Precompiler::CheckForNewDynamicFunctions() {
// Function is set:foo and somewhere get:#set:foo is called.
AddFunction(function);
- function2 = function.ImplicitClosureFunction();
- AddFunction(function2);
+ AddImplicitClosure(function, selector2);
}
} else if (function.kind() == RawFunction::kRegularFunction) {
selector2 = Field::LookupGetterSymbol(selector);
if (IsSent(selector2)) {
// Closurization.
// Function is foo and somewhere get:foo is called.
- function2 = function.ImplicitClosureFunction();
- AddFunction(function2);
+ AddImplicitClosure(function, selector2);
}
selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
selector);
if (IsSent(selector2)) {
// Hash-closurization.
// Function is foo and somewhere get:#foo is called.
- function2 = function.ImplicitClosureFunction();
- AddFunction(function2);
+ AddImplicitClosure(function, selector2);
}
}
}
@@ -626,6 +623,13 @@ void Precompiler::CheckForNewDynamicFunctions() {
}
+void Precompiler::AddImplicitClosure(const Function& function,
+ const String& selector) {
+ AddFunction(Function::Handle(function.ImplicitClosureFunction()));
rmacnak 2015/10/14 17:07:34 Handle(Z, ...
Florian Schneider 2015/10/14 17:55:54 I removed this helper again to not create extra ha
+ AddFunction(Function::Handle(function.GetMethodExtractor(selector)));
+}
+
+
void Precompiler::DropUncompiledFunctions() {
Library& lib = Library::Handle(Z);
Class& cls = Class::Handle(Z);
« no previous file with comments | « runtime/vm/precompiler.h ('k') | runtime/vm/resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698