Index: src/contexts.h |
diff --git a/src/contexts.h b/src/contexts.h |
index 05bc3b55ec872f65ce3b934b0639fcb98beb0e2b..4e4dd2c8e72c2d5efb56684c87f30b3924a88c9f 100644 |
--- a/src/contexts.h |
+++ b/src/contexts.h |
@@ -314,12 +314,11 @@ class ScriptContextTable : public FixedArray { |
}; |
int used() const { return Smi::cast(get(kUsedSlot))->value(); } |
- |
void set_used(int used) { set(kUsedSlot, Smi::FromInt(used)); } |
static Handle<Context> GetContext(Handle<ScriptContextTable> table, int i) { |
DCHECK(i < table->used()); |
- return Handle<Context>::cast(FixedArray::get(table, i + 1)); |
+ return Handle<Context>::cast(FixedArray::get(table, i + kFirstContextSlot)); |
} |
// Lookup a variable `name` in a ScriptContextTable. |
@@ -340,8 +339,9 @@ class ScriptContextTable : public FixedArray { |
private: |
static const int kUsedSlot = 0; |
+ static const int kFirstContextSlot = kUsedSlot + 1; |
static const int kFirstContextOffset = |
- FixedArray::kHeaderSize + (kUsedSlot + 1) * kPointerSize; |
+ FixedArray::kHeaderSize + kFirstContextSlot * kPointerSize; |
DISALLOW_IMPLICIT_CONSTRUCTORS(ScriptContextTable); |
}; |