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

Unified Diff: src/contexts.h

Issue 3764011: Link all global contexts into a weak list. (Closed)
Patch Set: Created 10 years, 2 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/bootstrapper.cc ('k') | src/heap.h » ('j') | src/mark-compact.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.h
diff --git a/src/contexts.h b/src/contexts.h
index 78dda6a64a6d73df78be031acb4b7f50148b05e4..e55c64c59f0bd3a487d0b95ae52101f57dd6b933 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -225,7 +225,14 @@ class Context: public FixedArray {
OUT_OF_MEMORY_INDEX,
MAP_CACHE_INDEX,
CONTEXT_DATA_INDEX,
- GLOBAL_CONTEXT_SLOTS
+
+ // Properties from here get weak reference treatment by the GC.
+ NEXT_CONTEXT_LINK, // Weak.
+
+ // Total number of slots.
+ GLOBAL_CONTEXT_SLOTS,
+
+ FIRST_WEAK_SLOT = NEXT_CONTEXT_LINK
};
// Direct slot access.
@@ -333,6 +340,17 @@ class Context: public FixedArray {
return kHeaderSize + index * kPointerSize - kHeapObjectTag;
}
+ static const int kSize = kHeaderSize + GLOBAL_CONTEXT_SLOTS * kPointerSize;
+
+ // GC support.
Søren Thygesen Gjesse 2010/10/18 14:31:10 Maybe extend the comment to say that during scaven
+ typedef FixedBodyDescriptor<
+ kHeaderSize, kSize, kSize> ScavengeBodyDescriptor;
+
+ typedef FixedBodyDescriptor<
+ kHeaderSize,
+ kHeaderSize + FIRST_WEAK_SLOT * kPointerSize,
+ kSize> MarkCompactBodyDescriptor;
+
private:
// Unchecked access to the slots.
Object* unchecked_previous() { return get(PREVIOUS_INDEX); }
« no previous file with comments | « src/bootstrapper.cc ('k') | src/heap.h » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698