OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 void StoreBuffer::FindPointersToNewSpaceOnPage( | 516 void StoreBuffer::FindPointersToNewSpaceOnPage( |
517 PagedSpace* space, | 517 PagedSpace* space, |
518 Page* page, | 518 Page* page, |
519 RegionCallback region_callback, | 519 RegionCallback region_callback, |
520 ObjectSlotCallback slot_callback, | 520 ObjectSlotCallback slot_callback, |
521 bool clear_maps) { | 521 bool clear_maps) { |
522 Address visitable_start = page->area_start(); | 522 Address visitable_start = page->area_start(); |
523 Address end_of_page = page->area_end(); | 523 Address end_of_page = page->area_end(); |
524 | 524 |
525 Address visitable_end = visitable_start; | 525 Address visitable_end = visitable_start; |
526 Address current_constant_pool_end = 0; | |
526 | 527 |
527 Object* free_space_map = heap_->free_space_map(); | 528 Object* free_space_map = heap_->free_space_map(); |
528 Object* two_pointer_filler_map = heap_->two_pointer_filler_map(); | 529 Object* two_pointer_filler_map = heap_->two_pointer_filler_map(); |
530 Object* constant_pool_array_map = heap_->constant_pool_array_map(); | |
529 | 531 |
530 while (visitable_end < end_of_page) { | 532 while (visitable_end < end_of_page) { |
531 Object* o = *reinterpret_cast<Object**>(visitable_end); | 533 Object* o = *reinterpret_cast<Object**>(visitable_end); |
534 if (o == constant_pool_array_map) { | |
Hannes Payer (out of office)
2014/03/03 13:56:13
I don't think a constant pool can contain old-to-n
rmcilroy
2014/03/03 15:07:48
You are right, skipping it entirely probably simpl
| |
535 // Constant pool arrays can contain pointers to the free_space_map or | |
536 // two_pointer_filler_map which should not be treated as fillers objects. | |
537 current_constant_pool_end = | |
538 visitable_end + HeapObject::FromAddress(visitable_end)->Size(); | |
539 } | |
532 // Skip fillers but not things that look like fillers in the special | 540 // Skip fillers but not things that look like fillers in the special |
533 // garbage section which can contain anything. | 541 // garbage section which can contain anything. |
534 if (o == free_space_map || | 542 if (o == free_space_map || |
535 o == two_pointer_filler_map || | 543 o == two_pointer_filler_map || |
536 (visitable_end == space->top() && visitable_end != space->limit())) { | 544 (visitable_end == space->top() && visitable_end != space->limit())) { |
537 if (visitable_start != visitable_end) { | 545 if (visitable_start != visitable_end) { |
538 // After calling this the special garbage section may have moved. | 546 // After calling this the special garbage section may have moved. |
539 (this->*region_callback)(visitable_start, | 547 (this->*region_callback)(visitable_start, |
540 visitable_end, | 548 visitable_end, |
541 slot_callback, | 549 slot_callback, |
542 clear_maps); | 550 clear_maps); |
543 if (visitable_end >= space->top() && visitable_end < space->limit()) { | 551 if (visitable_end >= space->top() && visitable_end < space->limit()) { |
544 visitable_end = space->limit(); | 552 visitable_end = space->limit(); |
545 visitable_start = visitable_end; | 553 visitable_start = visitable_end; |
546 continue; | 554 continue; |
547 } | 555 } |
548 } | 556 } |
549 if (visitable_end == space->top() && visitable_end != space->limit()) { | 557 if (visitable_end == space->top() && visitable_end != space->limit()) { |
550 visitable_start = visitable_end = space->limit(); | 558 visitable_start = visitable_end = space->limit(); |
559 } else if (visitable_end <= current_constant_pool_end) { | |
560 // If we are still within a constant pool object then we don't treat | |
561 // free_space_map or two_pointer_filler_map as filler objects, since | |
562 // they are just pointers to the map objects used by compiled code. | |
563 visitable_end += kPointerSize; | |
551 } else { | 564 } else { |
552 // At this point we are either at the start of a filler or we are at | 565 // At this point we are either at the start of a filler or we are at |
553 // the point where the space->top() used to be before the | 566 // the point where the space->top() used to be before the |
554 // visit_pointer_region call above. Either way we can skip the | 567 // visit_pointer_region call above. Either way we can skip the |
555 // object at the current spot: We don't promise to visit objects | 568 // object at the current spot: We don't promise to visit objects |
556 // allocated during heap traversal, and if space->top() moved then it | 569 // allocated during heap traversal, and if space->top() moved then it |
557 // must be because an object was allocated at this point. | 570 // must be because an object was allocated at this point. |
558 visitable_start = | 571 visitable_start = |
559 visitable_end + HeapObject::FromAddress(visitable_end)->Size(); | 572 visitable_end + HeapObject::FromAddress(visitable_end)->Size(); |
560 visitable_end = visitable_start; | 573 visitable_end = visitable_start; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
724 } | 737 } |
725 old_buffer_is_sorted_ = false; | 738 old_buffer_is_sorted_ = false; |
726 old_buffer_is_filtered_ = false; | 739 old_buffer_is_filtered_ = false; |
727 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 740 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
728 ASSERT(old_top_ <= old_limit_); | 741 ASSERT(old_top_ <= old_limit_); |
729 } | 742 } |
730 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 743 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
731 } | 744 } |
732 | 745 |
733 } } // namespace v8::internal | 746 } } // namespace v8::internal |
OLD | NEW |