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

Unified Diff: vm/dart_api_impl.cc

Issue 8970004: Changes to create an application snapshot which can be layered on top (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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: vm/dart_api_impl.cc
===================================================================
--- vm/dart_api_impl.cc (revision 2543)
+++ vm/dart_api_impl.cc (working copy)
@@ -613,6 +613,7 @@
intptr_t* size) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
+ TIMERSCOPE(time_creating_snapshot);
if (buffer == NULL) {
return Api::Error("%s expects argument 'buffer' to be non-null.",
CURRENT_FUNC);
@@ -640,6 +641,7 @@
intptr_t* size) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
+ TIMERSCOPE(time_creating_snapshot);
if (buffer == NULL) {
return Api::Error("%s expects argument 'buffer' to be non-null.",
CURRENT_FUNC);
@@ -656,8 +658,8 @@
if (msg != NULL) {
return Api::Error(msg);
}
- ScriptSnapshotWriter writer(root_lib, buffer, ApiAllocator);
- writer.WriteScriptSnapshot();
+ ScriptSnapshotWriter writer(buffer, ApiAllocator);
+ writer.WriteScriptSnapshot(root_lib);
*size = writer.Size();
return Api::Success();
}
@@ -2287,6 +2289,7 @@
DART_EXPORT Dart_Handle Dart_LoadScriptFromSnapshot(const uint8_t* buffer) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
+ TIMERSCOPE(time_script_loading);
if (buffer == NULL) {
return Api::Error("%s expects argument 'buffer' to be non-null.",
CURRENT_FUNC);
@@ -2309,6 +2312,7 @@
CURRENT_FUNC);
}
library ^= tmp.raw();
+ library.Register();
isolate->object_store()->set_root_library(library);
return Api::NewLocalHandle(library);
}

Powered by Google App Engine
This is Rietveld 408576698