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

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

Issue 9227007: Version 3.8.6 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 11 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 | « test/cctest/cctest.h ('k') | test/cctest/test-api.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 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 Block(Address base_arg, int size_arg) 196 Block(Address base_arg, int size_arg)
197 : base(base_arg), size(size_arg) {} 197 : base(base_arg), size(size_arg) {}
198 198
199 Address base; 199 Address base;
200 int size; 200 int size;
201 }; 201 };
202 202
203 203
204 TEST(CodeRange) { 204 TEST(CodeRange) {
205 const int code_range_size = 32*MB; 205 const int code_range_size = 32*MB;
206 OS::Setup(); 206 OS::SetUp();
207 Isolate::Current()->InitializeLoggingAndCounters(); 207 Isolate::Current()->InitializeLoggingAndCounters();
208 CodeRange* code_range = new CodeRange(Isolate::Current()); 208 CodeRange* code_range = new CodeRange(Isolate::Current());
209 code_range->Setup(code_range_size); 209 code_range->SetUp(code_range_size);
210 int current_allocated = 0; 210 int current_allocated = 0;
211 int total_allocated = 0; 211 int total_allocated = 0;
212 List<Block> blocks(1000); 212 List<Block> blocks(1000);
213 213
214 while (total_allocated < 5 * code_range_size) { 214 while (total_allocated < 5 * code_range_size) {
215 if (current_allocated < code_range_size / 10) { 215 if (current_allocated < code_range_size / 10) {
216 // Allocate a block. 216 // Allocate a block.
217 // Geometrically distributed sizes, greater than Page::kMaxHeapObjectSize. 217 // Geometrically distributed sizes, greater than Page::kMaxHeapObjectSize.
218 // TODO(gc): instead of using 3 use some contant based on code_range_size 218 // TODO(gc): instead of using 3 use some contant based on code_range_size
219 // kMaxHeapObjectSize. 219 // kMaxHeapObjectSize.
(...skipping 14 matching lines...) Expand all
234 blocks[index] = blocks.RemoveLast(); 234 blocks[index] = blocks.RemoveLast();
235 } else { 235 } else {
236 blocks.RemoveLast(); 236 blocks.RemoveLast();
237 } 237 }
238 } 238 }
239 } 239 }
240 240
241 code_range->TearDown(); 241 code_range->TearDown();
242 delete code_range; 242 delete code_range;
243 } 243 }
OLDNEW
« no previous file with comments | « test/cctest/cctest.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698