Index: src/heap.cc |
=================================================================== |
--- src/heap.cc (revision 5544) |
+++ src/heap.cc (working copy) |
@@ -63,8 +63,8 @@ |
CellSpace* Heap::cell_space_ = NULL; |
LargeObjectSpace* Heap::lo_space_ = NULL; |
-intptr_t Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit; |
-intptr_t Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit; |
+int Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit; |
+int Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit; |
int Heap::old_gen_exhausted_ = false; |
@@ -75,19 +75,19 @@ |
// a multiple of Page::kPageSize. |
#if defined(ANDROID) |
int Heap::max_semispace_size_ = 2*MB; |
-intptr_t Heap::max_old_generation_size_ = 192*MB; |
+int Heap::max_old_generation_size_ = 192*MB; |
int Heap::initial_semispace_size_ = 128*KB; |
-intptr_t Heap::code_range_size_ = 0; |
+size_t Heap::code_range_size_ = 0; |
#elif defined(V8_TARGET_ARCH_X64) |
int Heap::max_semispace_size_ = 16*MB; |
-intptr_t Heap::max_old_generation_size_ = 1*GB; |
+int Heap::max_old_generation_size_ = 1*GB; |
int Heap::initial_semispace_size_ = 1*MB; |
-intptr_t Heap::code_range_size_ = 512*MB; |
+size_t Heap::code_range_size_ = 512*MB; |
#else |
int Heap::max_semispace_size_ = 8*MB; |
-intptr_t Heap::max_old_generation_size_ = 512*MB; |
+int Heap::max_old_generation_size_ = 512*MB; |
int Heap::initial_semispace_size_ = 512*KB; |
-intptr_t Heap::code_range_size_ = 0; |
+size_t Heap::code_range_size_ = 0; |
#endif |
// The snapshot semispace size will be the default semispace size if |
@@ -108,7 +108,7 @@ |
// Will be 4 * reserved_semispace_size_ to ensure that young |
// generation can be aligned to its size. |
int Heap::survived_since_last_expansion_ = 0; |
-intptr_t Heap::external_allocation_limit_ = 0; |
+int Heap::external_allocation_limit_ = 0; |
Heap::HeapState Heap::gc_state_ = NOT_IN_GC; |
@@ -137,10 +137,10 @@ |
bool Heap::disallow_allocation_failure_ = false; |
#endif // DEBUG |
-intptr_t GCTracer::alive_after_last_gc_ = 0; |
+int GCTracer::alive_after_last_gc_ = 0; |
double GCTracer::last_gc_end_timestamp_ = 0.0; |
int GCTracer::max_gc_pause_ = 0; |
-intptr_t GCTracer::max_alive_after_gc_ = 0; |
+int GCTracer::max_alive_after_gc_ = 0; |
int GCTracer::min_in_mutator_ = kMaxInt; |
int Heap::Capacity() { |
@@ -289,46 +289,33 @@ |
#if defined(ENABLE_LOGGING_AND_PROFILING) |
void Heap::PrintShortHeapStatistics() { |
if (!FLAG_trace_gc_verbose) return; |
- PrintF("Memory allocator, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("Memory allocator, used: %8d, available: %8d\n", |
MemoryAllocator::Size(), |
MemoryAllocator::Available()); |
- PrintF("New space, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("New space, used: %8d, available: %8d\n", |
Heap::new_space_.Size(), |
new_space_.Available()); |
- PrintF("Old pointers, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d" |
- ", waste: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("Old pointers, used: %8d, available: %8d, waste: %8d\n", |
old_pointer_space_->Size(), |
old_pointer_space_->Available(), |
old_pointer_space_->Waste()); |
- PrintF("Old data space, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d" |
- ", waste: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("Old data space, used: %8d, available: %8d, waste: %8d\n", |
old_data_space_->Size(), |
old_data_space_->Available(), |
old_data_space_->Waste()); |
- PrintF("Code space, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d" |
- ", waste: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("Code space, used: %8d, available: %8d, waste: %8d\n", |
code_space_->Size(), |
code_space_->Available(), |
code_space_->Waste()); |
- PrintF("Map space, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d" |
- ", waste: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("Map space, used: %8d, available: %8d, waste: %8d\n", |
map_space_->Size(), |
map_space_->Available(), |
map_space_->Waste()); |
- PrintF("Cell space, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d" |
- ", waste: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("Cell space, used: %8d, available: %8d, waste: %8d\n", |
cell_space_->Size(), |
cell_space_->Available(), |
cell_space_->Waste()); |
- PrintF("Large object space, used: %8" V8_PTR_PREFIX "d" |
- ", available: %8" V8_PTR_PREFIX "d\n", |
+ PrintF("Large object space, used: %8d, avaialble: %8d\n", |
lo_space_->Size(), |
lo_space_->Available()); |
} |
@@ -377,8 +364,8 @@ |
#endif |
} |
-intptr_t Heap::SizeOfObjects() { |
- intptr_t total = 0; |
+int Heap::SizeOfObjects() { |
+ int total = 0; |
AllSpaces spaces; |
for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { |
total += space->Size(); |
@@ -975,7 +962,7 @@ |
DescriptorLookupCache::Clear(); |
// Used for updating survived_since_last_expansion_ at function end. |
- intptr_t survived_watermark = PromotedSpaceSize(); |
+ int survived_watermark = PromotedSpaceSize(); |
CheckNewSpaceExpansionCriteria(); |
@@ -3509,10 +3496,8 @@ |
PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n", |
title, gc_count_); |
PrintF("mark-compact GC : %d\n", mc_count_); |
- PrintF("old_gen_promotion_limit_ %" V8_PTR_PREFIX "d\n", |
- old_gen_promotion_limit_); |
- PrintF("old_gen_allocation_limit_ %" V8_PTR_PREFIX "d\n", |
- old_gen_allocation_limit_); |
+ PrintF("old_gen_promotion_limit_ %d\n", old_gen_promotion_limit_); |
+ PrintF("old_gen_allocation_limit_ %d\n", old_gen_allocation_limit_); |
PrintF("\n"); |
PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles()); |
@@ -4084,8 +4069,7 @@ |
bool Heap::ConfigureHeapDefault() { |
- return ConfigureHeap( |
- FLAG_max_new_space_size * (KB / 2), FLAG_max_old_space_size * MB); |
+ return ConfigureHeap(FLAG_max_new_space_size / 2, FLAG_max_old_space_size); |
} |
@@ -4127,7 +4111,7 @@ |
} |
-intptr_t Heap::PromotedSpaceSize() { |
+int Heap::PromotedSpaceSize() { |
return old_pointer_space_->Size() |
+ old_data_space_->Size() |
+ code_space_->Size() |
@@ -4273,8 +4257,7 @@ |
PrintF("mark_compact_count=%d ", mc_count_); |
PrintF("max_gc_pause=%d ", GCTracer::get_max_gc_pause()); |
PrintF("min_in_mutator=%d ", GCTracer::get_min_in_mutator()); |
- PrintF("max_alive_after_gc=%" V8_PTR_PREFIX "d ", |
- GCTracer::get_max_alive_after_gc()); |
+ PrintF("max_alive_after_gc=%d ", GCTracer::get_max_alive_after_gc()); |
PrintF("\n\n"); |
} |
@@ -4400,9 +4383,7 @@ |
public: |
void VisitPointers(Object** start, Object** end) { |
for (Object** p = start; p < end; p++) |
- PrintF(" handle %p to %p\n", |
- reinterpret_cast<void*>(p), |
- reinterpret_cast<void*>(*p)); |
+ PrintF(" handle %p to %p\n", p, *p); |
} |
}; |
@@ -4755,8 +4736,8 @@ |
#endif |
-static intptr_t CountTotalHolesSize() { |
- intptr_t holes_size = 0; |
+static int CountTotalHolesSize() { |
+ int holes_size = 0; |
OldSpaces spaces; |
for (OldSpace* space = spaces.next(); |
space != NULL; |
@@ -4854,14 +4835,13 @@ |
PrintF("sweepns=%d ", static_cast<int>(scopes_[Scope::MC_SWEEP_NEWSPACE])); |
PrintF("compact=%d ", static_cast<int>(scopes_[Scope::MC_COMPACT])); |
- PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_size_); |
- PrintF("total_size_after=%" V8_PTR_PREFIX "d ", Heap::SizeOfObjects()); |
- PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", |
- in_free_list_or_wasted_before_gc_); |
- PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize()); |
+ PrintF("total_size_before=%d ", start_size_); |
+ PrintF("total_size_after=%d ", Heap::SizeOfObjects()); |
+ PrintF("holes_size_before=%d ", in_free_list_or_wasted_before_gc_); |
+ PrintF("holes_size_after=%d ", CountTotalHolesSize()); |
- PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); |
- PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_); |
+ PrintF("allocated=%d ", allocated_since_last_gc_); |
+ PrintF("promoted=%d ", promoted_objects_size_); |
PrintF("\n"); |
} |