Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 9e8e2b53dbdd22447f3997554248d62e7b9ee079..d2267f7fa2605dfa5609e7fdf3fae3330930e6ae 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -2028,7 +2028,21 @@ void BytecodeGraphBuilder::VisitToObject() { |
} |
void BytecodeGraphBuilder::VisitToNumber() { |
- BuildCastOperator(javascript()->ToNumber()); |
+ PrepareEagerCheckpoint(); |
+ Node* object = environment()->LookupAccumulator(); |
+ |
+ Node* node = nullptr; |
+ FeedbackSlot slot = |
+ feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1)); |
+ if (Node* simplified = TryBuildSimplifiedBinaryOp( |
+ javascript()->Multiply(), object, jsgraph()->OneConstant(), slot)) { |
+ node = simplified; |
+ } else { |
+ node = NewNode(javascript()->ToNumber(), object); |
+ } |
+ |
+ environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), node, |
+ Environment::kAttachFrameState); |
} |
void BytecodeGraphBuilder::VisitJump() { BuildJump(); } |