| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 #ifdef DEBUG | 578 #ifdef DEBUG |
| 579 size_t chunk_size = chunks_[chunk_id].size(); | 579 size_t chunk_size = chunks_[chunk_id].size(); |
| 580 Address high = RoundDown(chunk_start + chunk_size, Page::kPageSize); | 580 Address high = RoundDown(chunk_start + chunk_size, Page::kPageSize); |
| 581 ASSERT(pages_in_chunk <= | 581 ASSERT(pages_in_chunk <= |
| 582 ((OffsetFrom(high) - OffsetFrom(low)) / Page::kPageSize)); | 582 ((OffsetFrom(high) - OffsetFrom(low)) / Page::kPageSize)); |
| 583 #endif | 583 #endif |
| 584 | 584 |
| 585 Address page_addr = low; | 585 Address page_addr = low; |
| 586 for (int i = 0; i < pages_in_chunk; i++) { | 586 for (int i = 0; i < pages_in_chunk; i++) { |
| 587 Page* p = Page::FromAddress(page_addr); | 587 Page* p = Page::FromAddress(page_addr); |
| 588 p->heap_ = owner->heap(); |
| 588 p->opaque_header = OffsetFrom(page_addr + Page::kPageSize) | chunk_id; | 589 p->opaque_header = OffsetFrom(page_addr + Page::kPageSize) | chunk_id; |
| 589 p->InvalidateWatermark(true); | 590 p->InvalidateWatermark(true); |
| 590 p->SetIsLargeObjectPage(false); | 591 p->SetIsLargeObjectPage(false); |
| 591 p->SetAllocationWatermark(p->ObjectAreaStart()); | 592 p->SetAllocationWatermark(p->ObjectAreaStart()); |
| 592 p->SetCachedAllocationWatermark(p->ObjectAreaStart()); | 593 p->SetCachedAllocationWatermark(p->ObjectAreaStart()); |
| 593 page_addr += Page::kPageSize; | 594 page_addr += Page::kPageSize; |
| 594 } | 595 } |
| 595 | 596 |
| 596 // Set the next page of the last page to 0. | 597 // Set the next page of the last page to 0. |
| 597 Page* last_page = Page::FromAddress(page_addr - Page::kPageSize); | 598 Page* last_page = Page::FromAddress(page_addr - Page::kPageSize); |
| (...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3047 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { | 3048 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { |
| 3048 if (obj->IsCode()) { | 3049 if (obj->IsCode()) { |
| 3049 Code* code = Code::cast(obj); | 3050 Code* code = Code::cast(obj); |
| 3050 isolate->code_kind_statistics()[code->kind()] += code->Size(); | 3051 isolate->code_kind_statistics()[code->kind()] += code->Size(); |
| 3051 } | 3052 } |
| 3052 } | 3053 } |
| 3053 } | 3054 } |
| 3054 #endif // DEBUG | 3055 #endif // DEBUG |
| 3055 | 3056 |
| 3056 } } // namespace v8::internal | 3057 } } // namespace v8::internal |
| OLD | NEW |