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