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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2995543004: [vm, gc] Require a safepoint for heap iteration. (Closed)
Patch Set: explicit-thread Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler_stats.cc ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 4bc1125f23058b732b486cee122f850f03dd89db..33ed0638759e34ba384a91dc60a14b15aee78be3 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1500,8 +1500,11 @@ Dart_CreateSnapshot(uint8_t** vm_snapshot_data_buffer,
#if defined(DEBUG)
I->heap()->CollectAllGarbage();
- CheckFunctionTypesVisitor check_canonical(T);
- I->heap()->IterateObjects(&check_canonical);
+ {
+ HeapIterationScope iteration(T);
+ CheckFunctionTypesVisitor check_canonical(T);
+ iteration.IterateObjects(&check_canonical);
+ }
#endif // #if defined(DEBUG)
Symbols::Compact(I);
@@ -1535,8 +1538,11 @@ Dart_CreateScriptSnapshot(uint8_t** script_snapshot_buffer,
#if defined(DEBUG)
I->heap()->CollectAllGarbage();
- CheckFunctionTypesVisitor check_canonical(T);
- I->heap()->IterateObjects(&check_canonical);
+ {
+ HeapIterationScope iteration(T);
+ CheckFunctionTypesVisitor check_canonical(T);
+ iteration.IterateObjects(&check_canonical);
+ }
#endif // #if defined(DEBUG)
ScriptSnapshotWriter writer(script_snapshot_buffer, ApiReallocate);
« no previous file with comments | « runtime/vm/compiler_stats.cc ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698