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

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

Issue 1051233002: Reland "Merge old data and pointer space." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/x87/macro-assembler-x87.cc ('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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Make sure we can allocate through optimized allocation functions 49 // Make sure we can allocate through optimized allocation functions
50 // for specific kinds. 50 // for specific kinds.
51 heap->AllocateFixedArray(100).ToObjectChecked(); 51 heap->AllocateFixedArray(100).ToObjectChecked();
52 heap->AllocateHeapNumber(0.42).ToObjectChecked(); 52 heap->AllocateHeapNumber(0.42).ToObjectChecked();
53 Object* object = heap->AllocateJSObject( 53 Object* object = heap->AllocateJSObject(
54 *CcTest::i_isolate()->object_function()).ToObjectChecked(); 54 *CcTest::i_isolate()->object_function()).ToObjectChecked();
55 heap->CopyJSObject(JSObject::cast(object)).ToObjectChecked(); 55 heap->CopyJSObject(JSObject::cast(object)).ToObjectChecked();
56 56
57 // Old data space. 57 // Old data space.
58 SimulateFullSpace(heap->old_data_space()); 58 SimulateFullSpace(heap->old_space());
59 heap->AllocateByteArray(100, TENURED).ToObjectChecked(); 59 heap->AllocateByteArray(100, TENURED).ToObjectChecked();
60 60
61 // Old pointer space. 61 // Old pointer space.
62 SimulateFullSpace(heap->old_pointer_space()); 62 SimulateFullSpace(heap->old_space());
63 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked(); 63 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked();
64 64
65 // Large object space. 65 // Large object space.
66 static const int kLargeObjectSpaceFillerLength = 3 * (Page::kPageSize / 10); 66 static const int kLargeObjectSpaceFillerLength = 3 * (Page::kPageSize / 10);
67 static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor( 67 static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor(
68 kLargeObjectSpaceFillerLength); 68 kLargeObjectSpaceFillerLength);
69 DCHECK(kLargeObjectSpaceFillerSize > heap->old_pointer_space()->AreaSize()); 69 DCHECK(kLargeObjectSpaceFillerSize > heap->old_space()->AreaSize());
70 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) { 70 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) {
71 heap->AllocateFixedArray( 71 heap->AllocateFixedArray(
72 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); 72 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked();
73 } 73 }
74 heap->AllocateFixedArray( 74 heap->AllocateFixedArray(
75 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); 75 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked();
76 76
77 // Map space. 77 // Map space.
78 SimulateFullSpace(heap->map_space()); 78 SimulateFullSpace(heap->map_space());
79 int instance_size = JSObject::kHeaderSize; 79 int instance_size = JSObject::kHeaderSize;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 if (index < blocks.length() - 1) { 230 if (index < blocks.length() - 1) {
231 blocks[index] = blocks.RemoveLast(); 231 blocks[index] = blocks.RemoveLast();
232 } else { 232 } else {
233 blocks.RemoveLast(); 233 blocks.RemoveLast();
234 } 234 }
235 } 235 }
236 } 236 }
237 237
238 code_range.TearDown(); 238 code_range.TearDown();
239 } 239 }
OLDNEW
« no previous file with comments | « src/x87/macro-assembler-x87.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698