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

Side by Side Diff: runtime/vm/become.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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/benchmark_test.cc » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 "vm/become.h" 5 #include "vm/become.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 9
10 #include "vm/dart_api_state.h" 10 #include "vm/dart_api_state.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 OS::PrintErr("AFTER OBJECT AS STRING=%s\n", obj.ToCString()); 208 OS::PrintErr("AFTER OBJECT AS STRING=%s\n", obj.ToCString());
209 } 209 }
210 } 210 }
211 211
212 void Become::ElementsForwardIdentity(const Array& before, const Array& after) { 212 void Become::ElementsForwardIdentity(const Array& before, const Array& after) {
213 Thread* thread = Thread::Current(); 213 Thread* thread = Thread::Current();
214 Isolate* isolate = thread->isolate(); 214 Isolate* isolate = thread->isolate();
215 Heap* heap = isolate->heap(); 215 Heap* heap = isolate->heap();
216 216
217 TIMELINE_FUNCTION_GC_DURATION(thread, "Become::ElementsForwardIdentity"); 217 TIMELINE_FUNCTION_GC_DURATION(thread, "Become::ElementsForwardIdentity");
218 HeapIterationScope his; 218 HeapIterationScope his(thread);
219 219
220 // Setup forwarding pointers. 220 // Setup forwarding pointers.
221 ASSERT(before.Length() == after.Length()); 221 ASSERT(before.Length() == after.Length());
222 for (intptr_t i = 0; i < before.Length(); i++) { 222 for (intptr_t i = 0; i < before.Length(); i++) {
223 RawObject* before_obj = before.At(i); 223 RawObject* before_obj = before.At(i);
224 RawObject* after_obj = after.At(i); 224 RawObject* after_obj = after.At(i);
225 225
226 if (before_obj == after_obj) { 226 if (before_obj == after_obj) {
227 FATAL("become: Cannot self-forward"); 227 FATAL("become: Cannot self-forward");
228 } 228 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 290 }
291 291
292 #if defined(DEBUG) 292 #if defined(DEBUG)
293 for (intptr_t i = 0; i < before.Length(); i++) { 293 for (intptr_t i = 0; i < before.Length(); i++) {
294 ASSERT(before.At(i) == after.At(i)); 294 ASSERT(before.At(i) == after.At(i));
295 } 295 }
296 #endif 296 #endif
297 } 297 }
298 298
299 } // namespace dart 299 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/benchmark_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698