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

Unified Diff: src/compiler/typer.cc

Issue 2202883005: [turbofan] Unify number operation typing rules. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove useless cementation. DCHECKs instead of defensive programming are way more useful. Created 4 years, 4 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/typer.h ('k') | src/type-cache.h » ('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 cf1ca6d2420a51e509911fb99dece87ca9651fd5..a4e3c64911f08fd4b58c73b3dcd7f31cb9964feb 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -39,20 +39,9 @@ Typer::Typer(Isolate* isolate, Graph* graph)
Zone* zone = this->zone();
Factory* const factory = isolate->factory();
- Type* infinity = Type::Constant(factory->infinity_value(), zone);
- Type* minus_infinity = Type::Constant(factory->minus_infinity_value(), zone);
- // Unfortunately, the infinities created in other places might be different
- // ones (eg the result of NewNumber in TypeNumberConstant).
- Type* truncating_to_zero =
- Type::Union(Type::Union(infinity, minus_infinity, zone),
- Type::MinusZeroOrNaN(), zone);
- DCHECK(!truncating_to_zero->Maybe(Type::Integral32()));
-
singleton_false_ = Type::Constant(factory->false_value(), zone);
singleton_true_ = Type::Constant(factory->true_value(), zone);
singleton_the_hole_ = Type::Constant(factory->the_hole_value(), zone);
- signed32ish_ = Type::Union(Type::Signed32(), truncating_to_zero, zone);
- unsigned32ish_ = Type::Union(Type::Unsigned32(), truncating_to_zero, zone);
falsish_ = Type::Union(
Type::Undetectable(),
Type::Union(Type::Union(singleton_false_, cache_.kZeroish, zone),
@@ -105,6 +94,19 @@ class Typer::Visitor : public Reducer {
JS_OTHER_OP_LIST(DECLARE_CASE)
#undef DECLARE_CASE
+#define DECLARE_CASE(x) \
+ case IrOpcode::k##x: \
+ return UpdateType(node, TypeBinaryOp(node, x));
+ SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_CASE)
+ SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(DECLARE_CASE)
+#undef DECLARE_CASE
+
+#define DECLARE_CASE(x) \
+ case IrOpcode::k##x: \
+ return UpdateType(node, TypeUnaryOp(node, x));
+ SIMPLIFIED_NUMBER_UNOP_LIST(DECLARE_CASE)
+#undef DECLARE_CASE
+
#define DECLARE_CASE(x) case IrOpcode::k##x:
DECLARE_CASE(Loop)
DECLARE_CASE(Branch)
@@ -155,6 +157,19 @@ class Typer::Visitor : public Reducer {
JS_OTHER_OP_LIST(DECLARE_CASE)
#undef DECLARE_CASE
+#define DECLARE_CASE(x) \
+ case IrOpcode::k##x: \
+ return TypeBinaryOp(node, x);
+ SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_CASE)
+ SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(DECLARE_CASE)
+#undef DECLARE_CASE
+
+#define DECLARE_CASE(x) \
+ case IrOpcode::k##x: \
+ return TypeUnaryOp(node, x);
+ SIMPLIFIED_NUMBER_UNOP_LIST(DECLARE_CASE)
+#undef DECLARE_CASE
+
#define DECLARE_CASE(x) case IrOpcode::k##x:
DECLARE_CASE(Loop)
DECLARE_CASE(Branch)
@@ -249,15 +264,19 @@ class Typer::Visitor : public Reducer {
static Type* ToNumber(Type*, Typer*);
static Type* ToObject(Type*, Typer*);
static Type* ToString(Type*, Typer*);
- static Type* NumberCeil(Type*, Typer*);
- static Type* NumberFloor(Type*, Typer*);
- static Type* NumberMax(Type*, Type*, Typer*);
- static Type* NumberMin(Type*, Type*, Typer*);
- static Type* NumberRound(Type*, Typer*);
- static Type* NumberSign(Type*, Typer*);
- static Type* NumberTrunc(Type*, Typer*);
- static Type* NumberToInt32(Type*, Typer*);
- static Type* NumberToUint32(Type*, Typer*);
+#define DECLARE_METHOD(Name) \
+ static Type* Name(Type* type, Typer* t) { \
+ return t->operation_typer_.Name(type); \
+ }
+ SIMPLIFIED_NUMBER_UNOP_LIST(DECLARE_METHOD)
+#undef DECLARE_METHOD
+#define DECLARE_METHOD(Name) \
+ static Type* Name(Type* lhs, Type* rhs, Typer* t) { \
+ return t->operation_typer_.Name(lhs, rhs); \
+ }
+ SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_METHOD)
+ SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(DECLARE_METHOD)
+#undef DECLARE_METHOD
static Type* ObjectIsCallable(Type*, Typer*);
static Type* ObjectIsNumber(Type*, Typer*);
@@ -451,24 +470,7 @@ Type* Typer::Visitor::ToName(Type* type, Typer* t) {
// static
Type* Typer::Visitor::ToNumber(Type* type, Typer* t) {
- if (type->Is(Type::Number())) return type;
- if (type->Is(Type::NullOrUndefined())) {
- if (type->Is(Type::Null())) return t->cache_.kSingletonZero;
- if (type->Is(Type::Undefined())) return Type::NaN();
- return Type::Union(Type::NaN(), t->cache_.kSingletonZero, t->zone());
- }
- if (type->Is(Type::NumberOrUndefined())) {
- return Type::Union(Type::Intersect(type, Type::Number(), t->zone()),
- Type::NaN(), t->zone());
- }
- if (type->Is(t->singleton_false_)) return t->cache_.kSingletonZero;
- if (type->Is(t->singleton_true_)) return t->cache_.kSingletonOne;
- if (type->Is(Type::Boolean())) return t->cache_.kZeroOrOne;
- if (type->Is(Type::BooleanOrNumber())) {
- return Type::Union(Type::Intersect(type, Type::Number(), t->zone()),
- t->cache_.kZeroOrOne, t->zone());
- }
- return Type::Number();
+ return t->operation_typer_.ToNumber(type);
}
@@ -492,136 +494,6 @@ Type* Typer::Visitor::ToString(Type* type, Typer* t) {
return Type::String();
}
-// static
-Type* Typer::Visitor::NumberCeil(Type* type, Typer* t) {
- DCHECK(type->Is(Type::Number()));
- if (type->Is(t->cache_.kIntegerOrMinusZeroOrNaN)) return type;
- // TODO(bmeurer): We could infer a more precise type here.
- return t->cache_.kIntegerOrMinusZeroOrNaN;
-}
-
-// static
-Type* Typer::Visitor::NumberFloor(Type* type, Typer* t) {
- DCHECK(type->Is(Type::Number()));
- if (type->Is(t->cache_.kIntegerOrMinusZeroOrNaN)) return type;
- // TODO(bmeurer): We could infer a more precise type here.
- return t->cache_.kIntegerOrMinusZeroOrNaN;
-}
-
-// static
-Type* Typer::Visitor::NumberMax(Type* lhs, Type* rhs, Typer* t) {
- DCHECK(lhs->Is(Type::Number()));
- DCHECK(rhs->Is(Type::Number()));
- if (lhs->Is(Type::NaN()) || rhs->Is(Type::NaN())) {
- return Type::NaN();
- }
- Type* type = Type::None();
- // TODO(turbofan): Improve minus zero handling here.
- if (lhs->Maybe(Type::NaN()) || rhs->Maybe(Type::NaN())) {
- type = Type::Union(type, Type::NaN(), t->zone());
- }
- lhs = Type::Intersect(lhs, Type::OrderedNumber(), t->zone());
- rhs = Type::Intersect(rhs, Type::OrderedNumber(), t->zone());
- if (lhs->Is(t->cache_.kInteger) && rhs->Is(t->cache_.kInteger)) {
- double max = std::max(lhs->Max(), rhs->Max());
- double min = std::max(lhs->Min(), rhs->Min());
- type = Type::Union(type, Type::Range(min, max, t->zone()), t->zone());
- } else {
- type = Type::Union(type, Type::Union(lhs, rhs, t->zone()), t->zone());
- }
- return type;
-}
-
-// static
-Type* Typer::Visitor::NumberMin(Type* lhs, Type* rhs, Typer* t) {
- DCHECK(lhs->Is(Type::Number()));
- DCHECK(rhs->Is(Type::Number()));
- if (lhs->Is(Type::NaN()) || rhs->Is(Type::NaN())) {
- return Type::NaN();
- }
- Type* type = Type::None();
- // TODO(turbofan): Improve minus zero handling here.
- if (lhs->Maybe(Type::NaN()) || rhs->Maybe(Type::NaN())) {
- type = Type::Union(type, Type::NaN(), t->zone());
- }
- lhs = Type::Intersect(lhs, Type::OrderedNumber(), t->zone());
- rhs = Type::Intersect(rhs, Type::OrderedNumber(), t->zone());
- if (lhs->Is(t->cache_.kInteger) && rhs->Is(t->cache_.kInteger)) {
- double max = std::min(lhs->Max(), rhs->Max());
- double min = std::min(lhs->Min(), rhs->Min());
- type = Type::Union(type, Type::Range(min, max, t->zone()), t->zone());
- } else {
- type = Type::Union(type, Type::Union(lhs, rhs, t->zone()), t->zone());
- }
- return type;
-}
-
-// static
-Type* Typer::Visitor::NumberRound(Type* type, Typer* t) {
- DCHECK(type->Is(Type::Number()));
- if (type->Is(t->cache_.kIntegerOrMinusZeroOrNaN)) return type;
- // TODO(bmeurer): We could infer a more precise type here.
- return t->cache_.kIntegerOrMinusZeroOrNaN;
-}
-
-// static
-Type* Typer::Visitor::NumberSign(Type* type, Typer* t) {
- DCHECK(type->Is(Type::Number()));
- if (type->Is(t->cache_.kZeroish)) return type;
- bool maybe_minuszero = type->Maybe(Type::MinusZero());
- bool maybe_nan = type->Maybe(Type::NaN());
- type = Type::Intersect(type, Type::PlainNumber(), t->zone());
- if (type->Max() < 0.0) {
- type = t->cache_.kSingletonMinusOne;
- } else if (type->Max() <= 0.0) {
- type = t->cache_.kMinusOneOrZero;
- } else if (type->Min() > 0.0) {
- type = t->cache_.kSingletonOne;
- } else if (type->Min() >= 0.0) {
- type = t->cache_.kZeroOrOne;
- } else {
- type = Type::Range(-1.0, 1.0, t->zone());
- }
- if (maybe_minuszero) {
- type = Type::Union(type, Type::MinusZero(), t->zone());
- }
- if (maybe_nan) {
- type = Type::Union(type, Type::NaN(), t->zone());
- }
- return type;
-}
-
-// static
-Type* Typer::Visitor::NumberTrunc(Type* type, Typer* t) {
- DCHECK(type->Is(Type::Number()));
- if (type->Is(t->cache_.kIntegerOrMinusZeroOrNaN)) return type;
- // TODO(bmeurer): We could infer a more precise type here.
- return t->cache_.kIntegerOrMinusZeroOrNaN;
-}
-
-Type* Typer::Visitor::NumberToInt32(Type* type, Typer* t) {
- if (type->Is(Type::Signed32())) return type;
- if (type->Is(t->cache_.kZeroish)) return t->cache_.kSingletonZero;
- if (type->Is(t->signed32ish_)) {
- return Type::Intersect(
- Type::Union(type, t->cache_.kSingletonZero, t->zone()),
- Type::Signed32(), t->zone());
- }
- return Type::Signed32();
-}
-
-
-Type* Typer::Visitor::NumberToUint32(Type* type, Typer* t) {
- if (type->Is(Type::Unsigned32())) return type;
- if (type->Is(t->cache_.kZeroish)) return t->cache_.kSingletonZero;
- if (type->Is(t->unsigned32ish_)) {
- return Type::Intersect(
- Type::Union(type, t->cache_.kSingletonZero, t->zone()),
- Type::Unsigned32(), t->zone());
- }
- return Type::Unsigned32();
-}
-
// Type checks.
Type* Typer::Visitor::ObjectIsCallable(Type* type, Typer* t) {
@@ -1024,129 +896,32 @@ Type* Typer::Visitor::JSGreaterThanOrEqualTyper(
Type* Typer::Visitor::JSBitwiseOrTyper(Type* lhs, Type* rhs, Typer* t) {
- lhs = NumberToInt32(ToNumber(lhs, t), t);
- rhs = NumberToInt32(ToNumber(rhs, t), t);
- double lmin = lhs->Min();
- double rmin = rhs->Min();
- double lmax = lhs->Max();
- double rmax = rhs->Max();
- // Or-ing any two values results in a value no smaller than their minimum.
- // Even no smaller than their maximum if both values are non-negative.
- double min =
- lmin >= 0 && rmin >= 0 ? std::max(lmin, rmin) : std::min(lmin, rmin);
- double max = Type::Signed32()->Max();
-
- // Or-ing with 0 is essentially a conversion to int32.
- if (rmin == 0 && rmax == 0) {
- min = lmin;
- max = lmax;
- }
- if (lmin == 0 && lmax == 0) {
- min = rmin;
- max = rmax;
- }
-
- if (lmax < 0 || rmax < 0) {
- // Or-ing two values of which at least one is negative results in a negative
- // value.
- max = std::min(max, -1.0);
- }
- return Type::Range(min, max, t->zone());
+ return NumberBitwiseOr(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSBitwiseAndTyper(Type* lhs, Type* rhs, Typer* t) {
- lhs = NumberToInt32(ToNumber(lhs, t), t);
- rhs = NumberToInt32(ToNumber(rhs, t), t);
- double lmin = lhs->Min();
- double rmin = rhs->Min();
- double lmax = lhs->Max();
- double rmax = rhs->Max();
- double min = Type::Signed32()->Min();
- // And-ing any two values results in a value no larger than their maximum.
- // Even no larger than their minimum if both values are non-negative.
- double max =
- lmin >= 0 && rmin >= 0 ? std::min(lmax, rmax) : std::max(lmax, rmax);
- // And-ing with a non-negative value x causes the result to be between
- // zero and x.
- if (lmin >= 0) {
- min = 0;
- max = std::min(max, lmax);
- }
- if (rmin >= 0) {
- min = 0;
- max = std::min(max, rmax);
- }
- return Type::Range(min, max, t->zone());
+ return NumberBitwiseAnd(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSBitwiseXorTyper(Type* lhs, Type* rhs, Typer* t) {
- lhs = NumberToInt32(ToNumber(lhs, t), t);
- rhs = NumberToInt32(ToNumber(rhs, t), t);
- double lmin = lhs->Min();
- double rmin = rhs->Min();
- double lmax = lhs->Max();
- double rmax = rhs->Max();
- if ((lmin >= 0 && rmin >= 0) || (lmax < 0 && rmax < 0)) {
- // Xor-ing negative or non-negative values results in a non-negative value.
- return Type::Unsigned31();
- }
- if ((lmax < 0 && rmin >= 0) || (lmin >= 0 && rmax < 0)) {
- // Xor-ing a negative and a non-negative value results in a negative value.
- // TODO(jarin) Use a range here.
- return Type::Negative32();
- }
- return Type::Signed32();
+ return NumberBitwiseXor(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSShiftLeftTyper(Type* lhs, Type* rhs, Typer* t) {
- return Type::Signed32();
+ return NumberShiftLeft(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSShiftRightTyper(Type* lhs, Type* rhs, Typer* t) {
- lhs = NumberToInt32(ToNumber(lhs, t), t);
- rhs = NumberToUint32(ToNumber(rhs, t), t);
- double min = kMinInt;
- double max = kMaxInt;
- if (lhs->Min() >= 0) {
- // Right-shifting a non-negative value cannot make it negative, nor larger.
- min = std::max(min, 0.0);
- max = std::min(max, lhs->Max());
- if (rhs->Min() > 0 && rhs->Max() <= 31) {
- max = static_cast<int>(max) >> static_cast<int>(rhs->Min());
- }
- }
- if (lhs->Max() < 0) {
- // Right-shifting a negative value cannot make it non-negative, nor smaller.
- min = std::max(min, lhs->Min());
- max = std::min(max, -1.0);
- if (rhs->Min() > 0 && rhs->Max() <= 31) {
- min = static_cast<int>(min) >> static_cast<int>(rhs->Min());
- }
- }
- if (rhs->Min() > 0 && rhs->Max() <= 31) {
- // Right-shifting by a positive value yields a small integer value.
- double shift_min = kMinInt >> static_cast<int>(rhs->Min());
- double shift_max = kMaxInt >> static_cast<int>(rhs->Min());
- min = std::max(min, shift_min);
- max = std::min(max, shift_max);
- }
- // TODO(jarin) Ideally, the following micro-optimization should be performed
- // by the type constructor.
- if (max != Type::Signed32()->Max() || min != Type::Signed32()->Min()) {
- return Type::Range(min, max, t->zone());
- }
- return Type::Signed32();
+ return NumberShiftRight(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSShiftRightLogicalTyper(Type* lhs, Type* rhs, Typer* t) {
- lhs = NumberToUint32(ToNumber(lhs, t), t);
- // Logical right-shifting any value cannot make it larger.
- return Type::Range(0.0, lhs->Max(), t->zone());
+ return NumberShiftRightLogical(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
@@ -1163,26 +938,23 @@ Type* Typer::Visitor::JSAddTyper(Type* lhs, Type* rhs, Typer* t) {
}
}
// The addition must be numeric.
- return t->operation_typer()->NumberAdd(ToNumber(lhs, t), ToNumber(rhs, t));
+ return NumberAdd(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSSubtractTyper(Type* lhs, Type* rhs, Typer* t) {
- return t->operation_typer()->NumberSubtract(ToNumber(lhs, t),
- ToNumber(rhs, t));
+ return NumberSubtract(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSMultiplyTyper(Type* lhs, Type* rhs, Typer* t) {
- return t->operation_typer()->NumberMultiply(ToNumber(lhs, t),
- ToNumber(rhs, t));
+ return NumberMultiply(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSDivideTyper(Type* lhs, Type* rhs, Typer* t) {
- return t->operation_typer()->NumberDivide(ToNumber(lhs, t), ToNumber(rhs, t));
+ return NumberDivide(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
Type* Typer::Visitor::JSModulusTyper(Type* lhs, Type* rhs, Typer* t) {
- return t->operation_typer()->NumberModulus(ToNumber(lhs, t),
- ToNumber(rhs, t));
+ return NumberModulus(ToNumber(lhs, t), ToNumber(rhs, t), t);
}
@@ -1669,89 +1441,6 @@ Type* Typer::Visitor::TypeSpeculativeNumberLessThanOrEqual(Node* node) {
return Type::Boolean();
}
-Type* Typer::Visitor::TypeNumberAdd(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberSubtract(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeSpeculativeNumberAdd(Node* node) {
- return Type::Number();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberSubtract(Node* node) {
- return Type::Number();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberMultiply(Node* node) {
- return Type::Number();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberDivide(Node* node) {
- return Type::Number();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberModulus(Node* node) {
- return Type::Number();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberShiftLeft(Node* node) {
- return Type::Signed32();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberShiftRight(Node* node) {
- return Type::Signed32();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberShiftRightLogical(Node* node) {
- return Type::Unsigned32();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberBitwiseOr(Node* node) {
- return Type::Signed32();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberBitwiseXor(Node* node) {
- return Type::Signed32();
-}
-
-Type* Typer::Visitor::TypeSpeculativeNumberBitwiseAnd(Node* node) {
- return Type::Signed32();
-}
-
-Type* Typer::Visitor::TypeNumberMultiply(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberDivide(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberModulus(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberBitwiseOr(Node* node) {
- return Type::Signed32();
-}
-
-
-Type* Typer::Visitor::TypeNumberBitwiseXor(Node* node) {
- return Type::Signed32();
-}
-
-
-Type* Typer::Visitor::TypeNumberBitwiseAnd(Node* node) {
- return Type::Signed32();
-}
-
-
-Type* Typer::Visitor::TypeNumberShiftLeft(Node* node) {
- return Type::Signed32();
-}
-
-
-Type* Typer::Visitor::TypeNumberShiftRight(Node* node) {
- return Type::Signed32();
-}
-
-
-Type* Typer::Visitor::TypeNumberShiftRightLogical(Node* node) {
- return Type::Unsigned32();
-}
-
Type* Typer::Visitor::TypePlainPrimitiveToNumber(Node* node) {
return TypeUnaryOp(node, ToNumber);
}
@@ -1764,103 +1453,6 @@ Type* Typer::Visitor::TypePlainPrimitiveToFloat64(Node* node) {
return Type::Number();
}
-Type* Typer::Visitor::TypeNumberImul(Node* node) { return Type::Signed32(); }
-
-Type* Typer::Visitor::TypeNumberAbs(Node* node) {
- return typer_->operation_typer()->NumberAbs(Operand(node, 0));
-}
-
-Type* Typer::Visitor::TypeNumberClz32(Node* node) {
- return typer_->cache_.kZeroToThirtyTwo;
-}
-
-Type* Typer::Visitor::TypeNumberCeil(Node* node) {
- return TypeUnaryOp(node, NumberCeil);
-}
-
-Type* Typer::Visitor::TypeNumberFloor(Node* node) {
- return TypeUnaryOp(node, NumberFloor);
-}
-
-Type* Typer::Visitor::TypeNumberFround(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberSign(Node* node) {
- return TypeUnaryOp(node, NumberSign);
-}
-
-Type* Typer::Visitor::TypeNumberAcos(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberAcosh(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberAsin(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberAsinh(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberAtan(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberAtanh(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberAtan2(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberCos(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberCosh(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberExp(Node* node) {
- return Type::Union(Type::PlainNumber(), Type::NaN(), zone());
-}
-
-// TODO(mvstanton): Is this type sufficient, or should it look like Exp()?
-Type* Typer::Visitor::TypeNumberExpm1(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberLog(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberLog1p(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberLog2(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberLog10(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberCbrt(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberMax(Node* node) {
- return TypeBinaryOp(node, NumberMax);
-}
-
-Type* Typer::Visitor::TypeNumberMin(Node* node) {
- return TypeBinaryOp(node, NumberMin);
-}
-
-Type* Typer::Visitor::TypeNumberPow(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberRound(Node* node) {
- return TypeUnaryOp(node, NumberRound);
-}
-
-Type* Typer::Visitor::TypeNumberSin(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberSinh(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberSqrt(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberTan(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberTanh(Node* node) { return Type::Number(); }
-
-Type* Typer::Visitor::TypeNumberTrunc(Node* node) {
- return TypeUnaryOp(node, NumberTrunc);
-}
-
-Type* Typer::Visitor::TypeNumberToInt32(Node* node) {
- return TypeUnaryOp(node, NumberToInt32);
-}
-
-
-Type* Typer::Visitor::TypeNumberToUint32(Node* node) {
- return TypeUnaryOp(node, NumberToUint32);
-}
-
-
// static
Type* Typer::Visitor::ReferenceEqualTyper(Type* lhs, Type* rhs, Typer* t) {
if (lhs->IsConstant() && rhs->Is(lhs)) {
@@ -2271,10 +1863,6 @@ Type* Typer::Visitor::TypeChangeFloat64ToInt32(Node* node) {
return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone());
}
-Type* Typer::Visitor::TypeNumberSilenceNaN(Node* node) {
- return Type::Number();
-}
-
Type* Typer::Visitor::TypeChangeFloat64ToUint32(Node* node) {
return Type::Intersect(Type::Unsigned32(), Type::UntaggedIntegral32(),
zone());
« no previous file with comments | « src/compiler/typer.h ('k') | src/type-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698