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/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 builder()->JumpIfUndefined(&subject_undefined_label); | 1126 builder()->JumpIfUndefined(&subject_undefined_label); |
1127 builder()->JumpIfNull(&subject_null_label); | 1127 builder()->JumpIfNull(&subject_null_label); |
1128 Register receiver = register_allocator()->NewRegister(); | 1128 Register receiver = register_allocator()->NewRegister(); |
1129 builder()->CastAccumulatorToJSObject(); | 1129 builder()->CastAccumulatorToJSObject(); |
1130 builder()->StoreAccumulatorInRegister(receiver); | 1130 builder()->StoreAccumulatorInRegister(receiver); |
1131 | 1131 |
1132 register_allocator()->PrepareForConsecutiveAllocations(3); | 1132 register_allocator()->PrepareForConsecutiveAllocations(3); |
1133 Register cache_type = register_allocator()->NextConsecutiveRegister(); | 1133 Register cache_type = register_allocator()->NextConsecutiveRegister(); |
1134 Register cache_array = register_allocator()->NextConsecutiveRegister(); | 1134 Register cache_array = register_allocator()->NextConsecutiveRegister(); |
1135 Register cache_length = register_allocator()->NextConsecutiveRegister(); | 1135 Register cache_length = register_allocator()->NextConsecutiveRegister(); |
1136 // Used as kRegTriple8 and kRegPair8 in ForInPrepare and ForInNext. | 1136 // Used as kRegTriple and kRegPair in ForInPrepare and ForInNext. |
1137 USE(cache_array); | 1137 USE(cache_array); |
1138 builder()->ForInPrepare(cache_type); | 1138 builder()->ForInPrepare(cache_type); |
1139 | 1139 |
1140 // Set up loop counter | 1140 // Set up loop counter |
1141 Register index = register_allocator()->NewRegister(); | 1141 Register index = register_allocator()->NewRegister(); |
1142 builder()->LoadLiteral(Smi::FromInt(0)); | 1142 builder()->LoadLiteral(Smi::FromInt(0)); |
1143 builder()->StoreAccumulatorInRegister(index); | 1143 builder()->StoreAccumulatorInRegister(index); |
1144 | 1144 |
1145 // The loop | 1145 // The loop |
1146 loop_builder.LoopHeader(); | 1146 loop_builder.LoopHeader(); |
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3155 } | 3155 } |
3156 | 3156 |
3157 | 3157 |
3158 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3158 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3159 return info()->feedback_vector()->GetIndex(slot); | 3159 return info()->feedback_vector()->GetIndex(slot); |
3160 } | 3160 } |
3161 | 3161 |
3162 } // namespace interpreter | 3162 } // namespace interpreter |
3163 } // namespace internal | 3163 } // namespace internal |
3164 } // namespace v8 | 3164 } // namespace v8 |
OLD | NEW |