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

Unified Diff: src/compiler/type-hints.h

Issue 1921563002: [turbofan] Initial version of number type feedback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 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/type-hint-analyzer.cc ('k') | src/compiler/type-hints.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/type-hints.h
diff --git a/src/compiler/type-hints.h b/src/compiler/type-hints.h
index f1cc64036c16ccc63b5dca4952d5accdbc5df0ab..6971960153f5c1d84b24ff2f33dba3b719ddc92d 100644
--- a/src/compiler/type-hints.h
+++ b/src/compiler/type-hints.h
@@ -15,7 +15,14 @@ namespace compiler {
// Type hints for an binary operation.
class BinaryOperationHints final {
public:
- enum Hint { kNone, kSignedSmall, kSigned32, kNumber, kString, kAny };
+ enum Hint {
+ kNone,
+ kSignedSmall,
+ kSigned32,
+ kNumberOrUndefined,
+ kString,
+ kAny
+ };
BinaryOperationHints() : BinaryOperationHints(kNone, kNone, kNone) {}
BinaryOperationHints(Hint left, Hint right, Hint result)
@@ -29,6 +36,11 @@ class BinaryOperationHints final {
Hint left() const { return LeftField::decode(bit_field_); }
Hint right() const { return RightField::decode(bit_field_); }
Hint result() const { return ResultField::decode(bit_field_); }
+ Hint combined() const { return Combine(Combine(left(), right()), result()); }
+
+ // Hint 'subtyping' and generalization.
+ static bool Is(Hint h1, Hint h2);
+ static Hint Combine(Hint h1, Hint h2);
bool operator==(BinaryOperationHints const& that) const {
return this->bit_field_ == that.bit_field_;
« no previous file with comments | « src/compiler/type-hint-analyzer.cc ('k') | src/compiler/type-hints.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698