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

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: 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..12b1f8bb41329e036258af0e9674ea8851e06aba 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::BuildCall(bool has_feedback_slot) {
rmcilroy 2016/02/12 14:21:03 Not keen on this, I'd prefer it just to be two sep
mythria 2016/02/17 11:02:47 Done.
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,11 @@ 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 = FeedbackVectorSlot::Invalid().ToInt();
+ if (has_feedback_slot) {
+ 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,9 +1061,13 @@ void BytecodeGraphBuilder::BuildCall() {
environment()->BindAccumulator(value, &states);
}
-void BytecodeGraphBuilder::VisitCall() { BuildCall(); }
+void BytecodeGraphBuilder::VisitCallIC() { BuildCall(true); }
+
+void BytecodeGraphBuilder::VisitCallICWide() { BuildCall(true); }
+
+void BytecodeGraphBuilder::VisitCall() { BuildCall(false); }
-void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); }
+void BytecodeGraphBuilder::VisitCallWide() { BuildCall(false); }
void BytecodeGraphBuilder::BuildCallJSRuntime() {
FrameStateBeforeAndAfter states(this);

Powered by Google App Engine
This is Rietveld 408576698