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

Unified Diff: src/objects.h

Issue 2271993002: Chain ScopeInfos together (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: try to please gcmole Created 4 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
« src/ast/scopes.cc ('K') | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index b4fec8ee7e35495d9622a555cec82f8396cfd821..6d278c2f2d6c325208aab9cf7e74e170ce5ce8dd 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4391,6 +4391,12 @@ class ScopeInfo : public FixedArray {
FunctionKind function_kind();
+ // Returns true if this ScopeInfo is linked to a outer ScopeInfo.
+ bool HasOuterScopeInfo();
+
+ // Return the outer ScopeInfo if present.
+ ScopeInfo* OuterScopeInfo();
+
static Handle<ScopeInfo> Create(Isolate* isolate, Zone* zone, Scope* scope);
static Handle<ScopeInfo> CreateGlobalThisBinding(Isolate* isolate);
@@ -4464,6 +4470,8 @@ class ScopeInfo : public FixedArray {
// information about the function variable. It always occupies two array
// slots: a. The name of the function variable.
// b. The context or stack slot index for the variable.
+ // 8. OuterScopeInfoEntryIndex:
+ // The outer scope's ScopeInfo or the hole if there's none.
int ParameterEntriesIndex();
int StackLocalFirstSlotIndex();
int StackLocalEntriesIndex();
@@ -4473,6 +4481,7 @@ class ScopeInfo : public FixedArray {
int ContextGlobalInfoEntriesIndex();
int ReceiverEntryIndex();
int FunctionNameEntryIndex();
+ int OuterScopeInfoEntryIndex();
int Lookup(Handle<String> name, int start, int end, VariableMode* mode,
VariableLocation* location, InitializationFlag* init_flag,
@@ -4506,6 +4515,8 @@ class ScopeInfo : public FixedArray {
: public BitField<bool, AsmFunctionField::kNext, 1> {};
class FunctionKindField
: public BitField<FunctionKind, HasSimpleParametersField::kNext, 9> {};
+ class HasOuterScopeInfoField
+ : public BitField<bool, FunctionKindField::kNext, 1> {};
// Properties of variables.
class VariableModeField : public BitField<VariableMode, 0, 3> {};
« src/ast/scopes.cc ('K') | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698