| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 | 59 |
| 60 TEST(Page) { | 60 TEST(Page) { |
| 61 byte* mem = NewArray<byte>(2*Page::kPageSize); | 61 byte* mem = NewArray<byte>(2*Page::kPageSize); |
| 62 CHECK(mem != NULL); | 62 CHECK(mem != NULL); |
| 63 | 63 |
| 64 Address start = reinterpret_cast<Address>(mem); | 64 Address start = reinterpret_cast<Address>(mem); |
| 65 Address page_start = RoundUp(start, Page::kPageSize); | 65 Address page_start = RoundUp(start, Page::kPageSize); |
| 66 | 66 |
| 67 Page* p = Page::FromAddress(page_start); | 67 Page* p = Page::FromAddress(page_start); |
| 68 // Initialized Page has heap pointer, normally set by memory_allocator. |
| 69 p->heap_ = HEAP; |
| 68 CHECK(p->address() == page_start); | 70 CHECK(p->address() == page_start); |
| 69 CHECK(p->is_valid()); | 71 CHECK(p->is_valid()); |
| 70 | 72 |
| 71 p->opaque_header = 0; | 73 p->opaque_header = 0; |
| 72 p->SetIsLargeObjectPage(false); | 74 p->SetIsLargeObjectPage(false); |
| 73 CHECK(!p->next_page()->is_valid()); | 75 CHECK(!p->next_page()->is_valid()); |
| 74 | 76 |
| 75 CHECK(p->ObjectAreaStart() == page_start + Page::kObjectStartOffset); | 77 CHECK(p->ObjectAreaStart() == page_start + Page::kObjectStartOffset); |
| 76 CHECK(p->ObjectAreaEnd() == page_start + Page::kPageSize); | 78 CHECK(p->ObjectAreaEnd() == page_start + Page::kPageSize); |
| 77 | 79 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 CHECK(!lo->IsEmpty()); | 247 CHECK(!lo->IsEmpty()); |
| 246 | 248 |
| 247 obj = lo->AllocateRaw(lo_size); | 249 obj = lo->AllocateRaw(lo_size); |
| 248 CHECK(obj->IsFailure()); | 250 CHECK(obj->IsFailure()); |
| 249 | 251 |
| 250 lo->TearDown(); | 252 lo->TearDown(); |
| 251 delete lo; | 253 delete lo; |
| 252 | 254 |
| 253 Isolate::Current()->memory_allocator()->TearDown(); | 255 Isolate::Current()->memory_allocator()->TearDown(); |
| 254 } | 256 } |
| OLD | NEW |