OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3614 ASSERT(allocation_sites_scratchpad()->length() == | 3614 ASSERT(allocation_sites_scratchpad()->length() == |
3615 kAllocationSiteScratchpadSize); | 3615 kAllocationSiteScratchpadSize); |
3616 for (int i = 0; i < kAllocationSiteScratchpadSize; i++) { | 3616 for (int i = 0; i < kAllocationSiteScratchpadSize; i++) { |
3617 allocation_sites_scratchpad()->set_undefined(i); | 3617 allocation_sites_scratchpad()->set_undefined(i); |
3618 } | 3618 } |
3619 } | 3619 } |
3620 | 3620 |
3621 | 3621 |
3622 void Heap::AddAllocationSiteToScratchpad(AllocationSite* site) { | 3622 void Heap::AddAllocationSiteToScratchpad(AllocationSite* site) { |
3623 if (allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize) { | 3623 if (allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize) { |
3624 // Since the processing of the allocation sites scratchpad happens after | |
3625 // evacuation, we have to explicitly record the slot to take evacuation | |
3626 // candidates into account. | |
Michael Starzinger
2014/02/11 10:48:48
Maybe make it explicit in the comment that "we can
Hannes Payer (out of office)
2014/02/11 10:52:20
Done.
| |
3624 allocation_sites_scratchpad()->set( | 3627 allocation_sites_scratchpad()->set( |
3625 allocation_sites_scratchpad_length_, site); | 3628 allocation_sites_scratchpad_length_, site, SKIP_WRITE_BARRIER); |
3629 Object** slot = allocation_sites_scratchpad()->RawFieldOfElementAt( | |
3630 allocation_sites_scratchpad_length_); | |
3631 mark_compact_collector()->RecordSlot(slot, slot, *slot); | |
3626 allocation_sites_scratchpad_length_++; | 3632 allocation_sites_scratchpad_length_++; |
3627 } | 3633 } |
3628 } | 3634 } |
3629 | 3635 |
3630 | 3636 |
3631 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { | 3637 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { |
3632 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); | 3638 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); |
3633 } | 3639 } |
3634 | 3640 |
3635 | 3641 |
(...skipping 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7699 static_cast<int>(object_sizes_last_time_[index])); | 7705 static_cast<int>(object_sizes_last_time_[index])); |
7700 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7706 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
7701 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7707 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7702 | 7708 |
7703 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7709 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7704 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7710 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7705 ClearObjectStats(); | 7711 ClearObjectStats(); |
7706 } | 7712 } |
7707 | 7713 |
7708 } } // namespace v8::internal | 7714 } } // namespace v8::internal |
OLD | NEW |