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/heap/mark-compact.h" | 5 #include "src/heap/mark-compact.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/base/sys-info.h" | 9 #include "src/base/sys-info.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 number_of_own_descriptors); | 2490 number_of_own_descriptors); |
2491 SLOW_DCHECK(layout_descriptor->IsConsistentWithMap(map, true)); | 2491 SLOW_DCHECK(layout_descriptor->IsConsistentWithMap(map, true)); |
2492 } | 2492 } |
2493 } | 2493 } |
2494 | 2494 |
2495 | 2495 |
2496 void MarkCompactCollector::TrimEnumCache(Map* map, | 2496 void MarkCompactCollector::TrimEnumCache(Map* map, |
2497 DescriptorArray* descriptors) { | 2497 DescriptorArray* descriptors) { |
2498 int live_enum = map->EnumLength(); | 2498 int live_enum = map->EnumLength(); |
2499 if (live_enum == kInvalidEnumCacheSentinel) { | 2499 if (live_enum == kInvalidEnumCacheSentinel) { |
2500 live_enum = map->NumberOfDescribedProperties(OWN_DESCRIPTORS, DONT_ENUM); | 2500 live_enum = |
| 2501 map->NumberOfDescribedProperties(OWN_DESCRIPTORS, ENUMERABLE_STRINGS); |
2501 } | 2502 } |
2502 if (live_enum == 0) return descriptors->ClearEnumCache(); | 2503 if (live_enum == 0) return descriptors->ClearEnumCache(); |
2503 | 2504 |
2504 FixedArray* enum_cache = descriptors->GetEnumCache(); | 2505 FixedArray* enum_cache = descriptors->GetEnumCache(); |
2505 | 2506 |
2506 int to_trim = enum_cache->length() - live_enum; | 2507 int to_trim = enum_cache->length() - live_enum; |
2507 if (to_trim <= 0) return; | 2508 if (to_trim <= 0) return; |
2508 heap_->RightTrimFixedArray<Heap::SEQUENTIAL_TO_SWEEPER>( | 2509 heap_->RightTrimFixedArray<Heap::SEQUENTIAL_TO_SWEEPER>( |
2509 descriptors->GetEnumCache(), to_trim); | 2510 descriptors->GetEnumCache(), to_trim); |
2510 | 2511 |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4134 MarkBit mark_bit = Marking::MarkBitFrom(host); | 4135 MarkBit mark_bit = Marking::MarkBitFrom(host); |
4135 if (Marking::IsBlack(mark_bit)) { | 4136 if (Marking::IsBlack(mark_bit)) { |
4136 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 4137 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
4137 RecordRelocSlot(&rinfo, target); | 4138 RecordRelocSlot(&rinfo, target); |
4138 } | 4139 } |
4139 } | 4140 } |
4140 } | 4141 } |
4141 | 4142 |
4142 } // namespace internal | 4143 } // namespace internal |
4143 } // namespace v8 | 4144 } // namespace v8 |
OLD | NEW |