OLD | NEW |
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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1515 RETURN_NULL_ERROR(isolate_snapshot_size); | 1515 RETURN_NULL_ERROR(isolate_snapshot_size); |
1516 } | 1516 } |
1517 // Finalize all classes if needed. | 1517 // Finalize all classes if needed. |
1518 Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate); | 1518 Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate); |
1519 if (::Dart_IsError(state)) { | 1519 if (::Dart_IsError(state)) { |
1520 return state; | 1520 return state; |
1521 } | 1521 } |
1522 isolate->heap()->CollectAllGarbage(); | 1522 isolate->heap()->CollectAllGarbage(); |
1523 #if defined(DEBUG) | 1523 #if defined(DEBUG) |
1524 FunctionVisitor check_canonical(isolate); | 1524 FunctionVisitor check_canonical(isolate); |
1525 isolate->heap()->VisitObjects(&check_canonical); | 1525 isolate->heap()->IterateObjects(&check_canonical); |
1526 #endif // #if defined(DEBUG). | 1526 #endif // #if defined(DEBUG). |
1527 | 1527 |
1528 // Since this is only a snapshot the root library should not be set. | 1528 // Since this is only a snapshot the root library should not be set. |
1529 isolate->object_store()->set_root_library(Library::Handle(isolate)); | 1529 isolate->object_store()->set_root_library(Library::Handle(isolate)); |
1530 FullSnapshotWriter writer(vm_isolate_snapshot_buffer, | 1530 FullSnapshotWriter writer(vm_isolate_snapshot_buffer, |
1531 isolate_snapshot_buffer, | 1531 isolate_snapshot_buffer, |
1532 ApiReallocate); | 1532 ApiReallocate); |
1533 writer.WriteFullSnapshot(); | 1533 writer.WriteFullSnapshot(); |
1534 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); | 1534 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); |
1535 *isolate_snapshot_size = writer.IsolateSnapshotSize(); | 1535 *isolate_snapshot_size = writer.IsolateSnapshotSize(); |
(...skipping 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5787 ASSERT(stream != NULL); | 5787 ASSERT(stream != NULL); |
5788 TimelineEvent* event = stream->StartEvent(); | 5788 TimelineEvent* event = stream->StartEvent(); |
5789 if (event != NULL) { | 5789 if (event != NULL) { |
5790 event->AsyncEnd(label, async_id); | 5790 event->AsyncEnd(label, async_id); |
5791 event->Complete(); | 5791 event->Complete(); |
5792 } | 5792 } |
5793 return Api::Success(); | 5793 return Api::Success(); |
5794 } | 5794 } |
5795 | 5795 |
5796 } // namespace dart | 5796 } // namespace dart |
OLD | NEW |