| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
| 6 | 6 |
| 7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
| 8 #include "src/base/lazy-instance.h" | 8 #include "src/base/lazy-instance.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 explicit CallOperator(const CallDescriptor* descriptor) | 871 explicit CallOperator(const CallDescriptor* descriptor) |
| 872 : Operator1<const CallDescriptor*>( | 872 : Operator1<const CallDescriptor*>( |
| 873 IrOpcode::kCall, descriptor->properties(), "Call", | 873 IrOpcode::kCall, descriptor->properties(), "Call", |
| 874 descriptor->InputCount() + descriptor->FrameStateCount(), | 874 descriptor->InputCount() + descriptor->FrameStateCount(), |
| 875 Operator::ZeroIfPure(descriptor->properties()), | 875 Operator::ZeroIfPure(descriptor->properties()), |
| 876 Operator::ZeroIfEliminatable(descriptor->properties()), | 876 Operator::ZeroIfEliminatable(descriptor->properties()), |
| 877 descriptor->ReturnCount(), | 877 descriptor->ReturnCount(), |
| 878 Operator::ZeroIfPure(descriptor->properties()), | 878 Operator::ZeroIfPure(descriptor->properties()), |
| 879 Operator::ZeroIfNoThrow(descriptor->properties()), descriptor) {} | 879 Operator::ZeroIfNoThrow(descriptor->properties()), descriptor) {} |
| 880 | 880 |
| 881 void PrintParameter(std::ostream& os) const override { | 881 void PrintParameter(std::ostream& os, PrintVerbosity verbose) const { |
| 882 os << "[" << *parameter() << "]"; | 882 os << "[" << *parameter() << "]"; |
| 883 } | 883 } |
| 884 }; | 884 }; |
| 885 return new (zone()) CallOperator(descriptor); | 885 return new (zone()) CallOperator(descriptor); |
| 886 } | 886 } |
| 887 | 887 |
| 888 | 888 |
| 889 const Operator* CommonOperatorBuilder::TailCall( | 889 const Operator* CommonOperatorBuilder::TailCall( |
| 890 const CallDescriptor* descriptor) { | 890 const CallDescriptor* descriptor) { |
| 891 class TailCallOperator final : public Operator1<const CallDescriptor*> { | 891 class TailCallOperator final : public Operator1<const CallDescriptor*> { |
| 892 public: | 892 public: |
| 893 explicit TailCallOperator(const CallDescriptor* descriptor) | 893 explicit TailCallOperator(const CallDescriptor* descriptor) |
| 894 : Operator1<const CallDescriptor*>( | 894 : Operator1<const CallDescriptor*>( |
| 895 IrOpcode::kTailCall, descriptor->properties(), "TailCall", | 895 IrOpcode::kTailCall, descriptor->properties(), "TailCall", |
| 896 descriptor->InputCount() + descriptor->FrameStateCount(), 1, 1, 0, | 896 descriptor->InputCount() + descriptor->FrameStateCount(), 1, 1, 0, |
| 897 0, 1, descriptor) {} | 897 0, 1, descriptor) {} |
| 898 | 898 |
| 899 void PrintParameter(std::ostream& os) const override { | 899 void PrintParameter(std::ostream& os, PrintVerbosity verbose) const { |
| 900 os << "[" << *parameter() << "]"; | 900 os << "[" << *parameter() << "]"; |
| 901 } | 901 } |
| 902 }; | 902 }; |
| 903 return new (zone()) TailCallOperator(descriptor); | 903 return new (zone()) TailCallOperator(descriptor); |
| 904 } | 904 } |
| 905 | 905 |
| 906 | 906 |
| 907 const Operator* CommonOperatorBuilder::Projection(size_t index) { | 907 const Operator* CommonOperatorBuilder::Projection(size_t index) { |
| 908 switch (index) { | 908 switch (index) { |
| 909 #define CACHED_PROJECTION(index) \ | 909 #define CACHED_PROJECTION(index) \ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 CommonOperatorBuilder::CreateFrameStateFunctionInfo( | 945 CommonOperatorBuilder::CreateFrameStateFunctionInfo( |
| 946 FrameStateType type, int parameter_count, int local_count, | 946 FrameStateType type, int parameter_count, int local_count, |
| 947 Handle<SharedFunctionInfo> shared_info) { | 947 Handle<SharedFunctionInfo> shared_info) { |
| 948 return new (zone()->New(sizeof(FrameStateFunctionInfo))) | 948 return new (zone()->New(sizeof(FrameStateFunctionInfo))) |
| 949 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); | 949 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); |
| 950 } | 950 } |
| 951 | 951 |
| 952 } // namespace compiler | 952 } // namespace compiler |
| 953 } // namespace internal | 953 } // namespace internal |
| 954 } // namespace v8 | 954 } // namespace v8 |
| OLD | NEW |