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

Side by Side Diff: test/cctest/test-mark-compact.cc

Issue 141653016: Remove Heap::MaxRegularSpaceAllocationSize and use Page::MaxRegularHeapObjectSize instead. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/test-heap.cc ('k') | test/cctest/test-spaces.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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 TEST(Promotion) { 76 TEST(Promotion) {
77 CcTest::InitializeVM(); 77 CcTest::InitializeVM();
78 Heap* heap = CcTest::heap(); 78 Heap* heap = CcTest::heap();
79 heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB); 79 heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB);
80 80
81 v8::HandleScope sc(CcTest::isolate()); 81 v8::HandleScope sc(CcTest::isolate());
82 82
83 // Allocate a fixed array in the new space. 83 // Allocate a fixed array in the new space.
84 int array_length = 84 int array_length =
85 (Page::kMaxNonCodeHeapObjectSize - FixedArray::kHeaderSize) / 85 (Page::kMaxRegularHeapObjectSize - FixedArray::kHeaderSize) /
86 (4 * kPointerSize); 86 (4 * kPointerSize);
87 Object* obj = heap->AllocateFixedArray(array_length)->ToObjectChecked(); 87 Object* obj = heap->AllocateFixedArray(array_length)->ToObjectChecked();
88 Handle<FixedArray> array(FixedArray::cast(obj)); 88 Handle<FixedArray> array(FixedArray::cast(obj));
89 89
90 // Array should be in the new space. 90 // Array should be in the new space.
91 CHECK(heap->InSpace(*array, NEW_SPACE)); 91 CHECK(heap->InSpace(*array, NEW_SPACE));
92 92
93 // Call mark compact GC, so array becomes an old object. 93 // Call mark compact GC, so array becomes an old object.
94 heap->CollectGarbage(OLD_POINTER_SPACE); 94 heap->CollectGarbage(OLD_POINTER_SPACE);
95 95
96 // Array now sits in the old space 96 // Array now sits in the old space
97 CHECK(heap->InSpace(*array, OLD_POINTER_SPACE)); 97 CHECK(heap->InSpace(*array, OLD_POINTER_SPACE));
98 } 98 }
99 99
100 100
101 TEST(NoPromotion) { 101 TEST(NoPromotion) {
102 CcTest::InitializeVM(); 102 CcTest::InitializeVM();
103 Heap* heap = CcTest::heap(); 103 Heap* heap = CcTest::heap();
104 heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB); 104 heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB);
105 105
106 v8::HandleScope sc(CcTest::isolate()); 106 v8::HandleScope sc(CcTest::isolate());
107 107
108 // Allocate a big fixed array in the new space. 108 // Allocate a big fixed array in the new space.
109 int array_length = 109 int array_length =
110 (Page::kMaxNonCodeHeapObjectSize - FixedArray::kHeaderSize) / 110 (Page::kMaxRegularHeapObjectSize - FixedArray::kHeaderSize) /
111 (2 * kPointerSize); 111 (2 * kPointerSize);
112 Object* obj = heap->AllocateFixedArray(array_length)->ToObjectChecked(); 112 Object* obj = heap->AllocateFixedArray(array_length)->ToObjectChecked();
113 Handle<FixedArray> array(FixedArray::cast(obj)); 113 Handle<FixedArray> array(FixedArray::cast(obj));
114 114
115 // Array should be in the new space. 115 // Array should be in the new space.
116 CHECK(heap->InSpace(*array, NEW_SPACE)); 116 CHECK(heap->InSpace(*array, NEW_SPACE));
117 117
118 // Simulate a full old space to make promotion fail. 118 // Simulate a full old space to make promotion fail.
119 SimulateFullSpace(heap->old_pointer_space()); 119 SimulateFullSpace(heap->old_pointer_space());
120 120
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 535
536 536
537 TEST(RegressJoinThreadsOnIsolateDeinit) { 537 TEST(RegressJoinThreadsOnIsolateDeinit) {
538 intptr_t size_limit = ShortLivingIsolate() * 2; 538 intptr_t size_limit = ShortLivingIsolate() * 2;
539 for (int i = 0; i < 10; i++) { 539 for (int i = 0; i < 10; i++) {
540 CHECK_GT(size_limit, ShortLivingIsolate()); 540 CHECK_GT(size_limit, ShortLivingIsolate());
541 } 541 }
542 } 542 }
543 543
544 #endif // __linux__ and !USE_SIMULATOR 544 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698