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

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

Issue 2342853002: [TypeFeedbackVector] special ic slots for interpreter compare/binary ops. (Closed)
Patch Set: Code comments. Created 4 years, 3 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 f5d65160ea33f8ca02823eecf56284c264fb7c8b..f0ec76a7b94680db72af98f2f986d08e50e1ad88 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1380,13 +1380,10 @@ BinaryOperationHint BytecodeGraphBuilder::GetBinaryOperationHint(
int operand_index) {
FeedbackVectorSlot slot = feedback_vector()->ToSlot(
bytecode_iterator().GetIndexOperand(operand_index));
- DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot));
- Object* feedback = feedback_vector()->Get(slot);
- BinaryOperationHint hint = BinaryOperationHint::kAny;
- if (feedback->IsSmi()) {
- hint = BinaryOperationHintFromFeedback((Smi::cast(feedback))->value());
- }
- return hint;
+ DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC,
+ feedback_vector()->GetKind(slot));
+ BinaryOpICNexus nexus(feedback_vector(), slot);
+ return nexus.GetBinaryOperationFeedback();
}
// Helper function to create compare operation hint from the recorded type
@@ -1398,13 +1395,10 @@ CompareOperationHint BytecodeGraphBuilder::GetCompareOperationHint() {
}
FeedbackVectorSlot slot =
feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1));
- DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot));
- Object* feedback = feedback_vector()->Get(slot);
- CompareOperationHint hint = CompareOperationHint::kAny;
- if (feedback->IsSmi()) {
- hint = CompareOperationHintFromFeedback((Smi::cast(feedback))->value());
- }
- return hint;
+ DCHECK_EQ(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC,
+ feedback_vector()->GetKind(slot));
+ CompareICNexus nexus(feedback_vector(), slot);
+ return nexus.GetCompareOperationFeedback();
}
float BytecodeGraphBuilder::ComputeCallFrequency(int slot_id) const {

Powered by Google App Engine
This is Rietveld 408576698