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

Side by Side Diff: test/cctest/test-alloc.cc

Issue 2807031: [Isolates] RegExpStack and memory allocation limits (statics #6) (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: -> is different than . Created 10 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/v8threads.cc ('k') | test/cctest/test-assembler-x64.cc » ('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 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 Block(void* base_arg, int size_arg) 178 Block(void* base_arg, int size_arg)
179 : base(base_arg), size(size_arg) {} 179 : base(base_arg), size(size_arg) {}
180 180
181 void *base; 181 void *base;
182 int size; 182 int size;
183 }; 183 };
184 184
185 185
186 TEST(CodeRange) { 186 TEST(CodeRange) {
187 const int code_range_size = 16*MB; 187 const int code_range_size = 16*MB;
188 OS::Setup();
188 Isolate::Current()->code_range()->Setup(code_range_size); 189 Isolate::Current()->code_range()->Setup(code_range_size);
189 int current_allocated = 0; 190 int current_allocated = 0;
190 int total_allocated = 0; 191 int total_allocated = 0;
191 List<Block> blocks(1000); 192 List<Block> blocks(1000);
192 193
193 while (total_allocated < 5 * code_range_size) { 194 while (total_allocated < 5 * code_range_size) {
194 if (current_allocated < code_range_size / 10) { 195 if (current_allocated < code_range_size / 10) {
195 // Allocate a block. 196 // Allocate a block.
196 // Geometrically distributed sizes, greater than Page::kPageSize. 197 // Geometrically distributed sizes, greater than Page::kPageSize.
197 size_t requested = (Page::kPageSize << (Pseudorandom() % 6)) + 198 size_t requested = (Page::kPageSize << (Pseudorandom() % 6)) +
(...skipping 13 matching lines...) Expand all
211 if (index < blocks.length() - 1) { 212 if (index < blocks.length() - 1) {
212 blocks[index] = blocks.RemoveLast(); 213 blocks[index] = blocks.RemoveLast();
213 } else { 214 } else {
214 blocks.RemoveLast(); 215 blocks.RemoveLast();
215 } 216 }
216 } 217 }
217 } 218 }
218 219
219 Isolate::Current()->code_range()->TearDown(); 220 Isolate::Current()->code_range()->TearDown();
220 } 221 }
OLDNEW
« no previous file with comments | « src/v8threads.cc ('k') | test/cctest/test-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698