Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 // Dummy constructor. This constructor doesn't set up the map | 45 // Dummy constructor. This constructor doesn't set up the map |
| 46 // properly so don't use it unless you have a good reason. | 46 // properly so don't use it unless you have a good reason. |
| 47 explicit VariableMap(bool gotta_love_static_overloading); | 47 explicit VariableMap(bool gotta_love_static_overloading); |
| 48 | 48 |
| 49 virtual ~VariableMap(); | 49 virtual ~VariableMap(); |
| 50 | 50 |
| 51 Variable* Declare(Scope* scope, | 51 Variable* Declare(Scope* scope, |
| 52 Handle<String> name, | 52 Handle<String> name, |
| 53 VariableMode mode, | 53 VariableMode mode, |
| 54 bool is_valid_lhs, | 54 bool is_valid_lhs, |
| 55 Variable::Kind kind); | 55 Variable::Kind kind, |
| 56 InitializationFlag); | |
|
Jakob Kummerow
2011/10/31 12:44:34
s/InitializationFlag/InitializationFlag initializa
Steven
2011/10/31 14:28:29
Done.
| |
| 56 | 57 |
| 57 Variable* Lookup(Handle<String> name); | 58 Variable* Lookup(Handle<String> name); |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 | 61 |
| 61 // The dynamic scope part holds hash maps for the variables that will | 62 // The dynamic scope part holds hash maps for the variables that will |
| 62 // be looked up dynamically from within eval and with scopes. The objects | 63 // be looked up dynamically from within eval and with scopes. The objects |
| 63 // are allocated on-demand from Scope::NonLocal to avoid wasting memory | 64 // are allocated on-demand from Scope::NonLocal to avoid wasting memory |
| 64 // and setup time for scopes that don't need them. | 65 // and setup time for scopes that don't need them. |
| 65 class DynamicScopePart : public ZoneObject { | 66 class DynamicScopePart : public ZoneObject { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 // outer scope. Only possible for function scopes; at most one variable. | 125 // outer scope. Only possible for function scopes; at most one variable. |
| 125 Variable* DeclareFunctionVar(Handle<String> name, VariableMode mode); | 126 Variable* DeclareFunctionVar(Handle<String> name, VariableMode mode); |
| 126 | 127 |
| 127 // Declare a parameter in this scope. When there are duplicated | 128 // Declare a parameter in this scope. When there are duplicated |
| 128 // parameters the rightmost one 'wins'. However, the implementation | 129 // parameters the rightmost one 'wins'. However, the implementation |
| 129 // expects all parameters to be declared and from left to right. | 130 // expects all parameters to be declared and from left to right. |
| 130 void DeclareParameter(Handle<String> name, VariableMode mode); | 131 void DeclareParameter(Handle<String> name, VariableMode mode); |
| 131 | 132 |
| 132 // Declare a local variable in this scope. If the variable has been | 133 // Declare a local variable in this scope. If the variable has been |
| 133 // declared before, the previously declared variable is returned. | 134 // declared before, the previously declared variable is returned. |
| 134 Variable* DeclareLocal(Handle<String> name, VariableMode mode); | 135 Variable* DeclareLocal(Handle<String> name, |
| 136 VariableMode mode, | |
| 137 InitializationFlag init_flag); | |
| 135 | 138 |
| 136 // Declare an implicit global variable in this scope which must be a | 139 // Declare an implicit global variable in this scope which must be a |
| 137 // global scope. The variable was introduced (possibly from an inner | 140 // global scope. The variable was introduced (possibly from an inner |
| 138 // scope) by a reference to an unresolved variable with no intervening | 141 // scope) by a reference to an unresolved variable with no intervening |
| 139 // with statements or eval calls. | 142 // with statements or eval calls. |
| 140 Variable* DeclareGlobal(Handle<String> name); | 143 Variable* DeclareGlobal(Handle<String> name); |
| 141 | 144 |
| 142 // Create a new unresolved variable. | 145 // Create a new unresolved variable. |
| 143 VariableProxy* NewUnresolved(Handle<String> name, | 146 VariableProxy* NewUnresolved(Handle<String> name, |
| 144 int position = RelocInfo::kNoPosition); | 147 int position = RelocInfo::kNoPosition); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 542 } | 545 } |
| 543 | 546 |
| 544 void SetDefaults(ScopeType type, | 547 void SetDefaults(ScopeType type, |
| 545 Scope* outer_scope, | 548 Scope* outer_scope, |
| 546 Handle<ScopeInfo> scope_info); | 549 Handle<ScopeInfo> scope_info); |
| 547 }; | 550 }; |
| 548 | 551 |
| 549 } } // namespace v8::internal | 552 } } // namespace v8::internal |
| 550 | 553 |
| 551 #endif // V8_SCOPES_H_ | 554 #endif // V8_SCOPES_H_ |
| OLD | NEW |