From: bmeurer Date: Thu, 19 Mar 2015 07:47:48 +0000 (-0700) Subject: [turbofan] Eliminatable JS/call nodes should not have a control input. X-Git-Tag: upstream/4.7.83~3752 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed082f2adc013bcd958ca334fc5eda05a4747257;p=platform%2Fupstream%2Fv8.git [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} --- diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc index 27a9d63..6cc1249 100644 --- a/src/compiler/common-operator.cc +++ b/src/compiler/common-operator.cc @@ -623,7 +623,7 @@ const Operator* CommonOperatorBuilder::Call(const CallDescriptor* descriptor) { IrOpcode::kCall, descriptor->properties(), mnemonic, descriptor->InputCount() + descriptor->FrameStateCount(), Operator::ZeroIfPure(descriptor->properties()), - Operator::ZeroIfPure(descriptor->properties()), + Operator::ZeroIfEliminatable(descriptor->properties()), descriptor->ReturnCount(), Operator::ZeroIfPure(descriptor->properties()), Operator::ZeroIfNoThrow(descriptor->properties()), descriptor) {} diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc index bc0e61f..6e7ee07 100644 --- a/src/compiler/js-operator.cc +++ b/src/compiler/js-operator.cc @@ -254,8 +254,8 @@ struct JSOperatorGlobalCache FINAL { Name##Operator() \ : Operator(IrOpcode::kJS##Name, properties, "JS" #Name, \ value_input_count, Operator::ZeroIfPure(properties), \ - Operator::ZeroIfPure(properties), value_output_count, \ - Operator::ZeroIfPure(properties), \ + Operator::ZeroIfEliminatable(properties), \ + value_output_count, Operator::ZeroIfPure(properties), \ Operator::ZeroIfNoThrow(properties)) {} \ }; \ Name##Operator k##Name##Operator; diff --git a/src/compiler/operator.h b/src/compiler/operator.h index 114cf6a..ec365fa 100644 --- a/src/compiler/operator.h +++ b/src/compiler/operator.h @@ -97,6 +97,10 @@ class Operator : public ZoneObject { int EffectOutputCount() const { return effect_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) { return (properties & kNoThrow) == kNoThrow ? 0 : 2; } diff --git a/test/unittests/compiler/js-operator-unittest.cc b/test/unittests/compiler/js-operator-unittest.cc index f8ef7fb..14939ed 100644 --- a/test/unittests/compiler/js-operator-unittest.cc +++ b/test/unittests/compiler/js-operator-unittest.cc @@ -73,7 +73,7 @@ const SharedOperator kSharedOperators[] = { SHARED(ToName, 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(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(TypeOf, Operator::kPure, 1, 0, 0, 0, 1, 0, 0), SHARED(InstanceOf, Operator::kNoProperties, 2, 1, 1, 1, 1, 1, 2),