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

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

Issue 1776243002: Fix incorrect assertion failures in noopt regarding removing classes that still have constants. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « runtime/vm/heap.h ('k') | runtime/vm/precompiler.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) 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 } 439 }
440 440
441 441
442 void Heap::CollectAllGarbage() { 442 void Heap::CollectAllGarbage() {
443 Thread* thread = Thread::Current(); 443 Thread* thread = Thread::Current();
444 CollectNewSpaceGarbage(thread, kInvokeApiCallbacks, kFull); 444 CollectNewSpaceGarbage(thread, kInvokeApiCallbacks, kFull);
445 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kFull); 445 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kFull);
446 } 446 }
447 447
448 448
449 #if defined(DEBUG)
450 void Heap::WaitForSweeperTasks() {
451 Thread* thread = Thread::Current();
452 {
453 MonitorLocker ml(old_space_.tasks_lock());
454 while (old_space_.tasks() > 0) {
455 ml.WaitWithSafepointCheck(thread);
456 }
457 }
458 }
459 #endif
460
461
449 bool Heap::ShouldPretenure(intptr_t class_id) const { 462 bool Heap::ShouldPretenure(intptr_t class_id) const {
450 if (class_id == kOneByteStringCid) { 463 if (class_id == kOneByteStringCid) {
451 return pretenure_policy_ > 0; 464 return pretenure_policy_ > 0;
452 } else { 465 } else {
453 return false; 466 return false;
454 } 467 }
455 } 468 }
456 469
457 470
458 void Heap::UpdatePretenurePolicy() { 471 void Heap::UpdatePretenurePolicy() {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); 854 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_);
842 } 855 }
843 856
844 857
845 WritableVMIsolateScope::~WritableVMIsolateScope() { 858 WritableVMIsolateScope::~WritableVMIsolateScope() {
846 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); 859 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
847 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); 860 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_);
848 } 861 }
849 862
850 } // namespace dart 863 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698