Chromium Code Reviews| 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); |