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: test/cctest/test-alloc.cc

Issue 10629004: Adapt fragmentation heuristics for over reserved pages. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Erik Corry. Created 8 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 | « src/mark-compact.cc ('k') | test/cctest/test-heap.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 16 matching lines...) Expand all
27 27
28 #include "v8.h" 28 #include "v8.h"
29 #include "accessors.h" 29 #include "accessors.h"
30 30
31 #include "cctest.h" 31 #include "cctest.h"
32 32
33 33
34 using namespace v8::internal; 34 using namespace v8::internal;
35 35
36 36
37 static inline void SimulateFullSpace(PagedSpace* space) { 37 // Also used in test-heap.cc test cases.
38 void SimulateFullSpace(PagedSpace* space) {
38 int old_linear_size = static_cast<int>(space->limit() - space->top()); 39 int old_linear_size = static_cast<int>(space->limit() - space->top());
39 space->Free(space->top(), old_linear_size); 40 space->Free(space->top(), old_linear_size);
40 space->SetTop(space->limit(), space->limit()); 41 space->SetTop(space->limit(), space->limit());
41 space->ResetFreeList(); 42 space->ResetFreeList();
42 space->ClearStats(); 43 space->ClearStats();
43 } 44 }
44 45
45 46
46 static MaybeObject* AllocateAfterFailures() { 47 static MaybeObject* AllocateAfterFailures() {
47 static int attempts = 0; 48 static int attempts = 0;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 blocks[index] = blocks.RemoveLast(); 229 blocks[index] = blocks.RemoveLast();
229 } else { 230 } else {
230 blocks.RemoveLast(); 231 blocks.RemoveLast();
231 } 232 }
232 } 233 }
233 } 234 }
234 235
235 code_range->TearDown(); 236 code_range->TearDown();
236 delete code_range; 237 delete code_range;
237 } 238 }
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698