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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 | 531 |
532 void PagedSpace::ClearRSet() { | 532 void PagedSpace::ClearRSet() { |
533 PageIterator it(this, PageIterator::ALL_PAGES); | 533 PageIterator it(this, PageIterator::ALL_PAGES); |
534 while (it.has_next()) { | 534 while (it.has_next()) { |
535 it.next()->ClearRSet(); | 535 it.next()->ClearRSet(); |
536 } | 536 } |
537 } | 537 } |
538 | 538 |
539 | 539 |
540 Object* PagedSpace::FindObject(Address addr) { | 540 Object* PagedSpace::FindObject(Address addr) { |
541 #ifdef DEBUG | |
542 // Note: this function can only be called before or after mark-compact GC | 541 // Note: this function can only be called before or after mark-compact GC |
543 // because it accesses map pointers. | 542 // because it accesses map pointers. |
544 ASSERT(!MarkCompactCollector::in_use()); | 543 ASSERT(!MarkCompactCollector::in_use()); |
545 #endif | |
546 | 544 |
547 if (!Contains(addr)) return Failure::Exception(); | 545 if (!Contains(addr)) return Failure::Exception(); |
548 | 546 |
549 Page* p = Page::FromAddress(addr); | 547 Page* p = Page::FromAddress(addr); |
550 ASSERT(IsUsed(p)); | 548 ASSERT(IsUsed(p)); |
551 Address cur = p->ObjectAreaStart(); | 549 Address cur = p->ObjectAreaStart(); |
552 Address end = p->AllocationTop(); | 550 Address end = p->AllocationTop(); |
553 while (cur < end) { | 551 while (cur < end) { |
554 HeapObject* obj = HeapObject::FromAddress(cur); | 552 HeapObject* obj = HeapObject::FromAddress(cur); |
555 Address next = cur + obj->Size(); | 553 Address next = cur + obj->Size(); |
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2537 reinterpret_cast<Object**>(object->address() | 2535 reinterpret_cast<Object**>(object->address() |
2538 + Page::kObjectAreaSize), | 2536 + Page::kObjectAreaSize), |
2539 allocation_top); | 2537 allocation_top); |
2540 PrintF("\n"); | 2538 PrintF("\n"); |
2541 } | 2539 } |
2542 } | 2540 } |
2543 } | 2541 } |
2544 #endif // DEBUG | 2542 #endif // DEBUG |
2545 | 2543 |
2546 } } // namespace v8::internal | 2544 } } // namespace v8::internal |
OLD | NEW |