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

Unified Diff: runtime/vm/dart.cc

Issue 1123813002: Move symbol table from per isolate snapshot to vm isolate snapshot, this reduces the per isolate in… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 months 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/benchmark_test.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
===================================================================
--- runtime/vm/dart.cc (revision 45789)
+++ runtime/vm/dart.cc (working copy)
@@ -131,7 +131,34 @@
StubCode::InitOnce();
// Now that the needed stub has been generated, set the stack limit.
vm_isolate_->InitializeStackLimit();
- Symbols::InitOnce(vm_isolate_);
+ if (vm_isolate_snapshot != NULL) {
+ const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot);
+ if (snapshot == NULL) {
+ return "Invalid vm isolate snapshot seen.";
+ }
+ ASSERT(snapshot->kind() == Snapshot::kFull);
+ VmIsolateSnapshotReader reader(snapshot->content(),
+ snapshot->length(),
+ zone.GetZone());
+ const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot());
+ if (!error.IsNull()) {
+ return error.ToCString();
+ }
+ if (FLAG_trace_isolates) {
+ OS::Print("Size of vm isolate snapshot = %" Pd "\n",
+ snapshot->length());
+ vm_isolate_->heap()->PrintSizes();
+ vm_isolate_->megamorphic_cache_table()->PrintSizes();
+ intptr_t size;
+ intptr_t capacity;
+ Symbols::GetStats(vm_isolate_, &size, &capacity);
+ OS::Print("VM Isolate: Number of symbols : %" Pd "\n", size);
+ OS::Print("VM Isolate: Symbol table capacity : %" Pd "\n", capacity);
+ }
+ Symbols::InitOnceFromSnapshot(vm_isolate_);
+ } else {
+ Symbols::InitOnce(vm_isolate_);
+ }
Scanner::InitOnce();
#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
// Dart VM requires at least SSE2.
@@ -139,11 +166,10 @@
return "SSE2 is required.";
}
#endif
- if (vm_isolate_snapshot != NULL) {
- // Initializing the VM isolate from a snapshot is not implemented yet.
- USE(vm_isolate_snapshot);
- }
Object::FinalizeVMIsolate(vm_isolate_);
+#if defined(DEBUG)
+ vm_isolate_->heap()->Verify(kRequireMarked);
+#endif
}
// There is a planned and known asymmetry here: We enter one scope for the VM
// isolate so that we can allocate the "persistent" scoped handles for the
@@ -241,8 +267,10 @@
if (FLAG_trace_isolates) {
OS::Print("Size of isolate snapshot = %" Pd "\n", snapshot->length());
}
- SnapshotReader reader(snapshot->content(), snapshot->length(),
- Snapshot::kFull, isolate, zone.GetZone());
+ IsolateSnapshotReader reader(snapshot->content(),
+ snapshot->length(),
+ isolate,
+ zone.GetZone());
const Error& error = Error::Handle(reader.ReadFullSnapshot());
if (!error.IsNull()) {
return error.raw();
@@ -251,6 +279,12 @@
isolate->heap()->PrintSizes();
isolate->megamorphic_cache_table()->PrintSizes();
}
+ } else {
+ // Populate the isolate's symbol table with all symbols from the
+ // VM isolate. We do this so that when we generate a full snapshot
+ // for the isolate we have a unified symbol table that we can then
+ // read into the VM isolate.
+ Symbols::AddPredefinedSymbolsToIsolate();
}
Object::VerifyBuiltinVtables();
« no previous file with comments | « runtime/vm/benchmark_test.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698