Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/heap/heap.cc

Issue 2547483002: Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: updates Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5767 matching lines...) Expand 10 before | Expand all | Expand 10 after
5778 void Heap::CompactWeakFixedArrays() { 5778 void Heap::CompactWeakFixedArrays() {
5779 // Find known WeakFixedArrays and compact them. 5779 // Find known WeakFixedArrays and compact them.
5780 HeapIterator iterator(this); 5780 HeapIterator iterator(this);
5781 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { 5781 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) {
5782 if (o->IsPrototypeInfo()) { 5782 if (o->IsPrototypeInfo()) {
5783 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users(); 5783 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users();
5784 if (prototype_users->IsWeakFixedArray()) { 5784 if (prototype_users->IsWeakFixedArray()) {
5785 WeakFixedArray* array = WeakFixedArray::cast(prototype_users); 5785 WeakFixedArray* array = WeakFixedArray::cast(prototype_users);
5786 array->Compact<JSObject::PrototypeRegistryCompactionCallback>(); 5786 array->Compact<JSObject::PrototypeRegistryCompactionCallback>();
5787 } 5787 }
5788 } else if (o->IsScript()) {
5789 CompactWeakFixedArray(Script::cast(o)->shared_function_infos());
5790 } 5788 }
5791 } 5789 }
5792 CompactWeakFixedArray(noscript_shared_function_infos()); 5790 CompactWeakFixedArray(noscript_shared_function_infos());
5793 CompactWeakFixedArray(script_list()); 5791 CompactWeakFixedArray(script_list());
5794 CompactWeakFixedArray(weak_stack_trace_list()); 5792 CompactWeakFixedArray(weak_stack_trace_list());
5795 } 5793 }
5796 5794
5797 void Heap::AddRetainedMap(Handle<Map> map) { 5795 void Heap::AddRetainedMap(Handle<Map> map) {
5798 Handle<WeakCell> cell = Map::WeakCellForMap(map); 5796 Handle<WeakCell> cell = Map::WeakCellForMap(map);
5799 Handle<ArrayList> array(retained_maps(), isolate()); 5797 Handle<ArrayList> array(retained_maps(), isolate());
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
6477 } 6475 }
6478 6476
6479 6477
6480 // static 6478 // static
6481 int Heap::GetStaticVisitorIdForMap(Map* map) { 6479 int Heap::GetStaticVisitorIdForMap(Map* map) {
6482 return StaticVisitorBase::GetVisitorId(map); 6480 return StaticVisitorBase::GetVisitorId(map);
6483 } 6481 }
6484 6482
6485 } // namespace internal 6483 } // namespace internal
6486 } // namespace v8 6484 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698