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

Unified Diff: src/contexts.h

Issue 1317383002: Crankshaft is now able to compile top level code even if there is a ScriptContext. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 5 years, 4 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/compiler/ast-graph-builder.cc ('k') | src/contexts.cc » ('j') | no next file with comments »
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 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);
};
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698