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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 1290933002: Toward precompiled snapshots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 isolate->heap()->CollectAllGarbage(); 1531 isolate->heap()->CollectAllGarbage();
1532 #if defined(DEBUG) 1532 #if defined(DEBUG)
1533 FunctionVisitor check_canonical(isolate); 1533 FunctionVisitor check_canonical(isolate);
1534 isolate->heap()->IterateObjects(&check_canonical); 1534 isolate->heap()->IterateObjects(&check_canonical);
1535 #endif // #if defined(DEBUG). 1535 #endif // #if defined(DEBUG).
1536 1536
1537 // Since this is only a snapshot the root library should not be set. 1537 // Since this is only a snapshot the root library should not be set.
1538 isolate->object_store()->set_root_library(Library::Handle(isolate)); 1538 isolate->object_store()->set_root_library(Library::Handle(isolate));
1539 FullSnapshotWriter writer(vm_isolate_snapshot_buffer, 1539 FullSnapshotWriter writer(vm_isolate_snapshot_buffer,
1540 isolate_snapshot_buffer, 1540 isolate_snapshot_buffer,
1541 ApiReallocate); 1541 ApiReallocate,
1542 false /* snapshot_code */);
1542 writer.WriteFullSnapshot(); 1543 writer.WriteFullSnapshot();
1543 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); 1544 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
1544 *isolate_snapshot_size = writer.IsolateSnapshotSize(); 1545 *isolate_snapshot_size = writer.IsolateSnapshotSize();
1545 return Api::Success(); 1546 return Api::Success();
1546 } 1547 }
1547 1548
1548 1549
1549 static Dart_Handle createLibrarySnapshot(Dart_Handle library, 1550 static Dart_Handle createLibrarySnapshot(Dart_Handle library,
1550 uint8_t** buffer, 1551 uint8_t** buffer,
1551 intptr_t* size) { 1552 intptr_t* size) {
(...skipping 4465 matching lines...) Expand 10 before | Expand all | Expand 10 after
6017 ASSERT(stream != NULL); 6018 ASSERT(stream != NULL);
6018 TimelineEvent* event = stream->StartEvent(); 6019 TimelineEvent* event = stream->StartEvent();
6019 if (event != NULL) { 6020 if (event != NULL) {
6020 event->AsyncEnd(label, async_id); 6021 event->AsyncEnd(label, async_id);
6021 event->Complete(); 6022 event->Complete();
6022 } 6023 }
6023 return Api::Success(); 6024 return Api::Success();
6024 } 6025 }
6025 6026
6026 } // namespace dart 6027 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698