| 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/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
| (...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1790 // The parameter indices are shifted by 1 (receiver is variable | 1790 // The parameter indices are shifted by 1 (receiver is variable |
| 1791 // index -1 but is parameter index 0 in BytecodeArrayBuilder). | 1791 // index -1 but is parameter index 0 in BytecodeArrayBuilder). |
| 1792 Register source = builder()->Parameter(variable->index() + 1); | 1792 Register source = builder()->Parameter(variable->index() + 1); |
| 1793 builder()->LoadAccumulatorWithRegister(source); | 1793 builder()->LoadAccumulatorWithRegister(source); |
| 1794 BuildHoleCheckForVariableLoad(mode, variable->name()); | 1794 BuildHoleCheckForVariableLoad(mode, variable->name()); |
| 1795 execution_result()->SetResultInAccumulator(); | 1795 execution_result()->SetResultInAccumulator(); |
| 1796 break; | 1796 break; |
| 1797 } | 1797 } |
| 1798 case VariableLocation::GLOBAL: | 1798 case VariableLocation::GLOBAL: |
| 1799 case VariableLocation::UNALLOCATED: { | 1799 case VariableLocation::UNALLOCATED: { |
| 1800 builder()->LoadGlobal(variable->name(), feedback_index(slot), | 1800 builder()->LoadGlobal(feedback_index(slot), typeof_mode); |
| 1801 typeof_mode); | |
| 1802 execution_result()->SetResultInAccumulator(); | 1801 execution_result()->SetResultInAccumulator(); |
| 1803 break; | 1802 break; |
| 1804 } | 1803 } |
| 1805 case VariableLocation::CONTEXT: { | 1804 case VariableLocation::CONTEXT: { |
| 1806 int depth = execution_context()->ContextChainDepth(variable->scope()); | 1805 int depth = execution_context()->ContextChainDepth(variable->scope()); |
| 1807 ContextScope* context = execution_context()->Previous(depth); | 1806 ContextScope* context = execution_context()->Previous(depth); |
| 1808 Register context_reg; | 1807 Register context_reg; |
| 1809 if (context) { | 1808 if (context) { |
| 1810 context_reg = context->reg(); | 1809 context_reg = context->reg(); |
| 1811 } else { | 1810 } else { |
| (...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3179 return execution_context()->scope()->language_mode(); | 3178 return execution_context()->scope()->language_mode(); |
| 3180 } | 3179 } |
| 3181 | 3180 |
| 3182 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3181 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 3183 return TypeFeedbackVector::GetIndex(slot); | 3182 return TypeFeedbackVector::GetIndex(slot); |
| 3184 } | 3183 } |
| 3185 | 3184 |
| 3186 } // namespace interpreter | 3185 } // namespace interpreter |
| 3187 } // namespace internal | 3186 } // namespace internal |
| 3188 } // namespace v8 | 3187 } // namespace v8 |
| OLD | NEW |