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

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

Issue 2278963002: Fully setup the catch variable for catch scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 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 | no next file » | 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 #include "src/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 : zone_(zone), 176 : zone_(zone),
177 outer_scope_(nullptr), 177 outer_scope_(nullptr),
178 variables_(zone), 178 variables_(zone),
179 ordered_variables_(0, zone), 179 ordered_variables_(0, zone),
180 decls_(0, zone), 180 decls_(0, zone),
181 scope_type_(CATCH_SCOPE) { 181 scope_type_(CATCH_SCOPE) {
182 SetDefaults(); 182 SetDefaults();
183 #ifdef DEBUG 183 #ifdef DEBUG
184 already_resolved_ = true; 184 already_resolved_ = true;
185 #endif 185 #endif
186 Variable* variable = 186 Variable* variable = Declare(zone, this, catch_variable_name, VAR,
187 variables_.Declare(zone, this, catch_variable_name, VAR, Variable::NORMAL, 187 Variable::NORMAL, kCreatedInitialized);
188 kCreatedInitialized);
189 AllocateHeapSlot(variable); 188 AllocateHeapSlot(variable);
190 } 189 }
191 190
192 void DeclarationScope::SetDefaults() { 191 void DeclarationScope::SetDefaults() {
193 is_declaration_scope_ = true; 192 is_declaration_scope_ = true;
194 has_simple_parameters_ = true; 193 has_simple_parameters_ = true;
195 asm_module_ = false; 194 asm_module_ = false;
196 asm_function_ = false; 195 asm_function_ = false;
197 force_eager_compilation_ = false; 196 force_eager_compilation_ = false;
198 has_arguments_parameter_ = false; 197 has_arguments_parameter_ = false;
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 function != nullptr && function->IsContextSlot(); 1665 function != nullptr && function->IsContextSlot();
1667 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - 1666 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() -
1668 (is_function_var_in_context ? 1 : 0); 1667 (is_function_var_in_context ? 1 : 0);
1669 } 1668 }
1670 1669
1671 1670
1672 int Scope::ContextGlobalCount() const { return num_global_slots(); } 1671 int Scope::ContextGlobalCount() const { return num_global_slots(); }
1673 1672
1674 } // namespace internal 1673 } // namespace internal
1675 } // namespace v8 1674 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698