| 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-flags.h" | 10 #include "src/interpreter/bytecode-flags.h" |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 builder()->ForInPrepare(receiver, cache_type); | 1324 builder()->ForInPrepare(receiver, cache_type); |
| 1325 | 1325 |
| 1326 // Set up loop counter | 1326 // Set up loop counter |
| 1327 Register index = register_allocator()->NewRegister(); | 1327 Register index = register_allocator()->NewRegister(); |
| 1328 builder()->LoadLiteral(Smi::FromInt(0)); | 1328 builder()->LoadLiteral(Smi::FromInt(0)); |
| 1329 builder()->StoreAccumulatorInRegister(index); | 1329 builder()->StoreAccumulatorInRegister(index); |
| 1330 | 1330 |
| 1331 // The loop | 1331 // The loop |
| 1332 VisitIterationHeader(stmt, &loop_builder); | 1332 VisitIterationHeader(stmt, &loop_builder); |
| 1333 builder()->SetExpressionAsStatementPosition(stmt->each()); | 1333 builder()->SetExpressionAsStatementPosition(stmt->each()); |
| 1334 builder()->ForInDone(index, cache_length); | 1334 builder()->ForInContinue(index, cache_length); |
| 1335 loop_builder.BreakIfTrue(); | 1335 loop_builder.BreakIfFalse(); |
| 1336 DCHECK(Register::AreContiguous(cache_type, cache_array)); | 1336 DCHECK(Register::AreContiguous(cache_type, cache_array)); |
| 1337 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); | 1337 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); |
| 1338 builder()->ForInNext(receiver, index, cache_type, feedback_index(slot)); | 1338 builder()->ForInNext(receiver, index, cache_type, feedback_index(slot)); |
| 1339 loop_builder.ContinueIfUndefined(); | 1339 loop_builder.ContinueIfUndefined(); |
| 1340 VisitForInAssignment(stmt->each(), stmt->EachFeedbackSlot()); | 1340 VisitForInAssignment(stmt->each(), stmt->EachFeedbackSlot()); |
| 1341 VisitIterationBody(stmt, &loop_builder); | 1341 VisitIterationBody(stmt, &loop_builder); |
| 1342 builder()->ForInStep(index); | 1342 builder()->ForInStep(index); |
| 1343 builder()->StoreAccumulatorInRegister(index); | 1343 builder()->StoreAccumulatorInRegister(index); |
| 1344 loop_builder.JumpToHeader(); | 1344 loop_builder.JumpToHeader(); |
| 1345 loop_builder.EndLoop(); | 1345 loop_builder.EndLoop(); |
| (...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3400 return execution_context()->scope()->language_mode(); | 3400 return execution_context()->scope()->language_mode(); |
| 3401 } | 3401 } |
| 3402 | 3402 |
| 3403 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3403 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 3404 return TypeFeedbackVector::GetIndex(slot); | 3404 return TypeFeedbackVector::GetIndex(slot); |
| 3405 } | 3405 } |
| 3406 | 3406 |
| 3407 } // namespace interpreter | 3407 } // namespace interpreter |
| 3408 } // namespace internal | 3408 } // namespace internal |
| 3409 } // namespace v8 | 3409 } // namespace v8 |
| OLD | NEW |