Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index faea8c7cb02ca8f9a7d3d9e14edb1fc02d207b51..4e22e5b3ff49bc41123830777213e99982b2fd62 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -501,10 +501,7 @@ Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { |
VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) { |
- FeedbackVectorSlot slot; |
- if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { |
- slot = feedback_vector()->ToSlot(slot_id); |
- } |
+ FeedbackVectorSlot slot = feedback_vector()->ToSlot(slot_id); |
return VectorSlotPair(feedback_vector(), slot); |
} |
@@ -992,7 +989,8 @@ Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, |
return value; |
} |
-void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) { |
+void BytecodeGraphBuilder::BuildCallWithFeedbackSlot( |
+ TailCallMode tail_call_mode) { |
FrameStateBeforeAndAfter states(this); |
// TODO(rmcilroy): Set receiver_hint correctly based on whether the receiver |
// register has been loaded with null / undefined explicitly or we are sure it |
@@ -1002,8 +1000,8 @@ void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) { |
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); |
size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
- VectorSlotPair feedback = |
- CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); |
+ int slot_id = bytecode_iterator().GetIndexOperand(3); |
+ VectorSlotPair feedback = CreateVectorSlotPair(slot_id); |
const Operator* call = javascript()->CallFunction( |
arg_count + 1, feedback, receiver_hint, tail_call_mode); |
@@ -1011,6 +1009,39 @@ void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) { |
environment()->BindAccumulator(value, &states); |
} |
+void BytecodeGraphBuilder::VisitCallIC() { |
+ BuildCallWithFeedbackSlot(TailCallMode::kDisallow); |
+} |
+ |
+void BytecodeGraphBuilder::VisitCallICWide() { |
+ BuildCallWithFeedbackSlot(TailCallMode::kDisallow); |
+} |
+ |
+void BytecodeGraphBuilder::VisitTailCallIC() { |
+ BuildCallWithFeedbackSlot(TailCallMode::kAllow); |
+} |
+ |
+void BytecodeGraphBuilder::VisitTailCallICWide() { |
+ BuildCallWithFeedbackSlot(TailCallMode::kAllow); |
+} |
+ |
+void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) { |
+ FrameStateBeforeAndAfter states(this); |
+ // TODO(rmcilroy): Set receiver_hint correctly based on whether the receiver |
+ // register has been loaded with null / undefined explicitly or we are sure it |
+ // is not null / undefined. |
+ ConvertReceiverMode receiver_hint = ConvertReceiverMode::kAny; |
+ Node* callee = |
+ environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
+ interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); |
+ size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
+ |
+ const Operator* call = javascript()->CallFunction( |
+ arg_count + 1, VectorSlotPair(), receiver_hint, tail_call_mode); |
+ Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); |
+ environment()->BindAccumulator(value, &states); |
+} |
+ |
void BytecodeGraphBuilder::VisitCall() { BuildCall(TailCallMode::kDisallow); } |
void BytecodeGraphBuilder::VisitCallWide() { |