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

[turbofan] Eliminatable JS/call nodes should not have a control input.

The control input is only relevant for operations that may "write" (to
prevent hoisting) or "throw" (because they are part of the control chain).

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1015353004

Cr-Commit-Position: refs/heads/master@{#27288}
parent 8849c000
...@@ -623,7 +623,7 @@ const Operator* CommonOperatorBuilder::Call(const CallDescriptor* descriptor) { ...@@ -623,7 +623,7 @@ const Operator* CommonOperatorBuilder::Call(const CallDescriptor* descriptor) {
IrOpcode::kCall, descriptor->properties(), mnemonic, IrOpcode::kCall, descriptor->properties(), mnemonic,
descriptor->InputCount() + descriptor->FrameStateCount(), descriptor->InputCount() + descriptor->FrameStateCount(),
Operator::ZeroIfPure(descriptor->properties()), Operator::ZeroIfPure(descriptor->properties()),
Operator::ZeroIfPure(descriptor->properties()), Operator::ZeroIfEliminatable(descriptor->properties()),
descriptor->ReturnCount(), descriptor->ReturnCount(),
Operator::ZeroIfPure(descriptor->properties()), Operator::ZeroIfPure(descriptor->properties()),
Operator::ZeroIfNoThrow(descriptor->properties()), descriptor) {} Operator::ZeroIfNoThrow(descriptor->properties()), descriptor) {}
......
...@@ -254,8 +254,8 @@ struct JSOperatorGlobalCache FINAL { ...@@ -254,8 +254,8 @@ struct JSOperatorGlobalCache FINAL {
Name##Operator() \ Name##Operator() \
: Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \ : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \
value_input_count, Operator::ZeroIfPure(properties), \ value_input_count, Operator::ZeroIfPure(properties), \
Operator::ZeroIfPure(properties), value_output_count, \ Operator::ZeroIfEliminatable(properties), \
Operator::ZeroIfPure(properties), \ value_output_count, Operator::ZeroIfPure(properties), \
Operator::ZeroIfNoThrow(properties)) {} \ Operator::ZeroIfNoThrow(properties)) {} \
}; \ }; \
Name##Operator k##Name##Operator; Name##Operator k##Name##Operator;
......
...@@ -97,6 +97,10 @@ class Operator : public ZoneObject { ...@@ -97,6 +97,10 @@ class Operator : public ZoneObject {
int EffectOutputCount() const { return effect_out_; } int EffectOutputCount() const { return effect_out_; }
int ControlOutputCount() const { return control_out_; } int ControlOutputCount() const { return control_out_; }
static size_t ZeroIfEliminatable(Properties properties) {
return (properties & kEliminatable) == kEliminatable ? 0 : 1;
}
static size_t ZeroIfNoThrow(Properties properties) { static size_t ZeroIfNoThrow(Properties properties) {
return (properties & kNoThrow) == kNoThrow ? 0 : 2; return (properties & kNoThrow) == kNoThrow ? 0 : 2;
} }
......
...@@ -73,7 +73,7 @@ const SharedOperator kSharedOperators[] = { ...@@ -73,7 +73,7 @@ const SharedOperator kSharedOperators[] = {
SHARED(ToName, Operator::kNoProperties, 1, 1, 1, 1, 1, 1, 2), SHARED(ToName, Operator::kNoProperties, 1, 1, 1, 1, 1, 1, 2),
SHARED(ToObject, Operator::kNoProperties, 1, 1, 1, 1, 1, 1, 2), SHARED(ToObject, Operator::kNoProperties, 1, 1, 1, 1, 1, 1, 2),
SHARED(Yield, Operator::kNoProperties, 1, 0, 1, 1, 1, 1, 2), SHARED(Yield, Operator::kNoProperties, 1, 0, 1, 1, 1, 1, 2),
SHARED(Create, Operator::kEliminatable, 0, 0, 1, 1, 1, 1, 0), SHARED(Create, Operator::kEliminatable, 0, 0, 1, 0, 1, 1, 0),
SHARED(HasProperty, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2), SHARED(HasProperty, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2),
SHARED(TypeOf, Operator::kPure, 1, 0, 0, 0, 1, 0, 0), SHARED(TypeOf, Operator::kPure, 1, 0, 0, 0, 1, 0, 0),
SHARED(InstanceOf, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2), SHARED(InstanceOf, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2),
......
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