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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/interpreter/control-flow-builders.h" | 8 #include "src/interpreter/control-flow-builders.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 #include "src/parser.h" | 10 #include "src/parser.h" |
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 UNIMPLEMENTED(); | 1556 UNIMPLEMENTED(); |
1557 } | 1557 } |
1558 | 1558 |
1559 // Evaluate all arguments to the function call and store in sequential | 1559 // Evaluate all arguments to the function call and store in sequential |
1560 // registers. | 1560 // registers. |
1561 Register arg = VisitArguments(args); | 1561 Register arg = VisitArguments(args); |
1562 CHECK(args->length() == 0 || arg.index() == receiver.index() + 1); | 1562 CHECK(args->length() == 0 || arg.index() == receiver.index() + 1); |
1563 | 1563 |
1564 // TODO(rmcilroy): Deal with possible direct eval here? | 1564 // TODO(rmcilroy): Deal with possible direct eval here? |
1565 // TODO(rmcilroy): Use CallIC to allow call type feedback. | 1565 // TODO(rmcilroy): Use CallIC to allow call type feedback. |
1566 builder()->Call(callee, receiver, args->length()); | 1566 builder()->Call(callee, receiver, args->length(), |
| 1567 feedback_index(expr->CallFeedbackICSlot())); |
1567 execution_result()->SetResultInAccumulator(); | 1568 execution_result()->SetResultInAccumulator(); |
1568 } | 1569 } |
1569 | 1570 |
1570 | 1571 |
1571 void BytecodeGenerator::VisitCallNew(CallNew* expr) { | 1572 void BytecodeGenerator::VisitCallNew(CallNew* expr) { |
1572 Register constructor = execution_result()->NewRegister(); | 1573 Register constructor = execution_result()->NewRegister(); |
1573 VisitForAccumulatorValue(expr->expression()); | 1574 VisitForAccumulatorValue(expr->expression()); |
1574 builder()->StoreAccumulatorInRegister(constructor); | 1575 builder()->StoreAccumulatorInRegister(constructor); |
1575 | 1576 |
1576 ZoneList<Expression*>* args = expr->arguments(); | 1577 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2160 } | 2161 } |
2161 | 2162 |
2162 | 2163 |
2163 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2164 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2164 return info()->feedback_vector()->GetIndex(slot); | 2165 return info()->feedback_vector()->GetIndex(slot); |
2165 } | 2166 } |
2166 | 2167 |
2167 } // namespace interpreter | 2168 } // namespace interpreter |
2168 } // namespace internal | 2169 } // namespace internal |
2169 } // namespace v8 | 2170 } // namespace v8 |
OLD | NEW |