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

Unified Diff: src/compiler/typer.cc

Issue 904863002: [turbofan] Separate representation type operations from the semantic types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes Created 5 years, 10 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 | « no previous file | src/hydrogen-types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index 3bd081886bf2b565a649b7cbd10ba421a9053e13..e9f3a3564ffd8da3e93b35b4eb8c644fb7baad32 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -436,14 +436,14 @@ void Typer::Decorator::Decorate(Node* node, bool incomplete) {
Bounds Typer::Visitor::TypeUnaryOp(Node* node, UnaryTyperFun f) {
Bounds input = Operand(node, 0);
- Type* upper = input.upper->Is(Type::None())
- ? Type::None()
- : f(input.upper, typer_);
- Type* lower = input.lower->Is(Type::None())
- ? Type::None()
- : (input.lower == input.upper || upper->IsConstant())
- ? upper // TODO(neis): Extend this to Range(x,x), NaN, MinusZero, ...?
- : f(input.lower, typer_);
+ Type* upper =
+ input.upper->IsInhabited() ? f(input.upper, typer_) : Type::None();
+ Type* lower = input.lower->IsInhabited()
+ ? ((input.lower == input.upper || upper->IsConstant())
+ ? upper // TODO(neis): Extend this to Range(x,x),
+ // NaN, MinusZero, ...?
+ : f(input.lower, typer_))
+ : Type::None();
// TODO(neis): Figure out what to do with lower bound.
return Bounds(lower, upper);
}
@@ -452,15 +452,16 @@ Bounds Typer::Visitor::TypeUnaryOp(Node* node, UnaryTyperFun f) {
Bounds Typer::Visitor::TypeBinaryOp(Node* node, BinaryTyperFun f) {
Bounds left = Operand(node, 0);
Bounds right = Operand(node, 1);
- Type* upper = left.upper->Is(Type::None()) || right.upper->Is(Type::None())
- ? Type::None()
- : f(left.upper, right.upper, typer_);
- Type* lower = left.lower->Is(Type::None()) || right.lower->Is(Type::None())
- ? Type::None()
- : ((left.lower == left.upper && right.lower == right.upper) ||
- upper->IsConstant())
- ? upper
- : f(left.lower, right.lower, typer_);
+ Type* upper = left.upper->IsInhabited() && right.upper->IsInhabited()
+ ? f(left.upper, right.upper, typer_)
+ : Type::None();
+ Type* lower =
+ left.lower->IsInhabited() && right.lower->IsInhabited()
+ ? (((left.lower == left.upper && right.lower == right.upper) ||
+ upper->IsConstant())
+ ? upper
+ : f(left.lower, right.lower, typer_))
+ : Type::None();
// TODO(neis): Figure out what to do with lower bound.
return Bounds(lower, upper);
}
« no previous file with comments | « no previous file | src/hydrogen-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698