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

Unified Diff: runtime/vm/kernel_reader.cc

Issue 2514373002: VM: [Kernel] Cherry-pick from dart-lang/kernel_sdk (Closed)
Patch Set: Rebased Created 4 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
« no previous file with comments | « runtime/vm/kernel_reader.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_reader.cc
diff --git a/runtime/vm/kernel_reader.cc b/runtime/vm/kernel_reader.cc
index 4cc9e75d8331f912fd7533ece02ddc5f9ae0f544..c6894b5d2cc5047e809793a999191c92524478af 100644
--- a/runtime/vm/kernel_reader.cc
+++ b/runtime/vm/kernel_reader.cc
@@ -103,8 +103,7 @@ Program* KernelReader::ReadPrecompiledProgram() {
}
Object& KernelReader::ReadProgram() {
- ASSERT(!bootstrapping_);
- Program* program = ReadPrecompiledProgram();
+ Program* program = ReadPrecompiledKernelFromBuffer(buffer_, buffer_length_);
if (program == NULL) {
const dart::String& error = H.DartString("Failed to read .kernell file");
return Object::Handle(Z, ApiError::New(error));
@@ -174,10 +173,6 @@ void KernelReader::ReadLibrary(Library* kernel_library) {
TokenPosition::kNoSource));
toplevel_class.set_is_cycle_free();
library.set_toplevel_class(toplevel_class);
- if (bootstrapping_) {
- GrowableObjectArray::Handle(Z, I->object_store()->pending_classes())
- .Add(toplevel_class, Heap::kOld);
- }
ActiveClassScope active_class_scope(&active_class_, NULL, &toplevel_class);
// Load toplevel fields.
@@ -215,6 +210,8 @@ void KernelReader::ReadLibrary(Library* kernel_library) {
Class* kernel_klass = kernel_library->classes()[i];
classes.Add(ReadClass(library, kernel_klass), Heap::kOld);
}
+
+ classes.Add(toplevel_class, Heap::kOld);
}
@@ -350,10 +347,8 @@ dart::Class& KernelReader::ReadClass(const dart::Library& library,
ReadProcedure(library, klass, kernel_procedure, kernel_klass);
}
- if (bootstrapping_ && !klass.is_marked_for_parsing()) {
+ if (!klass.is_marked_for_parsing()) {
klass.set_is_marked_for_parsing();
- GrowableObjectArray::Handle(Z, I->object_store()->pending_classes())
- .Add(klass, Heap::kOld);
}
return klass;
@@ -672,7 +667,7 @@ dart::Class& KernelReader::LookupClass(Class* klass) {
// we do not risk allocating the class again by calling LookupClass
// recursively from ReadPreliminaryClass for the same class.
classes_.Insert(klass, handle);
- if (!handle->is_type_finalized()) {
+ if (!handle->is_cycle_free()) {
ReadPreliminaryClass(handle, klass);
}
}
« no previous file with comments | « runtime/vm/kernel_reader.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698