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