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

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

Issue 2153433002: [Interpreter] Collect type feedback for 'new' in the bytecode handler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comments from Ross. 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 8d58c288b20c0603381b70ac34e4c4b1b1248fde..4f53a3d60b50bb66d023903f747b9f1df9396251 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1063,9 +1063,15 @@ void BytecodeGraphBuilder::VisitNew() {
Node* new_target = environment()->LookupAccumulator();
Node* callee = environment()->LookupRegister(callee_reg);
- // TODO(turbofan): Pass the feedback here.
- const Operator* call = javascript()->CallConstruct(
- static_cast<int>(arg_count) + 2, VectorSlotPair());
+
+ // Slot index of 0 is used indicate no feedback slot is available. Assert
+ // the assumption that slot index 0 is never a valid feedback slot.
+ STATIC_ASSERT(TypeFeedbackVector::kReservedIndexCount > 0);
+ VectorSlotPair feedback =
+ CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3));
+
+ const Operator* call =
+ javascript()->CallConstruct(static_cast<int>(arg_count) + 2, feedback);
Node* value = ProcessCallNewArguments(call, callee, new_target, first_arg,
arg_count + 2);
environment()->BindAccumulator(value, &states);

Powered by Google App Engine
This is Rietveld 408576698