Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index a347929131f28e7b5be849d7aeabb6529d43d354..37ae650202c9bc4899cda7ff12788c311f371154 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -945,7 +945,7 @@ Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, |
return value; |
} |
-void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) { |
+void BytecodeGraphBuilder::BuildCallWithFeedback(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 |
@@ -964,6 +964,35 @@ void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) { |
environment()->BindAccumulator(value, &states); |
} |
+void BytecodeGraphBuilder::VisitCallWithFeedback() { |
+ BuildCallWithFeedback(TailCallMode::kDisallow); |
+} |
+ |
+void BytecodeGraphBuilder::VisitTailCallWithFeedback() { |
+ TailCallMode tail_call_mode = |
+ bytecode_array_->GetIsolate()->is_tail_call_elimination_enabled() |
+ ? TailCallMode::kAllow |
+ : TailCallMode::kDisallow; |
+ BuildCallWithFeedback(tail_call_mode); |
+} |
+ |
+void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) { |
+ FrameStateBeforeAndAfter states(this); |
+ // TODO(rmcilroy): Set receiver_hint correctly based on whether the receiver |
Benedikt Meurer
2016/07/09 18:19:22
The JSTypedLowering will figure it out based on ty
rmcilroy
2016/07/11 09:28:27
This was based on the ASTGraphBuilder where it pas
mythria
2016/07/11 15:25:24
I removed the TODO. I will reintroduce it back if
|
+ // 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::VisitTailCall() { |