| Index: runtime/vm/compiler.cc
|
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
|
| index f3d879a8c90bf2a28d645b2b1974441517858ac5..d7bbc3d73dd7852e6a3a2418c19bf209d191e641 100644
|
| --- a/runtime/vm/compiler.cc
|
| +++ b/runtime/vm/compiler.cc
|
| @@ -1333,22 +1333,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();
|
|
|