Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 2122183002: [Interpreter] Collect type feedback for calls in the bytecode handler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed few comments. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698