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

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

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/simplified-operator.h ('k') | src/compiler/type-hint-analyzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator.cc
diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc
index 9377398c56622b63f8429ca313815d0f0fdb736c..d82133b484f15144f0d6f92ce4711ac45006878b 100644
--- a/src/compiler/simplified-operator.cc
+++ b/src/compiler/simplified-operator.cc
@@ -177,6 +177,12 @@ Type* TypeOf(const Operator* op) {
return OpParameter<Type*>(op);
}
+BinaryOperationHints::Hint BinaryOperationHintOf(const Operator* op) {
+ DCHECK(op->opcode() == IrOpcode::kSpeculativeNumberAdd ||
+ op->opcode() == IrOpcode::kSpeculativeNumberSubtract);
+ return OpParameter<BinaryOperationHints::Hint>(op);
+}
+
#define PURE_OP_LIST(V) \
V(BooleanNot, Operator::kNoProperties, 1) \
V(BooleanToNumber, Operator::kNoProperties, 1) \
@@ -227,6 +233,12 @@ Type* TypeOf(const Operator* op) {
V(StringLessThan, Operator::kNoProperties, 2) \
V(StringLessThanOrEqual, Operator::kNoProperties, 2)
+#define CHECKED_OP_LIST(V) \
+ V(CheckedUint32ToInt32) \
+ V(CheckedFloat64ToInt32) \
+ V(CheckedTaggedToInt32) \
+ V(CheckedTaggedToFloat64)
+
struct SimplifiedOperatorGlobalCache final {
#define PURE(Name, properties, input_count) \
struct Name##Operator final : public Operator { \
@@ -238,6 +250,16 @@ struct SimplifiedOperatorGlobalCache final {
PURE_OP_LIST(PURE)
#undef PURE
+#define CHECKED(Name) \
+ struct Name##Operator final : public Operator { \
+ Name##Operator() \
+ : Operator(IrOpcode::k##Name, Operator::kNoThrow, #Name, 1, 1, 1, 1, \
+ 1, 1) {} \
+ }; \
+ Name##Operator k##Name;
+ CHECKED_OP_LIST(CHECKED)
+#undef CHECKED
+
template <PretenureFlag kPretenure>
struct AllocateOperator final : public Operator1<PretenureFlag> {
AllocateOperator()
@@ -276,12 +298,15 @@ static base::LazyInstance<SimplifiedOperatorGlobalCache>::type kCache =
SimplifiedOperatorBuilder::SimplifiedOperatorBuilder(Zone* zone)
: cache_(kCache.Get()), zone_(zone) {}
-
#define GET_FROM_CACHE(Name, properties, input_count) \
const Operator* SimplifiedOperatorBuilder::Name() { return &cache_.k##Name; }
PURE_OP_LIST(GET_FROM_CACHE)
#undef GET_FROM_CACHE
+#define GET_FROM_CACHE(Name) \
+ const Operator* SimplifiedOperatorBuilder::Name() { return &cache_.k##Name; }
+CHECKED_OP_LIST(GET_FROM_CACHE)
+#undef GET_FROM_CACHE
const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) {
return new (zone()) Operator(IrOpcode::kReferenceEqual,
@@ -343,6 +368,19 @@ const Operator* SimplifiedOperatorBuilder::StoreBuffer(BufferAccess access) {
return nullptr;
}
+const Operator* SimplifiedOperatorBuilder::SpeculativeNumberAdd(
+ BinaryOperationHints::Hint hint) {
+ return new (zone()) Operator1<BinaryOperationHints::Hint>(
+ IrOpcode::kSpeculativeNumberAdd, Operator::kNoThrow,
+ "SpeculativeNumberAdd", 2, 1, 1, 1, 1, 1, hint);
+}
+
+const Operator* SimplifiedOperatorBuilder::SpeculativeNumberSubtract(
+ BinaryOperationHints::Hint hint) {
+ return new (zone()) Operator1<BinaryOperationHints::Hint>(
+ IrOpcode::kSpeculativeNumberSubtract, Operator::kNoThrow,
+ "SpeculativeNumberSubtract", 2, 1, 1, 1, 1, 1, hint);
+}
#define ACCESS_OP_LIST(V) \
V(LoadField, FieldAccess, Operator::kNoWrite, 1, 1, 1) \
« no previous file with comments | « src/compiler/simplified-operator.h ('k') | src/compiler/type-hint-analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698