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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 15085006: Inline Uint32x4 operations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 42621627) \ 96 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 42621627) \
97 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 42621627) \ 97 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 42621627) \
98 V(_Float32x4, _negate, Float32x4Negate, 42621627) \ 98 V(_Float32x4, _negate, Float32x4Negate, 42621627) \
99 V(_Float32x4, _abs, Float32x4Absolute, 42621627) \ 99 V(_Float32x4, _abs, Float32x4Absolute, 42621627) \
100 V(_Float32x4, _clamp, Float32x4Clamp, 615895313) \ 100 V(_Float32x4, _clamp, Float32x4Clamp, 615895313) \
101 V(_Float32x4, withX, Float32x4WithX, 219466242) \ 101 V(_Float32x4, withX, Float32x4WithX, 219466242) \
102 V(_Float32x4, withY, Float32x4WithY, 219466242) \ 102 V(_Float32x4, withY, Float32x4WithY, 219466242) \
103 V(_Float32x4, withZ, Float32x4WithZ, 219466242) \ 103 V(_Float32x4, withZ, Float32x4WithZ, 219466242) \
104 V(_Float32x4, withW, Float32x4WithW, 219466242) \ 104 V(_Float32x4, withW, Float32x4WithW, 219466242) \
105 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 1044409108) \ 105 V(_Float32x4, _toUint32x4, Float32x4ToUint32x4, 1044409108) \
106 V(Uint32x4, Uint32x4.bool, Uint32x4BoolConstructor, 1489869343) \
107 V(_Uint32x4, get:flagX, Uint32x4GetFlagX, 782547529) \
108 V(_Uint32x4, get:flagY, Uint32x4GetFlagY, 782547529) \
109 V(_Uint32x4, get:flagZ, Uint32x4GetFlagZ, 782547529) \
110 V(_Uint32x4, get:flagW, Uint32x4GetFlagW, 782547529) \
111 V(_Uint32x4, select, Uint32x4Select, 405662786) \
112 V(_Uint32x4, withFlagX, Uint32x4WithFlagX, 980864994) \
113 V(_Uint32x4, withFlagY, Uint32x4WithFlagY, 980864994) \
114 V(_Uint32x4, withFlagZ, Uint32x4WithFlagZ, 980864994) \
115 V(_Uint32x4, withFlagW, Uint32x4WithFlagW, 980864994) \
116 V(_Uint32x4, _toFloat32x4, Uint32x4ToUint32x4, 311564070) \
106 117
107 118
108 // Class that recognizes the name and owner of a function and returns the 119 // Class that recognizes the name and owner of a function and returns the
109 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable 120 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable
110 // functions. 121 // functions.
111 class MethodRecognizer : public AllStatic { 122 class MethodRecognizer : public AllStatic {
112 public: 123 public:
113 enum Kind { 124 enum Kind {
114 kUnknown, 125 kUnknown,
115 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name, 126 #define DEFINE_ENUM_LIST(class_name, function_name, enum_name, fp) k##enum_name,
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 M(Float32x4Splat) \ 592 M(Float32x4Splat) \
582 M(Float32x4Comparison) \ 593 M(Float32x4Comparison) \
583 M(Float32x4MinMax) \ 594 M(Float32x4MinMax) \
584 M(Float32x4Scale) \ 595 M(Float32x4Scale) \
585 M(Float32x4Sqrt) \ 596 M(Float32x4Sqrt) \
586 M(Float32x4ZeroArg) \ 597 M(Float32x4ZeroArg) \
587 M(Float32x4Clamp) \ 598 M(Float32x4Clamp) \
588 M(Float32x4With) \ 599 M(Float32x4With) \
589 M(Float32x4ToUint32x4) \ 600 M(Float32x4ToUint32x4) \
590 M(MaterializeObject) \ 601 M(MaterializeObject) \
602 M(Uint32x4BoolConstructor) \
603 M(Uint32x4GetFlag) \
604 M(Uint32x4Select) \
605 M(Uint32x4SetFlag) \
606 M(Uint32x4ToFloat32x4) \
607 M(BinaryUint32x4Op) \
608
591 609
592 #define FORWARD_DECLARATION(type) class type##Instr; 610 #define FORWARD_DECLARATION(type) class type##Instr;
593 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) 611 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
594 #undef FORWARD_DECLARATION 612 #undef FORWARD_DECLARATION
595 613
596 614
597 // Functions required in all concrete instruction classes. 615 // Functions required in all concrete instruction classes.
598 #define DECLARE_INSTRUCTION(type) \ 616 #define DECLARE_INSTRUCTION(type) \
599 virtual Tag tag() const { return k##type; } \ 617 virtual Tag tag() const { return k##type; } \
600 virtual void Accept(FlowGraphVisitor* visitor); \ 618 virtual void Accept(FlowGraphVisitor* visitor); \
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 friend class Float32x4ShuffleInstr; 868 friend class Float32x4ShuffleInstr;
851 friend class Float32x4ConstructorInstr; 869 friend class Float32x4ConstructorInstr;
852 friend class Float32x4ComparisonInstr; 870 friend class Float32x4ComparisonInstr;
853 friend class Float32x4MinMaxInstr; 871 friend class Float32x4MinMaxInstr;
854 friend class Float32x4ScaleInstr; 872 friend class Float32x4ScaleInstr;
855 friend class Float32x4SqrtInstr; 873 friend class Float32x4SqrtInstr;
856 friend class Float32x4ZeroArgInstr; 874 friend class Float32x4ZeroArgInstr;
857 friend class Float32x4ClampInstr; 875 friend class Float32x4ClampInstr;
858 friend class Float32x4WithInstr; 876 friend class Float32x4WithInstr;
859 friend class Float32x4ToUint32x4Instr; 877 friend class Float32x4ToUint32x4Instr;
878 friend class Uint32x4BoolConstructorInstr;
879 friend class Uint32x4GetFlagInstr;
880 friend class Uint32x4SetFlagInstr;
881 friend class Uint32x4SelectInstr;
882 friend class Uint32x4ToFloat32x4Instr;
883 friend class BinaryUint32x4OpInstr;
860 friend class BinaryMintOpInstr; 884 friend class BinaryMintOpInstr;
861 friend class BinarySmiOpInstr; 885 friend class BinarySmiOpInstr;
862 friend class UnarySmiOpInstr; 886 friend class UnarySmiOpInstr;
863 friend class ShiftMintOpInstr; 887 friend class ShiftMintOpInstr;
864 friend class UnaryMintOpInstr; 888 friend class UnaryMintOpInstr;
865 friend class MathSqrtInstr; 889 friend class MathSqrtInstr;
866 friend class CheckClassInstr; 890 friend class CheckClassInstr;
867 friend class GuardFieldInstr; 891 friend class GuardFieldInstr;
868 friend class CheckSmiInstr; 892 friend class CheckSmiInstr;
869 friend class CheckArrayBoundInstr; 893 friend class CheckArrayBoundInstr;
(...skipping 3704 matching lines...) Expand 10 before | Expand all | Expand 10 after
4574 4598
4575 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr); 4599 DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr);
4576 }; 4600 };
4577 4601
4578 4602
4579 class BinaryFloat32x4OpInstr : public TemplateDefinition<2> { 4603 class BinaryFloat32x4OpInstr : public TemplateDefinition<2> {
4580 public: 4604 public:
4581 BinaryFloat32x4OpInstr(Token::Kind op_kind, 4605 BinaryFloat32x4OpInstr(Token::Kind op_kind,
4582 Value* left, 4606 Value* left,
4583 Value* right, 4607 Value* right,
4584 InstanceCallInstr* instance_call) 4608 intptr_t deopt_id)
4585 : op_kind_(op_kind) { 4609 : op_kind_(op_kind) {
4586 SetInputAt(0, left); 4610 SetInputAt(0, left);
4587 SetInputAt(1, right); 4611 SetInputAt(1, right);
4588 deopt_id_ = instance_call->deopt_id(); 4612 deopt_id_ = deopt_id;
4589 } 4613 }
4590 4614
4591 Value* left() const { return inputs_[0]; } 4615 Value* left() const { return inputs_[0]; }
4592 Value* right() const { return inputs_[1]; } 4616 Value* right() const { return inputs_[1]; }
4593 4617
4594 Token::Kind op_kind() const { return op_kind_; } 4618 Token::Kind op_kind() const { return op_kind_; }
4595 4619
4596 virtual void PrintOperandsTo(BufferFormatter* f) const; 4620 virtual void PrintOperandsTo(BufferFormatter* f) const;
4597 4621
4598 virtual bool CanDeoptimize() const { return false; } 4622 virtual bool CanDeoptimize() const { return false; }
(...skipping 28 matching lines...) Expand all
4627 private: 4651 private:
4628 const Token::Kind op_kind_; 4652 const Token::Kind op_kind_;
4629 4653
4630 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr); 4654 DISALLOW_COPY_AND_ASSIGN(BinaryFloat32x4OpInstr);
4631 }; 4655 };
4632 4656
4633 4657
4634 class Float32x4ShuffleInstr : public TemplateDefinition<1> { 4658 class Float32x4ShuffleInstr : public TemplateDefinition<1> {
4635 public: 4659 public:
4636 Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value, 4660 Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value,
4637 InstanceCallInstr* instance_call) 4661 intptr_t deopt_id)
4638 : op_kind_(op_kind) { 4662 : op_kind_(op_kind) {
4639 SetInputAt(0, value); 4663 SetInputAt(0, value);
4640 deopt_id_ = instance_call->deopt_id(); 4664 deopt_id_ = deopt_id;
4641 } 4665 }
4642 4666
4643 Value* value() const { return inputs_[0]; } 4667 Value* value() const { return inputs_[0]; }
4644 4668
4645 MethodRecognizer::Kind op_kind() const { return op_kind_; } 4669 MethodRecognizer::Kind op_kind() const { return op_kind_; }
4646 4670
4647 virtual void PrintOperandsTo(BufferFormatter* f) const; 4671 virtual void PrintOperandsTo(BufferFormatter* f) const;
4648 4672
4649 virtual bool CanDeoptimize() const { return false; } 4673 virtual bool CanDeoptimize() const { return false; }
4650 4674
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4684 private: 4708 private:
4685 const MethodRecognizer::Kind op_kind_; 4709 const MethodRecognizer::Kind op_kind_;
4686 4710
4687 DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr); 4711 DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr);
4688 }; 4712 };
4689 4713
4690 4714
4691 class Float32x4ConstructorInstr : public TemplateDefinition<4> { 4715 class Float32x4ConstructorInstr : public TemplateDefinition<4> {
4692 public: 4716 public:
4693 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2, 4717 Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2,
4694 Value* value3, StaticCallInstr* static_call) { 4718 Value* value3, intptr_t deopt_id) {
4695 SetInputAt(0, value0); 4719 SetInputAt(0, value0);
4696 SetInputAt(1, value1); 4720 SetInputAt(1, value1);
4697 SetInputAt(2, value2); 4721 SetInputAt(2, value2);
4698 SetInputAt(3, value3); 4722 SetInputAt(3, value3);
4699 deopt_id_ = static_call->deopt_id(); 4723 deopt_id_ = deopt_id;
4700 } 4724 }
4701 4725
4702 Value* value0() const { return inputs_[0]; } 4726 Value* value0() const { return inputs_[0]; }
4703 Value* value1() const { return inputs_[1]; } 4727 Value* value1() const { return inputs_[1]; }
4704 Value* value2() const { return inputs_[2]; } 4728 Value* value2() const { return inputs_[2]; }
4705 Value* value3() const { return inputs_[3]; } 4729 Value* value3() const { return inputs_[3]; }
4706 4730
4707 virtual void PrintOperandsTo(BufferFormatter* f) const; 4731 virtual void PrintOperandsTo(BufferFormatter* f) const;
4708 4732
4709 virtual bool CanDeoptimize() const { return false; } 4733 virtual bool CanDeoptimize() const { return false; }
(...skipping 23 matching lines...) Expand all
4733 4757
4734 virtual bool MayThrow() const { return false; } 4758 virtual bool MayThrow() const { return false; }
4735 4759
4736 private: 4760 private:
4737 DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr); 4761 DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr);
4738 }; 4762 };
4739 4763
4740 4764
4741 class Float32x4SplatInstr : public TemplateDefinition<1> { 4765 class Float32x4SplatInstr : public TemplateDefinition<1> {
4742 public: 4766 public:
4743 Float32x4SplatInstr(Value* value, StaticCallInstr* static_call) { 4767 Float32x4SplatInstr(Value* value, intptr_t deopt_id) {
4744 SetInputAt(0, value); 4768 SetInputAt(0, value);
4745 deopt_id_ = static_call->deopt_id(); 4769 deopt_id_ = deopt_id;
4746 } 4770 }
4747 4771
4748 Value* value() const { return inputs_[0]; } 4772 Value* value() const { return inputs_[0]; }
4749 4773
4750 virtual void PrintOperandsTo(BufferFormatter* f) const; 4774 virtual void PrintOperandsTo(BufferFormatter* f) const;
4751 4775
4752 virtual bool CanDeoptimize() const { return false; } 4776 virtual bool CanDeoptimize() const { return false; }
4753 4777
4754 virtual Representation representation() const { 4778 virtual Representation representation() const {
4755 return kUnboxedFloat32x4; 4779 return kUnboxedFloat32x4;
(...skipping 20 matching lines...) Expand all
4776 4800
4777 virtual bool MayThrow() const { return false; } 4801 virtual bool MayThrow() const { return false; }
4778 4802
4779 private: 4803 private:
4780 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr); 4804 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr);
4781 }; 4805 };
4782 4806
4783 4807
4784 class Float32x4ZeroInstr : public TemplateDefinition<0> { 4808 class Float32x4ZeroInstr : public TemplateDefinition<0> {
4785 public: 4809 public:
4786 explicit Float32x4ZeroInstr(StaticCallInstr* static_call) { 4810 explicit Float32x4ZeroInstr(intptr_t deopt_id) {
4787 deopt_id_ = static_call->deopt_id(); 4811 deopt_id_ = deopt_id;
4788 } 4812 }
4789 4813
4790 Value* value() const { return inputs_[0]; } 4814 Value* value() const { return inputs_[0]; }
4791 4815
4792 virtual void PrintOperandsTo(BufferFormatter* f) const; 4816 virtual void PrintOperandsTo(BufferFormatter* f) const;
4793 4817
4794 virtual bool CanDeoptimize() const { return false; } 4818 virtual bool CanDeoptimize() const { return false; }
4795 4819
4796 virtual Representation representation() const { 4820 virtual Representation representation() const {
4797 return kUnboxedFloat32x4; 4821 return kUnboxedFloat32x4;
(...skipping 21 matching lines...) Expand all
4819 virtual bool MayThrow() const { return false; } 4843 virtual bool MayThrow() const { return false; }
4820 4844
4821 private: 4845 private:
4822 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr); 4846 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr);
4823 }; 4847 };
4824 4848
4825 4849
4826 class Float32x4ComparisonInstr : public TemplateDefinition<2> { 4850 class Float32x4ComparisonInstr : public TemplateDefinition<2> {
4827 public: 4851 public:
4828 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, Value* left, 4852 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, Value* left,
4829 Value* right, InstanceCallInstr* instance_call) 4853 Value* right, intptr_t deopt_id)
4830 : op_kind_(op_kind) { 4854 : op_kind_(op_kind) {
4831 SetInputAt(0, left); 4855 SetInputAt(0, left);
4832 SetInputAt(1, right); 4856 SetInputAt(1, right);
4833 deopt_id_ = instance_call->deopt_id(); 4857 deopt_id_ = deopt_id;
4834 } 4858 }
4835 4859
4836 Value* left() const { return inputs_[0]; } 4860 Value* left() const { return inputs_[0]; }
4837 Value* right() const { return inputs_[1]; } 4861 Value* right() const { return inputs_[1]; }
4838 4862
4839 MethodRecognizer::Kind op_kind() const { return op_kind_; } 4863 MethodRecognizer::Kind op_kind() const { return op_kind_; }
4840 4864
4841 virtual void PrintOperandsTo(BufferFormatter* f) const; 4865 virtual void PrintOperandsTo(BufferFormatter* f) const;
4842 4866
4843 virtual bool CanDeoptimize() const { return false; } 4867 virtual bool CanDeoptimize() const { return false; }
(...skipping 28 matching lines...) Expand all
4872 private: 4896 private:
4873 const MethodRecognizer::Kind op_kind_; 4897 const MethodRecognizer::Kind op_kind_;
4874 4898
4875 DISALLOW_COPY_AND_ASSIGN(Float32x4ComparisonInstr); 4899 DISALLOW_COPY_AND_ASSIGN(Float32x4ComparisonInstr);
4876 }; 4900 };
4877 4901
4878 4902
4879 class Float32x4MinMaxInstr : public TemplateDefinition<2> { 4903 class Float32x4MinMaxInstr : public TemplateDefinition<2> {
4880 public: 4904 public:
4881 Float32x4MinMaxInstr(MethodRecognizer::Kind op_kind, Value* left, 4905 Float32x4MinMaxInstr(MethodRecognizer::Kind op_kind, Value* left,
4882 Value* right, InstanceCallInstr* instance_call) 4906 Value* right, intptr_t deopt_id)
4883 : op_kind_(op_kind) { 4907 : op_kind_(op_kind) {
4884 SetInputAt(0, left); 4908 SetInputAt(0, left);
4885 SetInputAt(1, right); 4909 SetInputAt(1, right);
4886 deopt_id_ = instance_call->deopt_id(); 4910 deopt_id_ = deopt_id;
4887 } 4911 }
4888 4912
4889 Value* left() const { return inputs_[0]; } 4913 Value* left() const { return inputs_[0]; }
4890 Value* right() const { return inputs_[1]; } 4914 Value* right() const { return inputs_[1]; }
4891 4915
4892 MethodRecognizer::Kind op_kind() const { return op_kind_; } 4916 MethodRecognizer::Kind op_kind() const { return op_kind_; }
4893 4917
4894 virtual void PrintOperandsTo(BufferFormatter* f) const; 4918 virtual void PrintOperandsTo(BufferFormatter* f) const;
4895 4919
4896 virtual bool CanDeoptimize() const { return false; } 4920 virtual bool CanDeoptimize() const { return false; }
(...skipping 28 matching lines...) Expand all
4925 private: 4949 private:
4926 const MethodRecognizer::Kind op_kind_; 4950 const MethodRecognizer::Kind op_kind_;
4927 4951
4928 DISALLOW_COPY_AND_ASSIGN(Float32x4MinMaxInstr); 4952 DISALLOW_COPY_AND_ASSIGN(Float32x4MinMaxInstr);
4929 }; 4953 };
4930 4954
4931 4955
4932 class Float32x4ScaleInstr : public TemplateDefinition<2> { 4956 class Float32x4ScaleInstr : public TemplateDefinition<2> {
4933 public: 4957 public:
4934 Float32x4ScaleInstr(MethodRecognizer::Kind op_kind, Value* left, 4958 Float32x4ScaleInstr(MethodRecognizer::Kind op_kind, Value* left,
4935 Value* right, InstanceCallInstr* instance_call) 4959 Value* right, intptr_t deopt_id)
4936 : op_kind_(op_kind) { 4960 : op_kind_(op_kind) {
4937 SetInputAt(0, left); 4961 SetInputAt(0, left);
4938 SetInputAt(1, right); 4962 SetInputAt(1, right);
4939 deopt_id_ = instance_call->deopt_id(); 4963 deopt_id_ = deopt_id;
4940 } 4964 }
4941 4965
4942 Value* left() const { return inputs_[0]; } 4966 Value* left() const { return inputs_[0]; }
4943 Value* right() const { return inputs_[1]; } 4967 Value* right() const { return inputs_[1]; }
4944 4968
4945 MethodRecognizer::Kind op_kind() const { return op_kind_; } 4969 MethodRecognizer::Kind op_kind() const { return op_kind_; }
4946 4970
4947 virtual void PrintOperandsTo(BufferFormatter* f) const; 4971 virtual void PrintOperandsTo(BufferFormatter* f) const;
4948 4972
4949 virtual bool CanDeoptimize() const { return false; } 4973 virtual bool CanDeoptimize() const { return false; }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4981 private: 5005 private:
4982 const MethodRecognizer::Kind op_kind_; 5006 const MethodRecognizer::Kind op_kind_;
4983 5007
4984 DISALLOW_COPY_AND_ASSIGN(Float32x4ScaleInstr); 5008 DISALLOW_COPY_AND_ASSIGN(Float32x4ScaleInstr);
4985 }; 5009 };
4986 5010
4987 5011
4988 class Float32x4SqrtInstr : public TemplateDefinition<1> { 5012 class Float32x4SqrtInstr : public TemplateDefinition<1> {
4989 public: 5013 public:
4990 Float32x4SqrtInstr(MethodRecognizer::Kind op_kind, Value* left, 5014 Float32x4SqrtInstr(MethodRecognizer::Kind op_kind, Value* left,
4991 InstanceCallInstr* instance_call) : op_kind_(op_kind) { 5015 intptr_t deopt_id) : op_kind_(op_kind) {
4992 SetInputAt(0, left); 5016 SetInputAt(0, left);
4993 deopt_id_ = instance_call->deopt_id(); 5017 deopt_id_ = deopt_id;
4994 } 5018 }
4995 5019
4996 Value* left() const { return inputs_[0]; } 5020 Value* left() const { return inputs_[0]; }
4997 5021
4998 MethodRecognizer::Kind op_kind() const { return op_kind_; } 5022 MethodRecognizer::Kind op_kind() const { return op_kind_; }
4999 5023
5000 virtual void PrintOperandsTo(BufferFormatter* f) const; 5024 virtual void PrintOperandsTo(BufferFormatter* f) const;
5001 5025
5002 virtual bool CanDeoptimize() const { return false; } 5026 virtual bool CanDeoptimize() const { return false; }
5003 5027
(...skipping 27 matching lines...) Expand all
5031 private: 5055 private:
5032 const MethodRecognizer::Kind op_kind_; 5056 const MethodRecognizer::Kind op_kind_;
5033 5057
5034 DISALLOW_COPY_AND_ASSIGN(Float32x4SqrtInstr); 5058 DISALLOW_COPY_AND_ASSIGN(Float32x4SqrtInstr);
5035 }; 5059 };
5036 5060
5037 5061
5038 class Float32x4ZeroArgInstr : public TemplateDefinition<1> { 5062 class Float32x4ZeroArgInstr : public TemplateDefinition<1> {
5039 public: 5063 public:
5040 Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind, Value* left, 5064 Float32x4ZeroArgInstr(MethodRecognizer::Kind op_kind, Value* left,
5041 InstanceCallInstr* instance_call) : op_kind_(op_kind) { 5065 intptr_t deopt_id) : op_kind_(op_kind) {
5042 SetInputAt(0, left); 5066 SetInputAt(0, left);
5043 deopt_id_ = instance_call->deopt_id(); 5067 deopt_id_ = deopt_id;
5044 } 5068 }
5045 5069
5046 Value* left() const { return inputs_[0]; } 5070 Value* left() const { return inputs_[0]; }
5047 5071
5048 MethodRecognizer::Kind op_kind() const { return op_kind_; } 5072 MethodRecognizer::Kind op_kind() const { return op_kind_; }
5049 5073
5050 virtual void PrintOperandsTo(BufferFormatter* f) const; 5074 virtual void PrintOperandsTo(BufferFormatter* f) const;
5051 5075
5052 virtual bool CanDeoptimize() const { return false; } 5076 virtual bool CanDeoptimize() const { return false; }
5053 5077
(...skipping 27 matching lines...) Expand all
5081 private: 5105 private:
5082 const MethodRecognizer::Kind op_kind_; 5106 const MethodRecognizer::Kind op_kind_;
5083 5107
5084 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroArgInstr); 5108 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroArgInstr);
5085 }; 5109 };
5086 5110
5087 5111
5088 class Float32x4ClampInstr : public TemplateDefinition<3> { 5112 class Float32x4ClampInstr : public TemplateDefinition<3> {
5089 public: 5113 public:
5090 Float32x4ClampInstr(Value* left, Value* lower, Value* upper, 5114 Float32x4ClampInstr(Value* left, Value* lower, Value* upper,
5091 InstanceCallInstr* instance_call) { 5115 intptr_t deopt_id) {
5092 SetInputAt(0, left); 5116 SetInputAt(0, left);
5093 SetInputAt(1, lower); 5117 SetInputAt(1, lower);
5094 SetInputAt(2, upper); 5118 SetInputAt(2, upper);
5095 deopt_id_ = instance_call->deopt_id(); 5119 deopt_id_ = deopt_id;
5096 } 5120 }
5097 5121
5098 Value* left() const { return inputs_[0]; } 5122 Value* left() const { return inputs_[0]; }
5099 Value* lower() const { return inputs_[1]; } 5123 Value* lower() const { return inputs_[1]; }
5100 Value* upper() const { return inputs_[2]; } 5124 Value* upper() const { return inputs_[2]; }
5101 5125
5102 virtual void PrintOperandsTo(BufferFormatter* f) const; 5126 virtual void PrintOperandsTo(BufferFormatter* f) const;
5103 5127
5104 virtual bool CanDeoptimize() const { return false; } 5128 virtual bool CanDeoptimize() const { return false; }
5105 5129
(...skipping 23 matching lines...) Expand all
5129 virtual bool MayThrow() const { return false; } 5153 virtual bool MayThrow() const { return false; }
5130 5154
5131 private: 5155 private:
5132 DISALLOW_COPY_AND_ASSIGN(Float32x4ClampInstr); 5156 DISALLOW_COPY_AND_ASSIGN(Float32x4ClampInstr);
5133 }; 5157 };
5134 5158
5135 5159
5136 class Float32x4WithInstr : public TemplateDefinition<2> { 5160 class Float32x4WithInstr : public TemplateDefinition<2> {
5137 public: 5161 public:
5138 Float32x4WithInstr(MethodRecognizer::Kind op_kind, Value* left, 5162 Float32x4WithInstr(MethodRecognizer::Kind op_kind, Value* left,
5139 Value* replacement, InstanceCallInstr* instance_call) 5163 Value* replacement, intptr_t deopt_id)
5140 : op_kind_(op_kind) { 5164 : op_kind_(op_kind) {
5141 SetInputAt(0, replacement); 5165 SetInputAt(0, replacement);
5142 SetInputAt(1, left); 5166 SetInputAt(1, left);
5143 deopt_id_ = instance_call->deopt_id(); 5167 deopt_id_ = deopt_id;
5144 } 5168 }
5145 5169
5146 Value* left() const { return inputs_[1]; } 5170 Value* left() const { return inputs_[1]; }
5147 Value* replacement() const { return inputs_[0]; } 5171 Value* replacement() const { return inputs_[0]; }
5148 5172
5149 MethodRecognizer::Kind op_kind() const { return op_kind_; } 5173 MethodRecognizer::Kind op_kind() const { return op_kind_; }
5150 5174
5151 virtual void PrintOperandsTo(BufferFormatter* f) const; 5175 virtual void PrintOperandsTo(BufferFormatter* f) const;
5152 5176
5153 virtual bool CanDeoptimize() const { return false; } 5177 virtual bool CanDeoptimize() const { return false; }
(...skipping 30 matching lines...) Expand all
5184 5208
5185 private: 5209 private:
5186 const MethodRecognizer::Kind op_kind_; 5210 const MethodRecognizer::Kind op_kind_;
5187 5211
5188 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr); 5212 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr);
5189 }; 5213 };
5190 5214
5191 5215
5192 class Float32x4ToUint32x4Instr : public TemplateDefinition<1> { 5216 class Float32x4ToUint32x4Instr : public TemplateDefinition<1> {
5193 public: 5217 public:
5194 Float32x4ToUint32x4Instr(Value* left, InstanceCallInstr* instance_call) { 5218 Float32x4ToUint32x4Instr(Value* left, intptr_t deopt_id) {
5195 SetInputAt(0, left); 5219 SetInputAt(0, left);
5196 deopt_id_ = instance_call->deopt_id(); 5220 deopt_id_ = deopt_id;
5197 } 5221 }
5198 5222
5199 Value* left() const { return inputs_[0]; } 5223 Value* left() const { return inputs_[0]; }
5200 5224
5201 virtual void PrintOperandsTo(BufferFormatter* f) const; 5225 virtual void PrintOperandsTo(BufferFormatter* f) const;
5202 5226
5203 virtual bool CanDeoptimize() const { return false; } 5227 virtual bool CanDeoptimize() const { return false; }
5204 5228
5205 virtual Representation representation() const { 5229 virtual Representation representation() const {
5206 return kUnboxedUint32x4; 5230 return kUnboxedUint32x4;
(...skipping 18 matching lines...) Expand all
5225 virtual EffectSet Dependencies() const { return EffectSet::None(); } 5249 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5226 virtual bool AttributesEqual(Instruction* other) const { return true; } 5250 virtual bool AttributesEqual(Instruction* other) const { return true; }
5227 5251
5228 virtual bool MayThrow() const { return false; } 5252 virtual bool MayThrow() const { return false; }
5229 5253
5230 private: 5254 private:
5231 DISALLOW_COPY_AND_ASSIGN(Float32x4ToUint32x4Instr); 5255 DISALLOW_COPY_AND_ASSIGN(Float32x4ToUint32x4Instr);
5232 }; 5256 };
5233 5257
5234 5258
5259 class Uint32x4BoolConstructorInstr : public TemplateDefinition<4> {
5260 public:
5261 Uint32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2,
5262 Value* value3, intptr_t deopt_id) {
5263 SetInputAt(0, value0);
5264 SetInputAt(1, value1);
5265 SetInputAt(2, value2);
5266 SetInputAt(3, value3);
5267 deopt_id_ = deopt_id;
5268 }
5269
5270 Value* value0() const { return inputs_[0]; }
5271 Value* value1() const { return inputs_[1]; }
5272 Value* value2() const { return inputs_[2]; }
5273 Value* value3() const { return inputs_[3]; }
5274
5275 virtual void PrintOperandsTo(BufferFormatter* f) const;
5276
5277 virtual bool CanDeoptimize() const { return false; }
5278
5279 virtual Representation representation() const {
5280 return kUnboxedUint32x4;
5281 }
5282
5283 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5284 ASSERT(idx >= 0 && idx < 4);
5285 return kTagged;
5286 }
5287
5288 virtual intptr_t DeoptimizationTarget() const {
5289 // Direct access since this instruction cannot deoptimize, and the deopt-id
5290 // was inherited from another instruction that could deoptimize.
5291 return deopt_id_;
5292 }
5293
5294 DECLARE_INSTRUCTION(Uint32x4BoolConstructor)
5295 virtual CompileType ComputeType() const;
5296
5297 virtual bool AllowsCSE() const { return true; }
5298 virtual EffectSet Effects() const { return EffectSet::None(); }
5299 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5300 virtual bool AttributesEqual(Instruction* other) const { return true; }
5301
5302 virtual bool MayThrow() const { return false; }
5303
5304 private:
5305 DISALLOW_COPY_AND_ASSIGN(Uint32x4BoolConstructorInstr);
5306 };
5307
5308
5309 class Uint32x4GetFlagInstr : public TemplateDefinition<1> {
5310 public:
5311 Uint32x4GetFlagInstr(MethodRecognizer::Kind op_kind, Value* value,
5312 intptr_t deopt_id)
5313 : op_kind_(op_kind) {
5314 SetInputAt(0, value);
5315 deopt_id_ = deopt_id;
5316 }
5317
5318 Value* value() const { return inputs_[0]; }
5319
5320 MethodRecognizer::Kind op_kind() const { return op_kind_; }
5321
5322 virtual void PrintOperandsTo(BufferFormatter* f) const;
5323
5324 virtual bool CanDeoptimize() const { return false; }
5325
5326 virtual Representation representation() const {
5327 return kTagged;
5328 }
5329
5330 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5331 ASSERT(idx == 0);
5332 return kUnboxedUint32x4;
5333 }
5334
5335 virtual intptr_t DeoptimizationTarget() const {
5336 // Direct access since this instruction cannot deoptimize, and the deopt-id
5337 // was inherited from another instruction that could deoptimize.
5338 return deopt_id_;
5339 }
5340
5341 DECLARE_INSTRUCTION(Uint32x4GetFlag)
5342 virtual CompileType ComputeType() const;
5343
5344 virtual bool AllowsCSE() const { return true; }
5345 virtual EffectSet Effects() const { return EffectSet::None(); }
5346 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5347 virtual bool AttributesEqual(Instruction* other) const {
5348 return op_kind() == other->AsUint32x4GetFlag()->op_kind();
5349 }
5350
5351 virtual bool MayThrow() const { return false; }
5352
5353 private:
5354 const MethodRecognizer::Kind op_kind_;
5355
5356 DISALLOW_COPY_AND_ASSIGN(Uint32x4GetFlagInstr);
5357 };
5358
5359
5360 class Uint32x4SelectInstr : public TemplateDefinition<3> {
5361 public:
5362 Uint32x4SelectInstr(Value* mask, Value* trueValue, Value* falseValue,
5363 intptr_t deopt_id) {
5364 SetInputAt(0, mask);
5365 SetInputAt(1, trueValue);
5366 SetInputAt(2, falseValue);
5367 deopt_id_ = deopt_id;
5368 }
5369
5370 Value* mask() const { return inputs_[0]; }
5371 Value* trueValue() const { return inputs_[1]; }
5372 Value* falseValue() const { return inputs_[2]; }
5373
5374 virtual void PrintOperandsTo(BufferFormatter* f) const;
5375
5376 virtual bool CanDeoptimize() const { return false; }
5377
5378 virtual Representation representation() const {
5379 return kUnboxedFloat32x4;
5380 }
5381
5382 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5383 ASSERT((idx == 0) || (idx == 1) || (idx == 2));
5384 if (idx == 0) {
5385 return kUnboxedUint32x4;
5386 }
5387 return kUnboxedFloat32x4;
5388 }
5389
5390 virtual intptr_t DeoptimizationTarget() const {
5391 // Direct access since this instruction cannot deoptimize, and the deopt-id
5392 // was inherited from another instruction that could deoptimize.
5393 return deopt_id_;
5394 }
5395
5396 DECLARE_INSTRUCTION(Uint32x4Select)
5397 virtual CompileType ComputeType() const;
5398
5399 virtual bool AllowsCSE() const { return true; }
5400 virtual EffectSet Effects() const { return EffectSet::None(); }
5401 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5402 virtual bool AttributesEqual(Instruction* other) const { return true; }
5403
5404 virtual bool MayThrow() const { return false; }
5405
5406 private:
5407 DISALLOW_COPY_AND_ASSIGN(Uint32x4SelectInstr);
5408 };
5409
5410
5411 class Uint32x4SetFlagInstr : public TemplateDefinition<2> {
5412 public:
5413 Uint32x4SetFlagInstr(MethodRecognizer::Kind op_kind, Value* value,
5414 Value* flagValue, intptr_t deopt_id)
5415 : op_kind_(op_kind) {
5416 SetInputAt(0, value);
5417 SetInputAt(1, flagValue);
5418 deopt_id_ = deopt_id;
5419 }
5420
5421 Value* value() const { return inputs_[0]; }
5422 Value* flagValue() const { return inputs_[1]; }
5423
5424 MethodRecognizer::Kind op_kind() const { return op_kind_; }
5425
5426 virtual void PrintOperandsTo(BufferFormatter* f) const;
5427
5428 virtual bool CanDeoptimize() const { return false; }
5429
5430 virtual Representation representation() const {
5431 return kUnboxedUint32x4;
5432 }
5433
5434 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5435 ASSERT((idx == 0) || (idx == 1));
5436 if (idx == 1) {
5437 return kTagged;
5438 }
5439 return kUnboxedUint32x4;
5440 }
5441
5442 virtual intptr_t DeoptimizationTarget() const {
5443 // Direct access since this instruction cannot deoptimize, and the deopt-id
5444 // was inherited from another instruction that could deoptimize.
5445 return deopt_id_;
5446 }
5447
5448 DECLARE_INSTRUCTION(Uint32x4SetFlag)
5449 virtual CompileType ComputeType() const;
5450
5451 virtual bool AllowsCSE() const { return true; }
5452 virtual EffectSet Effects() const { return EffectSet::None(); }
5453 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5454 virtual bool AttributesEqual(Instruction* other) const {
5455 return op_kind() == other->AsUint32x4SetFlag()->op_kind();
5456 }
5457
5458 virtual bool MayThrow() const { return false; }
5459
5460 private:
5461 const MethodRecognizer::Kind op_kind_;
5462
5463 DISALLOW_COPY_AND_ASSIGN(Uint32x4SetFlagInstr);
5464 };
5465
5466
5467 class Uint32x4ToFloat32x4Instr : public TemplateDefinition<1> {
5468 public:
5469 Uint32x4ToFloat32x4Instr(Value* left, intptr_t deopt_id) {
5470 SetInputAt(0, left);
5471 deopt_id_ = deopt_id;
5472 }
5473
5474 Value* left() const { return inputs_[0]; }
5475
5476 virtual void PrintOperandsTo(BufferFormatter* f) const;
5477
5478 virtual bool CanDeoptimize() const { return false; }
5479
5480 virtual Representation representation() const {
5481 return kUnboxedFloat32x4;
5482 }
5483
5484 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5485 ASSERT(idx == 0);
5486 return kUnboxedUint32x4;
5487 }
5488
5489 virtual intptr_t DeoptimizationTarget() const {
5490 // Direct access since this instruction cannot deoptimize, and the deopt-id
5491 // was inherited from another instruction that could deoptimize.
5492 return deopt_id_;
5493 }
5494
5495 DECLARE_INSTRUCTION(Uint32x4ToFloat32x4)
5496 virtual CompileType ComputeType() const;
5497
5498 virtual bool AllowsCSE() const { return true; }
5499 virtual EffectSet Effects() const { return EffectSet::None(); }
5500 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5501 virtual bool AttributesEqual(Instruction* other) const { return true; }
5502
5503 virtual bool MayThrow() const { return false; }
5504
5505 private:
5506 DISALLOW_COPY_AND_ASSIGN(Uint32x4ToFloat32x4Instr);
5507 };
5508
5509
5510 class BinaryUint32x4OpInstr : public TemplateDefinition<2> {
5511 public:
5512 BinaryUint32x4OpInstr(Token::Kind op_kind,
5513 Value* left,
5514 Value* right,
5515 intptr_t deopt_id)
5516 : op_kind_(op_kind) {
5517 SetInputAt(0, left);
5518 SetInputAt(1, right);
5519 deopt_id_ = deopt_id;
5520 }
5521
5522 Value* left() const { return inputs_[0]; }
5523 Value* right() const { return inputs_[1]; }
5524
5525 Token::Kind op_kind() const { return op_kind_; }
5526
5527 virtual void PrintOperandsTo(BufferFormatter* f) const;
5528
5529 virtual bool CanDeoptimize() const { return false; }
5530
5531 virtual Representation representation() const {
5532 return kUnboxedUint32x4;
5533 }
5534
5535 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
5536 ASSERT((idx == 0) || (idx == 1));
5537 return kUnboxedUint32x4;
5538 }
5539
5540 virtual intptr_t DeoptimizationTarget() const {
5541 // Direct access since this instruction cannot deoptimize, and the deopt-id
5542 // was inherited from another instruction that could deoptimize.
5543 return deopt_id_;
5544 }
5545
5546 DECLARE_INSTRUCTION(BinaryUint32x4Op)
5547 virtual CompileType ComputeType() const;
5548
5549 virtual bool AllowsCSE() const { return true; }
5550 virtual EffectSet Effects() const { return EffectSet::None(); }
5551 virtual EffectSet Dependencies() const { return EffectSet::None(); }
5552 virtual bool AttributesEqual(Instruction* other) const {
5553 return op_kind() == other->AsBinaryUint32x4Op()->op_kind();
5554 }
5555
5556 virtual bool MayThrow() const { return false; }
5557
5558 private:
5559 const Token::Kind op_kind_;
5560
5561 DISALLOW_COPY_AND_ASSIGN(BinaryUint32x4OpInstr);
5562 };
5563
5235 class BinaryMintOpInstr : public TemplateDefinition<2> { 5564 class BinaryMintOpInstr : public TemplateDefinition<2> {
5236 public: 5565 public:
5237 BinaryMintOpInstr(Token::Kind op_kind, 5566 BinaryMintOpInstr(Token::Kind op_kind,
5238 Value* left, 5567 Value* left,
5239 Value* right, 5568 Value* right,
5240 InstanceCallInstr* instance_call) 5569 InstanceCallInstr* instance_call)
5241 : op_kind_(op_kind), 5570 : op_kind_(op_kind),
5242 instance_call_(instance_call) { 5571 instance_call_(instance_call) {
5243 SetInputAt(0, left); 5572 SetInputAt(0, left);
5244 SetInputAt(1, right); 5573 SetInputAt(1, right);
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
6071 ForwardInstructionIterator* current_iterator_; 6400 ForwardInstructionIterator* current_iterator_;
6072 6401
6073 private: 6402 private:
6074 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 6403 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
6075 }; 6404 };
6076 6405
6077 6406
6078 } // namespace dart 6407 } // namespace dart
6079 6408
6080 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 6409 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698