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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 CHECK(mem != NULL); | 70 CHECK(mem != NULL); |
71 | 71 |
72 Address start = reinterpret_cast<Address>(mem); | 72 Address start = reinterpret_cast<Address>(mem); |
73 Address page_start = RoundUp(start, Page::kPageSize); | 73 Address page_start = RoundUp(start, Page::kPageSize); |
74 | 74 |
75 Page* p = Page::FromAddress(page_start); | 75 Page* p = Page::FromAddress(page_start); |
76 CHECK(p->address() == page_start); | 76 CHECK(p->address() == page_start); |
77 CHECK(p->is_valid()); | 77 CHECK(p->is_valid()); |
78 | 78 |
79 p->opaque_header = 0; | 79 p->opaque_header = 0; |
80 p->is_normal_page = 0x1; | 80 p->SetIsLargeObjectPage(false); |
81 CHECK(!p->next_page()->is_valid()); | 81 CHECK(!p->next_page()->is_valid()); |
82 | 82 |
83 CHECK(p->ObjectAreaStart() == page_start + Page::kObjectStartOffset); | 83 CHECK(p->ObjectAreaStart() == page_start + Page::kObjectStartOffset); |
84 CHECK(p->ObjectAreaEnd() == page_start + Page::kPageSize); | 84 CHECK(p->ObjectAreaEnd() == page_start + Page::kPageSize); |
85 | 85 |
86 CHECK(p->Offset(page_start + Page::kObjectStartOffset) == | 86 CHECK(p->Offset(page_start + Page::kObjectStartOffset) == |
87 Page::kObjectStartOffset); | 87 Page::kObjectStartOffset); |
88 CHECK(p->Offset(page_start + Page::kPageSize) == Page::kPageSize); | 88 CHECK(p->Offset(page_start + Page::kPageSize) == Page::kPageSize); |
89 | 89 |
90 CHECK(p->OffsetToAddress(Page::kObjectStartOffset) == p->ObjectAreaStart()); | 90 CHECK(p->OffsetToAddress(Page::kObjectStartOffset) == p->ObjectAreaStart()); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 CHECK(!lo->IsEmpty()); | 239 CHECK(!lo->IsEmpty()); |
240 | 240 |
241 obj = lo->AllocateRaw(lo_size); | 241 obj = lo->AllocateRaw(lo_size); |
242 CHECK(obj->IsFailure()); | 242 CHECK(obj->IsFailure()); |
243 | 243 |
244 lo->TearDown(); | 244 lo->TearDown(); |
245 delete lo; | 245 delete lo; |
246 | 246 |
247 MemoryAllocator::TearDown(); | 247 MemoryAllocator::TearDown(); |
248 } | 248 } |
OLD | NEW |