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

Unified Diff: src/compiler/simplified-operator.h

Issue 2220573002: [turbofan] Add NumberOperationHint for speculative number operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update comment. 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/simplified-lowering.cc ('k') | src/compiler/simplified-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator.h
diff --git a/src/compiler/simplified-operator.h b/src/compiler/simplified-operator.h
index fac19f0882e6b02d2c52ec9a136577f6e5ebf9bd..37b64125a8fade7149a6d5af543ec19d83efbdc4 100644
--- a/src/compiler/simplified-operator.h
+++ b/src/compiler/simplified-operator.h
@@ -8,7 +8,6 @@
#include <iosfwd>
#include "src/compiler/operator.h"
-#include "src/compiler/type-hints.h"
#include "src/handles.h"
#include "src/machine-type.h"
#include "src/objects.h"
@@ -154,9 +153,19 @@ std::ostream& operator<<(std::ostream&, ElementsTransition);
ElementsTransition ElementsTransitionOf(const Operator* op) WARN_UNUSED_RESULT;
-BinaryOperationHints::Hint BinaryOperationHintOf(const Operator* op);
+// A hint for speculative number operations.
+enum class NumberOperationHint : uint8_t {
+ kSignedSmall, // Inputs were always Smi so far, output was in Smi range.
+ kSigned32, // Inputs and output were Signed32 so far.
+ kNumberOrOddball, // Inputs were Number or Oddball, output was Number.
+};
+
+size_t hash_value(NumberOperationHint);
+
+std::ostream& operator<<(std::ostream&, NumberOperationHint);
-CompareOperationHints::Hint CompareOperationHintOf(const Operator* op);
+NumberOperationHint NumberOperationHintOf(const Operator* op)
+ WARN_UNUSED_RESULT;
// Interface for building simplified operators, which represent the
// medium-level operations of V8, including adding numbers, allocating objects,
@@ -238,23 +247,21 @@ class SimplifiedOperatorBuilder final : public ZoneObject {
const Operator* NumberSilenceNaN();
- const Operator* SpeculativeNumberAdd(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberSubtract(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberMultiply(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberDivide(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberModulus(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberShiftLeft(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberShiftRight(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberShiftRightLogical(
- BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberBitwiseAnd(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberBitwiseOr(BinaryOperationHints::Hint hint);
- const Operator* SpeculativeNumberBitwiseXor(BinaryOperationHints::Hint hint);
-
- const Operator* SpeculativeNumberLessThan(CompareOperationHints::Hint hint);
- const Operator* SpeculativeNumberLessThanOrEqual(
- CompareOperationHints::Hint hint);
- const Operator* SpeculativeNumberEqual(CompareOperationHints::Hint hint);
+ const Operator* SpeculativeNumberAdd(NumberOperationHint hint);
+ const Operator* SpeculativeNumberSubtract(NumberOperationHint hint);
+ const Operator* SpeculativeNumberMultiply(NumberOperationHint hint);
+ const Operator* SpeculativeNumberDivide(NumberOperationHint hint);
+ const Operator* SpeculativeNumberModulus(NumberOperationHint hint);
+ const Operator* SpeculativeNumberShiftLeft(NumberOperationHint hint);
+ const Operator* SpeculativeNumberShiftRight(NumberOperationHint hint);
+ const Operator* SpeculativeNumberShiftRightLogical(NumberOperationHint hint);
+ const Operator* SpeculativeNumberBitwiseAnd(NumberOperationHint hint);
+ const Operator* SpeculativeNumberBitwiseOr(NumberOperationHint hint);
+ const Operator* SpeculativeNumberBitwiseXor(NumberOperationHint hint);
+
+ const Operator* SpeculativeNumberLessThan(NumberOperationHint hint);
+ const Operator* SpeculativeNumberLessThanOrEqual(NumberOperationHint hint);
+ const Operator* SpeculativeNumberEqual(NumberOperationHint hint);
const Operator* ReferenceEqual(Type* type);
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | src/compiler/simplified-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698