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

Unified Diff: runtime/vm/compiler.cc

Issue 1436243005: Collect closure functions in isolate (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 731699811a6446281dbc04293786c9b702ef7ae5..51a9477890d382154820f3a11ea8e10be56f2ff0 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1307,22 +1307,22 @@ RawError* Compiler::CompileAllFunctions(const Class& cls) {
func.ClearCode();
}
}
+
// Inner functions get added to the closures array. As part of compilation
// more closures can be added to the end of the array. Compile all the
// closures until we have reached the end of the "worklist".
- GrowableObjectArray& closures =
- GrowableObjectArray::Handle(zone, cls.closures());
- if (!closures.IsNull()) {
- for (int i = 0; i < closures.Length(); i++) {
- func ^= closures.At(i);
- if (!func.HasCode()) {
- error = CompileFunction(thread, func);
- if (!error.IsNull()) {
- return error.raw();
- }
- func.ClearICDataArray();
- func.ClearCode();
+ const GrowableObjectArray& closures =
+ GrowableObjectArray::Handle(zone,
+ Isolate::Current()->object_store()->closure_functions());
+ for (int i = 0; i < closures.Length(); i++) {
+ func ^= closures.At(i);
+ if ((func.Owner() == cls.raw()) && !func.HasCode()) {
+ error = CompileFunction(thread, func);
+ if (!error.IsNull()) {
+ return error.raw();
}
+ func.ClearICDataArray();
+ func.ClearCode();
}
}
return error.raw();

Powered by Google App Engine
This is Rietveld 408576698