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

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

Issue 915093005: Fix flaky disassembler crashes: do not call FindObject while concurrently sweeping. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) const { 246 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) const {
247 // Only executable pages can have RawInstructions objects. 247 // Only executable pages can have RawInstructions objects.
248 RawObject* raw_obj = old_space_->FindObject(visitor, HeapPage::kExecutable); 248 RawObject* raw_obj = old_space_->FindObject(visitor, HeapPage::kExecutable);
249 ASSERT((raw_obj == Object::null()) || 249 ASSERT((raw_obj == Object::null()) ||
250 (raw_obj->GetClassId() == kInstructionsCid)); 250 (raw_obj->GetClassId() == kInstructionsCid));
251 return reinterpret_cast<RawInstructions*>(raw_obj); 251 return reinterpret_cast<RawInstructions*>(raw_obj);
252 } 252 }
253 253
254 254
255 RawObject* Heap::FindOldObject(FindObjectVisitor* visitor) const { 255 RawObject* Heap::FindOldObject(FindObjectVisitor* visitor) const {
256 // Wait for any concurrent GC tasks to finish before walking.
257 MonitorLocker ml(old_space_->tasks_lock());
258 while (old_space_->tasks() > 0) {
259 ml.Wait();
260 }
256 return old_space_->FindObject(visitor, HeapPage::kData); 261 return old_space_->FindObject(visitor, HeapPage::kData);
257 } 262 }
258 263
259 264
260 RawObject* Heap::FindNewObject(FindObjectVisitor* visitor) const { 265 RawObject* Heap::FindNewObject(FindObjectVisitor* visitor) const {
261 return new_space_->FindObject(visitor); 266 return new_space_->FindObject(visitor);
262 } 267 }
263 268
264 269
265 RawObject* Heap::FindObject(FindObjectVisitor* visitor) const { 270 RawObject* Heap::FindObject(FindObjectVisitor* visitor) const {
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 heap->DisableGrowthControl(); 734 heap->DisableGrowthControl();
730 } 735 }
731 736
732 737
733 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { 738 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
734 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); 739 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
735 heap->SetGrowthControlState(current_growth_controller_state_); 740 heap->SetGrowthControlState(current_growth_controller_state_);
736 } 741 }
737 742
738 } // namespace dart 743 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698