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..522e5c0890fa68150a11500889e42a968468301d 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); |
} |
@@ -1002,8 +999,26 @@ 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)); |
+ |
+ 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); |
+} |
rmcilroy
2016/02/22 12:53:23
nit - move BuildCall(TailCallMode tail_call_mode)
mythria
2016/02/22 14:51:31
Done.
|
+ |
+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 |
+ // 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); |
+ 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 +1026,22 @@ 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::VisitCall() { BuildCall(TailCallMode::kDisallow); } |
void BytecodeGraphBuilder::VisitCallWide() { |