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

Side by Side Diff: src/heap.cc

Issue 155916: Introduce a external allocation limit.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 int Heap::old_generation_size_ = 512*MB; 78 int Heap::old_generation_size_ = 512*MB;
79 int Heap::initial_semispace_size_ = 512*KB; 79 int Heap::initial_semispace_size_ = 512*KB;
80 #endif 80 #endif
81 81
82 GCCallback Heap::global_gc_prologue_callback_ = NULL; 82 GCCallback Heap::global_gc_prologue_callback_ = NULL;
83 GCCallback Heap::global_gc_epilogue_callback_ = NULL; 83 GCCallback Heap::global_gc_epilogue_callback_ = NULL;
84 84
85 // Variables set based on semispace_size_ and old_generation_size_ in 85 // Variables set based on semispace_size_ and old_generation_size_ in
86 // ConfigureHeap. 86 // ConfigureHeap.
87 int Heap::young_generation_size_ = 0; // Will be 2 * semispace_size_. 87 int Heap::young_generation_size_ = 0; // Will be 2 * semispace_size_.
88
89 int Heap::survived_since_last_expansion_ = 0; 88 int Heap::survived_since_last_expansion_ = 0;
89 int Heap::external_allocation_limit_ = 0;
90 90
91 Heap::HeapState Heap::gc_state_ = NOT_IN_GC; 91 Heap::HeapState Heap::gc_state_ = NOT_IN_GC;
92 92
93 int Heap::mc_count_ = 0; 93 int Heap::mc_count_ = 0;
94 int Heap::gc_count_ = 0; 94 int Heap::gc_count_ = 0;
95 95
96 int Heap::always_allocate_scope_depth_ = 0; 96 int Heap::always_allocate_scope_depth_ = 0;
97 bool Heap::context_disposed_pending_ = false; 97 bool Heap::context_disposed_pending_ = false;
98 98
99 #ifdef DEBUG 99 #ifdef DEBUG
(...skipping 2881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 if (HasBeenSetup()) return false; 2981 if (HasBeenSetup()) return false;
2982 2982
2983 if (semispace_size > 0) semispace_size_ = semispace_size; 2983 if (semispace_size > 0) semispace_size_ = semispace_size;
2984 if (old_gen_size > 0) old_generation_size_ = old_gen_size; 2984 if (old_gen_size > 0) old_generation_size_ = old_gen_size;
2985 2985
2986 // The new space size must be a power of two to support single-bit testing 2986 // The new space size must be a power of two to support single-bit testing
2987 // for containment. 2987 // for containment.
2988 semispace_size_ = RoundUpToPowerOf2(semispace_size_); 2988 semispace_size_ = RoundUpToPowerOf2(semispace_size_);
2989 initial_semispace_size_ = Min(initial_semispace_size_, semispace_size_); 2989 initial_semispace_size_ = Min(initial_semispace_size_, semispace_size_);
2990 young_generation_size_ = 2 * semispace_size_; 2990 young_generation_size_ = 2 * semispace_size_;
2991 external_allocation_limit_ = 10 * semispace_size_;
2991 2992
2992 // The old generation is paged. 2993 // The old generation is paged.
2993 old_generation_size_ = RoundUp(old_generation_size_, Page::kPageSize); 2994 old_generation_size_ = RoundUp(old_generation_size_, Page::kPageSize);
2994 2995
2995 heap_configured = true; 2996 heap_configured = true;
2996 return true; 2997 return true;
2997 } 2998 }
2998 2999
2999 3000
3000 bool Heap::ConfigureHeapDefault() { 3001 bool Heap::ConfigureHeapDefault() {
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
3717 #ifdef DEBUG 3718 #ifdef DEBUG
3718 bool Heap::GarbageCollectionGreedyCheck() { 3719 bool Heap::GarbageCollectionGreedyCheck() {
3719 ASSERT(FLAG_gc_greedy); 3720 ASSERT(FLAG_gc_greedy);
3720 if (Bootstrapper::IsActive()) return true; 3721 if (Bootstrapper::IsActive()) return true;
3721 if (disallow_allocation_failure()) return true; 3722 if (disallow_allocation_failure()) return true;
3722 return CollectGarbage(0, NEW_SPACE); 3723 return CollectGarbage(0, NEW_SPACE);
3723 } 3724 }
3724 #endif 3725 #endif
3725 3726
3726 } } // namespace v8::internal 3727 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698