| 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 5782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5793 void Heap::CompactWeakFixedArrays() { | 5793 void Heap::CompactWeakFixedArrays() { |
| 5794 // Find known WeakFixedArrays and compact them. | 5794 // Find known WeakFixedArrays and compact them. |
| 5795 HeapIterator iterator(this); | 5795 HeapIterator iterator(this); |
| 5796 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { | 5796 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { |
| 5797 if (o->IsPrototypeInfo()) { | 5797 if (o->IsPrototypeInfo()) { |
| 5798 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users(); | 5798 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users(); |
| 5799 if (prototype_users->IsWeakFixedArray()) { | 5799 if (prototype_users->IsWeakFixedArray()) { |
| 5800 WeakFixedArray* array = WeakFixedArray::cast(prototype_users); | 5800 WeakFixedArray* array = WeakFixedArray::cast(prototype_users); |
| 5801 array->Compact<JSObject::PrototypeRegistryCompactionCallback>(); | 5801 array->Compact<JSObject::PrototypeRegistryCompactionCallback>(); |
| 5802 } | 5802 } |
| 5803 } else if (o->IsScript()) { | |
| 5804 CompactWeakFixedArray(Script::cast(o)->shared_function_infos()); | |
| 5805 } | 5803 } |
| 5806 } | 5804 } |
| 5807 CompactWeakFixedArray(noscript_shared_function_infos()); | 5805 CompactWeakFixedArray(noscript_shared_function_infos()); |
| 5808 CompactWeakFixedArray(script_list()); | 5806 CompactWeakFixedArray(script_list()); |
| 5809 CompactWeakFixedArray(weak_stack_trace_list()); | 5807 CompactWeakFixedArray(weak_stack_trace_list()); |
| 5810 } | 5808 } |
| 5811 | 5809 |
| 5812 void Heap::AddRetainedMap(Handle<Map> map) { | 5810 void Heap::AddRetainedMap(Handle<Map> map) { |
| 5813 Handle<WeakCell> cell = Map::WeakCellForMap(map); | 5811 Handle<WeakCell> cell = Map::WeakCellForMap(map); |
| 5814 Handle<ArrayList> array(retained_maps(), isolate()); | 5812 Handle<ArrayList> array(retained_maps(), isolate()); |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6492 } | 6490 } |
| 6493 | 6491 |
| 6494 | 6492 |
| 6495 // static | 6493 // static |
| 6496 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6494 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6497 return StaticVisitorBase::GetVisitorId(map); | 6495 return StaticVisitorBase::GetVisitorId(map); |
| 6498 } | 6496 } |
| 6499 | 6497 |
| 6500 } // namespace internal | 6498 } // namespace internal |
| 6501 } // namespace v8 | 6499 } // namespace v8 |
| OLD | NEW |