28 #ifndef V8_LIVEOBJECTLIST_H_
29 #define V8_LIVEOBJECTLIST_H_
41 #ifdef LIVE_OBJECT_LIST
50 typedef int LiveObjectType;
52 class LiveObjectSummary;
75 class LiveObjectList {
91 static bool Delete(
int id);
92 static MaybeObject*
Dump(
int id1,
96 Handle<JSObject> filter_obj);
97 static MaybeObject*
Info(
int start_idx,
int dump_limit);
98 static MaybeObject*
Summarize(
int id1,
int id2, Handle<JSObject> filter_obj);
105 Handle<JSObject> instance_filter,
109 Handle<JSObject> filter_obj);
113 Handle<JSObject> instance_filter);
122 explicit LiveObjectList(LiveObjectList* prev,
int capacity);
125 static void GCEpiloguePrivate();
126 static void IterateElementsPrivate(ObjectVisitor* v);
128 static void DoProcessNonLive(HeapObject* obj);
130 static int CompareElement(
const Element* a,
const Element* b);
132 static Object* GetPathPrivate(HeapObject* obj1, HeapObject* obj2);
134 static int GetRetainers(Handle<HeapObject> target,
135 Handle<JSObject> instance_filter,
136 Handle<FixedArray> retainers_arr,
141 LiveObjectSummary* summary,
142 JSFunction* arguments_function,
143 Handle<Object> error);
145 static MaybeObject* DumpPrivate(DumpWriter* writer,
149 static MaybeObject* SummarizePrivate(SummaryWriter* writer,
151 bool is_tracking_roots);
153 static bool NeedLOLProcessing() {
return (last() !=
NULL); }
154 static void NullifyNonLivePointer(HeapObject** p) {
163 *p =
reinterpret_cast<HeapObject*
>((*p)->address());
166 LiveObjectList* prev() {
return prev_; }
167 LiveObjectList* next() {
return next_; }
168 int id() {
return id_; }
170 static int list_count() {
return list_count_; }
171 static LiveObjectList* last() {
return last_; }
173 inline static LiveObjectList* FindLolForId(
int id, LiveObjectList* start_lol);
174 int TotalObjCount() {
return GetTotalObjCountAndSize(
NULL); }
175 int GetTotalObjCountAndSize(
int* size_p);
177 bool Add(HeapObject* obj);
178 Element* Find(HeapObject* obj);
179 static void NullifyMostRecent(HeapObject* obj);
181 static void SortAll();
183 static void PurgeDuplicates();
186 static void Verify(
bool match_heap_exactly =
false);
187 static void VerifyNotInFromSpace();
192 template <
typename T>
193 inline static LiveObjectList::Element*
194 FindElementFor(
T (*GetValue)(LiveObjectList::Element*),
T key);
196 inline static int GetElementId(Element* element);
197 inline static HeapObject* GetElementObj(Element* element);
200 LiveObjectList* prev_;
201 LiveObjectList* next_;
208 static uint32_t next_element_id_;
209 static int list_count_;
211 static LiveObjectList* first_;
212 static LiveObjectList* last_;
214 friend class LolIterator;
215 friend class LolForwardIterator;
216 friend class LolDumpWriter;
217 friend class RetainersDumpWriter;
218 friend class RetainersSummaryWriter;
219 friend class UpdateLiveObjectListVisitor;
224 class UpdateLiveObjectListVisitor:
public ObjectVisitor {
226 void VisitPointer(
Object** p) { UpdatePointer(p); }
230 for (
Object** p = start; p < end; p++) UpdatePointer(p);
236 void UpdatePointer(
Object** p) {
238 if (!
HEAP->InNewSpace(
object))
return;
247 MapWord first_word = heap_obj->map_word();
251 if (first_word.IsForwardingAddress()) {
252 *p = first_word.ToForwardingAddress();
257 LiveObjectList::NullifyNonLivePointer(reinterpret_cast<HeapObject**>(p));
263 #else // !LIVE_OBJECT_LIST
274 inline static MaybeObject*
Capture() {
return HEAP->undefined_value(); }
275 inline static bool Delete(
int id) {
return false; }
276 inline static MaybeObject*
Dump(
int id1,
281 return HEAP->undefined_value();
283 inline static MaybeObject*
Info(
int start_idx,
int dump_limit) {
284 return HEAP->undefined_value();
289 return HEAP->undefined_value();
295 return HEAP->undefined_value();
303 return HEAP->undefined_value();
309 return HEAP->undefined_value();
315 #endif // LIVE_OBJECT_LIST
319 #endif // V8_LIVEOBJECTLIST_H_
static Object * GetObjId(Handle< String > address)
static HeapObject * cast(Object *obj)
static bool Delete(int id)
static void IterateElements(ObjectVisitor *v)
#define ASSERT(condition)
static MaybeObject * Summarize(int id1, int id2, Handle< JSObject > filter_obj)
static MaybeObject * Info(int start_idx, int dump_limit)
static MaybeObject * Dump(int id1, int id2, int start_idx, int dump_limit, Handle< JSObject > filter_obj)
static MaybeObject * GetObjRetainers(int obj_id, Handle< JSObject > instance_filter, bool verbose, int start, int count, Handle< JSObject > filter_obj)
#define T(name, string, precedence)
static void UpdateReferencesForScavengeGC()
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
static Object * GetPath(int obj_id1, int obj_id2, Handle< JSObject > instance_filter)
static Object * GetObj(int obj_id)
static MaybeObject * Capture()
static Object * PrintObj(int obj_id)
static void ProcessNonLive(HeapObject *obj)