| Index: src/compiler/typed-optimization.cc
|
| diff --git a/src/compiler/typed-optimization.cc b/src/compiler/typed-optimization.cc
|
| index e130a10e4eb8e196e9b153d7c52f5f0792b534b6..7ef012658e5bc8434632ff43add3c0a5e6a556be 100644
|
| --- a/src/compiler/typed-optimization.cc
|
| +++ b/src/compiler/typed-optimization.cc
|
| @@ -78,6 +78,8 @@ Reduction TypedOptimization::Reduce(Node* node) {
|
| return ReduceCheckHeapObject(node);
|
| case IrOpcode::kCheckMaps:
|
| return ReduceCheckMaps(node);
|
| + case IrOpcode::kCheckNumber:
|
| + return ReduceCheckNumber(node);
|
| case IrOpcode::kCheckString:
|
| return ReduceCheckString(node);
|
| case IrOpcode::kLoadField:
|
| @@ -150,6 +152,16 @@ Reduction TypedOptimization::ReduceCheckMaps(Node* node) {
|
| return NoChange();
|
| }
|
|
|
| +Reduction TypedOptimization::ReduceCheckNumber(Node* node) {
|
| + Node* const input = NodeProperties::GetValueInput(node, 0);
|
| + Type* const input_type = NodeProperties::GetType(input);
|
| + if (input_type->Is(Type::Number())) {
|
| + ReplaceWithValue(node, input);
|
| + return Replace(input);
|
| + }
|
| + return NoChange();
|
| +}
|
| +
|
| Reduction TypedOptimization::ReduceCheckString(Node* node) {
|
| Node* const input = NodeProperties::GetValueInput(node, 0);
|
| Type* const input_type = NodeProperties::GetType(input);
|
|
|