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/heap.h" | 5 #include "src/heap/heap.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/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 5775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5786 void Heap::CompactWeakFixedArrays() { | 5786 void Heap::CompactWeakFixedArrays() { |
5787 // Find known WeakFixedArrays and compact them. | 5787 // Find known WeakFixedArrays and compact them. |
5788 HeapIterator iterator(this); | 5788 HeapIterator iterator(this); |
5789 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { | 5789 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { |
5790 if (o->IsPrototypeInfo()) { | 5790 if (o->IsPrototypeInfo()) { |
5791 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users(); | 5791 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users(); |
5792 if (prototype_users->IsWeakFixedArray()) { | 5792 if (prototype_users->IsWeakFixedArray()) { |
5793 WeakFixedArray* array = WeakFixedArray::cast(prototype_users); | 5793 WeakFixedArray* array = WeakFixedArray::cast(prototype_users); |
5794 array->Compact<JSObject::PrototypeRegistryCompactionCallback>(); | 5794 array->Compact<JSObject::PrototypeRegistryCompactionCallback>(); |
5795 } | 5795 } |
| 5796 } else if (o->IsScript()) { |
| 5797 CompactWeakFixedArray(Script::cast(o)->shared_function_infos()); |
5796 } | 5798 } |
5797 } | 5799 } |
5798 CompactWeakFixedArray(noscript_shared_function_infos()); | 5800 CompactWeakFixedArray(noscript_shared_function_infos()); |
5799 CompactWeakFixedArray(script_list()); | 5801 CompactWeakFixedArray(script_list()); |
5800 CompactWeakFixedArray(weak_stack_trace_list()); | 5802 CompactWeakFixedArray(weak_stack_trace_list()); |
5801 } | 5803 } |
5802 | 5804 |
5803 void Heap::AddRetainedMap(Handle<Map> map) { | 5805 void Heap::AddRetainedMap(Handle<Map> map) { |
5804 Handle<WeakCell> cell = Map::WeakCellForMap(map); | 5806 Handle<WeakCell> cell = Map::WeakCellForMap(map); |
5805 Handle<ArrayList> array(retained_maps(), isolate()); | 5807 Handle<ArrayList> array(retained_maps(), isolate()); |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6483 } | 6485 } |
6484 | 6486 |
6485 | 6487 |
6486 // static | 6488 // static |
6487 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6489 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6488 return StaticVisitorBase::GetVisitorId(map); | 6490 return StaticVisitorBase::GetVisitorId(map); |
6489 } | 6491 } |
6490 | 6492 |
6491 } // namespace internal | 6493 } // namespace internal |
6492 } // namespace v8 | 6494 } // namespace v8 |
OLD | NEW |