OLD | NEW |
---|---|
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 // the old space | 113 // the old space |
114 CcTest::InitializeVM(); | 114 CcTest::InitializeVM(); |
115 | 115 |
116 v8::HandleScope sc(CcTest::isolate()); | 116 v8::HandleScope sc(CcTest::isolate()); |
117 | 117 |
118 // Do a mark compact GC to shrink the heap. | 118 // Do a mark compact GC to shrink the heap. |
119 HEAP->CollectGarbage(OLD_POINTER_SPACE); | 119 HEAP->CollectGarbage(OLD_POINTER_SPACE); |
120 | 120 |
121 // Allocate a big Fixed array in the new space. | 121 // Allocate a big Fixed array in the new space. |
122 int max_size = | 122 int max_size = |
123 Min(Page::kMaxNonCodeHeapObjectSize, HEAP->MaxObjectSizeInNewSpace()); | 123 Min(Page::kMaxNonCodeHeapObjectSize, Page::kMaxNonCodeHeapObjectSize); |
Michael Starzinger
2013/07/22 19:27:50
nit: This Min() looks kind of redundant now. I gue
Hannes Payer (out of office)
2013/07/23 20:00:51
Done.
| |
124 | 124 |
125 int length = (max_size - FixedArray::kHeaderSize) / (2*kPointerSize); | 125 int length = (max_size - FixedArray::kHeaderSize) / (2*kPointerSize); |
126 Object* obj = i::Isolate::Current()->heap()->AllocateFixedArray(length)-> | 126 Object* obj = i::Isolate::Current()->heap()->AllocateFixedArray(length)-> |
127 ToObjectChecked(); | 127 ToObjectChecked(); |
128 | 128 |
129 Handle<FixedArray> array(FixedArray::cast(obj)); | 129 Handle<FixedArray> array(FixedArray::cast(obj)); |
130 | 130 |
131 // Array still stays in the new space. | 131 // Array still stays in the new space. |
132 CHECK(HEAP->InSpace(*array, NEW_SPACE)); | 132 CHECK(HEAP->InSpace(*array, NEW_SPACE)); |
133 | 133 |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
582 | 582 |
583 | 583 |
584 TEST(RegressJoinThreadsOnIsolateDeinit) { | 584 TEST(RegressJoinThreadsOnIsolateDeinit) { |
585 intptr_t size_limit = ShortLivingIsolate() * 2; | 585 intptr_t size_limit = ShortLivingIsolate() * 2; |
586 for (int i = 0; i < 10; i++) { | 586 for (int i = 0; i < 10; i++) { |
587 CHECK_GT(size_limit, ShortLivingIsolate()); | 587 CHECK_GT(size_limit, ShortLivingIsolate()); |
588 } | 588 } |
589 } | 589 } |
590 | 590 |
591 #endif // __linux__ and !USE_SIMULATOR | 591 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |