OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2057 | 2057 |
2058 UNREACHABLE(); | 2058 UNREACHABLE(); |
2059 } | 2059 } |
2060 | 2060 |
2061 | 2061 |
2062 static inline void EvacuateJSFunction(Map* map, HeapObject** slot, | 2062 static inline void EvacuateJSFunction(Map* map, HeapObject** slot, |
2063 HeapObject* object) { | 2063 HeapObject* object) { |
2064 ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< | 2064 ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< |
2065 JSFunction::kSize>(map, slot, object); | 2065 JSFunction::kSize>(map, slot, object); |
2066 | 2066 |
2067 HeapObject* target = *slot; | 2067 MapWord map_word = object->map_word(); |
| 2068 DCHECK(map_word.IsForwardingAddress()); |
| 2069 HeapObject* target = map_word.ToForwardingAddress(); |
| 2070 |
2068 MarkBit mark_bit = Marking::MarkBitFrom(target); | 2071 MarkBit mark_bit = Marking::MarkBitFrom(target); |
2069 if (Marking::IsBlack(mark_bit)) { | 2072 if (Marking::IsBlack(mark_bit)) { |
2070 // This object is black and it might not be rescanned by marker. | 2073 // This object is black and it might not be rescanned by marker. |
2071 // We should explicitly record code entry slot for compaction because | 2074 // We should explicitly record code entry slot for compaction because |
2072 // promotion queue processing (IterateAndMarkPointersToFromSpace) will | 2075 // promotion queue processing (IterateAndMarkPointersToFromSpace) will |
2073 // miss it as it is not HeapObject-tagged. | 2076 // miss it as it is not HeapObject-tagged. |
2074 Address code_entry_slot = | 2077 Address code_entry_slot = |
2075 target->address() + JSFunction::kCodeEntryOffset; | 2078 target->address() + JSFunction::kCodeEntryOffset; |
2076 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); | 2079 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); |
2077 map->GetHeap()->mark_compact_collector()->RecordCodeEntrySlot( | 2080 map->GetHeap()->mark_compact_collector()->RecordCodeEntrySlot( |
(...skipping 4045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6123 static_cast<int>(object_sizes_last_time_[index])); | 6126 static_cast<int>(object_sizes_last_time_[index])); |
6124 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6127 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6125 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6128 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6126 | 6129 |
6127 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6130 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6128 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6131 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6129 ClearObjectStats(); | 6132 ClearObjectStats(); |
6130 } | 6133 } |
6131 } | 6134 } |
6132 } // namespace v8::internal | 6135 } // namespace v8::internal |
OLD | NEW |