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

Side by Side Diff: src/heap.cc

Issue 7234004: Limit the size of the space reserved for code on systems that (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 6 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 | « no previous file | src/platform.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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 last_idle_notification_gc_count_init_(false), 146 last_idle_notification_gc_count_init_(false),
147 configured_(false), 147 configured_(false),
148 is_safe_to_read_maps_(true) { 148 is_safe_to_read_maps_(true) {
149 // Allow build-time customization of the max semispace size. Building 149 // Allow build-time customization of the max semispace size. Building
150 // V8 with snapshots and a non-default max semispace size is much 150 // V8 with snapshots and a non-default max semispace size is much
151 // easier if you can define it as part of the build environment. 151 // easier if you can define it as part of the build environment.
152 #if defined(V8_MAX_SEMISPACE_SIZE) 152 #if defined(V8_MAX_SEMISPACE_SIZE)
153 max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; 153 max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE;
154 #endif 154 #endif
155 155
156 intptr_t max_virtual = OS::MaxVirtualMemory();
157
158 if (max_virtual > 0) {
159 if (code_range_size_ > 0) {
160 // Reserve no more than 1/8 of the memory for the code range.
161 code_range_size_ = Min(code_range_size_, max_virtual >> 3);
162 }
163 }
164
156 memset(roots_, 0, sizeof(roots_[0]) * kRootListLength); 165 memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
157 global_contexts_list_ = NULL; 166 global_contexts_list_ = NULL;
158 mark_compact_collector_.heap_ = this; 167 mark_compact_collector_.heap_ = this;
159 external_string_table_.heap_ = this; 168 external_string_table_.heap_ = this;
160 } 169 }
161 170
162 171
163 intptr_t Heap::Capacity() { 172 intptr_t Heap::Capacity() {
164 if (!HasBeenSetup()) return 0; 173 if (!HasBeenSetup()) return 0;
165 174
(...skipping 5875 matching lines...) Expand 10 before | Expand all | Expand 10 after
6041 } 6050 }
6042 6051
6043 6052
6044 void ExternalStringTable::TearDown() { 6053 void ExternalStringTable::TearDown() {
6045 new_space_strings_.Free(); 6054 new_space_strings_.Free();
6046 old_space_strings_.Free(); 6055 old_space_strings_.Free();
6047 } 6056 }
6048 6057
6049 6058
6050 } } // namespace v8::internal 6059 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698