| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index 2456ed6b1defb6ad7f97bc4650d3a575828b11ee..927ad6e8ba73c7c00c380e63cef6737a0b1b64a8 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -11414,6 +11414,51 @@ RawError* Library::CompileAll() {
|
| }
|
|
|
|
|
| +RawError* Library::ParseAll(Thread* thread) {
|
| + Zone* zone = thread->zone();
|
| + Error& error = Error::Handle(zone);
|
| + Isolate* isolate = thread->isolate();
|
| + const GrowableObjectArray& libs = GrowableObjectArray::Handle(
|
| + isolate->object_store()->libraries());
|
| + Library& lib = Library::Handle(zone);
|
| + Class& cls = Class::Handle(zone);
|
| + for (int i = 0; i < libs.Length(); i++) {
|
| + lib ^= libs.At(i);
|
| + ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
|
| + while (it.HasNext()) {
|
| + cls = it.GetNextClass();
|
| + error = cls.EnsureIsFinalized(thread);
|
| + if (!error.IsNull()) {
|
| + return error.raw();
|
| + }
|
| + error = Compiler::ParseAllFunctions(cls);
|
| + if (!error.IsNull()) {
|
| + return error.raw();
|
| + }
|
| + }
|
| + }
|
| +
|
| + // 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".
|
| + const GrowableObjectArray& closures = GrowableObjectArray::Handle(zone,
|
| + Isolate::Current()->object_store()->closure_functions());
|
| + Function& func = Function::Handle(zone);
|
| + for (int i = 0; i < closures.Length(); i++) {
|
| + func ^= closures.At(i);
|
| + if (!func.HasCode()) {
|
| + error = Compiler::ParseFunction(thread, func);
|
| + if (!error.IsNull()) {
|
| + return error.raw();
|
| + }
|
| + func.ClearICDataArray();
|
| + func.ClearCode();
|
| + }
|
| + }
|
| + return error.raw();
|
| +}
|
| +
|
| +
|
| // Return Function::null() if function does not exist in libs.
|
| RawFunction* Library::GetFunction(const GrowableArray<Library*>& libs,
|
| const char* class_name,
|
|
|