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

Side by Side Diff: src/heap.cc

Issue 7528022: Fix the --max-old-space-size flag so it can be used on 64 bit for (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/incremental-marking.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4706 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 // output a flag to the snapshot. However at this point the serializer and 4717 // output a flag to the snapshot. However at this point the serializer and
4718 // deserializer are deliberately a little unsynchronized (see above) so the 4718 // deserializer are deliberately a little unsynchronized (see above) so the
4719 // checking of the sync flag in the snapshot would fail. 4719 // checking of the sync flag in the snapshot would fail.
4720 } 4720 }
4721 4721
4722 4722
4723 // TODO(1236194): Since the heap size is configurable on the command line 4723 // TODO(1236194): Since the heap size is configurable on the command line
4724 // and through the API, we should gracefully handle the case that the heap 4724 // and through the API, we should gracefully handle the case that the heap
4725 // size is not big enough to fit all the initial objects. 4725 // size is not big enough to fit all the initial objects.
4726 bool Heap::ConfigureHeap(int max_semispace_size, 4726 bool Heap::ConfigureHeap(int max_semispace_size,
4727 int max_old_gen_size, 4727 intptr_t max_old_gen_size,
4728 int max_executable_size) { 4728 intptr_t max_executable_size) {
4729 if (HasBeenSetup()) return false; 4729 if (HasBeenSetup()) return false;
4730 4730
4731 if (max_semispace_size > 0) { 4731 if (max_semispace_size > 0) {
4732 if (max_semispace_size < Page::kPageSize) { 4732 if (max_semispace_size < Page::kPageSize) {
4733 max_semispace_size = Page::kPageSize; 4733 max_semispace_size = Page::kPageSize;
4734 } 4734 }
4735 max_semispace_size_ = max_semispace_size; 4735 max_semispace_size_ = max_semispace_size;
4736 } 4736 }
4737 4737
4738 if (Snapshot::IsEnabled()) { 4738 if (Snapshot::IsEnabled()) {
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
5745 5745
5746 allocated_since_last_gc_ = 5746 allocated_since_last_gc_ =
5747 heap_->SizeOfObjects() - heap_->alive_after_last_gc_; 5747 heap_->SizeOfObjects() - heap_->alive_after_last_gc_;
5748 5748
5749 if (heap_->last_gc_end_timestamp_ > 0) { 5749 if (heap_->last_gc_end_timestamp_ > 0) {
5750 spent_in_mutator_ = Max(start_time_ - heap_->last_gc_end_timestamp_, 0.0); 5750 spent_in_mutator_ = Max(start_time_ - heap_->last_gc_end_timestamp_, 0.0);
5751 } 5751 }
5752 5752
5753 steps_count_ = heap_->incremental_marking()->steps_count(); 5753 steps_count_ = heap_->incremental_marking()->steps_count();
5754 steps_took_ = heap_->incremental_marking()->steps_took(); 5754 steps_took_ = heap_->incremental_marking()->steps_took();
5755 longest_step_ = heap_->incremental_marking()->longest_step();
5755 steps_count_since_last_gc_ = 5756 steps_count_since_last_gc_ =
5756 heap_->incremental_marking()->steps_count_since_last_gc(); 5757 heap_->incremental_marking()->steps_count_since_last_gc();
5757 steps_took_since_last_gc_ = 5758 steps_took_since_last_gc_ =
5758 heap_->incremental_marking()->steps_took_since_last_gc(); 5759 heap_->incremental_marking()->steps_took_since_last_gc();
5759 } 5760 }
5760 5761
5761 5762
5762 GCTracer::~GCTracer() { 5763 GCTracer::~GCTracer() {
5763 // Printf ONE line iff flag is set. 5764 // Printf ONE line iff flag is set.
5764 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; 5765 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return;
(...skipping 25 matching lines...) Expand all
5790 SizeOfHeapObjects()); 5791 SizeOfHeapObjects());
5791 5792
5792 if (external_time > 0) PrintF("%d / ", external_time); 5793 if (external_time > 0) PrintF("%d / ", external_time);
5793 PrintF("%d ms", time); 5794 PrintF("%d ms", time);
5794 if (steps_count_ > 0) { 5795 if (steps_count_ > 0) {
5795 if (collector_ == SCAVENGER) { 5796 if (collector_ == SCAVENGER) {
5796 PrintF(" (+ %d ms in %d steps since last GC)", 5797 PrintF(" (+ %d ms in %d steps since last GC)",
5797 static_cast<int>(steps_took_since_last_gc_), 5798 static_cast<int>(steps_took_since_last_gc_),
5798 steps_count_since_last_gc_); 5799 steps_count_since_last_gc_);
5799 } else { 5800 } else {
5800 PrintF(" (+ %d ms in %d steps since start of marking)", 5801 PrintF(" (+ %d ms in %d steps since start of marking, biggest step %f ms )",
5801 static_cast<int>(steps_took_), 5802 static_cast<int>(steps_took_),
5802 steps_count_); 5803 steps_count_,
5804 longest_step_);
5803 } 5805 }
5804 } 5806 }
5805 PrintF(".\n"); 5807 PrintF(".\n");
5806 } else { 5808 } else {
5807 PrintF("pause=%d ", time); 5809 PrintF("pause=%d ", time);
5808 PrintF("mutator=%d ", 5810 PrintF("mutator=%d ",
5809 static_cast<int>(spent_in_mutator_)); 5811 static_cast<int>(spent_in_mutator_));
5810 5812
5811 PrintF("gc="); 5813 PrintF("gc=");
5812 switch (collector_) { 5814 switch (collector_) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
6004 } 6006 }
6005 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 6007 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6006 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 6008 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
6007 next = chunk->next_chunk(); 6009 next = chunk->next_chunk();
6008 isolate_->memory_allocator()->Free(chunk); 6010 isolate_->memory_allocator()->Free(chunk);
6009 } 6011 }
6010 chunks_queued_for_free_ = NULL; 6012 chunks_queued_for_free_ = NULL;
6011 } 6013 }
6012 6014
6013 } } // namespace v8::internal 6015 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698