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

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: removes an unused label declaration. 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
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698