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

Unified Diff: src/interpreter/interpreter-generator.cc

Issue 2804813003: [turbofan] Collect and use type feedback on ToNumber. (Closed)
Patch Set: Created 3 years, 8 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/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();
}

Powered by Google App Engine
This is Rietveld 408576698