| 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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 expr->ComputeFlags(true)); | 1190 expr->ComputeFlags(true)); |
| 1191 Register index, literal; | 1191 Register index, literal; |
| 1192 | 1192 |
| 1193 // Evaluate all the non-constant subexpressions and store them into the | 1193 // Evaluate all the non-constant subexpressions and store them into the |
| 1194 // newly cloned array. | 1194 // newly cloned array. |
| 1195 bool literal_in_accumulator = true; | 1195 bool literal_in_accumulator = true; |
| 1196 for (int array_index = 0; array_index < expr->values()->length(); | 1196 for (int array_index = 0; array_index < expr->values()->length(); |
| 1197 array_index++) { | 1197 array_index++) { |
| 1198 Expression* subexpr = expr->values()->at(array_index); | 1198 Expression* subexpr = expr->values()->at(array_index); |
| 1199 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1199 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 1200 if (subexpr->IsSpread()) { | 1200 DCHECK(!subexpr->IsSpread()); |
| 1201 // TODO(rmcilroy): Deal with spread expressions. | |
| 1202 UNIMPLEMENTED(); | |
| 1203 } | |
| 1204 | 1201 |
| 1205 if (literal_in_accumulator) { | 1202 if (literal_in_accumulator) { |
| 1206 index = register_allocator()->NewRegister(); | 1203 index = register_allocator()->NewRegister(); |
| 1207 literal = register_allocator()->NewRegister(); | 1204 literal = register_allocator()->NewRegister(); |
| 1208 builder()->StoreAccumulatorInRegister(literal); | 1205 builder()->StoreAccumulatorInRegister(literal); |
| 1209 literal_in_accumulator = false; | 1206 literal_in_accumulator = false; |
| 1210 } | 1207 } |
| 1211 | 1208 |
| 1212 FeedbackVectorSlot slot = expr->LiteralFeedbackSlot(); | 1209 FeedbackVectorSlot slot = expr->LiteralFeedbackSlot(); |
| 1213 builder() | 1210 builder() |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2216 } | 2213 } |
| 2217 | 2214 |
| 2218 | 2215 |
| 2219 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2216 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 2220 return info()->feedback_vector()->GetIndex(slot); | 2217 return info()->feedback_vector()->GetIndex(slot); |
| 2221 } | 2218 } |
| 2222 | 2219 |
| 2223 } // namespace interpreter | 2220 } // namespace interpreter |
| 2224 } // namespace internal | 2221 } // namespace internal |
| 2225 } // namespace v8 | 2222 } // namespace v8 |
| OLD | NEW |