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

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

Issue 1688283003: [Interpreter] Implements calls through CallICStub in the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes comments I missed in last patch. Created 4 years, 10 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 4cfd68d4ca8b8d2b8fb56657e52e95e8ee847c65..ef63137cb8f56df8481272d06d6135eb93233424 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -502,10 +502,7 @@ Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) {
VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) {
Handle<TypeFeedbackVector> feedback_vector = info()->feedback_vector();
- 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);
}
@@ -1041,7 +1038,7 @@ Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op,
return value;
}
-void BytecodeGraphBuilder::BuildCall() {
+void BytecodeGraphBuilder::BuildCallWithFeedbackSlot() {
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
@@ -1051,8 +1048,8 @@ void BytecodeGraphBuilder::BuildCall() {
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);
// TODO(ishell): provide correct tail_call_mode value to CallFunction.
const Operator* call = javascript()->CallFunction(
@@ -1061,6 +1058,28 @@ void BytecodeGraphBuilder::BuildCall() {
environment()->BindAccumulator(value, &states);
}
+void BytecodeGraphBuilder::BuildCall() {
+ 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);
+
+ // TODO(ishell): provide correct tail_call_mode value to CallFunction.
+ const Operator* call = javascript()->CallFunction(
+ arg_count + 1, language_mode(), VectorSlotPair(), receiver_hint);
+ Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1);
+ environment()->BindAccumulator(value, &states);
+}
+
+void BytecodeGraphBuilder::VisitCallIC() { BuildCallWithFeedbackSlot(); }
+
+void BytecodeGraphBuilder::VisitCallICWide() { BuildCallWithFeedbackSlot(); }
+
void BytecodeGraphBuilder::VisitCall() { BuildCall(); }
void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); }

Powered by Google App Engine
This is Rietveld 408576698