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

Unified Diff: src/heap.h

Issue 6614010: [Isolates] Merge 6700:7030 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/handles-inl.h ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
===================================================================
--- src/heap.h (revision 7031)
+++ src/heap.h (working copy)
@@ -30,6 +30,8 @@
#include <math.h>
+#include "globals.h"
+#include "list.h"
#include "mark-compact.h"
#include "spaces.h"
#include "splay-tree-inl.h"
@@ -190,6 +192,7 @@
V(KeyedLoadSpecialized_symbol, "KeyedLoadSpecialized") \
V(KeyedStoreSpecialized_symbol, "KeyedStoreSpecialized") \
V(KeyedLoadPixelArray_symbol, "KeyedLoadPixelArray") \
+ V(KeyedStorePixelArray_symbol, "KeyedStorePixelArray") \
V(stack_overflow_symbol, "kStackOverflowBoilerplate") \
V(illegal_access_symbol, "illegal access") \
V(out_of_memory_symbol, "out-of-memory") \
@@ -1271,7 +1274,7 @@
int mc_count_; // how many mark-compact collections happened
int ms_count_; // how many mark-sweep collections happened
- int gc_count_; // how many gc happened
+ unsigned int gc_count_; // how many gc happened
// Total length of the strings we failed to flatten since the last GC.
int unflattened_strings_length_;
@@ -1562,7 +1565,7 @@
intptr_t page_watermark_invalidated_mark_;
int number_idle_notifications_;
- int last_idle_notification_gc_count_;
+ unsigned int last_idle_notification_gc_count_;
bool last_idle_notification_gc_count_init_;
// Shared state read by the scavenge collector and set by ScavengeObject.
@@ -2021,7 +2024,7 @@
void set_collector(GarbageCollector collector) { collector_ = collector; }
// Sets the GC count.
- void set_gc_count(int count) { gc_count_ = count; }
+ void set_gc_count(unsigned int count) { gc_count_ = count; }
// Sets the full GC count.
void set_full_gc_count(int count) { full_gc_count_ = count; }
@@ -2055,7 +2058,7 @@
// A count (including this one, eg, the first collection is 1) of the
// number of garbage collections.
- int gc_count_;
+ unsigned int gc_count_;
// A count (including this one) of the number of full garbage collections.
int full_gc_count_;
@@ -2185,6 +2188,65 @@
};
+#if defined(DEBUG) || defined(LIVE_OBJECT_LIST)
+// Helper class for tracing paths to a search target Object from all roots.
+// The TracePathFrom() method can be used to trace paths from a specific
+// object to the search target object.
+class PathTracer : public ObjectVisitor {
+ public:
+ enum WhatToFind {
+ FIND_ALL, // Will find all matches.
+ FIND_FIRST // Will stop the search after first match.
+ };
+
+ // For the WhatToFind arg, if FIND_FIRST is specified, tracing will stop
+ // after the first match. If FIND_ALL is specified, then tracing will be
+ // done for all matches.
+ PathTracer(Object* search_target,
+ WhatToFind what_to_find,
+ VisitMode visit_mode)
+ : search_target_(search_target),
+ found_target_(false),
+ found_target_in_trace_(false),
+ what_to_find_(what_to_find),
+ visit_mode_(visit_mode),
+ object_stack_(20),
+ no_alloc() {}
+
+ virtual void VisitPointers(Object** start, Object** end);
+
+ void Reset();
+ void TracePathFrom(Object** root);
+
+ bool found() const { return found_target_; }
+
+ static Object* const kAnyGlobalObject;
+
+ protected:
+ class MarkVisitor;
+ class UnmarkVisitor;
+
+ void MarkRecursively(Object** p, MarkVisitor* mark_visitor);
+ void UnmarkRecursively(Object** p, UnmarkVisitor* unmark_visitor);
+ virtual void ProcessResults();
+
+ // Tags 0, 1, and 3 are used. Use 2 for marking visited HeapObject.
+ static const int kMarkTag = 2;
+
+ Object* search_target_;
+ bool found_target_;
+ bool found_target_in_trace_;
+ WhatToFind what_to_find_;
+ VisitMode visit_mode_;
+ List<Object*> object_stack_;
+
+ AssertNoAllocation no_alloc; // i.e. no gc allowed.
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
+};
+#endif // DEBUG || LIVE_OBJECT_LIST
+
+
} } // namespace v8::internal
#undef HEAP
« no previous file with comments | « src/handles-inl.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698