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

Unified Diff: src/compiler/operation-typer.h

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/opcodes.h ('k') | src/compiler/operation-typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/operation-typer.h
diff --git a/src/compiler/operation-typer.h b/src/compiler/operation-typer.h
index d6ec06b898b825f888c47525f5a52cb110230519..0b039a928dd5a1cb9702aad3631629b8298ba5c4 100644
--- a/src/compiler/operation-typer.h
+++ b/src/compiler/operation-typer.h
@@ -32,13 +32,16 @@ class OperationTyper {
Type* ToNumber(Type* type);
Type* WeakenRange(Type* current_range, Type* previous_range);
- Type* NumberAdd(Type* lhs, Type* rhs);
- Type* NumberSubtract(Type* lhs, Type* rhs);
- Type* NumberMultiply(Type* lhs, Type* rhs);
- Type* NumberDivide(Type* lhs, Type* rhs);
- Type* NumberModulus(Type* lhs, Type* rhs);
+// Number unary operators.
+#define DECLARE_METHOD(Name) Type* Name(Type* type);
+ SIMPLIFIED_NUMBER_UNOP_LIST(DECLARE_METHOD)
+#undef DECLARE_METHOD
- Type* NumberAbs(Type* type);
+// Number binary operators.
+#define DECLARE_METHOD(Name) Type* Name(Type* lhs, Type* rhs);
+ SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_METHOD)
+ SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(DECLARE_METHOD)
+#undef DECLARE_METHOD
enum ComparisonOutcomeFlags {
kComparisonTrue = 1,
@@ -46,14 +49,9 @@ class OperationTyper {
kComparisonUndefined = 4
};
-// Javascript binop typers.
-#define DECLARE_CASE(x) Type* Type##x(Type* lhs, Type* rhs);
- JS_SIMPLE_BINOP_LIST(DECLARE_CASE)
-#undef DECLARE_CASE
-
- Type* singleton_false() { return singleton_false_; }
- Type* singleton_true() { return singleton_true_; }
- Type* singleton_the_hole() { return singleton_the_hole_; }
+ Type* singleton_false() const { return singleton_false_; }
+ Type* singleton_true() const { return singleton_true_; }
+ Type* singleton_the_hole() const { return singleton_the_hole_; }
private:
typedef base::Flags<ComparisonOutcomeFlags> ComparisonOutcome;
@@ -68,14 +66,16 @@ class OperationTyper {
Type* SubtractRanger(RangeType* lhs, RangeType* rhs);
Type* MultiplyRanger(Type* lhs, Type* rhs);
- Zone* zone() { return zone_; }
+ Zone* zone() const { return zone_; }
- Zone* zone_;
+ Zone* const zone_;
TypeCache const& cache_;
Type* singleton_false_;
Type* singleton_true_;
Type* singleton_the_hole_;
+ Type* signed32ish_;
+ Type* unsigned32ish_;
};
} // namespace compiler
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/operation-typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698