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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 HeapObject* ho = HeapObject::cast(obj); | 214 HeapObject* ho = HeapObject::cast(obj); |
215 ho->set_map(faked_map); | 215 ho->set_map(faked_map); |
216 | 216 |
217 CHECK(lo->Contains(HeapObject::cast(obj))); | 217 CHECK(lo->Contains(HeapObject::cast(obj))); |
218 | 218 |
219 CHECK(lo->FindObject(ho->address()) == obj); | 219 CHECK(lo->FindObject(ho->address()) == obj); |
220 | 220 |
221 CHECK(lo->Contains(ho)); | 221 CHECK(lo->Contains(ho)); |
222 | 222 |
223 while (true) { | 223 while (true) { |
224 int available = lo->Available(); | 224 intptr_t available = lo->Available(); |
225 obj = lo->AllocateRaw(lo_size); | 225 obj = lo->AllocateRaw(lo_size); |
226 if (obj->IsFailure()) break; | 226 if (obj->IsFailure()) break; |
227 HeapObject::cast(obj)->set_map(faked_map); | 227 HeapObject::cast(obj)->set_map(faked_map); |
228 CHECK(lo->Available() < available); | 228 CHECK(lo->Available() < available); |
229 }; | 229 }; |
230 | 230 |
231 CHECK(!lo->IsEmpty()); | 231 CHECK(!lo->IsEmpty()); |
232 | 232 |
233 obj = lo->AllocateRaw(lo_size); | 233 obj = lo->AllocateRaw(lo_size); |
234 CHECK(obj->IsFailure()); | 234 CHECK(obj->IsFailure()); |
235 | 235 |
236 lo->TearDown(); | 236 lo->TearDown(); |
237 delete lo; | 237 delete lo; |
238 | 238 |
239 MemoryAllocator::TearDown(); | 239 MemoryAllocator::TearDown(); |
240 } | 240 } |
OLD | NEW |