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

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

Issue 1212943010: Safer interface for heap iteration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix release mode. Created 5 years, 5 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
« no previous file with comments | « no previous file | runtime/vm/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698