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

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

Issue 1494973002: [turbofan] Introduce ToBooleanHints on ToBoolean operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/js-operator.h ('k') | src/compiler/type-hint-analyzer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-operator.cc
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc
index fa27ac219fb89f67b6e4bde37b574d177fbf71a9..5f9abceb4045ba408f82c379094654a791252c3d 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -46,6 +46,12 @@ ConvertReceiverMode ConvertReceiverModeOf(Operator const* op) {
}
+ToBooleanHints ToBooleanHintsOf(Operator const* op) {
+ DCHECK_EQ(IrOpcode::kJSToBoolean, op->opcode());
+ return OpParameter<ToBooleanHints>(op);
+}
+
+
size_t hash_value(TailCallMode mode) {
return base::hash_value(static_cast<unsigned>(mode));
}
@@ -486,7 +492,6 @@ const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op) {
V(NotEqual, Operator::kNoProperties, 2, 1) \
V(StrictEqual, Operator::kNoThrow, 2, 1) \
V(StrictNotEqual, Operator::kNoThrow, 2, 1) \
- V(ToBoolean, Operator::kEliminatable, 1, 1) \
V(ToNumber, Operator::kNoProperties, 1, 1) \
V(ToString, Operator::kNoProperties, 1, 1) \
V(ToName, Operator::kNoProperties, 1, 1) \
@@ -717,6 +722,16 @@ const Operator* JSOperatorBuilder::Modulus(LanguageMode language_mode,
}
+const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<ToBooleanHints>( //--
+ IrOpcode::kJSToBoolean, Operator::kEliminatable, // opcode
+ "JSToBoolean", // name
+ 1, 1, 0, 1, 1, 0, // inputs/outputs
+ hints); // parameter
+}
+
+
const Operator* JSOperatorBuilder::CallFunction(
size_t arity, LanguageMode language_mode, VectorSlotPair const& feedback,
ConvertReceiverMode convert_mode, TailCallMode tail_call_mode) {
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/type-hint-analyzer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698