Index: src/compiler/typed-optimization.cc |
diff --git a/src/compiler/typed-optimization.cc b/src/compiler/typed-optimization.cc |
index 1f943927b5ec234dd73435c763ef2a7123b355e6..42d5232d589555d27c57ba7969db95dc8e57f5d2 100644 |
--- a/src/compiler/typed-optimization.cc |
+++ b/src/compiler/typed-optimization.cc |
@@ -74,6 +74,8 @@ Reduction TypedOptimization::Reduce(Node* node) { |
} |
} |
switch (node->opcode()) { |
+ case IrOpcode::kCheckHeapObject: |
+ return ReduceCheckHeapObject(node); |
case IrOpcode::kCheckMaps: |
return ReduceCheckMaps(node); |
case IrOpcode::kCheckString: |
@@ -107,6 +109,16 @@ MaybeHandle<Map> GetStableMapFromObjectType(Type* object_type) { |
} // namespace |
+Reduction TypedOptimization::ReduceCheckHeapObject(Node* node) { |
+ Node* const input = NodeProperties::GetValueInput(node, 0); |
+ Type* const input_type = NodeProperties::GetType(input); |
+ if (!input_type->Maybe(Type::SignedSmall())) { |
+ ReplaceWithValue(node, input); |
+ return Replace(input); |
+ } |
+ return NoChange(); |
+} |
+ |
Reduction TypedOptimization::ReduceCheckMaps(Node* node) { |
// The CheckMaps(o, ...map...) can be eliminated if map is stable, |
// o has type Constant(object) and map == object->map, and either |