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/heap/test-mark-compact.cc

Issue 2311203002: Move kMaxRegularHeapObjectSize into globals (Closed)
Patch Set: Saving the file helps... Created 4 years, 3 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 | « test/cctest/heap/test-heap.cc ('k') | test/cctest/heap/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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 TEST(Promotion) { 78 TEST(Promotion) {
79 CcTest::InitializeVM(); 79 CcTest::InitializeVM();
80 Isolate* isolate = CcTest::i_isolate(); 80 Isolate* isolate = CcTest::i_isolate();
81 { 81 {
82 v8::HandleScope sc(CcTest::isolate()); 82 v8::HandleScope sc(CcTest::isolate());
83 Heap* heap = isolate->heap(); 83 Heap* heap = isolate->heap();
84 84
85 heap::SealCurrentObjects(heap); 85 heap::SealCurrentObjects(heap);
86 86
87 int array_length = 87 int array_length = heap::FixedArrayLenFromSize(kMaxRegularHeapObjectSize);
88 heap::FixedArrayLenFromSize(Page::kMaxRegularHeapObjectSize);
89 Handle<FixedArray> array = isolate->factory()->NewFixedArray(array_length); 88 Handle<FixedArray> array = isolate->factory()->NewFixedArray(array_length);
90 89
91 // Array should be in the new space. 90 // Array should be in the new space.
92 CHECK(heap->InSpace(*array, NEW_SPACE)); 91 CHECK(heap->InSpace(*array, NEW_SPACE));
93 heap->CollectAllGarbage(); 92 heap->CollectAllGarbage();
94 heap->CollectAllGarbage(); 93 heap->CollectAllGarbage();
95 CHECK(heap->InSpace(*array, OLD_SPACE)); 94 CHECK(heap->InSpace(*array, OLD_SPACE));
96 } 95 }
97 } 96 }
98 97
99 HEAP_TEST(NoPromotion) { 98 HEAP_TEST(NoPromotion) {
100 CcTest::InitializeVM(); 99 CcTest::InitializeVM();
101 Isolate* isolate = CcTest::i_isolate(); 100 Isolate* isolate = CcTest::i_isolate();
102 { 101 {
103 v8::HandleScope sc(CcTest::isolate()); 102 v8::HandleScope sc(CcTest::isolate());
104 Heap* heap = isolate->heap(); 103 Heap* heap = isolate->heap();
105 104
106 heap::SealCurrentObjects(heap); 105 heap::SealCurrentObjects(heap);
107 106
108 int array_length = 107 int array_length = heap::FixedArrayLenFromSize(kMaxRegularHeapObjectSize);
109 heap::FixedArrayLenFromSize(Page::kMaxRegularHeapObjectSize);
110 Handle<FixedArray> array = isolate->factory()->NewFixedArray(array_length); 108 Handle<FixedArray> array = isolate->factory()->NewFixedArray(array_length);
111 109
112 heap->set_force_oom(true); 110 heap->set_force_oom(true);
113 // Array should be in the new space. 111 // Array should be in the new space.
114 CHECK(heap->InSpace(*array, NEW_SPACE)); 112 CHECK(heap->InSpace(*array, NEW_SPACE));
115 heap->CollectAllGarbage(); 113 heap->CollectAllGarbage();
116 heap->CollectAllGarbage(); 114 heap->CollectAllGarbage();
117 CHECK(heap->InSpace(*array, NEW_SPACE)); 115 CHECK(heap->InSpace(*array, NEW_SPACE));
118 } 116 }
119 } 117 }
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 475
478 476
479 TEST(RegressJoinThreadsOnIsolateDeinit) { 477 TEST(RegressJoinThreadsOnIsolateDeinit) {
480 intptr_t size_limit = ShortLivingIsolate() * 2; 478 intptr_t size_limit = ShortLivingIsolate() * 2;
481 for (int i = 0; i < 10; i++) { 479 for (int i = 0; i < 10; i++) {
482 CHECK_GT(size_limit, ShortLivingIsolate()); 480 CHECK_GT(size_limit, ShortLivingIsolate());
483 } 481 }
484 } 482 }
485 483
486 #endif // __linux__ and !USE_SIMULATOR 484 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « test/cctest/heap/test-heap.cc ('k') | test/cctest/heap/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698