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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2995543004: [vm, gc] Require a safepoint for heap iteration. (Closed)
Patch Set: . 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
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..833de58b4a2277ef0ed27e2b50f8c8bc5c4087f0 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;
+ 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;
+ CheckFunctionTypesVisitor check_canonical(T);
+ iteration.IterateObjects(&check_canonical);
+ }
#endif // #if defined(DEBUG)
ScriptSnapshotWriter writer(script_snapshot_buffer, ApiReallocate);

Powered by Google App Engine
This is Rietveld 408576698