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: 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 5768 matching lines...) Expand 10 before | Expand all | Expand 10 after
5779 void Heap::CompactWeakFixedArrays() { 5779 void Heap::CompactWeakFixedArrays() {
5780 // Find known WeakFixedArrays and compact them. 5780 // Find known WeakFixedArrays and compact them.
5781 HeapIterator iterator(this); 5781 HeapIterator iterator(this);
5782 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { 5782 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) {
5783 if (o->IsPrototypeInfo()) { 5783 if (o->IsPrototypeInfo()) {
5784 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users(); 5784 Object* prototype_users = PrototypeInfo::cast(o)->prototype_users();
5785 if (prototype_users->IsWeakFixedArray()) { 5785 if (prototype_users->IsWeakFixedArray()) {
5786 WeakFixedArray* array = WeakFixedArray::cast(prototype_users); 5786 WeakFixedArray* array = WeakFixedArray::cast(prototype_users);
5787 array->Compact<JSObject::PrototypeRegistryCompactionCallback>(); 5787 array->Compact<JSObject::PrototypeRegistryCompactionCallback>();
5788 } 5788 }
5789 } else if (o->IsScript()) {
5790 CompactWeakFixedArray(Script::cast(o)->shared_function_infos());
5791 } 5789 }
5792 } 5790 }
5793 CompactWeakFixedArray(noscript_shared_function_infos()); 5791 CompactWeakFixedArray(noscript_shared_function_infos());
5794 CompactWeakFixedArray(script_list()); 5792 CompactWeakFixedArray(script_list());
5795 CompactWeakFixedArray(weak_stack_trace_list()); 5793 CompactWeakFixedArray(weak_stack_trace_list());
5796 } 5794 }
5797 5795
5798 void Heap::AddRetainedMap(Handle<Map> map) { 5796 void Heap::AddRetainedMap(Handle<Map> map) {
5799 Handle<WeakCell> cell = Map::WeakCellForMap(map); 5797 Handle<WeakCell> cell = Map::WeakCellForMap(map);
5800 Handle<ArrayList> array(retained_maps(), isolate()); 5798 Handle<ArrayList> array(retained_maps(), isolate());
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
6478 } 6476 }
6479 6477
6480 6478
6481 // static 6479 // static
6482 int Heap::GetStaticVisitorIdForMap(Map* map) { 6480 int Heap::GetStaticVisitorIdForMap(Map* map) {
6483 return StaticVisitorBase::GetVisitorId(map); 6481 return StaticVisitorBase::GetVisitorId(map);
6484 } 6482 }
6485 6483
6486 } // namespace internal 6484 } // namespace internal
6487 } // namespace v8 6485 } // namespace v8
OLDNEW
« src/debug/liveedit.js ('K') | « src/factory.cc ('k') | src/heap/object-stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698