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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 2111193002: [turbofan] Remove eager frame state from JSMultiply. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-checkpoint-typed-lowering-1
Patch Set: Addressed comment. Created 4 years, 6 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 | « no previous file | src/compiler/operator-properties.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index 7e2d10200de656c103e0ad764eee6204f02fda38..809eb494124602781ff304a5e3230a8b294bf70e 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -34,7 +34,7 @@ class JSBinopReduction final {
}
DCHECK_NE(0, node_->op()->ControlOutputCount());
DCHECK_EQ(1, node_->op()->EffectOutputCount());
- DCHECK_EQ(2, OperatorProperties::GetFrameStateInputCount(node_->op()));
+ DCHECK_LE(1, OperatorProperties::GetFrameStateInputCount(node_->op()));
BinaryOperationHints hints = BinaryOperationHintsOf(node_->op());
BinaryOperationHints::Hint combined = hints.combined();
if (combined == BinaryOperationHints::kSignedSmall ||
@@ -155,7 +155,7 @@ class JSBinopReduction final {
DCHECK_EQ(1, node_->op()->EffectOutputCount());
DCHECK_EQ(1, node_->op()->ControlInputCount());
DCHECK_LT(1, node_->op()->ControlOutputCount());
- DCHECK_EQ(2, OperatorProperties::GetFrameStateInputCount(node_->op()));
+ DCHECK_LE(1, OperatorProperties::GetFrameStateInputCount(node_->op()));
DCHECK_EQ(2, node_->op()->ValueInputCount());
// Reconnect the control output to bypass the IfSuccess node and
@@ -175,7 +175,9 @@ class JSBinopReduction final {
}
// Remove both bailout frame states and the context.
- node_->RemoveInput(NodeProperties::FirstFrameStateIndex(node_) + 1);
+ if (OperatorProperties::GetFrameStateInputCount(node_->op()) == 2) {
+ node_->RemoveInput(NodeProperties::FirstFrameStateIndex(node_) + 1);
+ }
node_->RemoveInput(NodeProperties::FirstFrameStateIndex(node_));
node_->RemoveInput(NodeProperties::FirstContextIndex(node_));
@@ -230,6 +232,13 @@ class JSBinopReduction final {
Node* node_; // The original node.
Node* CreateFrameStateForLeftInput() {
+ if (OperatorProperties::GetFrameStateInputCount(node_->op()) < 2) {
+ // Deoptimization is disabled => return dummy frame state instead.
+ Node* dummy_state = NodeProperties::GetFrameStateInput(node_, 0);
+ DCHECK(OpParameter<FrameStateInfo>(dummy_state).bailout_id().IsNone());
+ return dummy_state;
+ }
+
Node* frame_state = NodeProperties::GetFrameStateInput(node_, 1);
FrameStateInfo state_info = OpParameter<FrameStateInfo>(frame_state);
@@ -261,6 +270,13 @@ class JSBinopReduction final {
}
Node* CreateFrameStateForRightInput(Node* converted_left) {
+ if (OperatorProperties::GetFrameStateInputCount(node_->op()) < 2) {
+ // Deoptimization is disabled => return dummy frame state instead.
+ Node* dummy_state = NodeProperties::GetFrameStateInput(node_, 0);
+ DCHECK(OpParameter<FrameStateInfo>(dummy_state).bailout_id().IsNone());
+ return dummy_state;
+ }
+
Node* frame_state = NodeProperties::GetFrameStateInput(node_, 1);
FrameStateInfo state_info = OpParameter<FrameStateInfo>(frame_state);
@@ -516,8 +532,15 @@ Reduction JSTypedLowering::ReduceJSMultiply(Node* node) {
simplified()->SpeculativeNumberMultiply(feedback), Type::Number());
}
- r.ConvertInputsToNumber();
- return r.ChangeToPureOperator(simplified()->NumberMultiply(), Type::Number());
+ // If deoptimization is enabled we rely on type feedback.
+ if (r.BothInputsAre(Type::PlainPrimitive()) ||
+ !(flags() & kDeoptimizationEnabled)) {
+ r.ConvertInputsToNumber();
+ return r.ChangeToPureOperator(simplified()->NumberMultiply(),
+ Type::Number());
+ }
+
+ return NoChange();
}
Reduction JSTypedLowering::ReduceJSDivide(Node* node) {
« no previous file with comments | « no previous file | src/compiler/operator-properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698