Index: src/compiler/js-typed-lowering.cc |
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc |
index 4161a7327680199267ab3f6c5245728c3ec48281..b9f7c2ed27c771148b589ade3d00ac4f2223c5e1 100644 |
--- a/src/compiler/js-typed-lowering.cc |
+++ b/src/compiler/js-typed-lowering.cc |
@@ -695,7 +695,10 @@ Reduction JSTypedLowering::ReduceJSToNumberInput(Node* input) { |
// JSToNumber(x:boolean) => BooleanToNumber(x) |
return Replace(graph()->NewNode(simplified()->BooleanToNumber(), input)); |
} |
- // TODO(turbofan): js-typed-lowering of ToNumber(x:string) |
+ if (input_type->Is(Type::String())) { |
+ // JSToNumber(x:string) => StringToNumber(x) |
+ return Replace(graph()->NewNode(simplified()->StringToNumber(), input)); |
+ } |
return NoChange(); |
} |