OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
6 | 6 |
7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-info.h" | 10 #include "src/compilation-info.h" |
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1853 break; | 1853 break; |
1854 } | 1854 } |
1855 case VariableLocation::LOOKUP: { | 1855 case VariableLocation::LOOKUP: { |
1856 switch (variable->mode()) { | 1856 switch (variable->mode()) { |
1857 case DYNAMIC_LOCAL: { | 1857 case DYNAMIC_LOCAL: { |
1858 Variable* local_variable = variable->local_if_not_shadowed(); | 1858 Variable* local_variable = variable->local_if_not_shadowed(); |
1859 int depth = | 1859 int depth = |
1860 execution_context()->ContextChainDepth(local_variable->scope()); | 1860 execution_context()->ContextChainDepth(local_variable->scope()); |
1861 builder()->LoadLookupContextSlot(variable->name(), typeof_mode, | 1861 builder()->LoadLookupContextSlot(variable->name(), typeof_mode, |
1862 local_variable->index(), depth); | 1862 local_variable->index(), depth); |
1863 if (hole_check_mode == HoleCheckMode::kRequired) { | 1863 if (local_variable->binding_needs_init()) { |
rmcilroy
2016/12/05 19:18:07
This seems a bit hacky, I would rather fix the hol
Leszek Swirski
2016/12/05 19:42:37
That's what I thought originally, but non-local va
adamk
2016/12/06 19:16:42
I think it's possible for us to do this determinat
Leszek Swirski
2016/12/07 16:09:52
Fair enough, I was worried that changing it here w
| |
1864 BuildThrowIfHole(variable->name()); | 1864 BuildThrowIfHole(variable->name()); |
1865 } | 1865 } |
1866 break; | 1866 break; |
1867 } | 1867 } |
1868 case DYNAMIC_GLOBAL: { | 1868 case DYNAMIC_GLOBAL: { |
1869 int depth = scope()->ContextChainLengthUntilOutermostSloppyEval(); | 1869 int depth = scope()->ContextChainLengthUntilOutermostSloppyEval(); |
1870 builder()->LoadLookupGlobalSlot(variable->name(), typeof_mode, | 1870 builder()->LoadLookupGlobalSlot(variable->name(), typeof_mode, |
1871 feedback_index(slot), depth); | 1871 feedback_index(slot), depth); |
1872 break; | 1872 break; |
1873 } | 1873 } |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3223 } | 3223 } |
3224 | 3224 |
3225 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3225 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3226 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3226 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3227 : Runtime::kStoreKeyedToSuper_Sloppy; | 3227 : Runtime::kStoreKeyedToSuper_Sloppy; |
3228 } | 3228 } |
3229 | 3229 |
3230 } // namespace interpreter | 3230 } // namespace interpreter |
3231 } // namespace internal | 3231 } // namespace internal |
3232 } // namespace v8 | 3232 } // namespace v8 |
OLD | NEW |