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

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

Issue 1263513002: VM: Load allocation-top and -end via Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed cc tests Created 5 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
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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 446
447 447
448 void Heap::WriteProtect(bool read_only) { 448 void Heap::WriteProtect(bool read_only) {
449 read_only_ = read_only; 449 read_only_ = read_only;
450 new_space_.WriteProtect(read_only); 450 new_space_.WriteProtect(read_only);
451 old_space_.WriteProtect(read_only); 451 old_space_.WriteProtect(read_only);
452 } 452 }
453 453
454 454
455 uword Heap::TopAddress(Heap::Space space) {
456 if (space == kNew) {
457 return reinterpret_cast<uword>(new_space_.TopAddress());
458 } else {
459 ASSERT(space == kPretenured);
460 return reinterpret_cast<uword>(old_space_.TopAddress());
461 }
462 }
463
464
465 uword Heap::EndAddress(Heap::Space space) {
466 if (space == kNew) {
467 return reinterpret_cast<uword>(new_space_.EndAddress());
468 } else {
469 ASSERT(space == kPretenured);
470 return reinterpret_cast<uword>(old_space_.EndAddress());
471 }
472 }
473
474
475 Heap::Space Heap::SpaceForAllocation(intptr_t cid) { 455 Heap::Space Heap::SpaceForAllocation(intptr_t cid) {
476 return FLAG_pretenure_all ? kPretenured : kNew; 456 return FLAG_pretenure_all ? kPretenured : kNew;
477 } 457 }
478 458
479 459
480 intptr_t Heap::TopOffset(Heap::Space space) { 460 intptr_t Heap::TopOffset(Heap::Space space) {
481 if (space == kNew) { 461 if (space == kNew) {
482 return OFFSET_OF(Heap, new_space_) + Scavenger::top_offset(); 462 return OFFSET_OF(Heap, new_space_) + Scavenger::top_offset();
483 } else { 463 } else {
484 ASSERT(space == kPretenured); 464 ASSERT(space == kPretenured);
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 heap->DisableGrowthControl(); 765 heap->DisableGrowthControl();
786 } 766 }
787 767
788 768
789 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { 769 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
790 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); 770 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
791 heap->SetGrowthControlState(current_growth_controller_state_); 771 heap->SetGrowthControlState(current_growth_controller_state_);
792 } 772 }
793 773
794 } // namespace dart 774 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698