| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 CHECK(!obj->IsFailure()); | 200 CHECK(!obj->IsFailure()); |
| 201 } | 201 } |
| 202 | 202 |
| 203 s->TearDown(); | 203 s->TearDown(); |
| 204 delete s; | 204 delete s; |
| 205 MemoryAllocator::TearDown(); | 205 MemoryAllocator::TearDown(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 | 208 |
| 209 TEST(LargeObjectSpace) { | 209 TEST(LargeObjectSpace) { |
| 210 CHECK(Heap::ConfigureHeapDefault()); | 210 CHECK(Heap::Setup(false)); |
| 211 MemoryAllocator::Setup(Heap::MaxCapacity()); | |
| 212 | 211 |
| 213 LargeObjectSpace* lo = new LargeObjectSpace(LO_SPACE); | 212 LargeObjectSpace* lo = Heap::lo_space(); |
| 214 CHECK(lo != NULL); | 213 CHECK(lo != NULL); |
| 215 | 214 |
| 216 CHECK(lo->Setup()); | |
| 217 | |
| 218 Map* faked_map = reinterpret_cast<Map*>(HeapObject::FromAddress(0)); | 215 Map* faked_map = reinterpret_cast<Map*>(HeapObject::FromAddress(0)); |
| 219 int lo_size = Page::kPageSize; | 216 int lo_size = Page::kPageSize; |
| 220 | 217 |
| 221 Object* obj = lo->AllocateRaw(lo_size); | 218 Object* obj = lo->AllocateRaw(lo_size); |
| 222 CHECK(!obj->IsFailure()); | 219 CHECK(!obj->IsFailure()); |
| 223 CHECK(obj->IsHeapObject()); | 220 CHECK(obj->IsHeapObject()); |
| 224 | 221 |
| 225 HeapObject* ho = HeapObject::cast(obj); | 222 HeapObject* ho = HeapObject::cast(obj); |
| 226 ho->set_map(faked_map); | 223 ho->set_map(faked_map); |
| 227 | 224 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 242 CHECK(!lo->IsEmpty()); | 239 CHECK(!lo->IsEmpty()); |
| 243 | 240 |
| 244 obj = lo->AllocateRaw(lo_size); | 241 obj = lo->AllocateRaw(lo_size); |
| 245 CHECK(obj->IsFailure()); | 242 CHECK(obj->IsFailure()); |
| 246 | 243 |
| 247 lo->TearDown(); | 244 lo->TearDown(); |
| 248 delete lo; | 245 delete lo; |
| 249 | 246 |
| 250 MemoryAllocator::TearDown(); | 247 MemoryAllocator::TearDown(); |
| 251 } | 248 } |
| OLD | NEW |