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

Side by Side Diff: src/heap.cc

Issue 4937001: Make the max_semispace_size parameter customizable on a PLATFORM basis.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 1 month 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 | « no previous file | 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 intptr_t Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit; 72 intptr_t Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit;
73 73
74 int Heap::old_gen_exhausted_ = false; 74 int Heap::old_gen_exhausted_ = false;
75 75
76 int Heap::amount_of_external_allocated_memory_ = 0; 76 int Heap::amount_of_external_allocated_memory_ = 0;
77 int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0; 77 int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0;
78 78
79 // semispace_size_ should be a power of 2 and old_generation_size_ should be 79 // semispace_size_ should be a power of 2 and old_generation_size_ should be
80 // a multiple of Page::kPageSize. 80 // a multiple of Page::kPageSize.
81 #if defined(ANDROID) 81 #if defined(ANDROID)
82 int Heap::max_semispace_size_ = 2*MB; 82 static const int default_max_semispace_size = 2*MB;
83 intptr_t Heap::max_old_generation_size_ = 192*MB; 83 intptr_t Heap::max_old_generation_size_ = 192*MB;
84 int Heap::initial_semispace_size_ = 128*KB; 84 int Heap::initial_semispace_size_ = 128*KB;
85 intptr_t Heap::code_range_size_ = 0; 85 intptr_t Heap::code_range_size_ = 0;
86 #elif defined(V8_TARGET_ARCH_X64) 86 #elif defined(V8_TARGET_ARCH_X64)
87 int Heap::max_semispace_size_ = 16*MB; 87 static const int default_max_semispace_size = 16*MB;
88 intptr_t Heap::max_old_generation_size_ = 1*GB; 88 intptr_t Heap::max_old_generation_size_ = 1*GB;
89 int Heap::initial_semispace_size_ = 1*MB; 89 int Heap::initial_semispace_size_ = 1*MB;
90 intptr_t Heap::code_range_size_ = 512*MB; 90 intptr_t Heap::code_range_size_ = 512*MB;
91 #else 91 #else
92 int Heap::max_semispace_size_ = 8*MB; 92 static const int default_max_semispace_size = 8*MB;
93 intptr_t Heap::max_old_generation_size_ = 512*MB; 93 intptr_t Heap::max_old_generation_size_ = 512*MB;
94 int Heap::initial_semispace_size_ = 512*KB; 94 int Heap::initial_semispace_size_ = 512*KB;
95 intptr_t Heap::code_range_size_ = 0; 95 intptr_t Heap::code_range_size_ = 0;
96 #endif 96 #endif
97 97
98 // Give the platform a chance to modify max_semispace_size_.
99 // This helps / allows platforms that have the available memory footprint
100 // to vary their NEW SPACE sizes beyond the default settings provided.
101 #if defined(PLATFORM_SPECIFIC_MAX_SEMISPACE_SIZE)
Mads Ager (chromium) 2010/11/15 08:43:04 Let's just call this V8_MAX_SEMISPACE_SIZE. I woul
Mads Ager (chromium) 2010/11/15 10:00:56 I take this part back. You can't since this is an
102 int Heap::max_semispace_size_ = PLATFORM_SPECIFIC_MAX_SEMISPACE_SIZE;
103 #else
104 int Heap::max_semispace_size_ = default_max_semispace_size;
105 #endif
106
98 // The snapshot semispace size will be the default semispace size if 107 // The snapshot semispace size will be the default semispace size if
99 // snapshotting is used and will be the requested semispace size as 108 // snapshotting is used and will be the requested semispace size as
100 // set up by ConfigureHeap otherwise. 109 // set up by ConfigureHeap otherwise.
101 int Heap::reserved_semispace_size_ = Heap::max_semispace_size_; 110 int Heap::reserved_semispace_size_ = Heap::max_semispace_size_;
102 111
103 List<Heap::GCPrologueCallbackPair> Heap::gc_prologue_callbacks_; 112 List<Heap::GCPrologueCallbackPair> Heap::gc_prologue_callbacks_;
104 List<Heap::GCEpilogueCallbackPair> Heap::gc_epilogue_callbacks_; 113 List<Heap::GCEpilogueCallbackPair> Heap::gc_epilogue_callbacks_;
105 114
106 GCCallback Heap::global_gc_prologue_callback_ = NULL; 115 GCCallback Heap::global_gc_prologue_callback_ = NULL;
107 GCCallback Heap::global_gc_epilogue_callback_ = NULL; 116 GCCallback Heap::global_gc_epilogue_callback_ = NULL;
(...skipping 5124 matching lines...) Expand 10 before | Expand all | Expand 10 after
5232 void ExternalStringTable::TearDown() { 5241 void ExternalStringTable::TearDown() {
5233 new_space_strings_.Free(); 5242 new_space_strings_.Free();
5234 old_space_strings_.Free(); 5243 old_space_strings_.Free();
5235 } 5244 }
5236 5245
5237 5246
5238 List<Object*> ExternalStringTable::new_space_strings_; 5247 List<Object*> ExternalStringTable::new_space_strings_;
5239 List<Object*> ExternalStringTable::old_space_strings_; 5248 List<Object*> ExternalStringTable::old_space_strings_;
5240 5249
5241 } } // namespace v8::internal 5250 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698