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

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

Issue 2819653002: Merged: Squashed multiple commits. (Closed)
Patch Set: Created 3 years, 8 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') | src/compiler/typer.cc » ('j') | 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 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);
« no previous file with comments | « src/compiler/typed-optimization.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698