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/bytecode-generator.cc

Issue 2804813003: [turbofan] Collect and use type feedback on ToNumber. (Closed)
Patch Set: Address Michis feedback. 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 417873f47665cb2add328976e2ac7cc7fb23cc24..5cc9e224cffd613b4ad14dec6f5415d4cdebb137 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2976,17 +2976,19 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
}
// Save result for postfix expressions.
+ FeedbackSlot count_slot = expr->CountBinaryOpFeedbackSlot();
if (is_postfix) {
// Convert old value into a number before saving it.
old_value = register_allocator()->NewRegister();
+ // TODO(ignition): Think about adding proper PostInc/PostDec bytecodes
+ // instead of this ToNumber + Inc/Dec dance.
builder()
- ->ConvertAccumulatorToNumber(old_value)
+ ->ConvertAccumulatorToNumber(old_value, feedback_index(count_slot))
.LoadAccumulatorWithRegister(old_value);
}
// Perform +1/-1 operation.
- FeedbackSlot slot = expr->CountBinaryOpFeedbackSlot();
- builder()->CountOperation(expr->binary_op(), feedback_index(slot));
+ builder()->CountOperation(expr->binary_op(), feedback_index(count_slot));
// Store the value.
builder()->SetExpressionPosition(expr);
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698