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

Unified Diff: src/compiler/typed-optimization.cc

Issue 2425613002: [turbofan] Eliminate CheckHeapObject if the input cannot be in SignedSmall range. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « src/compiler/typed-optimization.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/compiler/typed-optimization.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698