| 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 void AllocateNonParameterLocals(); | 432 void AllocateNonParameterLocals(); |
| 433 void AllocateVariablesRecursively(); | 433 void AllocateVariablesRecursively(); |
| 434 | 434 |
| 435 private: | 435 private: |
| 436 // Construct a function or block scope based on the scope info. | 436 // Construct a function or block scope based on the scope info. |
| 437 Scope(Scope* inner_scope, Type type, Handle<SerializedScopeInfo> scope_info); | 437 Scope(Scope* inner_scope, Type type, Handle<SerializedScopeInfo> scope_info); |
| 438 | 438 |
| 439 // Construct a catch scope with a binding for the name. | 439 // Construct a catch scope with a binding for the name. |
| 440 Scope(Scope* inner_scope, Handle<String> catch_variable_name); | 440 Scope(Scope* inner_scope, Handle<String> catch_variable_name); |
| 441 | 441 |
| 442 inline Slot* NewSlot(Variable* var, Slot::Type type, int index) { | |
| 443 return new(isolate_->zone()) Slot(isolate_, var, type, index); | |
| 444 } | |
| 445 | |
| 446 void AddInnerScope(Scope* inner_scope) { | 442 void AddInnerScope(Scope* inner_scope) { |
| 447 if (inner_scope != NULL) { | 443 if (inner_scope != NULL) { |
| 448 inner_scopes_.Add(inner_scope); | 444 inner_scopes_.Add(inner_scope); |
| 449 inner_scope->outer_scope_ = this; | 445 inner_scope->outer_scope_ = this; |
| 450 } | 446 } |
| 451 } | 447 } |
| 452 | 448 |
| 453 void SetDefaults(Type type, | 449 void SetDefaults(Type type, |
| 454 Scope* outer_scope, | 450 Scope* outer_scope, |
| 455 Handle<SerializedScopeInfo> scope_info); | 451 Handle<SerializedScopeInfo> scope_info); |
| 456 }; | 452 }; |
| 457 | 453 |
| 458 } } // namespace v8::internal | 454 } } // namespace v8::internal |
| 459 | 455 |
| 460 #endif // V8_SCOPES_H_ | 456 #endif // V8_SCOPES_H_ |
| OLD | NEW |