Index: src/scopes.h |
diff --git a/src/scopes.h b/src/scopes.h |
index a5c7cdc798f788bccbacd6ee57451f346571d300..4486921d6a2b0f79097f112b07fe755454306c56 100644 |
--- a/src/scopes.h |
+++ b/src/scopes.h |
@@ -22,14 +22,14 @@ class VariableMap: public ZoneHashMap { |
virtual ~VariableMap(); |
Variable* Declare(Scope* scope, |
- const AstString* name, |
+ Handle<String> name, |
VariableMode mode, |
bool is_valid_lhs, |
Variable::Kind kind, |
InitializationFlag initialization_flag, |
Interface* interface = Interface::NewValue()); |
- Variable* Lookup(const AstString* name); |
+ Variable* Lookup(Handle<String> name); |
Zone* zone() const { return zone_; } |
@@ -74,8 +74,7 @@ class Scope: public ZoneObject { |
// --------------------------------------------------------------------------- |
// Construction |
- Scope(Scope* outer_scope, ScopeType scope_type, |
- AstValueFactory* value_factory, Zone* zone); |
+ Scope(Scope* outer_scope, ScopeType scope_type, Zone* zone); |
// Compute top scope and allocate variables. For lazy compilation the top |
// scope only contains the single lazily compiled function, so this |
@@ -86,7 +85,7 @@ class Scope: public ZoneObject { |
Zone* zone); |
// The scope name is only used for printing/debugging. |
- void SetScopeName(const AstString* scope_name) { scope_name_ = scope_name; } |
+ void SetScopeName(Handle<String> scope_name) { scope_name_ = scope_name; } |
void Initialize(); |
@@ -101,18 +100,18 @@ class Scope: public ZoneObject { |
// Declarations |
// Lookup a variable in this scope. Returns the variable or NULL if not found. |
- Variable* LookupLocal(const AstString* name); |
+ Variable* LookupLocal(Handle<String> name); |
// This lookup corresponds to a lookup in the "intermediate" scope sitting |
// between this scope and the outer scope. (ECMA-262, 3rd., requires that |
// the name of named function literal is kept in an intermediate scope |
// in between this scope and the next outer scope.) |
- Variable* LookupFunctionVar(const AstString* name, |
+ Variable* LookupFunctionVar(Handle<String> name, |
AstNodeFactory<AstNullVisitor>* factory); |
// Lookup a variable in this scope or outer scopes. |
// Returns the variable or NULL if not found. |
- Variable* Lookup(const AstString* name); |
+ Variable* Lookup(Handle<String> name); |
// Declare the function variable for a function literal. This variable |
// is in an intermediate scope between this function scope and the the |
@@ -125,11 +124,11 @@ class Scope: public ZoneObject { |
// Declare a parameter in this scope. When there are duplicated |
// parameters the rightmost one 'wins'. However, the implementation |
// expects all parameters to be declared and from left to right. |
- void DeclareParameter(const AstString* name, VariableMode mode); |
+ void DeclareParameter(Handle<String> name, VariableMode mode); |
// Declare a local variable in this scope. If the variable has been |
// declared before, the previously declared variable is returned. |
- Variable* DeclareLocal(const AstString* name, |
+ Variable* DeclareLocal(Handle<String> name, |
VariableMode mode, |
InitializationFlag init_flag, |
Interface* interface = Interface::NewValue()); |
@@ -138,12 +137,12 @@ class Scope: public ZoneObject { |
// global scope. The variable was introduced (possibly from an inner |
// scope) by a reference to an unresolved variable with no intervening |
// with statements or eval calls. |
- Variable* DeclareDynamicGlobal(const AstString* name); |
+ Variable* DeclareDynamicGlobal(Handle<String> name); |
// Create a new unresolved variable. |
template<class Visitor> |
VariableProxy* NewUnresolved(AstNodeFactory<Visitor>* factory, |
- const AstString* name, |
+ Handle<String> name, |
Interface* interface = Interface::NewValue(), |
int position = RelocInfo::kNoPosition) { |
// Note that we must not share the unresolved variables with |
@@ -168,13 +167,13 @@ class Scope: public ZoneObject { |
// for printing and cannot be used to find the variable. In particular, |
// the only way to get hold of the temporary is by keeping the Variable* |
// around. |
- Variable* NewInternal(const AstString* name); |
+ Variable* NewInternal(Handle<String> name); |
// Creates a new temporary variable in this scope. The name is only used |
// for printing and cannot be used to find the variable. In particular, |
// the only way to get hold of the temporary is by keeping the Variable* |
// around. The name should not clash with a legitimate variable names. |
- Variable* NewTemporary(const AstString* name); |
+ Variable* NewTemporary(Handle<String> name); |
// Adds the specific declaration node to the list of declarations in |
// this scope. The declarations are processed as part of entering |
@@ -391,7 +390,7 @@ class Scope: public ZoneObject { |
// --------------------------------------------------------------------------- |
// Strict mode support. |
- bool IsDeclared(const AstString* name) { |
+ bool IsDeclared(Handle<String> name) { |
// During formal parameter list parsing the scope only contains |
// two variables inserted at initialization: "this" and "arguments". |
// "this" is an invalid parameter name and "arguments" is invalid parameter |
@@ -422,7 +421,7 @@ class Scope: public ZoneObject { |
ScopeType scope_type_; |
// Debugging support. |
- const AstString* scope_name_; |
+ Handle<String> scope_name_; |
// The variables declared in this scope: |
// |
@@ -498,7 +497,7 @@ class Scope: public ZoneObject { |
// Create a non-local variable with a given name. |
// These variables are looked up dynamically at runtime. |
- Variable* NonLocal(const AstString* name, VariableMode mode); |
+ Variable* NonLocal(Handle<String> name, VariableMode mode); |
// Variable resolution. |
// Possible results of a recursive variable lookup telling if and how a |
@@ -549,7 +548,7 @@ class Scope: public ZoneObject { |
// Lookup a variable reference given by name recursively starting with this |
// scope. If the code is executed because of a call to 'eval', the context |
// parameter should be set to the calling context of 'eval'. |
- Variable* LookupRecursive(const AstString* name, |
+ Variable* LookupRecursive(Handle<String> name, |
BindingKind* binding_kind, |
AstNodeFactory<AstNullVisitor>* factory); |
MUST_USE_RESULT |
@@ -593,12 +592,10 @@ class Scope: public ZoneObject { |
private: |
// Construct a scope based on the scope info. |
Scope(Scope* inner_scope, ScopeType type, Handle<ScopeInfo> scope_info, |
- AstValueFactory* value_factory, Zone* zone); |
+ Zone* zone); |
// Construct a catch scope with a binding for the name. |
- Scope(Scope* inner_scope, |
- const AstString* catch_variable_name, |
- AstValueFactory* value_factory, Zone* zone); |
+ Scope(Scope* inner_scope, Handle<String> catch_variable_name, Zone* zone); |
void AddInnerScope(Scope* inner_scope) { |
if (inner_scope != NULL) { |
@@ -611,7 +608,6 @@ class Scope: public ZoneObject { |
Scope* outer_scope, |
Handle<ScopeInfo> scope_info); |
- AstValueFactory* ast_value_factory_; |
Zone* zone_; |
}; |