| 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);
|
| }
|
|
|