| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "src/ast/context-slot-cache.h" | 7 #include "src/ast/context-slot-cache.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/ast/variables.h" | 9 #include "src/ast/variables.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 int ScopeInfo::ContextLength() { | 438 int ScopeInfo::ContextLength() { |
| 439 if (length() > 0) { | 439 if (length() > 0) { |
| 440 int context_locals = ContextLocalCount(); | 440 int context_locals = ContextLocalCount(); |
| 441 bool function_name_context_slot = | 441 bool function_name_context_slot = |
| 442 FunctionVariableField::decode(Flags()) == CONTEXT; | 442 FunctionVariableField::decode(Flags()) == CONTEXT; |
| 443 bool has_context = context_locals > 0 || function_name_context_slot || | 443 bool has_context = context_locals > 0 || function_name_context_slot || |
| 444 scope_type() == WITH_SCOPE || | 444 scope_type() == WITH_SCOPE || |
| 445 (scope_type() == BLOCK_SCOPE && CallsSloppyEval() && | 445 (scope_type() == BLOCK_SCOPE && CallsSloppyEval() && |
| 446 is_declaration_scope()) || | 446 is_declaration_scope()) || |
| 447 (scope_type() == FUNCTION_SCOPE && CallsSloppyEval()) || | 447 (scope_type() == FUNCTION_SCOPE && CallsSloppyEval()) || |
| 448 (scope_type() == FUNCTION_SCOPE && IsAsmModule()) || |
| 448 scope_type() == MODULE_SCOPE; | 449 scope_type() == MODULE_SCOPE; |
| 449 | 450 |
| 450 if (has_context) { | 451 if (has_context) { |
| 451 return Context::MIN_CONTEXT_SLOTS + context_locals + | 452 return Context::MIN_CONTEXT_SLOTS + context_locals + |
| 452 (function_name_context_slot ? 1 : 0); | 453 (function_name_context_slot ? 1 : 0); |
| 453 } | 454 } |
| 454 } | 455 } |
| 455 return 0; | 456 return 0; |
| 456 } | 457 } |
| 457 | 458 |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 if (String::cast(entry->local_name())->Equals(*local_name)) { | 969 if (String::cast(entry->local_name())->Equals(*local_name)) { |
| 969 return entry; | 970 return entry; |
| 970 } | 971 } |
| 971 } | 972 } |
| 972 UNREACHABLE(); | 973 UNREACHABLE(); |
| 973 return Handle<ModuleInfoEntry>(); | 974 return Handle<ModuleInfoEntry>(); |
| 974 } | 975 } |
| 975 | 976 |
| 976 } // namespace internal | 977 } // namespace internal |
| 977 } // namespace v8 | 978 } // namespace v8 |
| OLD | NEW |