Commit ac50c1ca authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] JSTypedLowering can just look at the type hints.

If --turbo-type-feedback is off, the type hints on the operators will
just be kAny, so we don't need to do additional checks in the
JSTypedLowering reducer.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2144203002
Cr-Commit-Position: refs/heads/master@{#37750}
parent 0b3e6843
......@@ -28,36 +28,32 @@ class JSBinopReduction final {
: lowering_(lowering), node_(node) {}
BinaryOperationHints::Hint GetNumberBinaryOperationFeedback() {
if (!(lowering_->flags() & JSTypedLowering::kDeoptimizationEnabled) ||
!(lowering_->flags() & JSTypedLowering::kTypeFeedbackEnabled)) {
return BinaryOperationHints::kAny;
}
DCHECK_NE(0, node_->op()->ControlOutputCount());
DCHECK_EQ(1, node_->op()->EffectOutputCount());
DCHECK_LE(1, OperatorProperties::GetFrameStateInputCount(node_->op()));
BinaryOperationHints hints = BinaryOperationHintsOf(node_->op());
BinaryOperationHints::Hint combined = hints.combined();
if (combined == BinaryOperationHints::kSignedSmall ||
combined == BinaryOperationHints::kSigned32 ||
combined == BinaryOperationHints::kNumberOrOddball) {
return combined;
if (lowering_->flags() & JSTypedLowering::kDeoptimizationEnabled) {
DCHECK_NE(0, node_->op()->ControlOutputCount());
DCHECK_EQ(1, node_->op()->EffectOutputCount());
DCHECK_LE(1, OperatorProperties::GetFrameStateInputCount(node_->op()));
BinaryOperationHints hints = BinaryOperationHintsOf(node_->op());
BinaryOperationHints::Hint combined = hints.combined();
if (combined == BinaryOperationHints::kSignedSmall ||
combined == BinaryOperationHints::kSigned32 ||
combined == BinaryOperationHints::kNumberOrOddball) {
return combined;
}
}
return BinaryOperationHints::kAny;
}
CompareOperationHints::Hint GetNumberCompareOperationFeedback() {
if (!(lowering_->flags() & JSTypedLowering::kDeoptimizationEnabled) ||
!(lowering_->flags() & JSTypedLowering::kTypeFeedbackEnabled)) {
return CompareOperationHints::kAny;
}
DCHECK_NE(0, node_->op()->ControlOutputCount());
DCHECK_EQ(1, node_->op()->EffectOutputCount());
DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node_->op()));
CompareOperationHints hints = CompareOperationHintsOf(node_->op());
CompareOperationHints::Hint combined = hints.combined();
if (combined == CompareOperationHints::kSignedSmall ||
combined == CompareOperationHints::kNumberOrOddball) {
return combined;
if (lowering_->flags() & JSTypedLowering::kDeoptimizationEnabled) {
DCHECK_NE(0, node_->op()->ControlOutputCount());
DCHECK_EQ(1, node_->op()->EffectOutputCount());
DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node_->op()));
CompareOperationHints hints = CompareOperationHintsOf(node_->op());
CompareOperationHints::Hint combined = hints.combined();
if (combined == CompareOperationHints::kSignedSmall ||
combined == CompareOperationHints::kNumberOrOddball) {
return combined;
}
}
return CompareOperationHints::kAny;
}
......
......@@ -36,7 +36,6 @@ class JSTypedLowering final : public AdvancedReducer {
kNoFlags = 0u,
kDeoptimizationEnabled = 1u << 0,
kDisableIntegerBinaryOpReduction = 1u << 1,
kTypeFeedbackEnabled = 1u << 2,
};
typedef base::Flags<Flag> Flags;
......
......@@ -887,9 +887,6 @@ struct TypedLoweringPhase {
if (data->info()->is_optimizing_from_bytecode()) {
typed_lowering_flags |= JSTypedLowering::kDisableIntegerBinaryOpReduction;
}
if (data->info()->is_type_feedback_enabled()) {
typed_lowering_flags |= JSTypedLowering::kTypeFeedbackEnabled;
}
JSTypedLowering typed_lowering(&graph_reducer, data->info()->dependencies(),
typed_lowering_flags, data->jsgraph(),
temp_zone);
......
......@@ -87,9 +87,8 @@ class JSTypedLoweringTest : public TypedGraphTest {
// TODO(titzer): mock the GraphReducer here for better unit testing.
GraphReducer graph_reducer(zone(), graph());
JSTypedLowering reducer(&graph_reducer, &deps_,
JSTypedLowering::kDeoptimizationEnabled |
JSTypedLowering::kTypeFeedbackEnabled,
&jsgraph, zone());
JSTypedLowering::kDeoptimizationEnabled, &jsgraph,
zone());
return reducer.Reduce(node);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment