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/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/interpreter/control-flow-builders.h" | 9 #include "src/interpreter/control-flow-builders.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 ->LoadContextSlot(context_reg, Context::PREVIOUS_INDEX) | 1337 ->LoadContextSlot(context_reg, Context::PREVIOUS_INDEX) |
1338 .StoreAccumulatorInRegister(context_reg); | 1338 .StoreAccumulatorInRegister(context_reg); |
1339 } | 1339 } |
1340 } | 1340 } |
1341 builder()->LoadContextSlot(context_reg, variable->index()); | 1341 builder()->LoadContextSlot(context_reg, variable->index()); |
1342 execution_result()->SetResultInAccumulator(); | 1342 execution_result()->SetResultInAccumulator(); |
1343 // TODO(rmcilroy): Perform check for uninitialized legacy const, const and | 1343 // TODO(rmcilroy): Perform check for uninitialized legacy const, const and |
1344 // let variables. | 1344 // let variables. |
1345 break; | 1345 break; |
1346 } | 1346 } |
1347 case VariableLocation::LOOKUP: | 1347 case VariableLocation::LOOKUP: { |
1348 UNIMPLEMENTED(); | 1348 builder()->LoadLookupSlot(variable->name(), typeof_mode); |
| 1349 execution_result()->SetResultInAccumulator(); |
| 1350 break; |
| 1351 } |
1349 } | 1352 } |
1350 } | 1353 } |
1351 | 1354 |
1352 | 1355 |
1353 void BytecodeGenerator::VisitVariableLoadForAccumulatorValue( | 1356 void BytecodeGenerator::VisitVariableLoadForAccumulatorValue( |
1354 Variable* variable, FeedbackVectorSlot slot, TypeofMode typeof_mode) { | 1357 Variable* variable, FeedbackVectorSlot slot, TypeofMode typeof_mode) { |
1355 AccumulatorResultScope accumulator_result(this); | 1358 AccumulatorResultScope accumulator_result(this); |
1356 VisitVariableLoad(variable, slot, typeof_mode); | 1359 VisitVariableLoad(variable, slot, typeof_mode); |
1357 } | 1360 } |
1358 | 1361 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 for (int i = 0; i < depth; ++i) { | 1417 for (int i = 0; i < depth; ++i) { |
1415 builder() | 1418 builder() |
1416 ->LoadContextSlot(context_reg, Context::PREVIOUS_INDEX) | 1419 ->LoadContextSlot(context_reg, Context::PREVIOUS_INDEX) |
1417 .StoreAccumulatorInRegister(context_reg); | 1420 .StoreAccumulatorInRegister(context_reg); |
1418 } | 1421 } |
1419 builder()->LoadAccumulatorWithRegister(value_temp); | 1422 builder()->LoadAccumulatorWithRegister(value_temp); |
1420 } | 1423 } |
1421 builder()->StoreContextSlot(context_reg, variable->index()); | 1424 builder()->StoreContextSlot(context_reg, variable->index()); |
1422 break; | 1425 break; |
1423 } | 1426 } |
1424 case VariableLocation::LOOKUP: | 1427 case VariableLocation::LOOKUP: { |
1425 UNIMPLEMENTED(); | 1428 builder()->StoreLookupSlot(variable->name(), language_mode()); |
| 1429 break; |
| 1430 } |
1426 } | 1431 } |
1427 } | 1432 } |
1428 | 1433 |
1429 | 1434 |
1430 void BytecodeGenerator::VisitAssignment(Assignment* expr) { | 1435 void BytecodeGenerator::VisitAssignment(Assignment* expr) { |
1431 DCHECK(expr->target()->IsValidReferenceExpression()); | 1436 DCHECK(expr->target()->IsValidReferenceExpression()); |
1432 Register object, key; | 1437 Register object, key; |
1433 size_t name_index = kMaxUInt32; | 1438 size_t name_index = kMaxUInt32; |
1434 | 1439 |
1435 // Left-hand side can only be a property, a global or a variable slot. | 1440 // Left-hand side can only be a property, a global or a variable slot. |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 } | 2242 } |
2238 | 2243 |
2239 | 2244 |
2240 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2245 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2241 return info()->feedback_vector()->GetIndex(slot); | 2246 return info()->feedback_vector()->GetIndex(slot); |
2242 } | 2247 } |
2243 | 2248 |
2244 } // namespace interpreter | 2249 } // namespace interpreter |
2245 } // namespace internal | 2250 } // namespace internal |
2246 } // namespace v8 | 2251 } // namespace v8 |
OLD | NEW |