Index: src/interpreter/interpreter-generator.cc |
diff --git a/src/interpreter/interpreter-generator.cc b/src/interpreter/interpreter-generator.cc |
index 8f673bb80820ffe6c8c6e19144bc3b2de332f4f3..dfdd38722b6ca9f63ea5c91c3f26644c6e0e3ac5 100644 |
--- a/src/interpreter/interpreter-generator.cc |
+++ b/src/interpreter/interpreter-generator.cc |
@@ -1700,8 +1700,17 @@ void InterpreterGenerator::DoToName(InterpreterAssembler* assembler) { |
void InterpreterGenerator::DoToNumber(InterpreterAssembler* assembler) { |
Node* object = __ GetAccumulator(); |
Node* context = __ GetContext(); |
- Node* result = __ ToNumber(context, object); |
+ |
+ // Convert the {object} to a Number and collect feedback for the {object}. |
+ Variable var_type_feedback(assembler, MachineRepresentation::kTaggedSigned); |
+ Node* result = __ ToNumberWithFeedback(context, object, &var_type_feedback); |
__ StoreRegister(result, __ BytecodeOperandReg(0)); |
+ |
+ // Record the type feedback collected for {object}. |
+ Node* slot_index = __ BytecodeOperandIdx(1); |
+ Node* feedback_vector = __ LoadFeedbackVector(); |
+ __ UpdateFeedback(var_type_feedback.value(), feedback_vector, slot_index); |
+ |
__ Dispatch(); |
} |