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

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

Issue 1370123002: [heap] Remove retry space from AllocateRaw. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/heap/heap-inl.h ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 if (++attempts < 4) return AllocationResult::Retry(); 43 if (++attempts < 4) return AllocationResult::Retry();
44 44
45 // Expose some private stuff on Heap. 45 // Expose some private stuff on Heap.
46 Heap* heap = CcTest::heap(); 46 Heap* heap = CcTest::heap();
47 47
48 // Now that we have returned 'retry' 4 times, we are in a last-chance 48 // Now that we have returned 'retry' 4 times, we are in a last-chance
49 // scenario, with always_allocate. See CALL_AND_RETRY. Test that all 49 // scenario, with always_allocate. See CALL_AND_RETRY. Test that all
50 // allocations succeed. 50 // allocations succeed.
51 51
52 // New space. 52 // New space.
53 SimulateFullSpace(heap->new_space());
54 heap->AllocateByteArray(100).ToObjectChecked(); 53 heap->AllocateByteArray(100).ToObjectChecked();
55 heap->AllocateFixedArray(100, NOT_TENURED).ToObjectChecked(); 54 heap->AllocateFixedArray(100, NOT_TENURED).ToObjectChecked();
56 55
57 // Make sure we can allocate through optimized allocation functions 56 // Make sure we can allocate through optimized allocation functions
58 // for specific kinds. 57 // for specific kinds.
59 heap->AllocateFixedArray(100).ToObjectChecked(); 58 heap->AllocateFixedArray(100).ToObjectChecked();
60 heap->AllocateHeapNumber(0.42).ToObjectChecked(); 59 heap->AllocateHeapNumber(0.42).ToObjectChecked();
61 Object* object = heap->AllocateJSObject( 60 Object* object = heap->AllocateJSObject(
62 *CcTest::i_isolate()->object_function()).ToObjectChecked(); 61 *CcTest::i_isolate()->object_function()).ToObjectChecked();
63 heap->CopyJSObject(JSObject::cast(object)).ToObjectChecked(); 62 heap->CopyJSObject(JSObject::cast(object)).ToObjectChecked();
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); 239 code_range.FreeRawMemory(blocks[index].base, blocks[index].size);
241 current_allocated -= blocks[index].size; 240 current_allocated -= blocks[index].size;
242 if (index < blocks.length() - 1) { 241 if (index < blocks.length() - 1) {
243 blocks[index] = blocks.RemoveLast(); 242 blocks[index] = blocks.RemoveLast();
244 } else { 243 } else {
245 blocks.RemoveLast(); 244 blocks.RemoveLast();
246 } 245 }
247 } 246 }
248 } 247 }
249 } 248 }
OLDNEW
« no previous file with comments | « src/heap/heap-inl.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698