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

Side by Side Diff: src/ast/scopes.h

Issue 2221003002: Don't preallocate temps, params, decls space if we're ScopeInfo backed (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_SCOPES_H_ 5 #ifndef V8_AST_SCOPES_H_
6 #define V8_AST_SCOPES_H_ 6 #define V8_AST_SCOPES_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/base/hashmap.h" 9 #include "src/base/hashmap.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 // Remove a temporary variable. This is for adjusting the scope of 812 // Remove a temporary variable. This is for adjusting the scope of
813 // temporaries used when desugaring parameter initializers. 813 // temporaries used when desugaring parameter initializers.
814 // Returns the index at which it was found in this scope, or -1 if 814 // Returns the index at which it was found in this scope, or -1 if
815 // it was not found. 815 // it was not found.
816 int RemoveTemporary(Variable* var); 816 int RemoveTemporary(Variable* var);
817 817
818 // Adds a temporary variable in this scope's TemporaryScope. This is for 818 // Adds a temporary variable in this scope's TemporaryScope. This is for
819 // adjusting the scope of temporaries used when desugaring parameter 819 // adjusting the scope of temporaries used when desugaring parameter
820 // initializers. 820 // initializers.
821 void AddTemporary(Variable* var) { 821 void AddTemporary(Variable* var) {
822 DCHECK(!already_resolved());
822 // Temporaries are only placed in ClosureScopes. 823 // Temporaries are only placed in ClosureScopes.
823 DCHECK_EQ(GetClosureScope(), this); 824 DCHECK_EQ(GetClosureScope(), this);
824 temps_.Add(var, zone()); 825 temps_.Add(var, zone());
825 } 826 }
826 827
827 ZoneList<Variable*>* temps() { return &temps_; } 828 ZoneList<Variable*>* temps() { return &temps_; }
828 829
829 void DeclareSloppyBlockFunction(const AstRawString* name, 830 void DeclareSloppyBlockFunction(const AstRawString* name,
830 SloppyBlockFunctionStatement* statement) { 831 SloppyBlockFunctionStatement* statement) {
831 sloppy_block_function_map_.Declare(zone(), name, statement); 832 sloppy_block_function_map_.Declare(zone(), name, statement);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 // Convenience variable; Subclass constructor only 898 // Convenience variable; Subclass constructor only
898 Variable* this_function_; 899 Variable* this_function_;
899 // Module descriptor; module scopes only. 900 // Module descriptor; module scopes only.
900 ModuleDescriptor* module_descriptor_; 901 ModuleDescriptor* module_descriptor_;
901 }; 902 };
902 903
903 } // namespace internal 904 } // namespace internal
904 } // namespace v8 905 } // namespace v8
905 906
906 #endif // V8_AST_SCOPES_H_ 907 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698