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

Side by Side Diff: src/scopes.cc

Issue 1312613003: Ensure hole checks take place in switch statement scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename function and add sloppy mode tests Created 5 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 | « src/scopes.h ('k') | test/mjsunit/regress/regress-3926.js » ('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 #include "src/scopes.h" 5 #include "src/scopes.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/messages.h" 9 #include "src/messages.h"
10 #include "src/parser.h" 10 #include "src/parser.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 scope_calls_eval_ = false; 164 scope_calls_eval_ = false;
165 scope_uses_arguments_ = false; 165 scope_uses_arguments_ = false;
166 scope_uses_super_property_ = false; 166 scope_uses_super_property_ = false;
167 asm_module_ = false; 167 asm_module_ = false;
168 asm_function_ = outer_scope != NULL && outer_scope->asm_module_; 168 asm_function_ = outer_scope != NULL && outer_scope->asm_module_;
169 // Inherit the language mode from the parent scope. 169 // Inherit the language mode from the parent scope.
170 language_mode_ = outer_scope != NULL ? outer_scope->language_mode_ : SLOPPY; 170 language_mode_ = outer_scope != NULL ? outer_scope->language_mode_ : SLOPPY;
171 outer_scope_calls_sloppy_eval_ = false; 171 outer_scope_calls_sloppy_eval_ = false;
172 inner_scope_calls_eval_ = false; 172 inner_scope_calls_eval_ = false;
173 inner_scope_uses_arguments_ = false; 173 inner_scope_uses_arguments_ = false;
174 scope_nonlinear_ = false;
174 force_eager_compilation_ = false; 175 force_eager_compilation_ = false;
175 force_context_allocation_ = (outer_scope != NULL && !is_function_scope()) 176 force_context_allocation_ = (outer_scope != NULL && !is_function_scope())
176 ? outer_scope->has_forced_context_allocation() : false; 177 ? outer_scope->has_forced_context_allocation() : false;
177 num_var_or_const_ = 0; 178 num_var_or_const_ = 0;
178 num_stack_slots_ = 0; 179 num_stack_slots_ = 0;
179 num_heap_slots_ = 0; 180 num_heap_slots_ = 0;
180 num_global_slots_ = 0; 181 num_global_slots_ = 0;
181 num_modules_ = 0; 182 num_modules_ = 0;
182 module_var_ = NULL; 183 module_var_ = NULL;
183 arity_ = 0; 184 arity_ = 0;
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 function_ != NULL && function_->proxy()->var()->IsContextSlot(); 1621 function_ != NULL && function_->proxy()->var()->IsContextSlot();
1621 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - 1622 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() -
1622 (is_function_var_in_context ? 1 : 0); 1623 (is_function_var_in_context ? 1 : 0);
1623 } 1624 }
1624 1625
1625 1626
1626 int Scope::ContextGlobalCount() const { return num_global_slots(); } 1627 int Scope::ContextGlobalCount() const { return num_global_slots(); }
1627 1628
1628 } // namespace internal 1629 } // namespace internal
1629 } // namespace v8 1630 } // namespace v8
OLDNEW
« no previous file with comments | « src/scopes.h ('k') | test/mjsunit/regress/regress-3926.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698