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

Unified Diff: src/heap.h

Issue 11880018: Reland r13188, r13194, r13256 (Deferred formatting of error stack trace during GC). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix Created 7 years, 11 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.cc ('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
diff --git a/src/heap.h b/src/heap.h
index a2564a5a4f9b3b6f2565aa552837ff00ac504146..1615db5527dbcb8fc036c1a2f9a895051b303910 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -209,6 +209,7 @@ namespace internal {
V(char_at_symbol, "CharAt") \
V(undefined_symbol, "undefined") \
V(value_of_symbol, "valueOf") \
+ V(stack_symbol, "stack") \
V(InitializeVarGlobal_symbol, "InitializeVarGlobal") \
V(InitializeConstGlobal_symbol, "InitializeConstGlobal") \
V(KeyedLoadElementMonomorphic_symbol, \
@@ -427,6 +428,41 @@ class ExternalStringTable {
};
+// The stack property of an error object is implemented as a getter that
+// formats the attached raw stack trace into a string. This raw stack trace
+// keeps code and function objects alive until the getter is called the first
+// time. To release those objects, we call the getter after each GC for
+// newly tenured error objects that are kept in a list.
+class ErrorObjectList {
+ public:
+ inline void Add(JSObject* object);
+
+ inline void Iterate(ObjectVisitor* v);
+
+ void TearDown();
+
+ void RemoveUnmarked(Heap* heap);
+
+ void DeferredFormatStackTrace(Isolate* isolate);
+
+ void UpdateReferences();
+
+ void UpdateReferencesInNewSpace(Heap* heap);
+
+ private:
+ static const int kBudgetPerGC = 16;
+
+ ErrorObjectList() : nested_(false) { }
+
+ friend class Heap;
+
+ List<Object*> list_;
+ bool nested_;
+
+ DISALLOW_COPY_AND_ASSIGN(ErrorObjectList);
+};
+
+
enum ArrayStorageAllocationMode {
DONT_INITIALIZE_ARRAY_ELEMENTS,
INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE
@@ -1589,6 +1625,10 @@ class Heap {
return &external_string_table_;
}
+ ErrorObjectList* error_object_list() {
+ return &error_object_list_;
+ }
+
// Returns the current sweep generation.
int sweep_generation() {
return sweep_generation_;
@@ -2165,6 +2205,8 @@ class Heap {
ExternalStringTable external_string_table_;
+ ErrorObjectList error_object_list_;
+
VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
MemoryChunk* chunks_queued_for_free_;
« no previous file with comments | « src/handles.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698