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

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

Issue 14158003: Fix bug introduced by r21269. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « runtime/vm/pages.h ('k') | 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/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 127
128 PageSpace::~PageSpace() { 128 PageSpace::~PageSpace() {
129 FreePages(pages_); 129 FreePages(pages_);
130 FreePages(large_pages_); 130 FreePages(large_pages_);
131 } 131 }
132 132
133 133
134 intptr_t PageSpace::LargePageSizeFor(intptr_t size) { 134 intptr_t PageSpace::LargePageSizeFor(intptr_t size) {
135 intptr_t page_size = Utils::RoundUp(size + sizeof(HeapPage), 135 intptr_t page_size = Utils::RoundUp(size + HeapPage::ObjectStartOffset(),
136 VirtualMemory::PageSize()); 136 VirtualMemory::PageSize());
137 return page_size; 137 return page_size;
138 } 138 }
139 139
140 140
141 HeapPage* PageSpace::AllocatePage(HeapPage::PageType type) { 141 HeapPage* PageSpace::AllocatePage(HeapPage::PageType type) {
142 HeapPage* page = HeapPage::Allocate(kPageSize, type); 142 HeapPage* page = HeapPage::Allocate(kPageSize, type);
143 if (pages_ == NULL) { 143 if (pages_ == NULL) {
144 pages_ = page; 144 pages_ = page;
145 } else { 145 } else {
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 return 0; 617 return 0;
618 } else { 618 } else {
619 ASSERT(total_time >= gc_time); 619 ASSERT(total_time >= gc_time);
620 int result= static_cast<int>((static_cast<double>(gc_time) / 620 int result= static_cast<int>((static_cast<double>(gc_time) /
621 static_cast<double>(total_time)) * 100); 621 static_cast<double>(total_time)) * 100);
622 return result; 622 return result;
623 } 623 }
624 } 624 }
625 625
626 } // namespace dart 626 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/pages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698