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

Unified Diff: runtime/vm/pages.cc

Issue 10810048: Revert "Revert "Favor free list allocation to bump pointer allocation."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/freelist.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 6515f983a1f9024287376bceb0b15a1770b46c4b..e4a9964adf6ff663ca37cb637ee6cedb32ee3156 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -18,6 +18,10 @@ DEFINE_FLAG(int, heap_growth_time_ratio, 3,
"The desired maximum percentage of time spent in GC");
DEFINE_FLAG(int, heap_growth_rate, 4,
"The size the heap is grown, in heap pages");
+DEFINE_FLAG(bool, print_free_list_before_gc, false,
+ "Print free list statistics before a GC");
+DEFINE_FLAG(bool, print_free_list_after_gc, false,
+ "Print free list statistics after a GC");
HeapPage* HeapPage::Initialize(VirtualMemory* memory, bool is_executable) {
ASSERT(memory->size() > VirtualMemory::PageSize());
@@ -212,9 +216,9 @@ uword PageSpace::TryAllocate(intptr_t size, GrowthPolicy growth_policy) {
ASSERT(Utils::IsAligned(size, kObjectAlignment));
uword result = 0;
if (size < kAllocatablePageSize) {
- result = TryBumpAllocate(size);
+ result = freelist_.TryAllocate(size);
if (result == 0) {
- result = freelist_.TryAllocate(size);
+ result = TryBumpAllocate(size);
if ((result == 0) &&
(page_space_controller_.CanGrowPageSpace(size) ||
growth_policy == kForceGrowth) &&
@@ -343,6 +347,10 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
Isolate* isolate = Isolate::Current();
NoHandleScope no_handles(isolate);
+ if (FLAG_print_free_list_before_gc) {
+ freelist_.Print();
+ }
+
if (FLAG_verify_before_gc) {
OS::PrintErr("Verifying before MarkSweep...");
heap_->Verify();
@@ -415,6 +423,10 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
(capacity_ + KB2) / KB);
}
+ if (FLAG_print_free_list_after_gc) {
+ freelist_.Print();
+ }
+
if (FLAG_verify_after_gc) {
OS::PrintErr("Verifying after MarkSweep...");
heap_->Verify();
« no previous file with comments | « runtime/vm/freelist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698