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

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

Issue 1318803002: Toward precompiled snapshots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync again Created 5 years, 3 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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 I->heap()->CollectAllGarbage(); 1521 I->heap()->CollectAllGarbage();
1522 #if defined(DEBUG) 1522 #if defined(DEBUG)
1523 FunctionVisitor check_canonical(I); 1523 FunctionVisitor check_canonical(I);
1524 I->heap()->IterateObjects(&check_canonical); 1524 I->heap()->IterateObjects(&check_canonical);
1525 #endif // #if defined(DEBUG). 1525 #endif // #if defined(DEBUG).
1526 1526
1527 // Since this is only a snapshot the root library should not be set. 1527 // Since this is only a snapshot the root library should not be set.
1528 I->object_store()->set_root_library(Library::Handle(Z)); 1528 I->object_store()->set_root_library(Library::Handle(Z));
1529 FullSnapshotWriter writer(vm_isolate_snapshot_buffer, 1529 FullSnapshotWriter writer(vm_isolate_snapshot_buffer,
1530 isolate_snapshot_buffer, 1530 isolate_snapshot_buffer,
1531 NULL, /* instructions_snapshot_buffer */
1531 ApiReallocate, 1532 ApiReallocate,
1532 false /* snapshot_code */); 1533 false, /* snapshot_code */
1534 true /* vm_isolate_is_symbolic */);
1533 writer.WriteFullSnapshot(); 1535 writer.WriteFullSnapshot();
1534 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); 1536 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
1535 *isolate_snapshot_size = writer.IsolateSnapshotSize(); 1537 *isolate_snapshot_size = writer.IsolateSnapshotSize();
1536 return Api::Success(); 1538 return Api::Success();
1537 } 1539 }
1538 1540
1539 1541
1540 static Dart_Handle createLibrarySnapshot(Dart_Handle library, 1542 static Dart_Handle createLibrarySnapshot(Dart_Handle library,
1541 uint8_t** buffer, 1543 uint8_t** buffer,
1542 intptr_t* size) { 1544 intptr_t* size) {
(...skipping 4318 matching lines...) Expand 10 before | Expand all | Expand 10 after
5861 ASSERT(stream != NULL); 5863 ASSERT(stream != NULL);
5862 TimelineEvent* event = stream->StartEvent(); 5864 TimelineEvent* event = stream->StartEvent();
5863 if (event != NULL) { 5865 if (event != NULL) {
5864 event->AsyncEnd(label, async_id); 5866 event->AsyncEnd(label, async_id);
5865 event->Complete(); 5867 event->Complete();
5866 } 5868 }
5867 return Api::Success(); 5869 return Api::Success();
5868 } 5870 }
5869 5871
5870 } // namespace dart 5872 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698