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(), execution_context()->reg(), |
| 1349 typeof_mode); |
| 1350 execution_result()->SetResultInAccumulator(); |
| 1351 break; |
| 1352 } |
1349 } | 1353 } |
1350 } | 1354 } |
1351 | 1355 |
1352 | 1356 |
1353 void BytecodeGenerator::VisitVariableLoadForAccumulatorValue( | 1357 void BytecodeGenerator::VisitVariableLoadForAccumulatorValue( |
1354 Variable* variable, FeedbackVectorSlot slot, TypeofMode typeof_mode) { | 1358 Variable* variable, FeedbackVectorSlot slot, TypeofMode typeof_mode) { |
1355 AccumulatorResultScope accumulator_result(this); | 1359 AccumulatorResultScope accumulator_result(this); |
1356 VisitVariableLoad(variable, slot, typeof_mode); | 1360 VisitVariableLoad(variable, slot, typeof_mode); |
1357 } | 1361 } |
1358 | 1362 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 for (int i = 0; i < depth; ++i) { | 1418 for (int i = 0; i < depth; ++i) { |
1415 builder() | 1419 builder() |
1416 ->LoadContextSlot(context_reg, Context::PREVIOUS_INDEX) | 1420 ->LoadContextSlot(context_reg, Context::PREVIOUS_INDEX) |
1417 .StoreAccumulatorInRegister(context_reg); | 1421 .StoreAccumulatorInRegister(context_reg); |
1418 } | 1422 } |
1419 builder()->LoadAccumulatorWithRegister(value_temp); | 1423 builder()->LoadAccumulatorWithRegister(value_temp); |
1420 } | 1424 } |
1421 builder()->StoreContextSlot(context_reg, variable->index()); | 1425 builder()->StoreContextSlot(context_reg, variable->index()); |
1422 break; | 1426 break; |
1423 } | 1427 } |
1424 case VariableLocation::LOOKUP: | 1428 case VariableLocation::LOOKUP: { |
1425 UNIMPLEMENTED(); | 1429 builder()->StoreLookupSlot(variable->name(), execution_context()->reg(), |
| 1430 language_mode()); |
| 1431 break; |
| 1432 } |
1426 } | 1433 } |
1427 } | 1434 } |
1428 | 1435 |
1429 | 1436 |
1430 void BytecodeGenerator::VisitAssignment(Assignment* expr) { | 1437 void BytecodeGenerator::VisitAssignment(Assignment* expr) { |
1431 DCHECK(expr->target()->IsValidReferenceExpression()); | 1438 DCHECK(expr->target()->IsValidReferenceExpression()); |
1432 Register object, key; | 1439 Register object, key; |
1433 size_t name_index = kMaxUInt32; | 1440 size_t name_index = kMaxUInt32; |
1434 | 1441 |
1435 // Left-hand side can only be a property, a global or a variable slot. | 1442 // Left-hand side can only be a property, a global or a variable slot. |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 } | 2306 } |
2300 | 2307 |
2301 | 2308 |
2302 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2309 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2303 return info()->feedback_vector()->GetIndex(slot); | 2310 return info()->feedback_vector()->GetIndex(slot); |
2304 } | 2311 } |
2305 | 2312 |
2306 } // namespace interpreter | 2313 } // namespace interpreter |
2307 } // namespace internal | 2314 } // namespace internal |
2308 } // namespace v8 | 2315 } // namespace v8 |
OLD | NEW |