Chromium Code Reviews| 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); } |