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

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

Issue 2164573003: [turbofan] Introduce a TransitionElementsKind simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix the runtime fallback. Created 4 years, 5 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/typer.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 ac5134d7588598968f22ecba895013456bb3c092..193f65514460225e28466d91c8eb04414d919ca9 100644
--- a/src/compiler/simplified-operator.cc
+++ b/src/compiler/simplified-operator.cc
@@ -241,6 +241,26 @@ CheckTaggedHoleMode CheckTaggedHoleModeOf(const Operator* op) {
return OpParameter<CheckTaggedHoleMode>(op);
}
+size_t hash_value(ElementsTransition transition) {
+ return static_cast<uint8_t>(transition);
+}
+
+std::ostream& operator<<(std::ostream& os, ElementsTransition transition) {
+ switch (transition) {
+ case ElementsTransition::kFastTransition:
+ return os << "fast-transition";
+ case ElementsTransition::kSlowTransition:
+ return os << "slow-transition";
+ }
+ UNREACHABLE();
+ return os;
+}
+
+ElementsTransition ElementsTransitionOf(const Operator* op) {
+ DCHECK_EQ(IrOpcode::kTransitionElementsKind, op->opcode());
+ return OpParameter<ElementsTransition>(op);
+}
+
BinaryOperationHints::Hint BinaryOperationHintOf(const Operator* op) {
DCHECK(op->opcode() == IrOpcode::kSpeculativeNumberAdd ||
op->opcode() == IrOpcode::kSpeculativeNumberSubtract ||
@@ -516,6 +536,16 @@ const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) {
"ReferenceEqual", 2, 0, 0, 1, 0, 0);
}
+const Operator* SimplifiedOperatorBuilder::TransitionElementsKind(
+ ElementsTransition transition) {
+ return new (zone()) Operator1<ElementsTransition>( // --
+ IrOpcode::kTransitionElementsKind, // opcode
+ Operator::kNoDeopt | Operator::kNoThrow, // flags
+ "TransitionElementsKind", // name
+ 3, 1, 1, 0, 1, 0, // counts
+ transition); // parameter
+}
+
const Operator* SimplifiedOperatorBuilder::Allocate(PretenureFlag pretenure) {
switch (pretenure) {
case NOT_TENURED:
« no previous file with comments | « src/compiler/simplified-operator.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698