OLD | NEW |
---|---|
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 RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define RUNTIME_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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 bool IsAssignableTo(const AbstractType& type) { | 97 bool IsAssignableTo(const AbstractType& type) { |
98 bool is_instance; | 98 bool is_instance; |
99 return CanComputeIsInstanceOf(type, kNullable, &is_instance) && is_instance; | 99 return CanComputeIsInstanceOf(type, kNullable, &is_instance) && is_instance; |
100 } | 100 } |
101 | 101 |
102 // Create a new CompileType representing given combination of class id and | 102 // Create a new CompileType representing given combination of class id and |
103 // abstract type. The pair is assumed to be coherent. | 103 // abstract type. The pair is assumed to be coherent. |
104 static CompileType Create(intptr_t cid, const AbstractType& type); | 104 static CompileType Create(intptr_t cid, const AbstractType& type); |
105 | 105 |
106 CompileType CopyNonNullable() const { | 106 CompileType CopyNonNullable() const { |
107 return CompileType(kNonNullable, cid_, type_); | 107 return CompileType(kNonNullable, kIllegalCid, type_); |
108 } | 108 } |
109 | 109 |
110 static CompileType CreateNullable(bool is_nullable, intptr_t cid) { | 110 static CompileType CreateNullable(bool is_nullable, intptr_t cid) { |
111 return CompileType(is_nullable, cid, NULL); | 111 return CompileType(is_nullable, cid, NULL); |
112 } | 112 } |
113 | 113 |
114 // Create a new CompileType representing given abstract type. By default | 114 // Create a new CompileType representing given abstract type. By default |
115 // values as assumed to be nullable. | 115 // values as assumed to be nullable. |
116 static CompileType FromAbstractType(const AbstractType& type, | 116 static CompileType FromAbstractType(const AbstractType& type, |
117 bool is_nullable = kNullable); | 117 bool is_nullable = kNullable); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 // Returns true if this and other types are the same. | 150 // Returns true if this and other types are the same. |
151 bool IsEqualTo(CompileType* other) { | 151 bool IsEqualTo(CompileType* other) { |
152 return (is_nullable_ == other->is_nullable_) && | 152 return (is_nullable_ == other->is_nullable_) && |
153 (ToNullableCid() == other->ToNullableCid()) && | 153 (ToNullableCid() == other->ToNullableCid()) && |
154 (ToAbstractType()->Equals(*other->ToAbstractType())); | 154 (ToAbstractType()->Equals(*other->ToAbstractType())); |
155 } | 155 } |
156 | 156 |
157 bool IsNone() const { return (cid_ == kIllegalCid) && (type_ == NULL); } | 157 bool IsNone() const { return (cid_ == kIllegalCid) && (type_ == NULL); } |
158 | 158 |
159 bool IsInt() { | 159 bool IsInt() { |
160 return !is_nullable() && ((ToCid() == kSmiCid) || (ToCid() == kMintCid) || | 160 return !is_nullable() && |
161 ((type_ != NULL) && | 161 ((ToCid() == kSmiCid) || (ToCid() == kMintCid) || |
162 (type_->Equals(Type::Handle(Type::IntType()))))); | 162 ((type_ != NULL) && |
163 (type_->Equals(Type::Handle(Type::Int64Type()))))); | |
163 } | 164 } |
164 | 165 |
165 void PrintTo(BufferFormatter* f) const; | 166 void PrintTo(BufferFormatter* f) const; |
166 const char* ToCString() const; | 167 const char* ToCString() const; |
167 | 168 |
168 private: | 169 private: |
169 bool CanComputeIsInstanceOf(const AbstractType& type, | 170 bool CanComputeIsInstanceOf(const AbstractType& type, |
170 bool is_nullable, | 171 bool is_nullable, |
171 bool* is_instance); | 172 bool* is_instance); |
172 | 173 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
560 next_(NULL), | 561 next_(NULL), |
561 env_(NULL), | 562 env_(NULL), |
562 locs_(NULL), | 563 locs_(NULL), |
563 inlining_id_(-1) {} | 564 inlining_id_(-1) {} |
564 | 565 |
565 virtual ~Instruction() {} | 566 virtual ~Instruction() {} |
566 | 567 |
567 virtual Tag tag() const = 0; | 568 virtual Tag tag() const = 0; |
568 | 569 |
569 intptr_t deopt_id() const { | 570 intptr_t deopt_id() const { |
570 ASSERT(CanDeoptimize() || CanBecomeDeoptimizationTarget()); | 571 ASSERT(ComputeCanDeoptimize() || CanBecomeDeoptimizationTarget()); |
571 return GetDeoptId(); | 572 return GetDeoptId(); |
572 } | 573 } |
573 | 574 |
574 const ICData* GetICData( | 575 const ICData* GetICData( |
575 const ZoneGrowableArray<const ICData*>& ic_data_array) const; | 576 const ZoneGrowableArray<const ICData*>& ic_data_array) const; |
576 | 577 |
577 virtual TokenPosition token_pos() const { return TokenPosition::kNoSource; } | 578 virtual TokenPosition token_pos() const { return TokenPosition::kNoSource; } |
578 | 579 |
579 virtual intptr_t InputCount() const = 0; | 580 virtual intptr_t InputCount() const = 0; |
580 virtual Value* InputAt(intptr_t i) const = 0; | 581 virtual Value* InputAt(intptr_t i) const = 0; |
(...skipping 11 matching lines...) Expand all Loading... | |
592 // Call instructions override this function and return the number of | 593 // Call instructions override this function and return the number of |
593 // pushed arguments. | 594 // pushed arguments. |
594 virtual intptr_t ArgumentCount() const { return 0; } | 595 virtual intptr_t ArgumentCount() const { return 0; } |
595 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 596 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
596 UNREACHABLE(); | 597 UNREACHABLE(); |
597 return NULL; | 598 return NULL; |
598 } | 599 } |
599 inline Definition* ArgumentAt(intptr_t index) const; | 600 inline Definition* ArgumentAt(intptr_t index) const; |
600 | 601 |
601 // Returns true, if this instruction can deoptimize. | 602 // Returns true, if this instruction can deoptimize. |
602 virtual bool CanDeoptimize() const = 0; | 603 virtual bool ComputeCanDeoptimize() const = 0; |
Vyacheslav Egorov (Google)
2017/03/31 10:39:44
Maybe add a comment here that it is not currently
Florian Schneider
2017/03/31 16:39:31
Done.
| |
604 | |
605 // Once we removed the deopt environment, we assume that this | |
606 // instructions can't deoptimize. | |
607 bool CanDeoptimize() const { return env() != NULL && ComputeCanDeoptimize(); } | |
603 | 608 |
604 // Visiting support. | 609 // Visiting support. |
605 virtual void Accept(FlowGraphVisitor* visitor) = 0; | 610 virtual void Accept(FlowGraphVisitor* visitor) = 0; |
606 | 611 |
607 Instruction* previous() const { return previous_; } | 612 Instruction* previous() const { return previous_; } |
608 void set_previous(Instruction* instr) { | 613 void set_previous(Instruction* instr) { |
609 ASSERT(!IsBlockEntry()); | 614 ASSERT(!IsBlockEntry()); |
610 previous_ = instr; | 615 previous_ = instr; |
611 } | 616 } |
612 | 617 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 void InsertBefore(Instruction* next) { InsertAfter(next->previous()); } | 740 void InsertBefore(Instruction* next) { InsertAfter(next->previous()); } |
736 | 741 |
737 // Insert this instruction after 'prev' after use lists are computed. | 742 // Insert this instruction after 'prev' after use lists are computed. |
738 void InsertAfter(Instruction* prev); | 743 void InsertAfter(Instruction* prev); |
739 | 744 |
740 // Append an instruction to the current one and return the tail. | 745 // Append an instruction to the current one and return the tail. |
741 // This function updated def-use chains of the newly appended | 746 // This function updated def-use chains of the newly appended |
742 // instruction. | 747 // instruction. |
743 Instruction* AppendInstruction(Instruction* tail); | 748 Instruction* AppendInstruction(Instruction* tail); |
744 | 749 |
745 virtual bool AllowsDCE() const { return false; } | |
746 | |
747 // Returns true if CSE and LICM are allowed for this instruction. | 750 // Returns true if CSE and LICM are allowed for this instruction. |
748 virtual bool AllowsCSE() const { return false; } | 751 virtual bool AllowsCSE() const { return false; } |
749 | 752 |
750 // Returns set of effects created by this instruction. | 753 // Returns set of effects created by this instruction. |
751 virtual EffectSet Effects() const = 0; | 754 virtual EffectSet Effects() const = 0; |
752 | 755 |
753 // Returns set of effects that affect this instruction. | 756 // Returns set of effects that affect this instruction. |
754 virtual EffectSet Dependencies() const { | 757 virtual EffectSet Dependencies() const { |
755 UNREACHABLE(); | 758 UNREACHABLE(); |
756 return EffectSet::All(); | 759 return EffectSet::All(); |
(...skipping 27 matching lines...) Expand all Loading... | |
784 // All instructions that participate in CSE have to override this function. | 787 // All instructions that participate in CSE have to override this function. |
785 // This function can assume that the argument has the same type as this. | 788 // This function can assume that the argument has the same type as this. |
786 virtual bool AttributesEqual(Instruction* other) const { | 789 virtual bool AttributesEqual(Instruction* other) const { |
787 UNREACHABLE(); | 790 UNREACHABLE(); |
788 return false; | 791 return false; |
789 } | 792 } |
790 | 793 |
791 virtual void InheritDeoptTarget(Zone* zone, Instruction* other); | 794 virtual void InheritDeoptTarget(Zone* zone, Instruction* other); |
792 | 795 |
793 bool NeedsEnvironment() const { | 796 bool NeedsEnvironment() const { |
794 return CanDeoptimize() || CanBecomeDeoptimizationTarget(); | 797 return ComputeCanDeoptimize() || CanBecomeDeoptimizationTarget(); |
795 } | 798 } |
796 | 799 |
797 virtual bool CanBecomeDeoptimizationTarget() const { return false; } | 800 virtual bool CanBecomeDeoptimizationTarget() const { return false; } |
798 | 801 |
799 void InheritDeoptTargetAfter(FlowGraph* flow_graph, | 802 void InheritDeoptTargetAfter(FlowGraph* flow_graph, |
800 Definition* call, | 803 Definition* call, |
801 Definition* result); | 804 Definition* result); |
802 | 805 |
803 virtual bool MayThrow() const = 0; | 806 virtual bool MayThrow() const = 0; |
804 | 807 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
965 | 968 |
966 | 969 |
967 class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> { | 970 class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> { |
968 public: | 971 public: |
969 ParallelMoveInstr() : moves_(4) {} | 972 ParallelMoveInstr() : moves_(4) {} |
970 | 973 |
971 DECLARE_INSTRUCTION(ParallelMove) | 974 DECLARE_INSTRUCTION(ParallelMove) |
972 | 975 |
973 virtual intptr_t ArgumentCount() const { return 0; } | 976 virtual intptr_t ArgumentCount() const { return 0; } |
974 | 977 |
975 virtual bool CanDeoptimize() const { return false; } | 978 virtual bool ComputeCanDeoptimize() const { return false; } |
976 | 979 |
977 virtual EffectSet Effects() const { | 980 virtual EffectSet Effects() const { |
978 UNREACHABLE(); // This instruction never visited by optimization passes. | 981 UNREACHABLE(); // This instruction never visited by optimization passes. |
979 return EffectSet::None(); | 982 return EffectSet::None(); |
980 } | 983 } |
981 | 984 |
982 virtual EffectSet Dependencies() const { | 985 virtual EffectSet Dependencies() const { |
983 UNREACHABLE(); // This instruction never visited by optimization passes. | 986 UNREACHABLE(); // This instruction never visited by optimization passes. |
984 return EffectSet::None(); | 987 return EffectSet::None(); |
985 } | 988 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1097 } | 1100 } |
1098 | 1101 |
1099 virtual intptr_t ArgumentCount() const { return 0; } | 1102 virtual intptr_t ArgumentCount() const { return 0; } |
1100 | 1103 |
1101 virtual bool CanBecomeDeoptimizationTarget() const { | 1104 virtual bool CanBecomeDeoptimizationTarget() const { |
1102 // BlockEntry environment is copied to Goto and Branch instructions | 1105 // BlockEntry environment is copied to Goto and Branch instructions |
1103 // when we insert new blocks targeting this block. | 1106 // when we insert new blocks targeting this block. |
1104 return true; | 1107 return true; |
1105 } | 1108 } |
1106 | 1109 |
1107 virtual bool CanDeoptimize() const { return false; } | 1110 virtual bool ComputeCanDeoptimize() const { return false; } |
1108 | 1111 |
1109 virtual EffectSet Effects() const { return EffectSet::None(); } | 1112 virtual EffectSet Effects() const { return EffectSet::None(); } |
1110 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 1113 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
1111 | 1114 |
1112 virtual bool MayThrow() const { return false; } | 1115 virtual bool MayThrow() const { return false; } |
1113 | 1116 |
1114 intptr_t try_index() const { return try_index_; } | 1117 intptr_t try_index() const { return try_index_; } |
1115 void set_try_index(intptr_t index) { try_index_ = index; } | 1118 void set_try_index(intptr_t index) { try_index_ = index; } |
1116 | 1119 |
1117 // True for blocks inside a try { } region. | 1120 // True for blocks inside a try { } region. |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1830 virtual BlockEntryInstr* GetBlock() { return block(); } | 1833 virtual BlockEntryInstr* GetBlock() { return block(); } |
1831 JoinEntryInstr* block() const { return block_; } | 1834 JoinEntryInstr* block() const { return block_; } |
1832 | 1835 |
1833 virtual CompileType ComputeType() const; | 1836 virtual CompileType ComputeType() const; |
1834 virtual bool RecomputeType(); | 1837 virtual bool RecomputeType(); |
1835 | 1838 |
1836 intptr_t InputCount() const { return inputs_.length(); } | 1839 intptr_t InputCount() const { return inputs_.length(); } |
1837 | 1840 |
1838 Value* InputAt(intptr_t i) const { return inputs_[i]; } | 1841 Value* InputAt(intptr_t i) const { return inputs_[i]; } |
1839 | 1842 |
1840 virtual bool CanDeoptimize() const { return false; } | 1843 virtual bool ComputeCanDeoptimize() const { return false; } |
1841 | 1844 |
1842 virtual EffectSet Effects() const { return EffectSet::None(); } | 1845 virtual EffectSet Effects() const { return EffectSet::None(); } |
1843 | 1846 |
1844 // Phi is alive if it reaches a non-environment use. | 1847 // Phi is alive if it reaches a non-environment use. |
1845 bool is_alive() const { return is_alive_; } | 1848 bool is_alive() const { return is_alive_; } |
1846 void mark_alive() { is_alive_ = true; } | 1849 void mark_alive() { is_alive_ = true; } |
1847 void mark_dead() { is_alive_ = false; } | 1850 void mark_dead() { is_alive_ = false; } |
1848 | 1851 |
1849 virtual Representation RequiredInputRepresentation(intptr_t i) const { | 1852 virtual Representation RequiredInputRepresentation(intptr_t i) const { |
1850 return representation_; | 1853 return representation_; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1925 | 1928 |
1926 // Get the block entry for that instruction. | 1929 // Get the block entry for that instruction. |
1927 virtual BlockEntryInstr* GetBlock() { return block_; } | 1930 virtual BlockEntryInstr* GetBlock() { return block_; } |
1928 | 1931 |
1929 intptr_t InputCount() const { return 0; } | 1932 intptr_t InputCount() const { return 0; } |
1930 Value* InputAt(intptr_t i) const { | 1933 Value* InputAt(intptr_t i) const { |
1931 UNREACHABLE(); | 1934 UNREACHABLE(); |
1932 return NULL; | 1935 return NULL; |
1933 } | 1936 } |
1934 | 1937 |
1935 virtual bool CanDeoptimize() const { return false; } | 1938 virtual bool ComputeCanDeoptimize() const { return false; } |
1936 | 1939 |
1937 virtual EffectSet Effects() const { return EffectSet::None(); } | 1940 virtual EffectSet Effects() const { return EffectSet::None(); } |
1938 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 1941 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
1939 | 1942 |
1940 virtual intptr_t Hashcode() const { | 1943 virtual intptr_t Hashcode() const { |
1941 UNREACHABLE(); | 1944 UNREACHABLE(); |
1942 return 0; | 1945 return 0; |
1943 } | 1946 } |
1944 | 1947 |
1945 virtual CompileType ComputeType() const; | 1948 virtual CompileType ComputeType() const; |
(...skipping 16 matching lines...) Expand all Loading... | |
1962 class PushArgumentInstr : public TemplateDefinition<1, NoThrow> { | 1965 class PushArgumentInstr : public TemplateDefinition<1, NoThrow> { |
1963 public: | 1966 public: |
1964 explicit PushArgumentInstr(Value* value) { SetInputAt(0, value); } | 1967 explicit PushArgumentInstr(Value* value) { SetInputAt(0, value); } |
1965 | 1968 |
1966 DECLARE_INSTRUCTION(PushArgument) | 1969 DECLARE_INSTRUCTION(PushArgument) |
1967 | 1970 |
1968 virtual CompileType ComputeType() const; | 1971 virtual CompileType ComputeType() const; |
1969 | 1972 |
1970 Value* value() const { return InputAt(0); } | 1973 Value* value() const { return InputAt(0); } |
1971 | 1974 |
1972 virtual bool CanDeoptimize() const { return false; } | 1975 virtual bool ComputeCanDeoptimize() const { return false; } |
1973 | 1976 |
1974 virtual EffectSet Effects() const { return EffectSet::None(); } | 1977 virtual EffectSet Effects() const { return EffectSet::None(); } |
1975 | 1978 |
1976 virtual TokenPosition token_pos() const { | 1979 virtual TokenPosition token_pos() const { |
1977 return TokenPosition::kPushArgument; | 1980 return TokenPosition::kPushArgument; |
1978 } | 1981 } |
1979 | 1982 |
1980 PRINT_OPERANDS_TO_SUPPORT | 1983 PRINT_OPERANDS_TO_SUPPORT |
1981 | 1984 |
1982 private: | 1985 private: |
(...skipping 18 matching lines...) Expand all Loading... | |
2001 | 2004 |
2002 virtual TokenPosition token_pos() const { return token_pos_; } | 2005 virtual TokenPosition token_pos() const { return token_pos_; } |
2003 Value* value() const { return inputs_[0]; } | 2006 Value* value() const { return inputs_[0]; } |
2004 | 2007 |
2005 virtual bool CanBecomeDeoptimizationTarget() const { | 2008 virtual bool CanBecomeDeoptimizationTarget() const { |
2006 // Return instruction might turn into a Goto instruction after inlining. | 2009 // Return instruction might turn into a Goto instruction after inlining. |
2007 // Every Goto must have an environment. | 2010 // Every Goto must have an environment. |
2008 return true; | 2011 return true; |
2009 } | 2012 } |
2010 | 2013 |
2011 virtual bool CanDeoptimize() const { return false; } | 2014 virtual bool ComputeCanDeoptimize() const { return false; } |
2012 | 2015 |
2013 virtual EffectSet Effects() const { return EffectSet::None(); } | 2016 virtual EffectSet Effects() const { return EffectSet::None(); } |
2014 | 2017 |
2015 private: | 2018 private: |
2016 const TokenPosition token_pos_; | 2019 const TokenPosition token_pos_; |
2017 | 2020 |
2018 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); | 2021 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); |
2019 }; | 2022 }; |
2020 | 2023 |
2021 | 2024 |
2022 class ThrowInstr : public TemplateInstruction<0, Throws> { | 2025 class ThrowInstr : public TemplateInstruction<0, Throws> { |
2023 public: | 2026 public: |
2024 explicit ThrowInstr(TokenPosition token_pos) | 2027 explicit ThrowInstr(TokenPosition token_pos) |
2025 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), | 2028 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
2026 token_pos_(token_pos) {} | 2029 token_pos_(token_pos) {} |
2027 | 2030 |
2028 DECLARE_INSTRUCTION(Throw) | 2031 DECLARE_INSTRUCTION(Throw) |
2029 | 2032 |
2030 virtual intptr_t ArgumentCount() const { return 1; } | 2033 virtual intptr_t ArgumentCount() const { return 1; } |
2031 | 2034 |
2032 virtual TokenPosition token_pos() const { return token_pos_; } | 2035 virtual TokenPosition token_pos() const { return token_pos_; } |
2033 | 2036 |
2034 virtual bool CanDeoptimize() const { return true; } | 2037 virtual bool ComputeCanDeoptimize() const { return true; } |
2035 | 2038 |
2036 virtual EffectSet Effects() const { return EffectSet::None(); } | 2039 virtual EffectSet Effects() const { return EffectSet::None(); } |
2037 | 2040 |
2038 private: | 2041 private: |
2039 const TokenPosition token_pos_; | 2042 const TokenPosition token_pos_; |
2040 | 2043 |
2041 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); | 2044 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); |
2042 }; | 2045 }; |
2043 | 2046 |
2044 | 2047 |
2045 class ReThrowInstr : public TemplateInstruction<0, Throws> { | 2048 class ReThrowInstr : public TemplateInstruction<0, Throws> { |
2046 public: | 2049 public: |
2047 // 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the | 2050 // 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the |
2048 // rethrow has been artifically generated by the parser. | 2051 // rethrow has been artifically generated by the parser. |
2049 ReThrowInstr(TokenPosition token_pos, intptr_t catch_try_index) | 2052 ReThrowInstr(TokenPosition token_pos, intptr_t catch_try_index) |
2050 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), | 2053 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
2051 token_pos_(token_pos), | 2054 token_pos_(token_pos), |
2052 catch_try_index_(catch_try_index) {} | 2055 catch_try_index_(catch_try_index) {} |
2053 | 2056 |
2054 DECLARE_INSTRUCTION(ReThrow) | 2057 DECLARE_INSTRUCTION(ReThrow) |
2055 | 2058 |
2056 virtual intptr_t ArgumentCount() const { return 2; } | 2059 virtual intptr_t ArgumentCount() const { return 2; } |
2057 | 2060 |
2058 virtual TokenPosition token_pos() const { return token_pos_; } | 2061 virtual TokenPosition token_pos() const { return token_pos_; } |
2059 intptr_t catch_try_index() const { return catch_try_index_; } | 2062 intptr_t catch_try_index() const { return catch_try_index_; } |
2060 | 2063 |
2061 virtual bool CanDeoptimize() const { return true; } | 2064 virtual bool ComputeCanDeoptimize() const { return true; } |
2062 | 2065 |
2063 virtual EffectSet Effects() const { return EffectSet::None(); } | 2066 virtual EffectSet Effects() const { return EffectSet::None(); } |
2064 | 2067 |
2065 private: | 2068 private: |
2066 const TokenPosition token_pos_; | 2069 const TokenPosition token_pos_; |
2067 const intptr_t catch_try_index_; | 2070 const intptr_t catch_try_index_; |
2068 | 2071 |
2069 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); | 2072 DISALLOW_COPY_AND_ASSIGN(ReThrowInstr); |
2070 }; | 2073 }; |
2071 | 2074 |
2072 | 2075 |
2073 class StopInstr : public TemplateInstruction<0, NoThrow> { | 2076 class StopInstr : public TemplateInstruction<0, NoThrow> { |
2074 public: | 2077 public: |
2075 explicit StopInstr(const char* message) : message_(message) { | 2078 explicit StopInstr(const char* message) : message_(message) { |
2076 ASSERT(message != NULL); | 2079 ASSERT(message != NULL); |
2077 } | 2080 } |
2078 | 2081 |
2079 const char* message() const { return message_; } | 2082 const char* message() const { return message_; } |
2080 | 2083 |
2081 DECLARE_INSTRUCTION(Stop); | 2084 DECLARE_INSTRUCTION(Stop); |
2082 | 2085 |
2083 virtual intptr_t ArgumentCount() const { return 0; } | 2086 virtual intptr_t ArgumentCount() const { return 0; } |
2084 | 2087 |
2085 virtual bool CanDeoptimize() const { return false; } | 2088 virtual bool ComputeCanDeoptimize() const { return false; } |
2086 | 2089 |
2087 virtual EffectSet Effects() const { return EffectSet::None(); } | 2090 virtual EffectSet Effects() const { return EffectSet::None(); } |
2088 | 2091 |
2089 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2092 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
2090 | 2093 |
2091 private: | 2094 private: |
2092 const char* message_; | 2095 const char* message_; |
2093 | 2096 |
2094 DISALLOW_COPY_AND_ASSIGN(StopInstr); | 2097 DISALLOW_COPY_AND_ASSIGN(StopInstr); |
2095 }; | 2098 }; |
(...skipping 21 matching lines...) Expand all Loading... | |
2117 double edge_weight() const { return edge_weight_; } | 2120 double edge_weight() const { return edge_weight_; } |
2118 void set_edge_weight(double weight) { edge_weight_ = weight; } | 2121 void set_edge_weight(double weight) { edge_weight_ = weight; } |
2119 void adjust_edge_weight(double scale_factor) { edge_weight_ *= scale_factor; } | 2122 void adjust_edge_weight(double scale_factor) { edge_weight_ *= scale_factor; } |
2120 | 2123 |
2121 virtual bool CanBecomeDeoptimizationTarget() const { | 2124 virtual bool CanBecomeDeoptimizationTarget() const { |
2122 // Goto instruction can be used as a deoptimization target when LICM | 2125 // Goto instruction can be used as a deoptimization target when LICM |
2123 // hoists instructions out of the loop. | 2126 // hoists instructions out of the loop. |
2124 return true; | 2127 return true; |
2125 } | 2128 } |
2126 | 2129 |
2127 virtual bool CanDeoptimize() const { return false; } | 2130 virtual bool ComputeCanDeoptimize() const { return false; } |
2128 | 2131 |
2129 virtual EffectSet Effects() const { return EffectSet::None(); } | 2132 virtual EffectSet Effects() const { return EffectSet::None(); } |
2130 | 2133 |
2131 ParallelMoveInstr* parallel_move() const { return parallel_move_; } | 2134 ParallelMoveInstr* parallel_move() const { return parallel_move_; } |
2132 | 2135 |
2133 bool HasParallelMove() const { return parallel_move_ != NULL; } | 2136 bool HasParallelMove() const { return parallel_move_ != NULL; } |
2134 | 2137 |
2135 bool HasNonRedundantParallelMove() const { | 2138 bool HasNonRedundantParallelMove() const { |
2136 return HasParallelMove() && !parallel_move()->IsRedundant(); | 2139 return HasParallelMove() && !parallel_move()->IsRedundant(); |
2137 } | 2140 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2193 ASSERT(successor->next()->AsGoto()->successor()->IsIndirectEntry()); | 2196 ASSERT(successor->next()->AsGoto()->successor()->IsIndirectEntry()); |
2194 successors_.Add(successor); | 2197 successors_.Add(successor); |
2195 } | 2198 } |
2196 | 2199 |
2197 virtual intptr_t SuccessorCount() const { return successors_.length(); } | 2200 virtual intptr_t SuccessorCount() const { return successors_.length(); } |
2198 virtual TargetEntryInstr* SuccessorAt(intptr_t index) const { | 2201 virtual TargetEntryInstr* SuccessorAt(intptr_t index) const { |
2199 ASSERT(index < SuccessorCount()); | 2202 ASSERT(index < SuccessorCount()); |
2200 return successors_[index]; | 2203 return successors_[index]; |
2201 } | 2204 } |
2202 | 2205 |
2203 virtual bool CanDeoptimize() const { return false; } | 2206 virtual bool ComputeCanDeoptimize() const { return false; } |
2204 virtual bool CanBecomeDeoptimizationTarget() const { return false; } | 2207 virtual bool CanBecomeDeoptimizationTarget() const { return false; } |
2205 | 2208 |
2206 virtual EffectSet Effects() const { return EffectSet::None(); } | 2209 virtual EffectSet Effects() const { return EffectSet::None(); } |
2207 | 2210 |
2208 Value* offset() const { return inputs_[0]; } | 2211 Value* offset() const { return inputs_[0]; } |
2209 void ComputeOffsetTable(); | 2212 void ComputeOffsetTable(); |
2210 | 2213 |
2211 PRINT_TO_SUPPORT | 2214 PRINT_TO_SUPPORT |
2212 | 2215 |
2213 private: | 2216 private: |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2326 virtual intptr_t ArgumentCount() const { | 2329 virtual intptr_t ArgumentCount() const { |
2327 return comparison()->ArgumentCount(); | 2330 return comparison()->ArgumentCount(); |
2328 } | 2331 } |
2329 | 2332 |
2330 intptr_t InputCount() const { return comparison()->InputCount(); } | 2333 intptr_t InputCount() const { return comparison()->InputCount(); } |
2331 | 2334 |
2332 Value* InputAt(intptr_t i) const { return comparison()->InputAt(i); } | 2335 Value* InputAt(intptr_t i) const { return comparison()->InputAt(i); } |
2333 | 2336 |
2334 virtual TokenPosition token_pos() const { return comparison_->token_pos(); } | 2337 virtual TokenPosition token_pos() const { return comparison_->token_pos(); } |
2335 | 2338 |
2336 virtual bool CanDeoptimize() const { return comparison()->CanDeoptimize(); } | 2339 virtual bool ComputeCanDeoptimize() const { |
2340 return comparison()->ComputeCanDeoptimize(); | |
2341 } | |
2337 | 2342 |
2338 virtual bool CanBecomeDeoptimizationTarget() const { | 2343 virtual bool CanBecomeDeoptimizationTarget() const { |
2339 return comparison()->CanBecomeDeoptimizationTarget(); | 2344 return comparison()->CanBecomeDeoptimizationTarget(); |
2340 } | 2345 } |
2341 | 2346 |
2342 virtual EffectSet Effects() const { return comparison()->Effects(); } | 2347 virtual EffectSet Effects() const { return comparison()->Effects(); } |
2343 | 2348 |
2344 ComparisonInstr* comparison() const { return comparison_; } | 2349 ComparisonInstr* comparison() const { return comparison_; } |
2345 void SetComparison(ComparisonInstr* comp); | 2350 void SetComparison(ComparisonInstr* comp); |
2346 | 2351 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2387 | 2392 |
2388 DISALLOW_COPY_AND_ASSIGN(BranchInstr); | 2393 DISALLOW_COPY_AND_ASSIGN(BranchInstr); |
2389 }; | 2394 }; |
2390 | 2395 |
2391 | 2396 |
2392 class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> { | 2397 class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> { |
2393 public: | 2398 public: |
2394 DeoptimizeInstr(ICData::DeoptReasonId deopt_reason, intptr_t deopt_id) | 2399 DeoptimizeInstr(ICData::DeoptReasonId deopt_reason, intptr_t deopt_id) |
2395 : TemplateInstruction(deopt_id), deopt_reason_(deopt_reason) {} | 2400 : TemplateInstruction(deopt_id), deopt_reason_(deopt_reason) {} |
2396 | 2401 |
2397 virtual bool CanDeoptimize() const { return true; } | 2402 virtual bool ComputeCanDeoptimize() const { return true; } |
2398 | 2403 |
2399 virtual bool AttributesEqual(Instruction* other) const { return true; } | 2404 virtual bool AttributesEqual(Instruction* other) const { return true; } |
2400 | 2405 |
2401 DECLARE_INSTRUCTION(Deoptimize) | 2406 DECLARE_INSTRUCTION(Deoptimize) |
2402 | 2407 |
2403 private: | 2408 private: |
2404 const ICData::DeoptReasonId deopt_reason_; | 2409 const ICData::DeoptReasonId deopt_reason_; |
2405 | 2410 |
2406 DISALLOW_COPY_AND_ASSIGN(DeoptimizeInstr); | 2411 DISALLOW_COPY_AND_ASSIGN(DeoptimizeInstr); |
2407 }; | 2412 }; |
(...skipping 10 matching lines...) Expand all Loading... | |
2418 Value* value() const { return inputs_[0]; } | 2423 Value* value() const { return inputs_[0]; } |
2419 | 2424 |
2420 virtual CompileType ComputeType() const; | 2425 virtual CompileType ComputeType() const; |
2421 virtual bool RecomputeType(); | 2426 virtual bool RecomputeType(); |
2422 | 2427 |
2423 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2428 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
2424 | 2429 |
2425 void set_constrained_type(CompileType* type) { constrained_type_ = type; } | 2430 void set_constrained_type(CompileType* type) { constrained_type_ = type; } |
2426 CompileType* constrained_type() const { return constrained_type_; } | 2431 CompileType* constrained_type() const { return constrained_type_; } |
2427 | 2432 |
2428 virtual bool CanDeoptimize() const { return false; } | 2433 virtual bool ComputeCanDeoptimize() const { return false; } |
2429 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2434 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
2430 virtual EffectSet Effects() const { return EffectSet::None(); } | 2435 virtual EffectSet Effects() const { return EffectSet::None(); } |
2431 | 2436 |
2432 private: | 2437 private: |
2433 CompileType* constrained_type_; | 2438 CompileType* constrained_type_; |
2434 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr); | 2439 DISALLOW_COPY_AND_ASSIGN(RedefinitionInstr); |
2435 }; | 2440 }; |
2436 | 2441 |
2437 | 2442 |
2438 class ConstraintInstr : public TemplateDefinition<1, NoThrow> { | 2443 class ConstraintInstr : public TemplateDefinition<1, NoThrow> { |
2439 public: | 2444 public: |
2440 ConstraintInstr(Value* value, Range* constraint) | 2445 ConstraintInstr(Value* value, Range* constraint) |
2441 : constraint_(constraint), target_(NULL) { | 2446 : constraint_(constraint), target_(NULL) { |
2442 SetInputAt(0, value); | 2447 SetInputAt(0, value); |
2443 } | 2448 } |
2444 | 2449 |
2445 DECLARE_INSTRUCTION(Constraint) | 2450 DECLARE_INSTRUCTION(Constraint) |
2446 | 2451 |
2447 virtual CompileType ComputeType() const; | 2452 virtual CompileType ComputeType() const; |
2448 | 2453 |
2449 virtual bool CanDeoptimize() const { return false; } | 2454 virtual bool ComputeCanDeoptimize() const { return false; } |
2450 | 2455 |
2451 virtual EffectSet Effects() const { return EffectSet::None(); } | 2456 virtual EffectSet Effects() const { return EffectSet::None(); } |
2452 | 2457 |
2453 virtual bool AttributesEqual(Instruction* other) const { | 2458 virtual bool AttributesEqual(Instruction* other) const { |
2454 UNREACHABLE(); | 2459 UNREACHABLE(); |
2455 return false; | 2460 return false; |
2456 } | 2461 } |
2457 | 2462 |
2458 Value* value() const { return inputs_[0]; } | 2463 Value* value() const { return inputs_[0]; } |
2459 Range* constraint() const { return constraint_; } | 2464 Range* constraint() const { return constraint_; } |
(...skipping 21 matching lines...) Expand all Loading... | |
2481 ConstantInstr(const Object& value, | 2486 ConstantInstr(const Object& value, |
2482 TokenPosition token_pos = TokenPosition::kConstant); | 2487 TokenPosition token_pos = TokenPosition::kConstant); |
2483 | 2488 |
2484 DECLARE_INSTRUCTION(Constant) | 2489 DECLARE_INSTRUCTION(Constant) |
2485 virtual CompileType ComputeType() const; | 2490 virtual CompileType ComputeType() const; |
2486 | 2491 |
2487 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2492 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
2488 | 2493 |
2489 const Object& value() const { return value_; } | 2494 const Object& value() const { return value_; } |
2490 | 2495 |
2491 virtual bool CanDeoptimize() const { return false; } | 2496 virtual bool ComputeCanDeoptimize() const { return false; } |
2492 | 2497 |
2493 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 2498 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
2494 | 2499 |
2495 virtual bool AttributesEqual(Instruction* other) const; | 2500 virtual bool AttributesEqual(Instruction* other) const; |
2496 | 2501 |
2497 virtual TokenPosition token_pos() const { return token_pos_; } | 2502 virtual TokenPosition token_pos() const { return token_pos_; } |
2498 | 2503 |
2499 PRINT_OPERANDS_TO_SUPPORT | 2504 PRINT_OPERANDS_TO_SUPPORT |
2500 | 2505 |
2501 private: | 2506 private: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2558 Value* instantiator_type_arguments() const { return inputs_[1]; } | 2563 Value* instantiator_type_arguments() const { return inputs_[1]; } |
2559 | 2564 |
2560 virtual TokenPosition token_pos() const { return token_pos_; } | 2565 virtual TokenPosition token_pos() const { return token_pos_; } |
2561 const AbstractType& dst_type() const { return dst_type_; } | 2566 const AbstractType& dst_type() const { return dst_type_; } |
2562 void set_dst_type(const AbstractType& dst_type) { | 2567 void set_dst_type(const AbstractType& dst_type) { |
2563 ASSERT(!dst_type.IsTypeRef()); | 2568 ASSERT(!dst_type.IsTypeRef()); |
2564 dst_type_ = dst_type.raw(); | 2569 dst_type_ = dst_type.raw(); |
2565 } | 2570 } |
2566 const String& dst_name() const { return dst_name_; } | 2571 const String& dst_name() const { return dst_name_; } |
2567 | 2572 |
2568 virtual bool CanDeoptimize() const { return true; } | 2573 virtual bool ComputeCanDeoptimize() const { return true; } |
2569 | 2574 |
2570 virtual bool CanBecomeDeoptimizationTarget() const { | 2575 virtual bool CanBecomeDeoptimizationTarget() const { |
2571 // AssertAssignable instructions that are specialized by the optimizer | 2576 // AssertAssignable instructions that are specialized by the optimizer |
2572 // (e.g. replaced with CheckClass) need a deoptimization descriptor before. | 2577 // (e.g. replaced with CheckClass) need a deoptimization descriptor before. |
2573 return true; | 2578 return true; |
2574 } | 2579 } |
2575 | 2580 |
2576 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2581 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
2577 | 2582 |
2578 virtual bool AttributesEqual(Instruction* other) const; | 2583 virtual bool AttributesEqual(Instruction* other) const; |
(...skipping 16 matching lines...) Expand all Loading... | |
2595 token_pos_(token_pos) { | 2600 token_pos_(token_pos) { |
2596 SetInputAt(0, value); | 2601 SetInputAt(0, value); |
2597 } | 2602 } |
2598 | 2603 |
2599 DECLARE_INSTRUCTION(AssertBoolean) | 2604 DECLARE_INSTRUCTION(AssertBoolean) |
2600 virtual CompileType ComputeType() const; | 2605 virtual CompileType ComputeType() const; |
2601 | 2606 |
2602 virtual TokenPosition token_pos() const { return token_pos_; } | 2607 virtual TokenPosition token_pos() const { return token_pos_; } |
2603 Value* value() const { return inputs_[0]; } | 2608 Value* value() const { return inputs_[0]; } |
2604 | 2609 |
2605 virtual bool CanDeoptimize() const { return true; } | 2610 virtual bool ComputeCanDeoptimize() const { return true; } |
2606 | 2611 |
2607 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2612 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
2608 | 2613 |
2609 virtual bool AttributesEqual(Instruction* other) const { return true; } | 2614 virtual bool AttributesEqual(Instruction* other) const { return true; } |
2610 | 2615 |
2611 PRINT_OPERANDS_TO_SUPPORT | 2616 PRINT_OPERANDS_TO_SUPPORT |
2612 | 2617 |
2613 private: | 2618 private: |
2614 const TokenPosition token_pos_; | 2619 const TokenPosition token_pos_; |
2615 | 2620 |
2616 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); | 2621 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); |
2617 }; | 2622 }; |
2618 | 2623 |
2619 | 2624 |
2620 // Denotes the current context, normally held in a register. This is | 2625 // Denotes the current context, normally held in a register. This is |
2621 // a computation, not a value, because it's mutable. | 2626 // a computation, not a value, because it's mutable. |
2622 class CurrentContextInstr : public TemplateDefinition<0, NoThrow> { | 2627 class CurrentContextInstr : public TemplateDefinition<0, NoThrow> { |
2623 public: | 2628 public: |
2624 CurrentContextInstr() | 2629 CurrentContextInstr() |
2625 : TemplateDefinition(Thread::Current()->GetNextDeoptId()) {} | 2630 : TemplateDefinition(Thread::Current()->GetNextDeoptId()) {} |
2626 | 2631 |
2627 DECLARE_INSTRUCTION(CurrentContext) | 2632 DECLARE_INSTRUCTION(CurrentContext) |
2628 virtual CompileType ComputeType() const; | 2633 virtual CompileType ComputeType() const; |
2629 | 2634 |
2630 virtual bool CanDeoptimize() const { return false; } | 2635 virtual bool ComputeCanDeoptimize() const { return false; } |
2631 | 2636 |
2632 virtual EffectSet Effects() const { return EffectSet::None(); } | 2637 virtual EffectSet Effects() const { return EffectSet::None(); } |
2633 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2638 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
2634 virtual bool AttributesEqual(Instruction* other) const { return true; } | 2639 virtual bool AttributesEqual(Instruction* other) const { return true; } |
2635 | 2640 |
2636 private: | 2641 private: |
2637 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); | 2642 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); |
2638 }; | 2643 }; |
2639 | 2644 |
2640 | 2645 |
(...skipping 26 matching lines...) Expand all Loading... | |
2667 virtual TokenPosition token_pos() const { return token_pos_; } | 2672 virtual TokenPosition token_pos() const { return token_pos_; } |
2668 | 2673 |
2669 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | 2674 virtual intptr_t ArgumentCount() const { return arguments_->length(); } |
2670 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 2675 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
2671 return (*arguments_)[index]; | 2676 return (*arguments_)[index]; |
2672 } | 2677 } |
2673 | 2678 |
2674 // TODO(kmillikin): implement exact call counts for closure calls. | 2679 // TODO(kmillikin): implement exact call counts for closure calls. |
2675 virtual intptr_t CallCount() const { return 1; } | 2680 virtual intptr_t CallCount() const { return 1; } |
2676 | 2681 |
2677 virtual bool CanDeoptimize() const { return true; } | 2682 virtual bool ComputeCanDeoptimize() const { return true; } |
2678 | 2683 |
2679 virtual EffectSet Effects() const { return EffectSet::All(); } | 2684 virtual EffectSet Effects() const { return EffectSet::All(); } |
2680 | 2685 |
2681 PRINT_OPERANDS_TO_SUPPORT | 2686 PRINT_OPERANDS_TO_SUPPORT |
2682 | 2687 |
2683 private: | 2688 private: |
2684 const Array& argument_names_; | 2689 const Array& argument_names_; |
2685 TokenPosition token_pos_; | 2690 TokenPosition token_pos_; |
2686 ZoneGrowableArray<PushArgumentInstr*>* arguments_; | 2691 ZoneGrowableArray<PushArgumentInstr*>* arguments_; |
2687 | 2692 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2735 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | 2740 virtual intptr_t ArgumentCount() const { return arguments_->length(); } |
2736 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 2741 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
2737 return (*arguments_)[index]; | 2742 return (*arguments_)[index]; |
2738 } | 2743 } |
2739 const Array& argument_names() const { return argument_names_; } | 2744 const Array& argument_names() const { return argument_names_; } |
2740 intptr_t checked_argument_count() const { return checked_argument_count_; } | 2745 intptr_t checked_argument_count() const { return checked_argument_count_; } |
2741 | 2746 |
2742 bool has_unique_selector() const { return has_unique_selector_; } | 2747 bool has_unique_selector() const { return has_unique_selector_; } |
2743 void set_has_unique_selector(bool b) { has_unique_selector_ = b; } | 2748 void set_has_unique_selector(bool b) { has_unique_selector_ = b; } |
2744 | 2749 |
2745 virtual bool CanDeoptimize() const { return true; } | 2750 virtual bool ComputeCanDeoptimize() const { return true; } |
2746 | 2751 |
2747 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2752 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
2748 | 2753 |
2749 virtual bool CanBecomeDeoptimizationTarget() const { | 2754 virtual bool CanBecomeDeoptimizationTarget() const { |
2750 // Instance calls that are specialized by the optimizer need a | 2755 // Instance calls that are specialized by the optimizer need a |
2751 // deoptimization descriptor before the call. | 2756 // deoptimization descriptor before the call. |
2752 return true; | 2757 return true; |
2753 } | 2758 } |
2754 | 2759 |
2755 virtual EffectSet Effects() const { return EffectSet::All(); } | 2760 virtual EffectSet Effects() const { return EffectSet::All(); } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2821 // 10 calls in the CallCount above, but the heuristics need to know that the | 2826 // 10 calls in the CallCount above, but the heuristics need to know that the |
2822 // last two cids cover 7% and 3% of the calls, not 70% and 30%. | 2827 // last two cids cover 7% and 3% of the calls, not 70% and 30%. |
2823 intptr_t total_call_count() { return total_call_count_; } | 2828 intptr_t total_call_count() { return total_call_count_; } |
2824 | 2829 |
2825 void set_total_call_count(intptr_t count) { total_call_count_ = count; } | 2830 void set_total_call_count(intptr_t count) { total_call_count_ = count; } |
2826 | 2831 |
2827 DECLARE_INSTRUCTION(PolymorphicInstanceCall) | 2832 DECLARE_INSTRUCTION(PolymorphicInstanceCall) |
2828 | 2833 |
2829 const ICData& ic_data() const { return ic_data_; } | 2834 const ICData& ic_data() const { return ic_data_; } |
2830 | 2835 |
2831 virtual bool CanDeoptimize() const { return true; } | 2836 virtual bool ComputeCanDeoptimize() const { return true; } |
2832 | 2837 |
2833 virtual EffectSet Effects() const { return EffectSet::All(); } | 2838 virtual EffectSet Effects() const { return EffectSet::All(); } |
2834 | 2839 |
2835 virtual Definition* Canonicalize(FlowGraph* graph); | 2840 virtual Definition* Canonicalize(FlowGraph* graph); |
2836 | 2841 |
2837 static RawType* ComputeRuntimeType(const ICData& ic_data); | 2842 static RawType* ComputeRuntimeType(const ICData& ic_data); |
2838 | 2843 |
2839 PRINT_OPERANDS_TO_SUPPORT | 2844 PRINT_OPERANDS_TO_SUPPORT |
2840 | 2845 |
2841 private: | 2846 private: |
(...skipping 14 matching lines...) Expand all Loading... | |
2856 Value* left, | 2861 Value* left, |
2857 Value* right, | 2862 Value* right, |
2858 bool needs_number_check); | 2863 bool needs_number_check); |
2859 | 2864 |
2860 DECLARE_INSTRUCTION(StrictCompare) | 2865 DECLARE_INSTRUCTION(StrictCompare) |
2861 | 2866 |
2862 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 2867 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
2863 | 2868 |
2864 virtual CompileType ComputeType() const; | 2869 virtual CompileType ComputeType() const; |
2865 | 2870 |
2866 virtual bool CanDeoptimize() const { return false; } | 2871 virtual bool ComputeCanDeoptimize() const { return false; } |
2867 | 2872 |
2868 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2873 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
2869 | 2874 |
2870 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); | 2875 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); |
2871 | 2876 |
2872 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, | 2877 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, |
2873 BranchLabels labels); | 2878 BranchLabels labels); |
2874 | 2879 |
2875 bool needs_number_check() const { return needs_number_check_; } | 2880 bool needs_number_check() const { return needs_number_check_; } |
2876 void set_needs_number_check(bool value) { needs_number_check_ = value; } | 2881 void set_needs_number_check(bool value) { needs_number_check_ = value; } |
(...skipping 24 matching lines...) Expand all Loading... | |
2901 SetInputAt(0, left); | 2906 SetInputAt(0, left); |
2902 SetInputAt(1, right); | 2907 SetInputAt(1, right); |
2903 } | 2908 } |
2904 | 2909 |
2905 DECLARE_INSTRUCTION(TestSmi); | 2910 DECLARE_INSTRUCTION(TestSmi); |
2906 | 2911 |
2907 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 2912 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
2908 | 2913 |
2909 virtual CompileType ComputeType() const; | 2914 virtual CompileType ComputeType() const; |
2910 | 2915 |
2911 virtual bool CanDeoptimize() const { return false; } | 2916 virtual bool ComputeCanDeoptimize() const { return false; } |
2912 | 2917 |
2913 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 2918 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
2914 return kTagged; | 2919 return kTagged; |
2915 } | 2920 } |
2916 | 2921 |
2917 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); | 2922 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); |
2918 | 2923 |
2919 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, | 2924 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, |
2920 BranchLabels labels); | 2925 BranchLabels labels); |
2921 | 2926 |
(...skipping 24 matching lines...) Expand all Loading... | |
2946 } | 2951 } |
2947 | 2952 |
2948 DECLARE_INSTRUCTION(TestCids); | 2953 DECLARE_INSTRUCTION(TestCids); |
2949 | 2954 |
2950 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 2955 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
2951 | 2956 |
2952 virtual CompileType ComputeType() const; | 2957 virtual CompileType ComputeType() const; |
2953 | 2958 |
2954 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2959 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
2955 | 2960 |
2956 virtual bool CanDeoptimize() const { | 2961 virtual bool ComputeCanDeoptimize() const { |
2957 return GetDeoptId() != Thread::kNoDeoptId; | 2962 return GetDeoptId() != Thread::kNoDeoptId; |
2958 } | 2963 } |
2959 | 2964 |
2960 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 2965 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
2961 return kTagged; | 2966 return kTagged; |
2962 } | 2967 } |
2963 | 2968 |
2964 virtual bool AttributesEqual(Instruction* other) const; | 2969 virtual bool AttributesEqual(Instruction* other) const; |
2965 | 2970 |
2966 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); | 2971 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); |
(...skipping 26 matching lines...) Expand all Loading... | |
2993 SetInputAt(1, right); | 2998 SetInputAt(1, right); |
2994 set_operation_cid(cid); | 2999 set_operation_cid(cid); |
2995 } | 3000 } |
2996 | 3001 |
2997 DECLARE_INSTRUCTION(EqualityCompare) | 3002 DECLARE_INSTRUCTION(EqualityCompare) |
2998 | 3003 |
2999 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 3004 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
3000 | 3005 |
3001 virtual CompileType ComputeType() const; | 3006 virtual CompileType ComputeType() const; |
3002 | 3007 |
3003 virtual bool CanDeoptimize() const { return false; } | 3008 virtual bool ComputeCanDeoptimize() const { return false; } |
3004 | 3009 |
3005 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); | 3010 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); |
3006 | 3011 |
3007 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, | 3012 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, |
3008 BranchLabels labels); | 3013 BranchLabels labels); |
3009 | 3014 |
3010 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 3015 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
3011 ASSERT((idx == 0) || (idx == 1)); | 3016 ASSERT((idx == 0) || (idx == 1)); |
3012 if (operation_cid() == kDoubleCid) return kUnboxedDouble; | 3017 if (operation_cid() == kDoubleCid) return kUnboxedDouble; |
3013 if (operation_cid() == kMintCid) return kUnboxedMint; | 3018 if (operation_cid() == kMintCid) return kUnboxedMint; |
(...skipping 21 matching lines...) Expand all Loading... | |
3035 SetInputAt(1, right); | 3040 SetInputAt(1, right); |
3036 set_operation_cid(cid); | 3041 set_operation_cid(cid); |
3037 } | 3042 } |
3038 | 3043 |
3039 DECLARE_INSTRUCTION(RelationalOp) | 3044 DECLARE_INSTRUCTION(RelationalOp) |
3040 | 3045 |
3041 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 3046 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
3042 | 3047 |
3043 virtual CompileType ComputeType() const; | 3048 virtual CompileType ComputeType() const; |
3044 | 3049 |
3045 virtual bool CanDeoptimize() const { return false; } | 3050 virtual bool ComputeCanDeoptimize() const { return false; } |
3046 | 3051 |
3047 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); | 3052 virtual void EmitBranchCode(FlowGraphCompiler* compiler, BranchInstr* branch); |
3048 | 3053 |
3049 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, | 3054 virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, |
3050 BranchLabels labels); | 3055 BranchLabels labels); |
3051 | 3056 |
3052 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 3057 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
3053 ASSERT((idx == 0) || (idx == 1)); | 3058 ASSERT((idx == 0) || (idx == 1)); |
3054 if (operation_cid() == kDoubleCid) return kUnboxedDouble; | 3059 if (operation_cid() == kDoubleCid) return kUnboxedDouble; |
3055 if (operation_cid() == kMintCid) return kUnboxedMint; | 3060 if (operation_cid() == kMintCid) return kUnboxedMint; |
(...skipping 26 matching lines...) Expand all Loading... | |
3082 // Returns true if this combination of comparison and values flowing on | 3087 // Returns true if this combination of comparison and values flowing on |
3083 // the true and false paths is supported on the current platform. | 3088 // the true and false paths is supported on the current platform. |
3084 static bool Supports(ComparisonInstr* comparison, Value* v1, Value* v2); | 3089 static bool Supports(ComparisonInstr* comparison, Value* v1, Value* v2); |
3085 | 3090 |
3086 DECLARE_INSTRUCTION(IfThenElse) | 3091 DECLARE_INSTRUCTION(IfThenElse) |
3087 | 3092 |
3088 intptr_t InputCount() const { return comparison()->InputCount(); } | 3093 intptr_t InputCount() const { return comparison()->InputCount(); } |
3089 | 3094 |
3090 Value* InputAt(intptr_t i) const { return comparison()->InputAt(i); } | 3095 Value* InputAt(intptr_t i) const { return comparison()->InputAt(i); } |
3091 | 3096 |
3092 virtual bool CanDeoptimize() const { return comparison()->CanDeoptimize(); } | 3097 virtual bool ComputeCanDeoptimize() const { |
3098 return comparison()->ComputeCanDeoptimize(); | |
3099 } | |
3093 | 3100 |
3094 virtual bool CanBecomeDeoptimizationTarget() const { | 3101 virtual bool CanBecomeDeoptimizationTarget() const { |
3095 return comparison()->CanBecomeDeoptimizationTarget(); | 3102 return comparison()->CanBecomeDeoptimizationTarget(); |
3096 } | 3103 } |
3097 | 3104 |
3098 virtual intptr_t DeoptimizationTarget() const { | 3105 virtual intptr_t DeoptimizationTarget() const { |
3099 return comparison()->DeoptimizationTarget(); | 3106 return comparison()->DeoptimizationTarget(); |
3100 } | 3107 } |
3101 | 3108 |
3102 virtual Representation RequiredInputRepresentation(intptr_t i) const { | 3109 virtual Representation RequiredInputRepresentation(intptr_t i) const { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3199 | 3206 |
3200 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | 3207 virtual intptr_t ArgumentCount() const { return arguments_->length(); } |
3201 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 3208 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
3202 return (*arguments_)[index]; | 3209 return (*arguments_)[index]; |
3203 } | 3210 } |
3204 | 3211 |
3205 virtual intptr_t CallCount() const { | 3212 virtual intptr_t CallCount() const { |
3206 return ic_data() == NULL ? 0 : ic_data()->AggregateCount(); | 3213 return ic_data() == NULL ? 0 : ic_data()->AggregateCount(); |
3207 } | 3214 } |
3208 | 3215 |
3209 virtual bool CanDeoptimize() const { return true; } | 3216 virtual bool ComputeCanDeoptimize() const { return true; } |
3210 | 3217 |
3211 virtual bool CanBecomeDeoptimizationTarget() const { | 3218 virtual bool CanBecomeDeoptimizationTarget() const { |
3212 // Static calls that are specialized by the optimizer (e.g. sqrt) need a | 3219 // Static calls that are specialized by the optimizer (e.g. sqrt) need a |
3213 // deoptimization descriptor before the call. | 3220 // deoptimization descriptor before the call. |
3214 return true; | 3221 return true; |
3215 } | 3222 } |
3216 | 3223 |
3217 virtual EffectSet Effects() const { return EffectSet::All(); } | 3224 virtual EffectSet Effects() const { return EffectSet::All(); } |
3218 | 3225 |
3219 void set_result_cid(intptr_t value) { result_cid_ = value; } | 3226 void set_result_cid(intptr_t value) { result_cid_ = value; } |
(...skipping 30 matching lines...) Expand all Loading... | |
3250 class LoadLocalInstr : public TemplateDefinition<0, NoThrow> { | 3257 class LoadLocalInstr : public TemplateDefinition<0, NoThrow> { |
3251 public: | 3258 public: |
3252 LoadLocalInstr(const LocalVariable& local, TokenPosition token_pos) | 3259 LoadLocalInstr(const LocalVariable& local, TokenPosition token_pos) |
3253 : local_(local), is_last_(false), token_pos_(token_pos) {} | 3260 : local_(local), is_last_(false), token_pos_(token_pos) {} |
3254 | 3261 |
3255 DECLARE_INSTRUCTION(LoadLocal) | 3262 DECLARE_INSTRUCTION(LoadLocal) |
3256 virtual CompileType ComputeType() const; | 3263 virtual CompileType ComputeType() const; |
3257 | 3264 |
3258 const LocalVariable& local() const { return local_; } | 3265 const LocalVariable& local() const { return local_; } |
3259 | 3266 |
3260 virtual bool CanDeoptimize() const { return false; } | 3267 virtual bool ComputeCanDeoptimize() const { return false; } |
3261 | 3268 |
3262 virtual EffectSet Effects() const { | 3269 virtual EffectSet Effects() const { |
3263 UNREACHABLE(); // Eliminated by SSA construction. | 3270 UNREACHABLE(); // Eliminated by SSA construction. |
3264 return EffectSet::None(); | 3271 return EffectSet::None(); |
3265 } | 3272 } |
3266 | 3273 |
3267 void mark_last() { is_last_ = true; } | 3274 void mark_last() { is_last_ = true; } |
3268 bool is_last() const { return is_last_; } | 3275 bool is_last() const { return is_last_; } |
3269 | 3276 |
3270 virtual TokenPosition token_pos() const { return token_pos_; } | 3277 virtual TokenPosition token_pos() const { return token_pos_; } |
(...skipping 25 matching lines...) Expand all Loading... | |
3296 ASSERT((value_ != NULL) && (i == 0)); | 3303 ASSERT((value_ != NULL) && (i == 0)); |
3297 return value_; | 3304 return value_; |
3298 } | 3305 } |
3299 | 3306 |
3300 Value* value() const { return value_; } | 3307 Value* value() const { return value_; } |
3301 | 3308 |
3302 intptr_t num_temps() const { return num_temps_; } | 3309 intptr_t num_temps() const { return num_temps_; } |
3303 | 3310 |
3304 virtual CompileType ComputeType() const; | 3311 virtual CompileType ComputeType() const; |
3305 | 3312 |
3306 virtual bool CanDeoptimize() const { return false; } | 3313 virtual bool ComputeCanDeoptimize() const { return false; } |
3307 | 3314 |
3308 virtual EffectSet Effects() const { | 3315 virtual EffectSet Effects() const { |
3309 UNREACHABLE(); // Eliminated by SSA construction. | 3316 UNREACHABLE(); // Eliminated by SSA construction. |
3310 return EffectSet::None(); | 3317 return EffectSet::None(); |
3311 } | 3318 } |
3312 | 3319 |
3313 virtual bool MayThrow() const { | 3320 virtual bool MayThrow() const { |
3314 UNREACHABLE(); | 3321 UNREACHABLE(); |
3315 return false; | 3322 return false; |
3316 } | 3323 } |
(...skipping 20 matching lines...) Expand all Loading... | |
3337 : local_(local), is_dead_(false), is_last_(false), token_pos_(token_pos) { | 3344 : local_(local), is_dead_(false), is_last_(false), token_pos_(token_pos) { |
3338 SetInputAt(0, value); | 3345 SetInputAt(0, value); |
3339 } | 3346 } |
3340 | 3347 |
3341 DECLARE_INSTRUCTION(StoreLocal) | 3348 DECLARE_INSTRUCTION(StoreLocal) |
3342 virtual CompileType ComputeType() const; | 3349 virtual CompileType ComputeType() const; |
3343 | 3350 |
3344 const LocalVariable& local() const { return local_; } | 3351 const LocalVariable& local() const { return local_; } |
3345 Value* value() const { return inputs_[0]; } | 3352 Value* value() const { return inputs_[0]; } |
3346 | 3353 |
3347 virtual bool CanDeoptimize() const { return false; } | 3354 virtual bool ComputeCanDeoptimize() const { return false; } |
3348 | 3355 |
3349 void mark_dead() { is_dead_ = true; } | 3356 void mark_dead() { is_dead_ = true; } |
3350 bool is_dead() const { return is_dead_; } | 3357 bool is_dead() const { return is_dead_; } |
3351 | 3358 |
3352 void mark_last() { is_last_ = true; } | 3359 void mark_last() { is_last_ = true; } |
3353 bool is_last() const { return is_last_; } | 3360 bool is_last() const { return is_last_; } |
3354 | 3361 |
3355 virtual EffectSet Effects() const { | 3362 virtual EffectSet Effects() const { |
3356 UNREACHABLE(); // Eliminated by SSA construction. | 3363 UNREACHABLE(); // Eliminated by SSA construction. |
3357 return EffectSet::None(); | 3364 return EffectSet::None(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3394 | 3401 |
3395 DECLARE_INSTRUCTION(NativeCall) | 3402 DECLARE_INSTRUCTION(NativeCall) |
3396 | 3403 |
3397 const String& native_name() const { return *native_name_; } | 3404 const String& native_name() const { return *native_name_; } |
3398 const Function& function() const { return *function_; } | 3405 const Function& function() const { return *function_; } |
3399 NativeFunction native_c_function() const { return native_c_function_; } | 3406 NativeFunction native_c_function() const { return native_c_function_; } |
3400 bool is_bootstrap_native() const { return is_bootstrap_native_; } | 3407 bool is_bootstrap_native() const { return is_bootstrap_native_; } |
3401 bool link_lazily() const { return link_lazily_; } | 3408 bool link_lazily() const { return link_lazily_; } |
3402 virtual TokenPosition token_pos() const { return token_pos_; } | 3409 virtual TokenPosition token_pos() const { return token_pos_; } |
3403 | 3410 |
3404 virtual bool CanDeoptimize() const { return false; } | 3411 virtual bool ComputeCanDeoptimize() const { return false; } |
3405 | 3412 |
3406 virtual EffectSet Effects() const { return EffectSet::All(); } | 3413 virtual EffectSet Effects() const { return EffectSet::All(); } |
3407 | 3414 |
3408 void SetupNative(); | 3415 void SetupNative(); |
3409 | 3416 |
3410 PRINT_OPERANDS_TO_SUPPORT | 3417 PRINT_OPERANDS_TO_SUPPORT |
3411 | 3418 |
3412 private: | 3419 private: |
3413 void set_native_c_function(NativeFunction value) { | 3420 void set_native_c_function(NativeFunction value) { |
3414 native_c_function_ = value; | 3421 native_c_function_ = value; |
(...skipping 13 matching lines...) Expand all Loading... | |
3428 | 3435 |
3429 | 3436 |
3430 class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> { | 3437 class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> { |
3431 public: | 3438 public: |
3432 DebugStepCheckInstr(TokenPosition token_pos, RawPcDescriptors::Kind stub_kind) | 3439 DebugStepCheckInstr(TokenPosition token_pos, RawPcDescriptors::Kind stub_kind) |
3433 : token_pos_(token_pos), stub_kind_(stub_kind) {} | 3440 : token_pos_(token_pos), stub_kind_(stub_kind) {} |
3434 | 3441 |
3435 DECLARE_INSTRUCTION(DebugStepCheck) | 3442 DECLARE_INSTRUCTION(DebugStepCheck) |
3436 | 3443 |
3437 virtual TokenPosition token_pos() const { return token_pos_; } | 3444 virtual TokenPosition token_pos() const { return token_pos_; } |
3438 virtual bool CanDeoptimize() const { return false; } | 3445 virtual bool ComputeCanDeoptimize() const { return false; } |
3439 virtual EffectSet Effects() const { return EffectSet::All(); } | 3446 virtual EffectSet Effects() const { return EffectSet::All(); } |
3440 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 3447 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
3441 | 3448 |
3442 private: | 3449 private: |
3443 const TokenPosition token_pos_; | 3450 const TokenPosition token_pos_; |
3444 const RawPcDescriptors::Kind stub_kind_; | 3451 const RawPcDescriptors::Kind stub_kind_; |
3445 | 3452 |
3446 DISALLOW_COPY_AND_ASSIGN(DebugStepCheckInstr); | 3453 DISALLOW_COPY_AND_ASSIGN(DebugStepCheckInstr); |
3447 }; | 3454 }; |
3448 | 3455 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3494 virtual TokenPosition token_pos() const { return token_pos_; } | 3501 virtual TokenPosition token_pos() const { return token_pos_; } |
3495 | 3502 |
3496 const Field& field() const { return field_; } | 3503 const Field& field() const { return field_; } |
3497 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 3504 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
3498 | 3505 |
3499 bool ShouldEmitStoreBarrier() const { | 3506 bool ShouldEmitStoreBarrier() const { |
3500 return value()->NeedsStoreBuffer() && | 3507 return value()->NeedsStoreBuffer() && |
3501 (emit_store_barrier_ == kEmitStoreBarrier); | 3508 (emit_store_barrier_ == kEmitStoreBarrier); |
3502 } | 3509 } |
3503 | 3510 |
3504 virtual bool CanDeoptimize() const { return false; } | 3511 virtual bool ComputeCanDeoptimize() const { return false; } |
3505 | 3512 |
3506 // May require a deoptimization target for input conversions. | 3513 // May require a deoptimization target for input conversions. |
3507 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } | 3514 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } |
3508 | 3515 |
3509 // Currently CSE/LICM don't operate on any instructions that can be affected | 3516 // Currently CSE/LICM don't operate on any instructions that can be affected |
3510 // by stores/loads. LoadOptimizer handles loads separately. Hence stores | 3517 // by stores/loads. LoadOptimizer handles loads separately. Hence stores |
3511 // are marked as having no side-effects. | 3518 // are marked as having no side-effects. |
3512 virtual EffectSet Effects() const { return EffectSet::None(); } | 3519 virtual EffectSet Effects() const { return EffectSet::None(); } |
3513 | 3520 |
3514 bool IsUnboxedStore() const; | 3521 bool IsUnboxedStore() const; |
(...skipping 30 matching lines...) Expand all Loading... | |
3545 GuardFieldInstr(Value* value, const Field& field, intptr_t deopt_id) | 3552 GuardFieldInstr(Value* value, const Field& field, intptr_t deopt_id) |
3546 : TemplateInstruction(deopt_id), field_(field) { | 3553 : TemplateInstruction(deopt_id), field_(field) { |
3547 SetInputAt(0, value); | 3554 SetInputAt(0, value); |
3548 CheckField(field); | 3555 CheckField(field); |
3549 } | 3556 } |
3550 | 3557 |
3551 Value* value() const { return inputs_[0]; } | 3558 Value* value() const { return inputs_[0]; } |
3552 | 3559 |
3553 const Field& field() const { return field_; } | 3560 const Field& field() const { return field_; } |
3554 | 3561 |
3555 virtual bool CanDeoptimize() const { return true; } | 3562 virtual bool ComputeCanDeoptimize() const { return true; } |
3556 virtual bool CanBecomeDeoptimizationTarget() const { | 3563 virtual bool CanBecomeDeoptimizationTarget() const { |
3557 // Ensure that we record kDeopt PC descriptor in unoptimized code. | 3564 // Ensure that we record kDeopt PC descriptor in unoptimized code. |
3558 return true; | 3565 return true; |
3559 } | 3566 } |
3560 | 3567 |
3561 PRINT_OPERANDS_TO_SUPPORT | 3568 PRINT_OPERANDS_TO_SUPPORT |
3562 | 3569 |
3563 private: | 3570 private: |
3564 const Field& field_; | 3571 const Field& field_; |
3565 | 3572 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3611 SetInputAt(0, field_value); | 3618 SetInputAt(0, field_value); |
3612 } | 3619 } |
3613 | 3620 |
3614 DECLARE_INSTRUCTION(LoadStaticField) | 3621 DECLARE_INSTRUCTION(LoadStaticField) |
3615 virtual CompileType ComputeType() const; | 3622 virtual CompileType ComputeType() const; |
3616 | 3623 |
3617 const Field& StaticField() const; | 3624 const Field& StaticField() const; |
3618 | 3625 |
3619 Value* field_value() const { return inputs_[0]; } | 3626 Value* field_value() const { return inputs_[0]; } |
3620 | 3627 |
3621 virtual bool CanDeoptimize() const { return false; } | 3628 virtual bool ComputeCanDeoptimize() const { return false; } |
3622 | 3629 |
3623 virtual bool AllowsCSE() const { return StaticField().is_final(); } | 3630 virtual bool AllowsCSE() const { return StaticField().is_final(); } |
3624 virtual EffectSet Effects() const { return EffectSet::None(); } | 3631 virtual EffectSet Effects() const { return EffectSet::None(); } |
3625 virtual EffectSet Dependencies() const; | 3632 virtual EffectSet Dependencies() const; |
3626 virtual bool AttributesEqual(Instruction* other) const; | 3633 virtual bool AttributesEqual(Instruction* other) const; |
3627 | 3634 |
3628 virtual TokenPosition token_pos() const { return token_pos_; } | 3635 virtual TokenPosition token_pos() const { return token_pos_; } |
3629 | 3636 |
3630 PRINT_OPERANDS_TO_SUPPORT | 3637 PRINT_OPERANDS_TO_SUPPORT |
3631 | 3638 |
(...skipping 15 matching lines...) Expand all Loading... | |
3647 CheckField(field); | 3654 CheckField(field); |
3648 } | 3655 } |
3649 | 3656 |
3650 enum { kValuePos = 0 }; | 3657 enum { kValuePos = 0 }; |
3651 | 3658 |
3652 DECLARE_INSTRUCTION(StoreStaticField) | 3659 DECLARE_INSTRUCTION(StoreStaticField) |
3653 | 3660 |
3654 const Field& field() const { return field_; } | 3661 const Field& field() const { return field_; } |
3655 Value* value() const { return inputs_[kValuePos]; } | 3662 Value* value() const { return inputs_[kValuePos]; } |
3656 | 3663 |
3657 virtual bool CanDeoptimize() const { return false; } | 3664 virtual bool ComputeCanDeoptimize() const { return false; } |
3658 | 3665 |
3659 // Currently CSE/LICM don't operate on any instructions that can be affected | 3666 // Currently CSE/LICM don't operate on any instructions that can be affected |
3660 // by stores/loads. LoadOptimizer handles loads separately. Hence stores | 3667 // by stores/loads. LoadOptimizer handles loads separately. Hence stores |
3661 // are marked as having no side-effects. | 3668 // are marked as having no side-effects. |
3662 virtual EffectSet Effects() const { return EffectSet::None(); } | 3669 virtual EffectSet Effects() const { return EffectSet::None(); } |
3663 | 3670 |
3664 virtual TokenPosition token_pos() const { return token_pos_; } | 3671 virtual TokenPosition token_pos() const { return token_pos_; } |
3665 | 3672 |
3666 PRINT_OPERANDS_TO_SUPPORT | 3673 PRINT_OPERANDS_TO_SUPPORT |
3667 | 3674 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3709 bool IsExternal() const { | 3716 bool IsExternal() const { |
3710 return array()->definition()->representation() == kUntagged; | 3717 return array()->definition()->representation() == kUntagged; |
3711 } | 3718 } |
3712 | 3719 |
3713 Value* array() const { return inputs_[0]; } | 3720 Value* array() const { return inputs_[0]; } |
3714 Value* index() const { return inputs_[1]; } | 3721 Value* index() const { return inputs_[1]; } |
3715 intptr_t index_scale() const { return index_scale_; } | 3722 intptr_t index_scale() const { return index_scale_; } |
3716 intptr_t class_id() const { return class_id_; } | 3723 intptr_t class_id() const { return class_id_; } |
3717 bool aligned() const { return alignment_ == kAlignedAccess; } | 3724 bool aligned() const { return alignment_ == kAlignedAccess; } |
3718 | 3725 |
3719 virtual bool CanDeoptimize() const { | 3726 virtual bool ComputeCanDeoptimize() const { |
3720 return GetDeoptId() != Thread::kNoDeoptId; | 3727 return GetDeoptId() != Thread::kNoDeoptId; |
3721 } | 3728 } |
3722 | 3729 |
3723 virtual Representation representation() const; | 3730 virtual Representation representation() const; |
3724 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 3731 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
3725 | 3732 |
3726 virtual EffectSet Effects() const { return EffectSet::None(); } | 3733 virtual EffectSet Effects() const { return EffectSet::None(); } |
3727 | 3734 |
3728 private: | 3735 private: |
3729 const intptr_t index_scale_; | 3736 const intptr_t index_scale_; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3780 Value* array() const { return inputs_[0]; } | 3787 Value* array() const { return inputs_[0]; } |
3781 Value* index() const { return inputs_[1]; } | 3788 Value* index() const { return inputs_[1]; } |
3782 intptr_t index_scale() const { return Instance::ElementSizeFor(class_id_); } | 3789 intptr_t index_scale() const { return Instance::ElementSizeFor(class_id_); } |
3783 intptr_t class_id() const { return class_id_; } | 3790 intptr_t class_id() const { return class_id_; } |
3784 intptr_t element_count() const { return element_count_; } | 3791 intptr_t element_count() const { return element_count_; } |
3785 | 3792 |
3786 bool can_pack_into_smi() const { | 3793 bool can_pack_into_smi() const { |
3787 return element_count() <= kSmiBits / (index_scale() * kBitsPerByte); | 3794 return element_count() <= kSmiBits / (index_scale() * kBitsPerByte); |
3788 } | 3795 } |
3789 | 3796 |
3790 virtual bool CanDeoptimize() const { return false; } | 3797 virtual bool ComputeCanDeoptimize() const { return false; } |
3791 | 3798 |
3792 virtual Representation representation() const { return representation_; } | 3799 virtual Representation representation() const { return representation_; } |
3793 void set_representation(Representation repr) { representation_ = repr; } | 3800 void set_representation(Representation repr) { representation_ = repr; } |
3794 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 3801 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
3795 | 3802 |
3796 virtual EffectSet Effects() const { return EffectSet::None(); } | 3803 virtual EffectSet Effects() const { return EffectSet::None(); } |
3797 | 3804 |
3798 private: | 3805 private: |
3799 const intptr_t class_id_; | 3806 const intptr_t class_id_; |
3800 const TokenPosition token_pos_; | 3807 const TokenPosition token_pos_; |
3801 const intptr_t element_count_; | 3808 const intptr_t element_count_; |
3802 Representation representation_; | 3809 Representation representation_; |
3803 | 3810 |
3804 DISALLOW_COPY_AND_ASSIGN(LoadCodeUnitsInstr); | 3811 DISALLOW_COPY_AND_ASSIGN(LoadCodeUnitsInstr); |
3805 }; | 3812 }; |
3806 | 3813 |
3807 | 3814 |
3808 class OneByteStringFromCharCodeInstr | 3815 class OneByteStringFromCharCodeInstr |
3809 : public TemplateDefinition<1, NoThrow, Pure> { | 3816 : public TemplateDefinition<1, NoThrow, Pure> { |
3810 public: | 3817 public: |
3811 explicit OneByteStringFromCharCodeInstr(Value* char_code) { | 3818 explicit OneByteStringFromCharCodeInstr(Value* char_code) { |
3812 SetInputAt(0, char_code); | 3819 SetInputAt(0, char_code); |
3813 } | 3820 } |
3814 | 3821 |
3815 DECLARE_INSTRUCTION(OneByteStringFromCharCode) | 3822 DECLARE_INSTRUCTION(OneByteStringFromCharCode) |
3816 virtual CompileType ComputeType() const; | 3823 virtual CompileType ComputeType() const; |
3817 | 3824 |
3818 Value* char_code() const { return inputs_[0]; } | 3825 Value* char_code() const { return inputs_[0]; } |
3819 | 3826 |
3820 virtual bool CanDeoptimize() const { return false; } | 3827 virtual bool ComputeCanDeoptimize() const { return false; } |
3821 | 3828 |
3822 virtual bool AttributesEqual(Instruction* other) const { return true; } | 3829 virtual bool AttributesEqual(Instruction* other) const { return true; } |
3823 | 3830 |
3824 private: | 3831 private: |
3825 DISALLOW_COPY_AND_ASSIGN(OneByteStringFromCharCodeInstr); | 3832 DISALLOW_COPY_AND_ASSIGN(OneByteStringFromCharCodeInstr); |
3826 }; | 3833 }; |
3827 | 3834 |
3828 | 3835 |
3829 class StringToCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> { | 3836 class StringToCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> { |
3830 public: | 3837 public: |
3831 StringToCharCodeInstr(Value* str, intptr_t cid) : cid_(cid) { | 3838 StringToCharCodeInstr(Value* str, intptr_t cid) : cid_(cid) { |
3832 ASSERT(str != NULL); | 3839 ASSERT(str != NULL); |
3833 SetInputAt(0, str); | 3840 SetInputAt(0, str); |
3834 } | 3841 } |
3835 | 3842 |
3836 DECLARE_INSTRUCTION(StringToCharCode) | 3843 DECLARE_INSTRUCTION(StringToCharCode) |
3837 virtual CompileType ComputeType() const; | 3844 virtual CompileType ComputeType() const; |
3838 | 3845 |
3839 Value* str() const { return inputs_[0]; } | 3846 Value* str() const { return inputs_[0]; } |
3840 | 3847 |
3841 virtual bool CanDeoptimize() const { return false; } | 3848 virtual bool ComputeCanDeoptimize() const { return false; } |
3842 | 3849 |
3843 virtual bool AttributesEqual(Instruction* other) const { | 3850 virtual bool AttributesEqual(Instruction* other) const { |
3844 return other->AsStringToCharCode()->cid_ == cid_; | 3851 return other->AsStringToCharCode()->cid_ == cid_; |
3845 } | 3852 } |
3846 | 3853 |
3847 private: | 3854 private: |
3848 const intptr_t cid_; | 3855 const intptr_t cid_; |
3849 | 3856 |
3850 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr); | 3857 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr); |
3851 }; | 3858 }; |
3852 | 3859 |
3853 | 3860 |
3854 class StringInterpolateInstr : public TemplateDefinition<1, Throws> { | 3861 class StringInterpolateInstr : public TemplateDefinition<1, Throws> { |
3855 public: | 3862 public: |
3856 StringInterpolateInstr(Value* value, TokenPosition token_pos) | 3863 StringInterpolateInstr(Value* value, TokenPosition token_pos) |
3857 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), | 3864 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
3858 token_pos_(token_pos), | 3865 token_pos_(token_pos), |
3859 function_(Function::ZoneHandle()) { | 3866 function_(Function::ZoneHandle()) { |
3860 SetInputAt(0, value); | 3867 SetInputAt(0, value); |
3861 } | 3868 } |
3862 | 3869 |
3863 Value* value() const { return inputs_[0]; } | 3870 Value* value() const { return inputs_[0]; } |
3864 virtual TokenPosition token_pos() const { return token_pos_; } | 3871 virtual TokenPosition token_pos() const { return token_pos_; } |
3865 | 3872 |
3866 virtual CompileType ComputeType() const; | 3873 virtual CompileType ComputeType() const; |
3867 // Issues a static call to Dart code which calls toString on objects. | 3874 // Issues a static call to Dart code which calls toString on objects. |
3868 virtual EffectSet Effects() const { return EffectSet::All(); } | 3875 virtual EffectSet Effects() const { return EffectSet::All(); } |
3869 virtual bool CanDeoptimize() const { return true; } | 3876 virtual bool ComputeCanDeoptimize() const { return true; } |
3870 | 3877 |
3871 const Function& CallFunction() const; | 3878 const Function& CallFunction() const; |
3872 | 3879 |
3873 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 3880 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
3874 | 3881 |
3875 DECLARE_INSTRUCTION(StringInterpolate) | 3882 DECLARE_INSTRUCTION(StringInterpolate) |
3876 | 3883 |
3877 private: | 3884 private: |
3878 const TokenPosition token_pos_; | 3885 const TokenPosition token_pos_; |
3879 Function& function_; | 3886 Function& function_; |
(...skipping 23 matching lines...) Expand all Loading... | |
3903 | 3910 |
3904 intptr_t index_scale() const { return index_scale_; } | 3911 intptr_t index_scale() const { return index_scale_; } |
3905 intptr_t class_id() const { return class_id_; } | 3912 intptr_t class_id() const { return class_id_; } |
3906 bool aligned() const { return alignment_ == kAlignedAccess; } | 3913 bool aligned() const { return alignment_ == kAlignedAccess; } |
3907 | 3914 |
3908 bool ShouldEmitStoreBarrier() const { | 3915 bool ShouldEmitStoreBarrier() const { |
3909 return value()->NeedsStoreBuffer() && | 3916 return value()->NeedsStoreBuffer() && |
3910 (emit_store_barrier_ == kEmitStoreBarrier); | 3917 (emit_store_barrier_ == kEmitStoreBarrier); |
3911 } | 3918 } |
3912 | 3919 |
3913 virtual bool CanDeoptimize() const { return false; } | 3920 virtual bool ComputeCanDeoptimize() const { return false; } |
3914 | 3921 |
3915 virtual Representation RequiredInputRepresentation(intptr_t idx) const; | 3922 virtual Representation RequiredInputRepresentation(intptr_t idx) const; |
3916 | 3923 |
3917 bool IsExternal() const { | 3924 bool IsExternal() const { |
3918 return array()->definition()->representation() == kUntagged; | 3925 return array()->definition()->representation() == kUntagged; |
3919 } | 3926 } |
3920 | 3927 |
3921 virtual intptr_t DeoptimizationTarget() const { | 3928 virtual intptr_t DeoptimizationTarget() const { |
3922 // Direct access since this instruction cannot deoptimize, and the deopt-id | 3929 // Direct access since this instruction cannot deoptimize, and the deopt-id |
3923 // was inherited from another instruction that could deoptimize. | 3930 // was inherited from another instruction that could deoptimize. |
(...skipping 16 matching lines...) Expand all Loading... | |
3940 // Note overrideable, built-in: value ? false : true. | 3947 // Note overrideable, built-in: value ? false : true. |
3941 class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> { | 3948 class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> { |
3942 public: | 3949 public: |
3943 explicit BooleanNegateInstr(Value* value) { SetInputAt(0, value); } | 3950 explicit BooleanNegateInstr(Value* value) { SetInputAt(0, value); } |
3944 | 3951 |
3945 DECLARE_INSTRUCTION(BooleanNegate) | 3952 DECLARE_INSTRUCTION(BooleanNegate) |
3946 virtual CompileType ComputeType() const; | 3953 virtual CompileType ComputeType() const; |
3947 | 3954 |
3948 Value* value() const { return inputs_[0]; } | 3955 Value* value() const { return inputs_[0]; } |
3949 | 3956 |
3950 virtual bool CanDeoptimize() const { return false; } | 3957 virtual bool ComputeCanDeoptimize() const { return false; } |
3951 | 3958 |
3952 virtual EffectSet Effects() const { return EffectSet::None(); } | 3959 virtual EffectSet Effects() const { return EffectSet::None(); } |
3953 | 3960 |
3954 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 3961 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
3955 | 3962 |
3956 private: | 3963 private: |
3957 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); | 3964 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); |
3958 }; | 3965 }; |
3959 | 3966 |
3960 | 3967 |
(...skipping 14 matching lines...) Expand all Loading... | |
3975 | 3982 |
3976 DECLARE_INSTRUCTION(InstanceOf) | 3983 DECLARE_INSTRUCTION(InstanceOf) |
3977 virtual CompileType ComputeType() const; | 3984 virtual CompileType ComputeType() const; |
3978 | 3985 |
3979 Value* value() const { return inputs_[0]; } | 3986 Value* value() const { return inputs_[0]; } |
3980 Value* instantiator_type_arguments() const { return inputs_[1]; } | 3987 Value* instantiator_type_arguments() const { return inputs_[1]; } |
3981 | 3988 |
3982 const AbstractType& type() const { return type_; } | 3989 const AbstractType& type() const { return type_; } |
3983 virtual TokenPosition token_pos() const { return token_pos_; } | 3990 virtual TokenPosition token_pos() const { return token_pos_; } |
3984 | 3991 |
3985 virtual bool CanDeoptimize() const { return true; } | 3992 virtual bool ComputeCanDeoptimize() const { return true; } |
3986 | 3993 |
3987 virtual EffectSet Effects() const { return EffectSet::None(); } | 3994 virtual EffectSet Effects() const { return EffectSet::None(); } |
3988 | 3995 |
3989 PRINT_OPERANDS_TO_SUPPORT | 3996 PRINT_OPERANDS_TO_SUPPORT |
3990 | 3997 |
3991 private: | 3998 private: |
3992 const TokenPosition token_pos_; | 3999 const TokenPosition token_pos_; |
3993 Value* value_; | 4000 Value* value_; |
3994 Value* type_arguments_; | 4001 Value* type_arguments_; |
3995 const AbstractType& type_; | 4002 const AbstractType& type_; |
(...skipping 25 matching lines...) Expand all Loading... | |
4021 } | 4028 } |
4022 | 4029 |
4023 const Class& cls() const { return cls_; } | 4030 const Class& cls() const { return cls_; } |
4024 virtual TokenPosition token_pos() const { return token_pos_; } | 4031 virtual TokenPosition token_pos() const { return token_pos_; } |
4025 | 4032 |
4026 const Function& closure_function() const { return closure_function_; } | 4033 const Function& closure_function() const { return closure_function_; } |
4027 void set_closure_function(const Function& function) { | 4034 void set_closure_function(const Function& function) { |
4028 closure_function_ ^= function.raw(); | 4035 closure_function_ ^= function.raw(); |
4029 } | 4036 } |
4030 | 4037 |
4031 virtual bool CanDeoptimize() const { return false; } | 4038 virtual bool ComputeCanDeoptimize() const { return false; } |
4032 | 4039 |
4033 virtual EffectSet Effects() const { return EffectSet::None(); } | 4040 virtual EffectSet Effects() const { return EffectSet::None(); } |
4034 | 4041 |
4035 virtual AliasIdentity Identity() const { return identity_; } | 4042 virtual AliasIdentity Identity() const { return identity_; } |
4036 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } | 4043 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } |
4037 | 4044 |
4038 PRINT_OPERANDS_TO_SUPPORT | 4045 PRINT_OPERANDS_TO_SUPPORT |
4039 | 4046 |
4040 private: | 4047 private: |
4041 const TokenPosition token_pos_; | 4048 const TokenPosition token_pos_; |
(...skipping 14 matching lines...) Expand all Loading... | |
4056 : token_pos_(token_pos), | 4063 : token_pos_(token_pos), |
4057 num_context_variables_(num_context_variables), | 4064 num_context_variables_(num_context_variables), |
4058 identity_(AliasIdentity::Unknown()) {} | 4065 identity_(AliasIdentity::Unknown()) {} |
4059 | 4066 |
4060 DECLARE_INSTRUCTION(AllocateUninitializedContext) | 4067 DECLARE_INSTRUCTION(AllocateUninitializedContext) |
4061 virtual CompileType ComputeType() const; | 4068 virtual CompileType ComputeType() const; |
4062 | 4069 |
4063 virtual TokenPosition token_pos() const { return token_pos_; } | 4070 virtual TokenPosition token_pos() const { return token_pos_; } |
4064 intptr_t num_context_variables() const { return num_context_variables_; } | 4071 intptr_t num_context_variables() const { return num_context_variables_; } |
4065 | 4072 |
4066 virtual bool CanDeoptimize() const { return false; } | 4073 virtual bool ComputeCanDeoptimize() const { return false; } |
4067 | 4074 |
4068 virtual EffectSet Effects() const { return EffectSet::None(); } | 4075 virtual EffectSet Effects() const { return EffectSet::None(); } |
4069 | 4076 |
4070 virtual AliasIdentity Identity() const { return identity_; } | 4077 virtual AliasIdentity Identity() const { return identity_; } |
4071 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } | 4078 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } |
4072 | 4079 |
4073 PRINT_OPERANDS_TO_SUPPORT | 4080 PRINT_OPERANDS_TO_SUPPORT |
4074 | 4081 |
4075 private: | 4082 private: |
4076 const TokenPosition token_pos_; | 4083 const TokenPosition token_pos_; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4143 // SelectRepresentations pass is run once more while MaterializeObject | 4150 // SelectRepresentations pass is run once more while MaterializeObject |
4144 // instructions are still in the graph. To avoid any redundant boxing | 4151 // instructions are still in the graph. To avoid any redundant boxing |
4145 // operations inserted by that pass we should indicate that this | 4152 // operations inserted by that pass we should indicate that this |
4146 // instruction can cope with any representation as it is essentially | 4153 // instruction can cope with any representation as it is essentially |
4147 // an environment use. | 4154 // an environment use. |
4148 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4155 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
4149 ASSERT(0 <= idx && idx < InputCount()); | 4156 ASSERT(0 <= idx && idx < InputCount()); |
4150 return kNoRepresentation; | 4157 return kNoRepresentation; |
4151 } | 4158 } |
4152 | 4159 |
4153 virtual bool CanDeoptimize() const { return false; } | 4160 virtual bool ComputeCanDeoptimize() const { return false; } |
4154 virtual EffectSet Effects() const { return EffectSet::None(); } | 4161 virtual EffectSet Effects() const { return EffectSet::None(); } |
4155 | 4162 |
4156 Location* locations() { return locations_; } | 4163 Location* locations() { return locations_; } |
4157 void set_locations(Location* locations) { locations_ = locations; } | 4164 void set_locations(Location* locations) { locations_ = locations; } |
4158 | 4165 |
4159 virtual bool MayThrow() const { return false; } | 4166 virtual bool MayThrow() const { return false; } |
4160 | 4167 |
4161 void RemapRegisters(intptr_t* cpu_reg_slots, intptr_t* fpu_reg_slots); | 4168 void RemapRegisters(intptr_t* cpu_reg_slots, intptr_t* fpu_reg_slots); |
4162 | 4169 |
4163 bool was_visited_for_liveness() const { return visited_for_liveness_; } | 4170 bool was_visited_for_liveness() const { return visited_for_liveness_; } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4200 | 4207 |
4201 DECLARE_INSTRUCTION(CreateArray) | 4208 DECLARE_INSTRUCTION(CreateArray) |
4202 virtual CompileType ComputeType() const; | 4209 virtual CompileType ComputeType() const; |
4203 | 4210 |
4204 virtual TokenPosition token_pos() const { return token_pos_; } | 4211 virtual TokenPosition token_pos() const { return token_pos_; } |
4205 Value* element_type() const { return inputs_[kElementTypePos]; } | 4212 Value* element_type() const { return inputs_[kElementTypePos]; } |
4206 Value* num_elements() const { return inputs_[kLengthPos]; } | 4213 Value* num_elements() const { return inputs_[kLengthPos]; } |
4207 | 4214 |
4208 // Throw needs environment, which is created only if instruction can | 4215 // Throw needs environment, which is created only if instruction can |
4209 // deoptimize. | 4216 // deoptimize. |
4210 virtual bool CanDeoptimize() const { return MayThrow(); } | 4217 virtual bool ComputeCanDeoptimize() const { return MayThrow(); } |
4211 | 4218 |
4212 virtual EffectSet Effects() const { return EffectSet::None(); } | 4219 virtual EffectSet Effects() const { return EffectSet::None(); } |
4213 | 4220 |
4214 virtual AliasIdentity Identity() const { return identity_; } | 4221 virtual AliasIdentity Identity() const { return identity_; } |
4215 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } | 4222 virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; } |
4216 | 4223 |
4217 private: | 4224 private: |
4218 const TokenPosition token_pos_; | 4225 const TokenPosition token_pos_; |
4219 AliasIdentity identity_; | 4226 AliasIdentity identity_; |
4220 | 4227 |
(...skipping 18 matching lines...) Expand all Loading... | |
4239 | 4246 |
4240 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4247 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
4241 ASSERT(idx == 0); | 4248 ASSERT(idx == 0); |
4242 // The object may be tagged or untagged (for external objects). | 4249 // The object may be tagged or untagged (for external objects). |
4243 return kNoRepresentation; | 4250 return kNoRepresentation; |
4244 } | 4251 } |
4245 | 4252 |
4246 Value* object() const { return inputs_[0]; } | 4253 Value* object() const { return inputs_[0]; } |
4247 intptr_t offset() const { return offset_; } | 4254 intptr_t offset() const { return offset_; } |
4248 | 4255 |
4249 virtual bool CanDeoptimize() const { return false; } | 4256 virtual bool ComputeCanDeoptimize() const { return false; } |
4250 | 4257 |
4251 virtual EffectSet Effects() const { return EffectSet::None(); } | 4258 virtual EffectSet Effects() const { return EffectSet::None(); } |
4252 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4259 virtual bool AttributesEqual(Instruction* other) const { return true; } |
4253 | 4260 |
4254 private: | 4261 private: |
4255 intptr_t offset_; | 4262 intptr_t offset_; |
4256 | 4263 |
4257 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr); | 4264 DISALLOW_COPY_AND_ASSIGN(LoadUntaggedInstr); |
4258 }; | 4265 }; |
4259 | 4266 |
4260 | 4267 |
4261 class LoadClassIdInstr : public TemplateDefinition<1, NoThrow> { | 4268 class LoadClassIdInstr : public TemplateDefinition<1, NoThrow> { |
4262 public: | 4269 public: |
4263 explicit LoadClassIdInstr(Value* object) { SetInputAt(0, object); } | 4270 explicit LoadClassIdInstr(Value* object) { SetInputAt(0, object); } |
4264 | 4271 |
4265 virtual Representation representation() const { return kTagged; } | 4272 virtual Representation representation() const { return kTagged; } |
4266 DECLARE_INSTRUCTION(LoadClassId) | 4273 DECLARE_INSTRUCTION(LoadClassId) |
4267 virtual CompileType ComputeType() const; | 4274 virtual CompileType ComputeType() const; |
4268 | 4275 |
4269 Value* object() const { return inputs_[0]; } | 4276 Value* object() const { return inputs_[0]; } |
4270 | 4277 |
4271 virtual bool CanDeoptimize() const { return false; } | 4278 virtual bool ComputeCanDeoptimize() const { return false; } |
4272 | 4279 |
4273 virtual bool AllowsCSE() const { return true; } | 4280 virtual bool AllowsCSE() const { return true; } |
4274 virtual EffectSet Dependencies() const { | 4281 virtual EffectSet Dependencies() const { |
4275 return EffectSet::Externalization(); | 4282 return EffectSet::Externalization(); |
4276 } | 4283 } |
4277 virtual EffectSet Effects() const { return EffectSet::None(); } | 4284 virtual EffectSet Effects() const { return EffectSet::None(); } |
4278 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4285 virtual bool AttributesEqual(Instruction* other) const { return true; } |
4279 | 4286 |
4280 private: | 4287 private: |
4281 DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr); | 4288 DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4345 | 4352 |
4346 void set_recognized_kind(MethodRecognizer::Kind kind) { | 4353 void set_recognized_kind(MethodRecognizer::Kind kind) { |
4347 recognized_kind_ = kind; | 4354 recognized_kind_ = kind; |
4348 } | 4355 } |
4349 | 4356 |
4350 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } | 4357 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } |
4351 | 4358 |
4352 DECLARE_INSTRUCTION(LoadField) | 4359 DECLARE_INSTRUCTION(LoadField) |
4353 virtual CompileType ComputeType() const; | 4360 virtual CompileType ComputeType() const; |
4354 | 4361 |
4355 virtual bool CanDeoptimize() const { return false; } | 4362 virtual bool ComputeCanDeoptimize() const { return false; } |
4356 | 4363 |
4357 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 4364 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
4358 | 4365 |
4359 bool IsImmutableLengthLoad() const; | 4366 bool IsImmutableLengthLoad() const; |
4360 | 4367 |
4361 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 4368 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
4362 | 4369 |
4363 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); | 4370 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); |
4364 | 4371 |
4365 static bool IsFixedLengthArrayCid(intptr_t cid); | 4372 static bool IsFixedLengthArrayCid(intptr_t cid); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4398 ASSERT(function_type_arguments == NULL); // TODO(regis): Implement. | 4405 ASSERT(function_type_arguments == NULL); // TODO(regis): Implement. |
4399 SetInputAt(0, instantiator_type_arguments); | 4406 SetInputAt(0, instantiator_type_arguments); |
4400 } | 4407 } |
4401 | 4408 |
4402 DECLARE_INSTRUCTION(InstantiateType) | 4409 DECLARE_INSTRUCTION(InstantiateType) |
4403 | 4410 |
4404 Value* instantiator_type_arguments() const { return inputs_[0]; } | 4411 Value* instantiator_type_arguments() const { return inputs_[0]; } |
4405 const AbstractType& type() const { return type_; } | 4412 const AbstractType& type() const { return type_; } |
4406 virtual TokenPosition token_pos() const { return token_pos_; } | 4413 virtual TokenPosition token_pos() const { return token_pos_; } |
4407 | 4414 |
4408 virtual bool CanDeoptimize() const { return true; } | 4415 virtual bool ComputeCanDeoptimize() const { return true; } |
4409 | 4416 |
4410 virtual EffectSet Effects() const { return EffectSet::None(); } | 4417 virtual EffectSet Effects() const { return EffectSet::None(); } |
4411 | 4418 |
4412 PRINT_OPERANDS_TO_SUPPORT | 4419 PRINT_OPERANDS_TO_SUPPORT |
4413 | 4420 |
4414 private: | 4421 private: |
4415 const TokenPosition token_pos_; | 4422 const TokenPosition token_pos_; |
4416 const AbstractType& type_; | 4423 const AbstractType& type_; |
4417 | 4424 |
4418 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr); | 4425 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr); |
(...skipping 16 matching lines...) Expand all Loading... | |
4435 SetInputAt(0, instantiator_type_arguments); | 4442 SetInputAt(0, instantiator_type_arguments); |
4436 } | 4443 } |
4437 | 4444 |
4438 DECLARE_INSTRUCTION(InstantiateTypeArguments) | 4445 DECLARE_INSTRUCTION(InstantiateTypeArguments) |
4439 | 4446 |
4440 Value* instantiator_type_arguments() const { return inputs_[0]; } | 4447 Value* instantiator_type_arguments() const { return inputs_[0]; } |
4441 const TypeArguments& type_arguments() const { return type_arguments_; } | 4448 const TypeArguments& type_arguments() const { return type_arguments_; } |
4442 const Class& instantiator_class() const { return instantiator_class_; } | 4449 const Class& instantiator_class() const { return instantiator_class_; } |
4443 virtual TokenPosition token_pos() const { return token_pos_; } | 4450 virtual TokenPosition token_pos() const { return token_pos_; } |
4444 | 4451 |
4445 virtual bool CanDeoptimize() const { return true; } | 4452 virtual bool ComputeCanDeoptimize() const { return true; } |
4446 | 4453 |
4447 virtual EffectSet Effects() const { return EffectSet::None(); } | 4454 virtual EffectSet Effects() const { return EffectSet::None(); } |
4448 | 4455 |
4449 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 4456 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
4450 | 4457 |
4451 PRINT_OPERANDS_TO_SUPPORT | 4458 PRINT_OPERANDS_TO_SUPPORT |
4452 | 4459 |
4453 private: | 4460 private: |
4454 const TokenPosition token_pos_; | 4461 const TokenPosition token_pos_; |
4455 const TypeArguments& type_arguments_; | 4462 const TypeArguments& type_arguments_; |
4456 const Class& instantiator_class_; | 4463 const Class& instantiator_class_; |
4457 | 4464 |
4458 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); | 4465 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); |
4459 }; | 4466 }; |
4460 | 4467 |
4461 | 4468 |
4462 class AllocateContextInstr : public TemplateDefinition<0, NoThrow> { | 4469 class AllocateContextInstr : public TemplateDefinition<0, NoThrow> { |
4463 public: | 4470 public: |
4464 AllocateContextInstr(TokenPosition token_pos, intptr_t num_context_variables) | 4471 AllocateContextInstr(TokenPosition token_pos, intptr_t num_context_variables) |
4465 : token_pos_(token_pos), num_context_variables_(num_context_variables) {} | 4472 : token_pos_(token_pos), num_context_variables_(num_context_variables) {} |
4466 | 4473 |
4467 DECLARE_INSTRUCTION(AllocateContext) | 4474 DECLARE_INSTRUCTION(AllocateContext) |
4468 virtual CompileType ComputeType() const; | 4475 virtual CompileType ComputeType() const; |
4469 | 4476 |
4470 virtual TokenPosition token_pos() const { return token_pos_; } | 4477 virtual TokenPosition token_pos() const { return token_pos_; } |
4471 intptr_t num_context_variables() const { return num_context_variables_; } | 4478 intptr_t num_context_variables() const { return num_context_variables_; } |
4472 | 4479 |
4473 virtual bool CanDeoptimize() const { return false; } | 4480 virtual bool ComputeCanDeoptimize() const { return false; } |
4474 | 4481 |
4475 virtual EffectSet Effects() const { return EffectSet::None(); } | 4482 virtual EffectSet Effects() const { return EffectSet::None(); } |
4476 | 4483 |
4477 PRINT_OPERANDS_TO_SUPPORT | 4484 PRINT_OPERANDS_TO_SUPPORT |
4478 | 4485 |
4479 private: | 4486 private: |
4480 const TokenPosition token_pos_; | 4487 const TokenPosition token_pos_; |
4481 const intptr_t num_context_variables_; | 4488 const intptr_t num_context_variables_; |
4482 | 4489 |
4483 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); | 4490 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); |
4484 }; | 4491 }; |
4485 | 4492 |
4486 | 4493 |
4487 class InitStaticFieldInstr : public TemplateInstruction<1, Throws> { | 4494 class InitStaticFieldInstr : public TemplateInstruction<1, Throws> { |
4488 public: | 4495 public: |
4489 InitStaticFieldInstr(Value* input, const Field& field) | 4496 InitStaticFieldInstr(Value* input, const Field& field) |
4490 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), | 4497 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
4491 field_(field) { | 4498 field_(field) { |
4492 SetInputAt(0, input); | 4499 SetInputAt(0, input); |
4493 CheckField(field); | 4500 CheckField(field); |
4494 } | 4501 } |
4495 | 4502 |
4496 virtual TokenPosition token_pos() const { return field_.token_pos(); } | 4503 virtual TokenPosition token_pos() const { return field_.token_pos(); } |
4497 const Field& field() const { return field_; } | 4504 const Field& field() const { return field_; } |
4498 | 4505 |
4499 DECLARE_INSTRUCTION(InitStaticField) | 4506 DECLARE_INSTRUCTION(InitStaticField) |
4500 | 4507 |
4501 virtual bool CanDeoptimize() const { return true; } | 4508 virtual bool ComputeCanDeoptimize() const { return true; } |
4502 virtual EffectSet Effects() const { return EffectSet::All(); } | 4509 virtual EffectSet Effects() const { return EffectSet::All(); } |
4503 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 4510 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
4504 | 4511 |
4505 private: | 4512 private: |
4506 const Field& field_; | 4513 const Field& field_; |
4507 | 4514 |
4508 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldInstr); | 4515 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldInstr); |
4509 }; | 4516 }; |
4510 | 4517 |
4511 | 4518 |
4512 class CloneContextInstr : public TemplateDefinition<1, NoThrow> { | 4519 class CloneContextInstr : public TemplateDefinition<1, NoThrow> { |
4513 public: | 4520 public: |
4514 CloneContextInstr(TokenPosition token_pos, Value* context_value) | 4521 CloneContextInstr(TokenPosition token_pos, Value* context_value) |
4515 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), | 4522 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
4516 token_pos_(token_pos) { | 4523 token_pos_(token_pos) { |
4517 SetInputAt(0, context_value); | 4524 SetInputAt(0, context_value); |
4518 } | 4525 } |
4519 | 4526 |
4520 virtual TokenPosition token_pos() const { return token_pos_; } | 4527 virtual TokenPosition token_pos() const { return token_pos_; } |
4521 Value* context_value() const { return inputs_[0]; } | 4528 Value* context_value() const { return inputs_[0]; } |
4522 | 4529 |
4523 DECLARE_INSTRUCTION(CloneContext) | 4530 DECLARE_INSTRUCTION(CloneContext) |
4524 virtual CompileType ComputeType() const; | 4531 virtual CompileType ComputeType() const; |
4525 | 4532 |
4526 virtual bool CanDeoptimize() const { return true; } | 4533 virtual bool ComputeCanDeoptimize() const { return true; } |
4527 | 4534 |
4528 virtual EffectSet Effects() const { return EffectSet::None(); } | 4535 virtual EffectSet Effects() const { return EffectSet::None(); } |
4529 | 4536 |
4530 private: | 4537 private: |
4531 const TokenPosition token_pos_; | 4538 const TokenPosition token_pos_; |
4532 | 4539 |
4533 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); | 4540 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); |
4534 }; | 4541 }; |
4535 | 4542 |
4536 | 4543 |
4537 class CheckEitherNonSmiInstr : public TemplateInstruction<2, NoThrow, Pure> { | 4544 class CheckEitherNonSmiInstr : public TemplateInstruction<2, NoThrow, Pure> { |
4538 public: | 4545 public: |
4539 CheckEitherNonSmiInstr(Value* left, Value* right, intptr_t deopt_id) | 4546 CheckEitherNonSmiInstr(Value* left, Value* right, intptr_t deopt_id) |
4540 : TemplateInstruction(deopt_id), licm_hoisted_(false) { | 4547 : TemplateInstruction(deopt_id), licm_hoisted_(false) { |
4541 SetInputAt(0, left); | 4548 SetInputAt(0, left); |
4542 SetInputAt(1, right); | 4549 SetInputAt(1, right); |
4543 } | 4550 } |
4544 | 4551 |
4545 Value* left() const { return inputs_[0]; } | 4552 Value* left() const { return inputs_[0]; } |
4546 Value* right() const { return inputs_[1]; } | 4553 Value* right() const { return inputs_[1]; } |
4547 | 4554 |
4548 DECLARE_INSTRUCTION(CheckEitherNonSmi) | 4555 DECLARE_INSTRUCTION(CheckEitherNonSmi) |
4549 | 4556 |
4550 virtual bool CanDeoptimize() const { return true; } | 4557 virtual bool ComputeCanDeoptimize() const { return true; } |
4551 | 4558 |
4552 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 4559 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
4553 | 4560 |
4554 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4561 virtual bool AttributesEqual(Instruction* other) const { return true; } |
4555 | 4562 |
4556 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } | 4563 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } |
4557 | 4564 |
4558 private: | 4565 private: |
4559 bool licm_hoisted_; | 4566 bool licm_hoisted_; |
4560 | 4567 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4625 class BoxInstr : public TemplateDefinition<1, NoThrow, Pure> { | 4632 class BoxInstr : public TemplateDefinition<1, NoThrow, Pure> { |
4626 public: | 4633 public: |
4627 static BoxInstr* Create(Representation from, Value* value); | 4634 static BoxInstr* Create(Representation from, Value* value); |
4628 | 4635 |
4629 Value* value() const { return inputs_[0]; } | 4636 Value* value() const { return inputs_[0]; } |
4630 Representation from_representation() const { return from_representation_; } | 4637 Representation from_representation() const { return from_representation_; } |
4631 | 4638 |
4632 DECLARE_INSTRUCTION(Box) | 4639 DECLARE_INSTRUCTION(Box) |
4633 virtual CompileType ComputeType() const; | 4640 virtual CompileType ComputeType() const; |
4634 | 4641 |
4635 virtual bool CanDeoptimize() const { return false; } | 4642 virtual bool ComputeCanDeoptimize() const { return false; } |
4636 virtual intptr_t DeoptimizationTarget() const { return Thread::kNoDeoptId; } | 4643 virtual intptr_t DeoptimizationTarget() const { return Thread::kNoDeoptId; } |
4637 | 4644 |
4638 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4645 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
4639 ASSERT(idx == 0); | 4646 ASSERT(idx == 0); |
4640 return from_representation(); | 4647 return from_representation(); |
4641 } | 4648 } |
4642 | 4649 |
4643 virtual bool AttributesEqual(Instruction* other) const { | 4650 virtual bool AttributesEqual(Instruction* other) const { |
4644 return other->AsBox()->from_representation() == from_representation(); | 4651 return other->AsBox()->from_representation() == from_representation(); |
4645 } | 4652 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4734 DISALLOW_COPY_AND_ASSIGN(BoxInt64Instr); | 4741 DISALLOW_COPY_AND_ASSIGN(BoxInt64Instr); |
4735 }; | 4742 }; |
4736 | 4743 |
4737 | 4744 |
4738 class UnboxInstr : public TemplateDefinition<1, NoThrow, Pure> { | 4745 class UnboxInstr : public TemplateDefinition<1, NoThrow, Pure> { |
4739 public: | 4746 public: |
4740 static UnboxInstr* Create(Representation to, Value* value, intptr_t deopt_id); | 4747 static UnboxInstr* Create(Representation to, Value* value, intptr_t deopt_id); |
4741 | 4748 |
4742 Value* value() const { return inputs_[0]; } | 4749 Value* value() const { return inputs_[0]; } |
4743 | 4750 |
4744 virtual bool CanDeoptimize() const { | 4751 virtual bool ComputeCanDeoptimize() const { |
4745 const intptr_t value_cid = value()->Type()->ToCid(); | 4752 const intptr_t value_cid = value()->Type()->ToCid(); |
4746 | 4753 |
4747 if (CanConvertSmi() && (value()->Type()->ToCid() == kSmiCid)) { | 4754 if (CanConvertSmi() && (value()->Type()->ToCid() == kSmiCid)) { |
4748 return false; | 4755 return false; |
4749 } | 4756 } |
4750 | 4757 |
4751 return (value_cid != BoxCid()); | 4758 return (value_cid != BoxCid()); |
4752 } | 4759 } |
4753 | 4760 |
4754 virtual Representation representation() const { return representation_; } | 4761 virtual Representation representation() const { return representation_; } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4836 }; | 4843 }; |
4837 | 4844 |
4838 | 4845 |
4839 class UnboxUint32Instr : public UnboxInteger32Instr { | 4846 class UnboxUint32Instr : public UnboxInteger32Instr { |
4840 public: | 4847 public: |
4841 UnboxUint32Instr(Value* value, intptr_t deopt_id) | 4848 UnboxUint32Instr(Value* value, intptr_t deopt_id) |
4842 : UnboxInteger32Instr(kUnboxedUint32, kTruncate, value, deopt_id) { | 4849 : UnboxInteger32Instr(kUnboxedUint32, kTruncate, value, deopt_id) { |
4843 ASSERT(is_truncating()); | 4850 ASSERT(is_truncating()); |
4844 } | 4851 } |
4845 | 4852 |
4846 virtual bool CanDeoptimize() const; | 4853 virtual bool ComputeCanDeoptimize() const; |
4847 | 4854 |
4848 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 4855 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
4849 | 4856 |
4850 DECLARE_INSTRUCTION_NO_BACKEND(UnboxUint32) | 4857 DECLARE_INSTRUCTION_NO_BACKEND(UnboxUint32) |
4851 | 4858 |
4852 private: | 4859 private: |
4853 DISALLOW_COPY_AND_ASSIGN(UnboxUint32Instr); | 4860 DISALLOW_COPY_AND_ASSIGN(UnboxUint32Instr); |
4854 }; | 4861 }; |
4855 | 4862 |
4856 | 4863 |
4857 class UnboxInt32Instr : public UnboxInteger32Instr { | 4864 class UnboxInt32Instr : public UnboxInteger32Instr { |
4858 public: | 4865 public: |
4859 UnboxInt32Instr(TruncationMode truncation_mode, | 4866 UnboxInt32Instr(TruncationMode truncation_mode, |
4860 Value* value, | 4867 Value* value, |
4861 intptr_t deopt_id) | 4868 intptr_t deopt_id) |
4862 : UnboxInteger32Instr(kUnboxedInt32, truncation_mode, value, deopt_id) {} | 4869 : UnboxInteger32Instr(kUnboxedInt32, truncation_mode, value, deopt_id) {} |
4863 | 4870 |
4864 virtual bool CanDeoptimize() const; | 4871 virtual bool ComputeCanDeoptimize() const; |
4865 | 4872 |
4866 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 4873 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
4867 | 4874 |
4868 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 4875 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
4869 | 4876 |
4870 DECLARE_INSTRUCTION_NO_BACKEND(UnboxInt32) | 4877 DECLARE_INSTRUCTION_NO_BACKEND(UnboxInt32) |
4871 | 4878 |
4872 private: | 4879 private: |
4873 DISALLOW_COPY_AND_ASSIGN(UnboxInt32Instr); | 4880 DISALLOW_COPY_AND_ASSIGN(UnboxInt32Instr); |
4874 }; | 4881 }; |
(...skipping 27 matching lines...) Expand all Loading... | |
4902 kDoubleSquare, | 4909 kDoubleSquare, |
4903 }; | 4910 }; |
4904 MathUnaryInstr(MathUnaryKind kind, Value* value, intptr_t deopt_id) | 4911 MathUnaryInstr(MathUnaryKind kind, Value* value, intptr_t deopt_id) |
4905 : TemplateDefinition(deopt_id), kind_(kind) { | 4912 : TemplateDefinition(deopt_id), kind_(kind) { |
4906 SetInputAt(0, value); | 4913 SetInputAt(0, value); |
4907 } | 4914 } |
4908 | 4915 |
4909 Value* value() const { return inputs_[0]; } | 4916 Value* value() const { return inputs_[0]; } |
4910 MathUnaryKind kind() const { return kind_; } | 4917 MathUnaryKind kind() const { return kind_; } |
4911 | 4918 |
4912 virtual bool CanDeoptimize() const { return false; } | 4919 virtual bool ComputeCanDeoptimize() const { return false; } |
4913 | 4920 |
4914 virtual Representation representation() const { return kUnboxedDouble; } | 4921 virtual Representation representation() const { return kUnboxedDouble; } |
4915 | 4922 |
4916 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4923 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
4917 ASSERT(idx == 0); | 4924 ASSERT(idx == 0); |
4918 return kUnboxedDouble; | 4925 return kUnboxedDouble; |
4919 } | 4926 } |
4920 | 4927 |
4921 virtual intptr_t DeoptimizationTarget() const { | 4928 virtual intptr_t DeoptimizationTarget() const { |
4922 // Direct access since this instruction cannot deoptimize, and the deopt-id | 4929 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4970 Value* str() const { return inputs_[0]; } | 4977 Value* str() const { return inputs_[0]; } |
4971 Value* lhs_index() const { return inputs_[1]; } | 4978 Value* lhs_index() const { return inputs_[1]; } |
4972 Value* rhs_index() const { return inputs_[2]; } | 4979 Value* rhs_index() const { return inputs_[2]; } |
4973 Value* length() const { return inputs_[3]; } | 4980 Value* length() const { return inputs_[3]; } |
4974 | 4981 |
4975 const RuntimeEntry& TargetFunction() const; | 4982 const RuntimeEntry& TargetFunction() const; |
4976 bool IsExternal() const { return cid_ == kExternalTwoByteStringCid; } | 4983 bool IsExternal() const { return cid_ == kExternalTwoByteStringCid; } |
4977 intptr_t class_id() const { return cid_; } | 4984 intptr_t class_id() const { return cid_; } |
4978 intptr_t index_scale() const { return Instance::ElementSizeFor(cid_); } | 4985 intptr_t index_scale() const { return Instance::ElementSizeFor(cid_); } |
4979 | 4986 |
4980 virtual bool CanDeoptimize() const { return false; } | 4987 virtual bool ComputeCanDeoptimize() const { return false; } |
4981 | 4988 |
4982 virtual Representation representation() const { return kTagged; } | 4989 virtual Representation representation() const { return kTagged; } |
4983 | 4990 |
4984 DECLARE_INSTRUCTION(CaseInsensitiveCompareUC16) | 4991 DECLARE_INSTRUCTION(CaseInsensitiveCompareUC16) |
4985 virtual CompileType ComputeType() const; | 4992 virtual CompileType ComputeType() const; |
4986 | 4993 |
4987 virtual bool AttributesEqual(Instruction* other) const { | 4994 virtual bool AttributesEqual(Instruction* other) const { |
4988 return other->AsCaseInsensitiveCompareUC16()->cid_ == cid_; | 4995 return other->AsCaseInsensitiveCompareUC16()->cid_ == cid_; |
4989 } | 4996 } |
4990 | 4997 |
(...skipping 20 matching lines...) Expand all Loading... | |
5011 SetInputAt(1, right_value); | 5018 SetInputAt(1, right_value); |
5012 } | 5019 } |
5013 | 5020 |
5014 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5021 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5015 | 5022 |
5016 Value* left() const { return inputs_[0]; } | 5023 Value* left() const { return inputs_[0]; } |
5017 Value* right() const { return inputs_[1]; } | 5024 Value* right() const { return inputs_[1]; } |
5018 | 5025 |
5019 intptr_t result_cid() const { return result_cid_; } | 5026 intptr_t result_cid() const { return result_cid_; } |
5020 | 5027 |
5021 virtual bool CanDeoptimize() const { return false; } | 5028 virtual bool ComputeCanDeoptimize() const { return false; } |
5022 | 5029 |
5023 virtual Representation representation() const { | 5030 virtual Representation representation() const { |
5024 if (result_cid() == kSmiCid) { | 5031 if (result_cid() == kSmiCid) { |
5025 return kTagged; | 5032 return kTagged; |
5026 } | 5033 } |
5027 ASSERT(result_cid() == kDoubleCid); | 5034 ASSERT(result_cid() == kDoubleCid); |
5028 return kUnboxedDouble; | 5035 return kUnboxedDouble; |
5029 } | 5036 } |
5030 | 5037 |
5031 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5038 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5066 SetInputAt(1, right); | 5073 SetInputAt(1, right); |
5067 } | 5074 } |
5068 | 5075 |
5069 Value* left() const { return inputs_[0]; } | 5076 Value* left() const { return inputs_[0]; } |
5070 Value* right() const { return inputs_[1]; } | 5077 Value* right() const { return inputs_[1]; } |
5071 | 5078 |
5072 Token::Kind op_kind() const { return op_kind_; } | 5079 Token::Kind op_kind() const { return op_kind_; } |
5073 | 5080 |
5074 virtual TokenPosition token_pos() const { return token_pos_; } | 5081 virtual TokenPosition token_pos() const { return token_pos_; } |
5075 | 5082 |
5076 virtual bool CanDeoptimize() const { return false; } | 5083 virtual bool ComputeCanDeoptimize() const { return false; } |
5077 | 5084 |
5078 virtual Representation representation() const { return kUnboxedDouble; } | 5085 virtual Representation representation() const { return kUnboxedDouble; } |
5079 | 5086 |
5080 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5087 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5081 ASSERT((idx == 0) || (idx == 1)); | 5088 ASSERT((idx == 0) || (idx == 1)); |
5082 return kUnboxedDouble; | 5089 return kUnboxedDouble; |
5083 } | 5090 } |
5084 | 5091 |
5085 virtual intptr_t DeoptimizationTarget() const { | 5092 virtual intptr_t DeoptimizationTarget() const { |
5086 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5093 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 27 matching lines...) Expand all Loading... | |
5114 intptr_t deopt_id, | 5121 intptr_t deopt_id, |
5115 TokenPosition token_pos) | 5122 TokenPosition token_pos) |
5116 : TemplateComparison(token_pos, Token::kEQ, deopt_id), op_kind_(op_kind) { | 5123 : TemplateComparison(token_pos, Token::kEQ, deopt_id), op_kind_(op_kind) { |
5117 SetInputAt(0, value); | 5124 SetInputAt(0, value); |
5118 } | 5125 } |
5119 | 5126 |
5120 Value* value() const { return InputAt(0); } | 5127 Value* value() const { return InputAt(0); } |
5121 | 5128 |
5122 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5129 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5123 | 5130 |
5124 virtual bool CanDeoptimize() const { return false; } | 5131 virtual bool ComputeCanDeoptimize() const { return false; } |
5125 | 5132 |
5126 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5133 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5127 ASSERT(idx == 0); | 5134 ASSERT(idx == 0); |
5128 return kUnboxedDouble; | 5135 return kUnboxedDouble; |
5129 } | 5136 } |
5130 | 5137 |
5131 PRINT_OPERANDS_TO_SUPPORT | 5138 PRINT_OPERANDS_TO_SUPPORT |
5132 | 5139 |
5133 DECLARE_INSTRUCTION(DoubleTestOp) | 5140 DECLARE_INSTRUCTION(DoubleTestOp) |
5134 virtual CompileType ComputeType() const; | 5141 virtual CompileType ComputeType() const; |
(...skipping 28 matching lines...) Expand all Loading... | |
5163 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 5170 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
5164 SetInputAt(0, left); | 5171 SetInputAt(0, left); |
5165 SetInputAt(1, right); | 5172 SetInputAt(1, right); |
5166 } | 5173 } |
5167 | 5174 |
5168 Value* left() const { return inputs_[0]; } | 5175 Value* left() const { return inputs_[0]; } |
5169 Value* right() const { return inputs_[1]; } | 5176 Value* right() const { return inputs_[1]; } |
5170 | 5177 |
5171 Token::Kind op_kind() const { return op_kind_; } | 5178 Token::Kind op_kind() const { return op_kind_; } |
5172 | 5179 |
5173 virtual bool CanDeoptimize() const { return false; } | 5180 virtual bool ComputeCanDeoptimize() const { return false; } |
5174 | 5181 |
5175 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5182 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5176 | 5183 |
5177 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5184 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5178 ASSERT((idx == 0) || (idx == 1)); | 5185 ASSERT((idx == 0) || (idx == 1)); |
5179 return kUnboxedFloat32x4; | 5186 return kUnboxedFloat32x4; |
5180 } | 5187 } |
5181 | 5188 |
5182 virtual intptr_t DeoptimizationTarget() const { | 5189 virtual intptr_t DeoptimizationTarget() const { |
5183 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5190 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 26 matching lines...) Expand all Loading... | |
5210 : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) { | 5217 : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) { |
5211 SetInputAt(0, value); | 5218 SetInputAt(0, value); |
5212 } | 5219 } |
5213 | 5220 |
5214 Value* value() const { return inputs_[0]; } | 5221 Value* value() const { return inputs_[0]; } |
5215 | 5222 |
5216 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5223 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5217 | 5224 |
5218 intptr_t mask() const { return mask_; } | 5225 intptr_t mask() const { return mask_; } |
5219 | 5226 |
5220 virtual bool CanDeoptimize() const { return false; } | 5227 virtual bool ComputeCanDeoptimize() const { return false; } |
5221 | 5228 |
5222 virtual Representation representation() const { | 5229 virtual Representation representation() const { |
5223 if ((op_kind_ == MethodRecognizer::kFloat32x4ShuffleX) || | 5230 if ((op_kind_ == MethodRecognizer::kFloat32x4ShuffleX) || |
5224 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleY) || | 5231 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleY) || |
5225 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleZ) || | 5232 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleZ) || |
5226 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleW)) { | 5233 (op_kind_ == MethodRecognizer::kFloat32x4ShuffleW)) { |
5227 return kUnboxedDouble; | 5234 return kUnboxedDouble; |
5228 } | 5235 } |
5229 if ((op_kind_ == MethodRecognizer::kInt32x4Shuffle)) { | 5236 if ((op_kind_ == MethodRecognizer::kInt32x4Shuffle)) { |
5230 return kUnboxedInt32x4; | 5237 return kUnboxedInt32x4; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5282 SetInputAt(1, zw); | 5289 SetInputAt(1, zw); |
5283 } | 5290 } |
5284 | 5291 |
5285 Value* xy() const { return inputs_[0]; } | 5292 Value* xy() const { return inputs_[0]; } |
5286 Value* zw() const { return inputs_[1]; } | 5293 Value* zw() const { return inputs_[1]; } |
5287 | 5294 |
5288 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5295 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5289 | 5296 |
5290 intptr_t mask() const { return mask_; } | 5297 intptr_t mask() const { return mask_; } |
5291 | 5298 |
5292 virtual bool CanDeoptimize() const { return false; } | 5299 virtual bool ComputeCanDeoptimize() const { return false; } |
5293 | 5300 |
5294 virtual Representation representation() const { | 5301 virtual Representation representation() const { |
5295 if (op_kind() == MethodRecognizer::kInt32x4ShuffleMix) { | 5302 if (op_kind() == MethodRecognizer::kInt32x4ShuffleMix) { |
5296 return kUnboxedInt32x4; | 5303 return kUnboxedInt32x4; |
5297 } | 5304 } |
5298 ASSERT(op_kind() == MethodRecognizer::kFloat32x4ShuffleMix); | 5305 ASSERT(op_kind() == MethodRecognizer::kFloat32x4ShuffleMix); |
5299 return kUnboxedFloat32x4; | 5306 return kUnboxedFloat32x4; |
5300 } | 5307 } |
5301 | 5308 |
5302 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5309 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5344 SetInputAt(1, value1); | 5351 SetInputAt(1, value1); |
5345 SetInputAt(2, value2); | 5352 SetInputAt(2, value2); |
5346 SetInputAt(3, value3); | 5353 SetInputAt(3, value3); |
5347 } | 5354 } |
5348 | 5355 |
5349 Value* value0() const { return inputs_[0]; } | 5356 Value* value0() const { return inputs_[0]; } |
5350 Value* value1() const { return inputs_[1]; } | 5357 Value* value1() const { return inputs_[1]; } |
5351 Value* value2() const { return inputs_[2]; } | 5358 Value* value2() const { return inputs_[2]; } |
5352 Value* value3() const { return inputs_[3]; } | 5359 Value* value3() const { return inputs_[3]; } |
5353 | 5360 |
5354 virtual bool CanDeoptimize() const { return false; } | 5361 virtual bool ComputeCanDeoptimize() const { return false; } |
5355 | 5362 |
5356 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5363 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5357 | 5364 |
5358 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5365 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5359 ASSERT(idx >= 0 && idx < 4); | 5366 ASSERT(idx >= 0 && idx < 4); |
5360 return kUnboxedDouble; | 5367 return kUnboxedDouble; |
5361 } | 5368 } |
5362 | 5369 |
5363 virtual intptr_t DeoptimizationTarget() const { | 5370 virtual intptr_t DeoptimizationTarget() const { |
5364 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5371 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 15 matching lines...) Expand all Loading... | |
5380 | 5387 |
5381 class Float32x4SplatInstr : public TemplateDefinition<1, NoThrow, Pure> { | 5388 class Float32x4SplatInstr : public TemplateDefinition<1, NoThrow, Pure> { |
5382 public: | 5389 public: |
5383 Float32x4SplatInstr(Value* value, intptr_t deopt_id) | 5390 Float32x4SplatInstr(Value* value, intptr_t deopt_id) |
5384 : TemplateDefinition(deopt_id) { | 5391 : TemplateDefinition(deopt_id) { |
5385 SetInputAt(0, value); | 5392 SetInputAt(0, value); |
5386 } | 5393 } |
5387 | 5394 |
5388 Value* value() const { return inputs_[0]; } | 5395 Value* value() const { return inputs_[0]; } |
5389 | 5396 |
5390 virtual bool CanDeoptimize() const { return false; } | 5397 virtual bool ComputeCanDeoptimize() const { return false; } |
5391 | 5398 |
5392 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5399 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5393 | 5400 |
5394 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5401 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5395 ASSERT(idx == 0); | 5402 ASSERT(idx == 0); |
5396 return kUnboxedDouble; | 5403 return kUnboxedDouble; |
5397 } | 5404 } |
5398 | 5405 |
5399 virtual intptr_t DeoptimizationTarget() const { | 5406 virtual intptr_t DeoptimizationTarget() const { |
5400 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5407 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 11 matching lines...) Expand all Loading... | |
5412 private: | 5419 private: |
5413 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr); | 5420 DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr); |
5414 }; | 5421 }; |
5415 | 5422 |
5416 | 5423 |
5417 // TODO(vegorov) replace with UnboxedConstantInstr. | 5424 // TODO(vegorov) replace with UnboxedConstantInstr. |
5418 class Float32x4ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> { | 5425 class Float32x4ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> { |
5419 public: | 5426 public: |
5420 Float32x4ZeroInstr() {} | 5427 Float32x4ZeroInstr() {} |
5421 | 5428 |
5422 virtual bool CanDeoptimize() const { return false; } | 5429 virtual bool ComputeCanDeoptimize() const { return false; } |
5423 | 5430 |
5424 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5431 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5425 | 5432 |
5426 DECLARE_INSTRUCTION(Float32x4Zero) | 5433 DECLARE_INSTRUCTION(Float32x4Zero) |
5427 virtual CompileType ComputeType() const; | 5434 virtual CompileType ComputeType() const; |
5428 | 5435 |
5429 virtual bool AttributesEqual(Instruction* other) const { return true; } | 5436 virtual bool AttributesEqual(Instruction* other) const { return true; } |
5430 | 5437 |
5431 private: | 5438 private: |
5432 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr); | 5439 DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr); |
5433 }; | 5440 }; |
5434 | 5441 |
5435 | 5442 |
5436 class Float32x4ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> { | 5443 class Float32x4ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> { |
5437 public: | 5444 public: |
5438 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, | 5445 Float32x4ComparisonInstr(MethodRecognizer::Kind op_kind, |
5439 Value* left, | 5446 Value* left, |
5440 Value* right, | 5447 Value* right, |
5441 intptr_t deopt_id) | 5448 intptr_t deopt_id) |
5442 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 5449 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
5443 SetInputAt(0, left); | 5450 SetInputAt(0, left); |
5444 SetInputAt(1, right); | 5451 SetInputAt(1, right); |
5445 } | 5452 } |
5446 | 5453 |
5447 Value* left() const { return inputs_[0]; } | 5454 Value* left() const { return inputs_[0]; } |
5448 Value* right() const { return inputs_[1]; } | 5455 Value* right() const { return inputs_[1]; } |
5449 | 5456 |
5450 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5457 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5451 | 5458 |
5452 virtual bool CanDeoptimize() const { return false; } | 5459 virtual bool ComputeCanDeoptimize() const { return false; } |
5453 | 5460 |
5454 virtual Representation representation() const { return kUnboxedInt32x4; } | 5461 virtual Representation representation() const { return kUnboxedInt32x4; } |
5455 | 5462 |
5456 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5463 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5457 ASSERT((idx == 0) || (idx == 1)); | 5464 ASSERT((idx == 0) || (idx == 1)); |
5458 return kUnboxedFloat32x4; | 5465 return kUnboxedFloat32x4; |
5459 } | 5466 } |
5460 | 5467 |
5461 virtual intptr_t DeoptimizationTarget() const { | 5468 virtual intptr_t DeoptimizationTarget() const { |
5462 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5469 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 26 matching lines...) Expand all Loading... | |
5489 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 5496 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
5490 SetInputAt(0, left); | 5497 SetInputAt(0, left); |
5491 SetInputAt(1, right); | 5498 SetInputAt(1, right); |
5492 } | 5499 } |
5493 | 5500 |
5494 Value* left() const { return inputs_[0]; } | 5501 Value* left() const { return inputs_[0]; } |
5495 Value* right() const { return inputs_[1]; } | 5502 Value* right() const { return inputs_[1]; } |
5496 | 5503 |
5497 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5504 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5498 | 5505 |
5499 virtual bool CanDeoptimize() const { return false; } | 5506 virtual bool ComputeCanDeoptimize() const { return false; } |
5500 | 5507 |
5501 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5508 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5502 | 5509 |
5503 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5510 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5504 ASSERT((idx == 0) || (idx == 1)); | 5511 ASSERT((idx == 0) || (idx == 1)); |
5505 return kUnboxedFloat32x4; | 5512 return kUnboxedFloat32x4; |
5506 } | 5513 } |
5507 | 5514 |
5508 virtual intptr_t DeoptimizationTarget() const { | 5515 virtual intptr_t DeoptimizationTarget() const { |
5509 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5516 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 26 matching lines...) Expand all Loading... | |
5536 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 5543 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
5537 SetInputAt(0, left); | 5544 SetInputAt(0, left); |
5538 SetInputAt(1, right); | 5545 SetInputAt(1, right); |
5539 } | 5546 } |
5540 | 5547 |
5541 Value* left() const { return inputs_[0]; } | 5548 Value* left() const { return inputs_[0]; } |
5542 Value* right() const { return inputs_[1]; } | 5549 Value* right() const { return inputs_[1]; } |
5543 | 5550 |
5544 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5551 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5545 | 5552 |
5546 virtual bool CanDeoptimize() const { return false; } | 5553 virtual bool ComputeCanDeoptimize() const { return false; } |
5547 | 5554 |
5548 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5555 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5549 | 5556 |
5550 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5557 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5551 ASSERT((idx == 0) || (idx == 1)); | 5558 ASSERT((idx == 0) || (idx == 1)); |
5552 if (idx == 0) { | 5559 if (idx == 0) { |
5553 return kUnboxedDouble; | 5560 return kUnboxedDouble; |
5554 } | 5561 } |
5555 return kUnboxedFloat32x4; | 5562 return kUnboxedFloat32x4; |
5556 } | 5563 } |
(...skipping 26 matching lines...) Expand all Loading... | |
5583 Value* left, | 5590 Value* left, |
5584 intptr_t deopt_id) | 5591 intptr_t deopt_id) |
5585 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 5592 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
5586 SetInputAt(0, left); | 5593 SetInputAt(0, left); |
5587 } | 5594 } |
5588 | 5595 |
5589 Value* left() const { return inputs_[0]; } | 5596 Value* left() const { return inputs_[0]; } |
5590 | 5597 |
5591 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5598 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5592 | 5599 |
5593 virtual bool CanDeoptimize() const { return false; } | 5600 virtual bool ComputeCanDeoptimize() const { return false; } |
5594 | 5601 |
5595 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5602 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5596 | 5603 |
5597 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5604 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5598 ASSERT(idx == 0); | 5605 ASSERT(idx == 0); |
5599 return kUnboxedFloat32x4; | 5606 return kUnboxedFloat32x4; |
5600 } | 5607 } |
5601 | 5608 |
5602 virtual intptr_t DeoptimizationTarget() const { | 5609 virtual intptr_t DeoptimizationTarget() const { |
5603 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5610 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 24 matching lines...) Expand all Loading... | |
5628 Value* left, | 5635 Value* left, |
5629 intptr_t deopt_id) | 5636 intptr_t deopt_id) |
5630 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 5637 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
5631 SetInputAt(0, left); | 5638 SetInputAt(0, left); |
5632 } | 5639 } |
5633 | 5640 |
5634 Value* left() const { return inputs_[0]; } | 5641 Value* left() const { return inputs_[0]; } |
5635 | 5642 |
5636 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5643 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5637 | 5644 |
5638 virtual bool CanDeoptimize() const { return false; } | 5645 virtual bool ComputeCanDeoptimize() const { return false; } |
5639 | 5646 |
5640 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5647 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5641 | 5648 |
5642 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5649 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5643 ASSERT(idx == 0); | 5650 ASSERT(idx == 0); |
5644 return kUnboxedFloat32x4; | 5651 return kUnboxedFloat32x4; |
5645 } | 5652 } |
5646 | 5653 |
5647 virtual intptr_t DeoptimizationTarget() const { | 5654 virtual intptr_t DeoptimizationTarget() const { |
5648 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5655 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 26 matching lines...) Expand all Loading... | |
5675 : TemplateDefinition(deopt_id) { | 5682 : TemplateDefinition(deopt_id) { |
5676 SetInputAt(0, left); | 5683 SetInputAt(0, left); |
5677 SetInputAt(1, lower); | 5684 SetInputAt(1, lower); |
5678 SetInputAt(2, upper); | 5685 SetInputAt(2, upper); |
5679 } | 5686 } |
5680 | 5687 |
5681 Value* left() const { return inputs_[0]; } | 5688 Value* left() const { return inputs_[0]; } |
5682 Value* lower() const { return inputs_[1]; } | 5689 Value* lower() const { return inputs_[1]; } |
5683 Value* upper() const { return inputs_[2]; } | 5690 Value* upper() const { return inputs_[2]; } |
5684 | 5691 |
5685 virtual bool CanDeoptimize() const { return false; } | 5692 virtual bool ComputeCanDeoptimize() const { return false; } |
5686 | 5693 |
5687 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5694 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5688 | 5695 |
5689 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5696 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5690 ASSERT((idx == 0) || (idx == 1) || (idx == 2)); | 5697 ASSERT((idx == 0) || (idx == 1) || (idx == 2)); |
5691 return kUnboxedFloat32x4; | 5698 return kUnboxedFloat32x4; |
5692 } | 5699 } |
5693 | 5700 |
5694 virtual intptr_t DeoptimizationTarget() const { | 5701 virtual intptr_t DeoptimizationTarget() const { |
5695 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5702 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 22 matching lines...) Expand all Loading... | |
5718 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 5725 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
5719 SetInputAt(0, replacement); | 5726 SetInputAt(0, replacement); |
5720 SetInputAt(1, left); | 5727 SetInputAt(1, left); |
5721 } | 5728 } |
5722 | 5729 |
5723 Value* left() const { return inputs_[1]; } | 5730 Value* left() const { return inputs_[1]; } |
5724 Value* replacement() const { return inputs_[0]; } | 5731 Value* replacement() const { return inputs_[0]; } |
5725 | 5732 |
5726 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5733 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5727 | 5734 |
5728 virtual bool CanDeoptimize() const { return false; } | 5735 virtual bool ComputeCanDeoptimize() const { return false; } |
5729 | 5736 |
5730 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5737 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5731 | 5738 |
5732 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5739 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5733 ASSERT((idx == 0) || (idx == 1)); | 5740 ASSERT((idx == 0) || (idx == 1)); |
5734 if (idx == 0) { | 5741 if (idx == 0) { |
5735 return kUnboxedDouble; | 5742 return kUnboxedDouble; |
5736 } | 5743 } |
5737 return kUnboxedFloat32x4; | 5744 return kUnboxedFloat32x4; |
5738 } | 5745 } |
(...skipping 29 matching lines...) Expand all Loading... | |
5768 : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) { | 5775 : TemplateDefinition(deopt_id), op_kind_(op_kind), mask_(mask) { |
5769 SetInputAt(0, value); | 5776 SetInputAt(0, value); |
5770 } | 5777 } |
5771 | 5778 |
5772 Value* value() const { return inputs_[0]; } | 5779 Value* value() const { return inputs_[0]; } |
5773 | 5780 |
5774 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 5781 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
5775 | 5782 |
5776 intptr_t mask() const { return mask_; } | 5783 intptr_t mask() const { return mask_; } |
5777 | 5784 |
5778 virtual bool CanDeoptimize() const { return false; } | 5785 virtual bool ComputeCanDeoptimize() const { return false; } |
5779 | 5786 |
5780 virtual Representation representation() const { | 5787 virtual Representation representation() const { |
5781 if ((op_kind_ == MethodRecognizer::kFloat64x2GetX) || | 5788 if ((op_kind_ == MethodRecognizer::kFloat64x2GetX) || |
5782 (op_kind_ == MethodRecognizer::kFloat64x2GetY)) { | 5789 (op_kind_ == MethodRecognizer::kFloat64x2GetY)) { |
5783 return kUnboxedDouble; | 5790 return kUnboxedDouble; |
5784 } | 5791 } |
5785 UNIMPLEMENTED(); | 5792 UNIMPLEMENTED(); |
5786 return kUnboxedDouble; | 5793 return kUnboxedDouble; |
5787 } | 5794 } |
5788 | 5795 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5822 | 5829 |
5823 class Float32x4ToInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> { | 5830 class Float32x4ToInt32x4Instr : public TemplateDefinition<1, NoThrow, Pure> { |
5824 public: | 5831 public: |
5825 Float32x4ToInt32x4Instr(Value* left, intptr_t deopt_id) | 5832 Float32x4ToInt32x4Instr(Value* left, intptr_t deopt_id) |
5826 : TemplateDefinition(deopt_id) { | 5833 : TemplateDefinition(deopt_id) { |
5827 SetInputAt(0, left); | 5834 SetInputAt(0, left); |
5828 } | 5835 } |
5829 | 5836 |
5830 Value* left() const { return inputs_[0]; } | 5837 Value* left() const { return inputs_[0]; } |
5831 | 5838 |
5832 virtual bool CanDeoptimize() const { return false; } | 5839 virtual bool ComputeCanDeoptimize() const { return false; } |
5833 | 5840 |
5834 virtual Representation representation() const { return kUnboxedInt32x4; } | 5841 virtual Representation representation() const { return kUnboxedInt32x4; } |
5835 | 5842 |
5836 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5843 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5837 ASSERT(idx == 0); | 5844 ASSERT(idx == 0); |
5838 return kUnboxedFloat32x4; | 5845 return kUnboxedFloat32x4; |
5839 } | 5846 } |
5840 | 5847 |
5841 virtual intptr_t DeoptimizationTarget() const { | 5848 virtual intptr_t DeoptimizationTarget() const { |
5842 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5849 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 15 matching lines...) Expand all Loading... | |
5858 | 5865 |
5859 class Float32x4ToFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> { | 5866 class Float32x4ToFloat64x2Instr : public TemplateDefinition<1, NoThrow, Pure> { |
5860 public: | 5867 public: |
5861 Float32x4ToFloat64x2Instr(Value* left, intptr_t deopt_id) | 5868 Float32x4ToFloat64x2Instr(Value* left, intptr_t deopt_id) |
5862 : TemplateDefinition(deopt_id) { | 5869 : TemplateDefinition(deopt_id) { |
5863 SetInputAt(0, left); | 5870 SetInputAt(0, left); |
5864 } | 5871 } |
5865 | 5872 |
5866 Value* left() const { return inputs_[0]; } | 5873 Value* left() const { return inputs_[0]; } |
5867 | 5874 |
5868 virtual bool CanDeoptimize() const { return false; } | 5875 virtual bool ComputeCanDeoptimize() const { return false; } |
5869 | 5876 |
5870 virtual Representation representation() const { return kUnboxedFloat64x2; } | 5877 virtual Representation representation() const { return kUnboxedFloat64x2; } |
5871 | 5878 |
5872 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5879 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5873 ASSERT(idx == 0); | 5880 ASSERT(idx == 0); |
5874 return kUnboxedFloat32x4; | 5881 return kUnboxedFloat32x4; |
5875 } | 5882 } |
5876 | 5883 |
5877 virtual intptr_t DeoptimizationTarget() const { | 5884 virtual intptr_t DeoptimizationTarget() const { |
5878 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5885 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 15 matching lines...) Expand all Loading... | |
5894 | 5901 |
5895 class Float64x2ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> { | 5902 class Float64x2ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> { |
5896 public: | 5903 public: |
5897 Float64x2ToFloat32x4Instr(Value* left, intptr_t deopt_id) | 5904 Float64x2ToFloat32x4Instr(Value* left, intptr_t deopt_id) |
5898 : TemplateDefinition(deopt_id) { | 5905 : TemplateDefinition(deopt_id) { |
5899 SetInputAt(0, left); | 5906 SetInputAt(0, left); |
5900 } | 5907 } |
5901 | 5908 |
5902 Value* left() const { return inputs_[0]; } | 5909 Value* left() const { return inputs_[0]; } |
5903 | 5910 |
5904 virtual bool CanDeoptimize() const { return false; } | 5911 virtual bool ComputeCanDeoptimize() const { return false; } |
5905 | 5912 |
5906 virtual Representation representation() const { return kUnboxedFloat32x4; } | 5913 virtual Representation representation() const { return kUnboxedFloat32x4; } |
5907 | 5914 |
5908 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5915 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5909 ASSERT(idx == 0); | 5916 ASSERT(idx == 0); |
5910 return kUnboxedFloat64x2; | 5917 return kUnboxedFloat64x2; |
5911 } | 5918 } |
5912 | 5919 |
5913 virtual intptr_t DeoptimizationTarget() const { | 5920 virtual intptr_t DeoptimizationTarget() const { |
5914 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5921 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 17 matching lines...) Expand all Loading... | |
5932 public: | 5939 public: |
5933 Float64x2ConstructorInstr(Value* value0, Value* value1, intptr_t deopt_id) | 5940 Float64x2ConstructorInstr(Value* value0, Value* value1, intptr_t deopt_id) |
5934 : TemplateDefinition(deopt_id) { | 5941 : TemplateDefinition(deopt_id) { |
5935 SetInputAt(0, value0); | 5942 SetInputAt(0, value0); |
5936 SetInputAt(1, value1); | 5943 SetInputAt(1, value1); |
5937 } | 5944 } |
5938 | 5945 |
5939 Value* value0() const { return inputs_[0]; } | 5946 Value* value0() const { return inputs_[0]; } |
5940 Value* value1() const { return inputs_[1]; } | 5947 Value* value1() const { return inputs_[1]; } |
5941 | 5948 |
5942 virtual bool CanDeoptimize() const { return false; } | 5949 virtual bool ComputeCanDeoptimize() const { return false; } |
5943 | 5950 |
5944 virtual Representation representation() const { return kUnboxedFloat64x2; } | 5951 virtual Representation representation() const { return kUnboxedFloat64x2; } |
5945 | 5952 |
5946 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5953 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5947 ASSERT(idx >= 0 && idx < 2); | 5954 ASSERT(idx >= 0 && idx < 2); |
5948 return kUnboxedDouble; | 5955 return kUnboxedDouble; |
5949 } | 5956 } |
5950 | 5957 |
5951 virtual intptr_t DeoptimizationTarget() const { | 5958 virtual intptr_t DeoptimizationTarget() const { |
5952 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5959 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 15 matching lines...) Expand all Loading... | |
5968 | 5975 |
5969 class Float64x2SplatInstr : public TemplateDefinition<1, NoThrow, Pure> { | 5976 class Float64x2SplatInstr : public TemplateDefinition<1, NoThrow, Pure> { |
5970 public: | 5977 public: |
5971 Float64x2SplatInstr(Value* value, intptr_t deopt_id) | 5978 Float64x2SplatInstr(Value* value, intptr_t deopt_id) |
5972 : TemplateDefinition(deopt_id) { | 5979 : TemplateDefinition(deopt_id) { |
5973 SetInputAt(0, value); | 5980 SetInputAt(0, value); |
5974 } | 5981 } |
5975 | 5982 |
5976 Value* value() const { return inputs_[0]; } | 5983 Value* value() const { return inputs_[0]; } |
5977 | 5984 |
5978 virtual bool CanDeoptimize() const { return false; } | 5985 virtual bool ComputeCanDeoptimize() const { return false; } |
5979 | 5986 |
5980 virtual Representation representation() const { return kUnboxedFloat64x2; } | 5987 virtual Representation representation() const { return kUnboxedFloat64x2; } |
5981 | 5988 |
5982 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 5989 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
5983 ASSERT(idx == 0); | 5990 ASSERT(idx == 0); |
5984 return kUnboxedDouble; | 5991 return kUnboxedDouble; |
5985 } | 5992 } |
5986 | 5993 |
5987 virtual intptr_t DeoptimizationTarget() const { | 5994 virtual intptr_t DeoptimizationTarget() const { |
5988 // Direct access since this instruction cannot deoptimize, and the deopt-id | 5995 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 10 matching lines...) Expand all Loading... | |
5999 | 6006 |
6000 private: | 6007 private: |
6001 DISALLOW_COPY_AND_ASSIGN(Float64x2SplatInstr); | 6008 DISALLOW_COPY_AND_ASSIGN(Float64x2SplatInstr); |
6002 }; | 6009 }; |
6003 | 6010 |
6004 | 6011 |
6005 class Float64x2ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> { | 6012 class Float64x2ZeroInstr : public TemplateDefinition<0, NoThrow, Pure> { |
6006 public: | 6013 public: |
6007 Float64x2ZeroInstr() {} | 6014 Float64x2ZeroInstr() {} |
6008 | 6015 |
6009 virtual bool CanDeoptimize() const { return false; } | 6016 virtual bool ComputeCanDeoptimize() const { return false; } |
6010 | 6017 |
6011 virtual Representation representation() const { return kUnboxedFloat64x2; } | 6018 virtual Representation representation() const { return kUnboxedFloat64x2; } |
6012 | 6019 |
6013 DECLARE_INSTRUCTION(Float64x2Zero) | 6020 DECLARE_INSTRUCTION(Float64x2Zero) |
6014 virtual CompileType ComputeType() const; | 6021 virtual CompileType ComputeType() const; |
6015 | 6022 |
6016 virtual bool AttributesEqual(Instruction* other) const { return true; } | 6023 virtual bool AttributesEqual(Instruction* other) const { return true; } |
6017 | 6024 |
6018 private: | 6025 private: |
6019 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroInstr); | 6026 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroInstr); |
6020 }; | 6027 }; |
6021 | 6028 |
6022 | 6029 |
6023 // TODO(vegorov) rename to Unary to match arithmetic instructions. | 6030 // TODO(vegorov) rename to Unary to match arithmetic instructions. |
6024 class Float64x2ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> { | 6031 class Float64x2ZeroArgInstr : public TemplateDefinition<1, NoThrow, Pure> { |
6025 public: | 6032 public: |
6026 Float64x2ZeroArgInstr(MethodRecognizer::Kind op_kind, | 6033 Float64x2ZeroArgInstr(MethodRecognizer::Kind op_kind, |
6027 Value* left, | 6034 Value* left, |
6028 intptr_t deopt_id) | 6035 intptr_t deopt_id) |
6029 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 6036 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
6030 SetInputAt(0, left); | 6037 SetInputAt(0, left); |
6031 } | 6038 } |
6032 | 6039 |
6033 Value* left() const { return inputs_[0]; } | 6040 Value* left() const { return inputs_[0]; } |
6034 | 6041 |
6035 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 6042 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
6036 | 6043 |
6037 virtual bool CanDeoptimize() const { return false; } | 6044 virtual bool ComputeCanDeoptimize() const { return false; } |
6038 | 6045 |
6039 virtual Representation representation() const { | 6046 virtual Representation representation() const { |
6040 if (op_kind() == MethodRecognizer::kFloat64x2GetSignMask) { | 6047 if (op_kind() == MethodRecognizer::kFloat64x2GetSignMask) { |
6041 // Smi. | 6048 // Smi. |
6042 return kTagged; | 6049 return kTagged; |
6043 } | 6050 } |
6044 return kUnboxedFloat64x2; | 6051 return kUnboxedFloat64x2; |
6045 } | 6052 } |
6046 | 6053 |
6047 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6054 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6080 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 6087 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
6081 SetInputAt(0, left); | 6088 SetInputAt(0, left); |
6082 SetInputAt(1, right); | 6089 SetInputAt(1, right); |
6083 } | 6090 } |
6084 | 6091 |
6085 Value* left() const { return inputs_[0]; } | 6092 Value* left() const { return inputs_[0]; } |
6086 Value* right() const { return inputs_[1]; } | 6093 Value* right() const { return inputs_[1]; } |
6087 | 6094 |
6088 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 6095 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
6089 | 6096 |
6090 virtual bool CanDeoptimize() const { return false; } | 6097 virtual bool ComputeCanDeoptimize() const { return false; } |
6091 | 6098 |
6092 virtual Representation representation() const { return kUnboxedFloat64x2; } | 6099 virtual Representation representation() const { return kUnboxedFloat64x2; } |
6093 | 6100 |
6094 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6101 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6095 if (idx == 0) { | 6102 if (idx == 0) { |
6096 return kUnboxedFloat64x2; | 6103 return kUnboxedFloat64x2; |
6097 } | 6104 } |
6098 ASSERT(idx == 1); | 6105 ASSERT(idx == 1); |
6099 if ((op_kind() == MethodRecognizer::kFloat64x2WithX) || | 6106 if ((op_kind() == MethodRecognizer::kFloat64x2WithX) || |
6100 (op_kind() == MethodRecognizer::kFloat64x2WithY) || | 6107 (op_kind() == MethodRecognizer::kFloat64x2WithY) || |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6138 SetInputAt(1, value1); | 6145 SetInputAt(1, value1); |
6139 SetInputAt(2, value2); | 6146 SetInputAt(2, value2); |
6140 SetInputAt(3, value3); | 6147 SetInputAt(3, value3); |
6141 } | 6148 } |
6142 | 6149 |
6143 Value* value0() const { return inputs_[0]; } | 6150 Value* value0() const { return inputs_[0]; } |
6144 Value* value1() const { return inputs_[1]; } | 6151 Value* value1() const { return inputs_[1]; } |
6145 Value* value2() const { return inputs_[2]; } | 6152 Value* value2() const { return inputs_[2]; } |
6146 Value* value3() const { return inputs_[3]; } | 6153 Value* value3() const { return inputs_[3]; } |
6147 | 6154 |
6148 virtual bool CanDeoptimize() const { return false; } | 6155 virtual bool ComputeCanDeoptimize() const { return false; } |
6149 | 6156 |
6150 virtual Representation representation() const { return kUnboxedInt32x4; } | 6157 virtual Representation representation() const { return kUnboxedInt32x4; } |
6151 | 6158 |
6152 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6159 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6153 ASSERT((idx >= 0) && (idx < 4)); | 6160 ASSERT((idx >= 0) && (idx < 4)); |
6154 return kUnboxedInt32; | 6161 return kUnboxedInt32; |
6155 } | 6162 } |
6156 | 6163 |
6157 virtual intptr_t DeoptimizationTarget() const { | 6164 virtual intptr_t DeoptimizationTarget() const { |
6158 // Direct access since this instruction cannot deoptimize, and the deopt-id | 6165 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 26 matching lines...) Expand all Loading... | |
6185 SetInputAt(1, value1); | 6192 SetInputAt(1, value1); |
6186 SetInputAt(2, value2); | 6193 SetInputAt(2, value2); |
6187 SetInputAt(3, value3); | 6194 SetInputAt(3, value3); |
6188 } | 6195 } |
6189 | 6196 |
6190 Value* value0() const { return inputs_[0]; } | 6197 Value* value0() const { return inputs_[0]; } |
6191 Value* value1() const { return inputs_[1]; } | 6198 Value* value1() const { return inputs_[1]; } |
6192 Value* value2() const { return inputs_[2]; } | 6199 Value* value2() const { return inputs_[2]; } |
6193 Value* value3() const { return inputs_[3]; } | 6200 Value* value3() const { return inputs_[3]; } |
6194 | 6201 |
6195 virtual bool CanDeoptimize() const { return false; } | 6202 virtual bool ComputeCanDeoptimize() const { return false; } |
6196 | 6203 |
6197 virtual Representation representation() const { return kUnboxedInt32x4; } | 6204 virtual Representation representation() const { return kUnboxedInt32x4; } |
6198 | 6205 |
6199 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6206 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6200 ASSERT((idx >= 0) && (idx < 4)); | 6207 ASSERT((idx >= 0) && (idx < 4)); |
6201 return kTagged; | 6208 return kTagged; |
6202 } | 6209 } |
6203 | 6210 |
6204 virtual intptr_t DeoptimizationTarget() const { | 6211 virtual intptr_t DeoptimizationTarget() const { |
6205 // Direct access since this instruction cannot deoptimize, and the deopt-id | 6212 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 19 matching lines...) Expand all Loading... | |
6225 Value* value, | 6232 Value* value, |
6226 intptr_t deopt_id) | 6233 intptr_t deopt_id) |
6227 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 6234 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
6228 SetInputAt(0, value); | 6235 SetInputAt(0, value); |
6229 } | 6236 } |
6230 | 6237 |
6231 Value* value() const { return inputs_[0]; } | 6238 Value* value() const { return inputs_[0]; } |
6232 | 6239 |
6233 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 6240 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
6234 | 6241 |
6235 virtual bool CanDeoptimize() const { return false; } | 6242 virtual bool ComputeCanDeoptimize() const { return false; } |
6236 | 6243 |
6237 virtual Representation representation() const { return kTagged; } | 6244 virtual Representation representation() const { return kTagged; } |
6238 | 6245 |
6239 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6246 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6240 ASSERT(idx == 0); | 6247 ASSERT(idx == 0); |
6241 return kUnboxedInt32x4; | 6248 return kUnboxedInt32x4; |
6242 } | 6249 } |
6243 | 6250 |
6244 virtual intptr_t DeoptimizationTarget() const { | 6251 virtual intptr_t DeoptimizationTarget() const { |
6245 // Direct access since this instruction cannot deoptimize, and the deopt-id | 6252 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 23 matching lines...) Expand all Loading... | |
6269 Value* value, | 6276 Value* value, |
6270 intptr_t deopt_id) | 6277 intptr_t deopt_id) |
6271 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 6278 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
6272 SetInputAt(0, value); | 6279 SetInputAt(0, value); |
6273 } | 6280 } |
6274 | 6281 |
6275 Value* value() const { return inputs_[0]; } | 6282 Value* value() const { return inputs_[0]; } |
6276 | 6283 |
6277 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 6284 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
6278 | 6285 |
6279 virtual bool CanDeoptimize() const { return false; } | 6286 virtual bool ComputeCanDeoptimize() const { return false; } |
6280 | 6287 |
6281 virtual Representation representation() const { return kTagged; } | 6288 virtual Representation representation() const { return kTagged; } |
6282 | 6289 |
6283 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6290 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6284 ASSERT(idx == 0); | 6291 ASSERT(idx == 0); |
6285 if (op_kind_ == MethodRecognizer::kFloat32x4GetSignMask) { | 6292 if (op_kind_ == MethodRecognizer::kFloat32x4GetSignMask) { |
6286 return kUnboxedFloat32x4; | 6293 return kUnboxedFloat32x4; |
6287 } | 6294 } |
6288 ASSERT(op_kind_ == MethodRecognizer::kInt32x4GetSignMask); | 6295 ASSERT(op_kind_ == MethodRecognizer::kInt32x4GetSignMask); |
6289 return kUnboxedInt32x4; | 6296 return kUnboxedInt32x4; |
(...skipping 30 matching lines...) Expand all Loading... | |
6320 : TemplateDefinition(deopt_id) { | 6327 : TemplateDefinition(deopt_id) { |
6321 SetInputAt(0, mask); | 6328 SetInputAt(0, mask); |
6322 SetInputAt(1, trueValue); | 6329 SetInputAt(1, trueValue); |
6323 SetInputAt(2, falseValue); | 6330 SetInputAt(2, falseValue); |
6324 } | 6331 } |
6325 | 6332 |
6326 Value* mask() const { return inputs_[0]; } | 6333 Value* mask() const { return inputs_[0]; } |
6327 Value* trueValue() const { return inputs_[1]; } | 6334 Value* trueValue() const { return inputs_[1]; } |
6328 Value* falseValue() const { return inputs_[2]; } | 6335 Value* falseValue() const { return inputs_[2]; } |
6329 | 6336 |
6330 virtual bool CanDeoptimize() const { return false; } | 6337 virtual bool ComputeCanDeoptimize() const { return false; } |
6331 | 6338 |
6332 virtual Representation representation() const { return kUnboxedFloat32x4; } | 6339 virtual Representation representation() const { return kUnboxedFloat32x4; } |
6333 | 6340 |
6334 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6341 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6335 ASSERT((idx == 0) || (idx == 1) || (idx == 2)); | 6342 ASSERT((idx == 0) || (idx == 1) || (idx == 2)); |
6336 if (idx == 0) { | 6343 if (idx == 0) { |
6337 return kUnboxedInt32x4; | 6344 return kUnboxedInt32x4; |
6338 } | 6345 } |
6339 return kUnboxedFloat32x4; | 6346 return kUnboxedFloat32x4; |
6340 } | 6347 } |
(...skipping 25 matching lines...) Expand all Loading... | |
6366 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 6373 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
6367 SetInputAt(0, value); | 6374 SetInputAt(0, value); |
6368 SetInputAt(1, flagValue); | 6375 SetInputAt(1, flagValue); |
6369 } | 6376 } |
6370 | 6377 |
6371 Value* value() const { return inputs_[0]; } | 6378 Value* value() const { return inputs_[0]; } |
6372 Value* flagValue() const { return inputs_[1]; } | 6379 Value* flagValue() const { return inputs_[1]; } |
6373 | 6380 |
6374 MethodRecognizer::Kind op_kind() const { return op_kind_; } | 6381 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
6375 | 6382 |
6376 virtual bool CanDeoptimize() const { return false; } | 6383 virtual bool ComputeCanDeoptimize() const { return false; } |
6377 | 6384 |
6378 virtual Representation representation() const { return kUnboxedInt32x4; } | 6385 virtual Representation representation() const { return kUnboxedInt32x4; } |
6379 | 6386 |
6380 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6387 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6381 ASSERT((idx == 0) || (idx == 1)); | 6388 ASSERT((idx == 0) || (idx == 1)); |
6382 if (idx == 1) { | 6389 if (idx == 1) { |
6383 return kTagged; | 6390 return kTagged; |
6384 } | 6391 } |
6385 return kUnboxedInt32x4; | 6392 return kUnboxedInt32x4; |
6386 } | 6393 } |
(...skipping 22 matching lines...) Expand all Loading... | |
6409 | 6416 |
6410 class Int32x4ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> { | 6417 class Int32x4ToFloat32x4Instr : public TemplateDefinition<1, NoThrow, Pure> { |
6411 public: | 6418 public: |
6412 Int32x4ToFloat32x4Instr(Value* left, intptr_t deopt_id) | 6419 Int32x4ToFloat32x4Instr(Value* left, intptr_t deopt_id) |
6413 : TemplateDefinition(deopt_id) { | 6420 : TemplateDefinition(deopt_id) { |
6414 SetInputAt(0, left); | 6421 SetInputAt(0, left); |
6415 } | 6422 } |
6416 | 6423 |
6417 Value* left() const { return inputs_[0]; } | 6424 Value* left() const { return inputs_[0]; } |
6418 | 6425 |
6419 virtual bool CanDeoptimize() const { return false; } | 6426 virtual bool ComputeCanDeoptimize() const { return false; } |
6420 | 6427 |
6421 virtual Representation representation() const { return kUnboxedFloat32x4; } | 6428 virtual Representation representation() const { return kUnboxedFloat32x4; } |
6422 | 6429 |
6423 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6430 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6424 ASSERT(idx == 0); | 6431 ASSERT(idx == 0); |
6425 return kUnboxedInt32x4; | 6432 return kUnboxedInt32x4; |
6426 } | 6433 } |
6427 | 6434 |
6428 virtual intptr_t DeoptimizationTarget() const { | 6435 virtual intptr_t DeoptimizationTarget() const { |
6429 // Direct access since this instruction cannot deoptimize, and the deopt-id | 6436 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 22 matching lines...) Expand all Loading... | |
6452 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 6459 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
6453 SetInputAt(0, left); | 6460 SetInputAt(0, left); |
6454 SetInputAt(1, right); | 6461 SetInputAt(1, right); |
6455 } | 6462 } |
6456 | 6463 |
6457 Value* left() const { return inputs_[0]; } | 6464 Value* left() const { return inputs_[0]; } |
6458 Value* right() const { return inputs_[1]; } | 6465 Value* right() const { return inputs_[1]; } |
6459 | 6466 |
6460 Token::Kind op_kind() const { return op_kind_; } | 6467 Token::Kind op_kind() const { return op_kind_; } |
6461 | 6468 |
6462 virtual bool CanDeoptimize() const { return false; } | 6469 virtual bool ComputeCanDeoptimize() const { return false; } |
6463 | 6470 |
6464 virtual Representation representation() const { return kUnboxedInt32x4; } | 6471 virtual Representation representation() const { return kUnboxedInt32x4; } |
6465 | 6472 |
6466 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6473 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6467 ASSERT((idx == 0) || (idx == 1)); | 6474 ASSERT((idx == 0) || (idx == 1)); |
6468 return kUnboxedInt32x4; | 6475 return kUnboxedInt32x4; |
6469 } | 6476 } |
6470 | 6477 |
6471 virtual intptr_t DeoptimizationTarget() const { | 6478 virtual intptr_t DeoptimizationTarget() const { |
6472 // Direct access since this instruction cannot deoptimize, and the deopt-id | 6479 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 26 matching lines...) Expand all Loading... | |
6499 : TemplateDefinition(deopt_id), op_kind_(op_kind) { | 6506 : TemplateDefinition(deopt_id), op_kind_(op_kind) { |
6500 SetInputAt(0, left); | 6507 SetInputAt(0, left); |
6501 SetInputAt(1, right); | 6508 SetInputAt(1, right); |
6502 } | 6509 } |
6503 | 6510 |
6504 Value* left() const { return inputs_[0]; } | 6511 Value* left() const { return inputs_[0]; } |
6505 Value* right() const { return inputs_[1]; } | 6512 Value* right() const { return inputs_[1]; } |
6506 | 6513 |
6507 Token::Kind op_kind() const { return op_kind_; } | 6514 Token::Kind op_kind() const { return op_kind_; } |
6508 | 6515 |
6509 virtual bool CanDeoptimize() const { return false; } | 6516 virtual bool ComputeCanDeoptimize() const { return false; } |
6510 | 6517 |
6511 virtual Representation representation() const { return kUnboxedFloat64x2; } | 6518 virtual Representation representation() const { return kUnboxedFloat64x2; } |
6512 | 6519 |
6513 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6520 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6514 ASSERT((idx == 0) || (idx == 1)); | 6521 ASSERT((idx == 0) || (idx == 1)); |
6515 return kUnboxedFloat64x2; | 6522 return kUnboxedFloat64x2; |
6516 } | 6523 } |
6517 | 6524 |
6518 virtual intptr_t DeoptimizationTarget() const { | 6525 virtual intptr_t DeoptimizationTarget() const { |
6519 // Direct access since this instruction cannot deoptimize, and the deopt-id | 6526 // Direct access since this instruction cannot deoptimize, and the deopt-id |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6574 const Token::Kind op_kind_; | 6581 const Token::Kind op_kind_; |
6575 }; | 6582 }; |
6576 | 6583 |
6577 | 6584 |
6578 // Handles both Smi operations: BIT_OR and NEGATE. | 6585 // Handles both Smi operations: BIT_OR and NEGATE. |
6579 class UnarySmiOpInstr : public UnaryIntegerOpInstr { | 6586 class UnarySmiOpInstr : public UnaryIntegerOpInstr { |
6580 public: | 6587 public: |
6581 UnarySmiOpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id) | 6588 UnarySmiOpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id) |
6582 : UnaryIntegerOpInstr(op_kind, value, deopt_id) {} | 6589 : UnaryIntegerOpInstr(op_kind, value, deopt_id) {} |
6583 | 6590 |
6584 virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; } | 6591 virtual bool ComputeCanDeoptimize() const { |
6592 return op_kind() == Token::kNEGATE; | |
6593 } | |
6585 | 6594 |
6586 virtual CompileType ComputeType() const; | 6595 virtual CompileType ComputeType() const; |
6587 | 6596 |
6588 DECLARE_INSTRUCTION(UnarySmiOp) | 6597 DECLARE_INSTRUCTION(UnarySmiOp) |
6589 | 6598 |
6590 private: | 6599 private: |
6591 DISALLOW_COPY_AND_ASSIGN(UnarySmiOpInstr); | 6600 DISALLOW_COPY_AND_ASSIGN(UnarySmiOpInstr); |
6592 }; | 6601 }; |
6593 | 6602 |
6594 | 6603 |
6595 class UnaryUint32OpInstr : public UnaryIntegerOpInstr { | 6604 class UnaryUint32OpInstr : public UnaryIntegerOpInstr { |
6596 public: | 6605 public: |
6597 UnaryUint32OpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id) | 6606 UnaryUint32OpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id) |
6598 : UnaryIntegerOpInstr(op_kind, value, deopt_id) { | 6607 : UnaryIntegerOpInstr(op_kind, value, deopt_id) { |
6599 ASSERT(op_kind == Token::kBIT_NOT); | 6608 ASSERT(op_kind == Token::kBIT_NOT); |
6600 } | 6609 } |
6601 | 6610 |
6602 virtual bool CanDeoptimize() const { return false; } | 6611 virtual bool ComputeCanDeoptimize() const { return false; } |
6603 | 6612 |
6604 virtual CompileType ComputeType() const; | 6613 virtual CompileType ComputeType() const; |
6605 | 6614 |
6606 virtual Representation representation() const { return kUnboxedUint32; } | 6615 virtual Representation representation() const { return kUnboxedUint32; } |
6607 | 6616 |
6608 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6617 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6609 ASSERT(idx == 0); | 6618 ASSERT(idx == 0); |
6610 return kUnboxedUint32; | 6619 return kUnboxedUint32; |
6611 } | 6620 } |
6612 | 6621 |
6613 DECLARE_INSTRUCTION(UnaryUint32Op) | 6622 DECLARE_INSTRUCTION(UnaryUint32Op) |
6614 | 6623 |
6615 private: | 6624 private: |
6616 DISALLOW_COPY_AND_ASSIGN(UnaryUint32OpInstr); | 6625 DISALLOW_COPY_AND_ASSIGN(UnaryUint32OpInstr); |
6617 }; | 6626 }; |
6618 | 6627 |
6619 | 6628 |
6620 class UnaryMintOpInstr : public UnaryIntegerOpInstr { | 6629 class UnaryMintOpInstr : public UnaryIntegerOpInstr { |
6621 public: | 6630 public: |
6622 UnaryMintOpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id) | 6631 UnaryMintOpInstr(Token::Kind op_kind, Value* value, intptr_t deopt_id) |
6623 : UnaryIntegerOpInstr(op_kind, value, deopt_id) { | 6632 : UnaryIntegerOpInstr(op_kind, value, deopt_id) { |
6624 ASSERT(op_kind == Token::kBIT_NOT); | 6633 ASSERT(op_kind == Token::kBIT_NOT); |
6625 } | 6634 } |
6626 | 6635 |
6627 virtual bool CanDeoptimize() const { return false; } | 6636 virtual bool ComputeCanDeoptimize() const { return false; } |
6628 | 6637 |
6629 virtual CompileType ComputeType() const; | 6638 virtual CompileType ComputeType() const; |
6630 | 6639 |
6631 virtual Representation representation() const { return kUnboxedMint; } | 6640 virtual Representation representation() const { return kUnboxedMint; } |
6632 | 6641 |
6633 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6642 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6634 ASSERT(idx == 0); | 6643 ASSERT(idx == 0); |
6635 return kUnboxedMint; | 6644 return kUnboxedMint; |
6636 } | 6645 } |
6637 | 6646 |
(...skipping 13 matching lines...) Expand all Loading... | |
6651 : TemplateDefinition(call->deopt_id()), call_(call), op_kind_(op_kind) { | 6660 : TemplateDefinition(call->deopt_id()), call_(call), op_kind_(op_kind) { |
6652 SetInputAt(0, left); | 6661 SetInputAt(0, left); |
6653 SetInputAt(1, right); | 6662 SetInputAt(1, right); |
6654 } | 6663 } |
6655 | 6664 |
6656 InstanceCallInstr* call() const { return call_; } | 6665 InstanceCallInstr* call() const { return call_; } |
6657 Token::Kind op_kind() const { return op_kind_; } | 6666 Token::Kind op_kind() const { return op_kind_; } |
6658 Value* left() const { return inputs_[0]; } | 6667 Value* left() const { return inputs_[0]; } |
6659 Value* right() const { return inputs_[1]; } | 6668 Value* right() const { return inputs_[1]; } |
6660 | 6669 |
6661 virtual bool CanDeoptimize() const { return false; } | 6670 virtual bool ComputeCanDeoptimize() const { return false; } |
6662 | 6671 |
6663 virtual EffectSet Effects() const { return EffectSet::All(); } | 6672 virtual EffectSet Effects() const { return EffectSet::All(); } |
6664 | 6673 |
6665 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 6674 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
6666 | 6675 |
6667 PRINT_OPERANDS_TO_SUPPORT | 6676 PRINT_OPERANDS_TO_SUPPORT |
6668 | 6677 |
6669 DECLARE_INSTRUCTION(CheckedSmiOp) | 6678 DECLARE_INSTRUCTION(CheckedSmiOp) |
6670 | 6679 |
6671 private: | 6680 private: |
(...skipping 11 matching lines...) Expand all Loading... | |
6683 InstanceCallInstr* call) | 6692 InstanceCallInstr* call) |
6684 : TemplateComparison(call->token_pos(), op_kind, call->deopt_id()), | 6693 : TemplateComparison(call->token_pos(), op_kind, call->deopt_id()), |
6685 call_(call), | 6694 call_(call), |
6686 is_negated_(false) { | 6695 is_negated_(false) { |
6687 SetInputAt(0, left); | 6696 SetInputAt(0, left); |
6688 SetInputAt(1, right); | 6697 SetInputAt(1, right); |
6689 } | 6698 } |
6690 | 6699 |
6691 InstanceCallInstr* call() const { return call_; } | 6700 InstanceCallInstr* call() const { return call_; } |
6692 | 6701 |
6693 virtual bool CanDeoptimize() const { return false; } | 6702 virtual bool ComputeCanDeoptimize() const { return false; } |
6694 | 6703 |
6695 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 6704 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
6696 | 6705 |
6697 virtual void NegateComparison() { | 6706 virtual void NegateComparison() { |
6698 ComparisonInstr::NegateComparison(); | 6707 ComparisonInstr::NegateComparison(); |
6699 is_negated_ = !is_negated_; | 6708 is_negated_ = !is_negated_; |
6700 } | 6709 } |
6701 | 6710 |
6702 bool is_negated() const { return is_negated_; } | 6711 bool is_negated() const { return is_negated_; } |
6703 | 6712 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6761 } | 6770 } |
6762 | 6771 |
6763 // Returns true if right is a non-zero Smi constant which absolute value is | 6772 // Returns true if right is a non-zero Smi constant which absolute value is |
6764 // a power of two. | 6773 // a power of two. |
6765 bool RightIsPowerOfTwoConstant() const; | 6774 bool RightIsPowerOfTwoConstant() const; |
6766 | 6775 |
6767 RawInteger* Evaluate(const Integer& left, const Integer& right) const; | 6776 RawInteger* Evaluate(const Integer& left, const Integer& right) const; |
6768 | 6777 |
6769 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 6778 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
6770 | 6779 |
6771 virtual bool AllowsDCE() const { | |
6772 switch (op_kind()) { | |
6773 case Token::kADD: | |
6774 case Token::kSUB: | |
6775 case Token::kMUL: | |
6776 case Token::kBIT_AND: | |
6777 case Token::kBIT_OR: | |
6778 case Token::kBIT_XOR: | |
6779 return true; | |
6780 | |
6781 case Token::kSHR: | |
6782 case Token::kSHL: | |
6783 // These instructions throw on negative shifts. | |
6784 return !CanDeoptimize(); | |
6785 | |
6786 default: | |
6787 return false; | |
6788 } | |
6789 } | |
6790 | |
6791 virtual bool AttributesEqual(Instruction* other) const; | 6780 virtual bool AttributesEqual(Instruction* other) const; |
6792 | 6781 |
6793 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } | 6782 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } |
6794 | 6783 |
6795 | 6784 |
6796 PRINT_OPERANDS_TO_SUPPORT | 6785 PRINT_OPERANDS_TO_SUPPORT |
6797 | 6786 |
6798 DEFINE_INSTRUCTION_TYPE_CHECK(BinaryIntegerOp) | 6787 DEFINE_INSTRUCTION_TYPE_CHECK(BinaryIntegerOp) |
6799 | 6788 |
6800 protected: | 6789 protected: |
(...skipping 12 matching lines...) Expand all Loading... | |
6813 | 6802 |
6814 | 6803 |
6815 class BinarySmiOpInstr : public BinaryIntegerOpInstr { | 6804 class BinarySmiOpInstr : public BinaryIntegerOpInstr { |
6816 public: | 6805 public: |
6817 BinarySmiOpInstr(Token::Kind op_kind, | 6806 BinarySmiOpInstr(Token::Kind op_kind, |
6818 Value* left, | 6807 Value* left, |
6819 Value* right, | 6808 Value* right, |
6820 intptr_t deopt_id) | 6809 intptr_t deopt_id) |
6821 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {} | 6810 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {} |
6822 | 6811 |
6823 virtual bool CanDeoptimize() const; | 6812 virtual bool ComputeCanDeoptimize() const; |
6824 | 6813 |
6825 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 6814 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
6826 virtual CompileType ComputeType() const; | 6815 virtual CompileType ComputeType() const; |
6827 | 6816 |
6828 DECLARE_INSTRUCTION(BinarySmiOp) | 6817 DECLARE_INSTRUCTION(BinarySmiOp) |
6829 | 6818 |
6830 private: | 6819 private: |
6831 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); | 6820 DISALLOW_COPY_AND_ASSIGN(BinarySmiOpInstr); |
6832 }; | 6821 }; |
6833 | 6822 |
(...skipping 25 matching lines...) Expand all Loading... | |
6859 return right->BindsToConstant(); | 6848 return right->BindsToConstant(); |
6860 | 6849 |
6861 default: | 6850 default: |
6862 return false; | 6851 return false; |
6863 } | 6852 } |
6864 #else | 6853 #else |
6865 return false; | 6854 return false; |
6866 #endif | 6855 #endif |
6867 } | 6856 } |
6868 | 6857 |
6869 virtual bool CanDeoptimize() const; | 6858 virtual bool ComputeCanDeoptimize() const; |
6870 | 6859 |
6871 virtual Representation representation() const { return kUnboxedInt32; } | 6860 virtual Representation representation() const { return kUnboxedInt32; } |
6872 | 6861 |
6873 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6862 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6874 ASSERT((idx == 0) || (idx == 1)); | 6863 ASSERT((idx == 0) || (idx == 1)); |
6875 return kUnboxedInt32; | 6864 return kUnboxedInt32; |
6876 } | 6865 } |
6877 | 6866 |
6878 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 6867 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
6879 virtual CompileType ComputeType() const; | 6868 virtual CompileType ComputeType() const; |
6880 | 6869 |
6881 DECLARE_INSTRUCTION(BinaryInt32Op) | 6870 DECLARE_INSTRUCTION(BinaryInt32Op) |
6882 | 6871 |
6883 private: | 6872 private: |
6884 DISALLOW_COPY_AND_ASSIGN(BinaryInt32OpInstr); | 6873 DISALLOW_COPY_AND_ASSIGN(BinaryInt32OpInstr); |
6885 }; | 6874 }; |
6886 | 6875 |
6887 | 6876 |
6888 class BinaryUint32OpInstr : public BinaryIntegerOpInstr { | 6877 class BinaryUint32OpInstr : public BinaryIntegerOpInstr { |
6889 public: | 6878 public: |
6890 BinaryUint32OpInstr(Token::Kind op_kind, | 6879 BinaryUint32OpInstr(Token::Kind op_kind, |
6891 Value* left, | 6880 Value* left, |
6892 Value* right, | 6881 Value* right, |
6893 intptr_t deopt_id) | 6882 intptr_t deopt_id) |
6894 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) { | 6883 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) { |
6895 mark_truncating(); | 6884 mark_truncating(); |
6896 } | 6885 } |
6897 | 6886 |
6898 virtual bool CanDeoptimize() const { return false; } | 6887 virtual bool ComputeCanDeoptimize() const { return false; } |
6899 | 6888 |
6900 virtual Representation representation() const { return kUnboxedUint32; } | 6889 virtual Representation representation() const { return kUnboxedUint32; } |
6901 | 6890 |
6902 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6891 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6903 ASSERT((idx == 0) || (idx == 1)); | 6892 ASSERT((idx == 0) || (idx == 1)); |
6904 return kUnboxedUint32; | 6893 return kUnboxedUint32; |
6905 } | 6894 } |
6906 | 6895 |
6907 virtual CompileType ComputeType() const; | 6896 virtual CompileType ComputeType() const; |
6908 | 6897 |
6909 DECLARE_INSTRUCTION(BinaryUint32Op) | 6898 DECLARE_INSTRUCTION(BinaryUint32Op) |
6910 | 6899 |
6911 private: | 6900 private: |
6912 DISALLOW_COPY_AND_ASSIGN(BinaryUint32OpInstr); | 6901 DISALLOW_COPY_AND_ASSIGN(BinaryUint32OpInstr); |
6913 }; | 6902 }; |
6914 | 6903 |
6915 | 6904 |
6916 class ShiftUint32OpInstr : public BinaryIntegerOpInstr { | 6905 class ShiftUint32OpInstr : public BinaryIntegerOpInstr { |
6917 public: | 6906 public: |
6918 ShiftUint32OpInstr(Token::Kind op_kind, | 6907 ShiftUint32OpInstr(Token::Kind op_kind, |
6919 Value* left, | 6908 Value* left, |
6920 Value* right, | 6909 Value* right, |
6921 intptr_t deopt_id) | 6910 intptr_t deopt_id) |
6922 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) { | 6911 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) { |
6923 ASSERT((op_kind == Token::kSHR) || (op_kind == Token::kSHL)); | 6912 ASSERT((op_kind == Token::kSHR) || (op_kind == Token::kSHL)); |
6924 } | 6913 } |
6925 | 6914 |
6926 virtual bool CanDeoptimize() const { return true; } | 6915 virtual bool ComputeCanDeoptimize() const { return true; } |
6927 | 6916 |
6928 virtual Representation representation() const { return kUnboxedUint32; } | 6917 virtual Representation representation() const { return kUnboxedUint32; } |
6929 | 6918 |
6930 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6919 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6931 ASSERT((idx == 0) || (idx == 1)); | 6920 ASSERT((idx == 0) || (idx == 1)); |
6932 return (idx == 0) ? kUnboxedUint32 : kTagged; | 6921 return (idx == 0) ? kUnboxedUint32 : kTagged; |
6933 } | 6922 } |
6934 | 6923 |
6935 virtual CompileType ComputeType() const; | 6924 virtual CompileType ComputeType() const; |
6936 | 6925 |
6937 DECLARE_INSTRUCTION(ShiftUint32Op) | 6926 DECLARE_INSTRUCTION(ShiftUint32Op) |
6938 | 6927 |
6939 private: | 6928 private: |
6940 DISALLOW_COPY_AND_ASSIGN(ShiftUint32OpInstr); | 6929 DISALLOW_COPY_AND_ASSIGN(ShiftUint32OpInstr); |
6941 }; | 6930 }; |
6942 | 6931 |
6943 | 6932 |
6944 class BinaryMintOpInstr : public BinaryIntegerOpInstr { | 6933 class BinaryMintOpInstr : public BinaryIntegerOpInstr { |
6945 public: | 6934 public: |
6946 BinaryMintOpInstr(Token::Kind op_kind, | 6935 BinaryMintOpInstr(Token::Kind op_kind, |
6947 Value* left, | 6936 Value* left, |
6948 Value* right, | 6937 Value* right, |
6949 intptr_t deopt_id) | 6938 intptr_t deopt_id) |
6950 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {} | 6939 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {} |
6951 | 6940 |
6952 virtual bool CanDeoptimize() const { | 6941 virtual bool ComputeCanDeoptimize() const { |
6953 return (can_overflow() && | 6942 return (can_overflow() && |
6954 ((op_kind() == Token::kADD) || (op_kind() == Token::kSUB))) || | 6943 ((op_kind() == Token::kADD) || (op_kind() == Token::kSUB))) || |
6955 (op_kind() == Token::kMUL); // Deopt if inputs are not int32. | 6944 (op_kind() == Token::kMUL); // Deopt if inputs are not int32. |
6956 } | 6945 } |
6957 | 6946 |
6958 virtual Representation representation() const { return kUnboxedMint; } | 6947 virtual Representation representation() const { return kUnboxedMint; } |
6959 | 6948 |
6960 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6949 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6961 ASSERT((idx == 0) || (idx == 1)); | 6950 ASSERT((idx == 0) || (idx == 1)); |
6962 return kUnboxedMint; | 6951 return kUnboxedMint; |
(...skipping 12 matching lines...) Expand all Loading... | |
6975 class ShiftMintOpInstr : public BinaryIntegerOpInstr { | 6964 class ShiftMintOpInstr : public BinaryIntegerOpInstr { |
6976 public: | 6965 public: |
6977 ShiftMintOpInstr(Token::Kind op_kind, | 6966 ShiftMintOpInstr(Token::Kind op_kind, |
6978 Value* left, | 6967 Value* left, |
6979 Value* right, | 6968 Value* right, |
6980 intptr_t deopt_id) | 6969 intptr_t deopt_id) |
6981 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) { | 6970 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) { |
6982 ASSERT((op_kind == Token::kSHR) || (op_kind == Token::kSHL)); | 6971 ASSERT((op_kind == Token::kSHR) || (op_kind == Token::kSHL)); |
6983 } | 6972 } |
6984 | 6973 |
6985 virtual bool CanDeoptimize() const { | 6974 virtual bool ComputeCanDeoptimize() const { |
6986 return has_shift_count_check() || | 6975 return has_shift_count_check() || |
6987 (can_overflow() && (op_kind() == Token::kSHL)); | 6976 (can_overflow() && (op_kind() == Token::kSHL)); |
6988 } | 6977 } |
6989 | 6978 |
6990 virtual Representation representation() const { return kUnboxedMint; } | 6979 virtual Representation representation() const { return kUnboxedMint; } |
6991 | 6980 |
6992 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 6981 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
6993 ASSERT((idx == 0) || (idx == 1)); | 6982 ASSERT((idx == 0) || (idx == 1)); |
6994 return (idx == 0) ? kUnboxedMint : kTagged; | 6983 return (idx == 0) ? kUnboxedMint : kTagged; |
6995 } | 6984 } |
(...skipping 18 matching lines...) Expand all Loading... | |
7014 ASSERT(op_kind == Token::kNEGATE); | 7003 ASSERT(op_kind == Token::kNEGATE); |
7015 SetInputAt(0, value); | 7004 SetInputAt(0, value); |
7016 } | 7005 } |
7017 | 7006 |
7018 Value* value() const { return inputs_[0]; } | 7007 Value* value() const { return inputs_[0]; } |
7019 Token::Kind op_kind() const { return op_kind_; } | 7008 Token::Kind op_kind() const { return op_kind_; } |
7020 | 7009 |
7021 DECLARE_INSTRUCTION(UnaryDoubleOp) | 7010 DECLARE_INSTRUCTION(UnaryDoubleOp) |
7022 virtual CompileType ComputeType() const; | 7011 virtual CompileType ComputeType() const; |
7023 | 7012 |
7024 virtual bool CanDeoptimize() const { return false; } | 7013 virtual bool ComputeCanDeoptimize() const { return false; } |
7025 | 7014 |
7026 virtual intptr_t DeoptimizationTarget() const { | 7015 virtual intptr_t DeoptimizationTarget() const { |
7027 // Direct access since this instruction cannot deoptimize, and the deopt-id | 7016 // Direct access since this instruction cannot deoptimize, and the deopt-id |
7028 // was inherited from another instruction that could deoptimize. | 7017 // was inherited from another instruction that could deoptimize. |
7029 return GetDeoptId(); | 7018 return GetDeoptId(); |
7030 } | 7019 } |
7031 | 7020 |
7032 virtual Representation representation() const { return kUnboxedDouble; } | 7021 virtual Representation representation() const { return kUnboxedDouble; } |
7033 | 7022 |
7034 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7023 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
(...skipping 18 matching lines...) Expand all Loading... | |
7053 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), | 7042 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
7054 token_pos_(token_pos), | 7043 token_pos_(token_pos), |
7055 loop_depth_(loop_depth) {} | 7044 loop_depth_(loop_depth) {} |
7056 | 7045 |
7057 virtual TokenPosition token_pos() const { return token_pos_; } | 7046 virtual TokenPosition token_pos() const { return token_pos_; } |
7058 bool in_loop() const { return loop_depth_ > 0; } | 7047 bool in_loop() const { return loop_depth_ > 0; } |
7059 intptr_t loop_depth() const { return loop_depth_; } | 7048 intptr_t loop_depth() const { return loop_depth_; } |
7060 | 7049 |
7061 DECLARE_INSTRUCTION(CheckStackOverflow) | 7050 DECLARE_INSTRUCTION(CheckStackOverflow) |
7062 | 7051 |
7063 virtual bool CanDeoptimize() const { return true; } | 7052 virtual bool ComputeCanDeoptimize() const { return true; } |
7064 | 7053 |
7065 virtual EffectSet Effects() const { return EffectSet::None(); } | 7054 virtual EffectSet Effects() const { return EffectSet::None(); } |
7066 | 7055 |
7067 PRINT_OPERANDS_TO_SUPPORT | 7056 PRINT_OPERANDS_TO_SUPPORT |
7068 | 7057 |
7069 private: | 7058 private: |
7070 const TokenPosition token_pos_; | 7059 const TokenPosition token_pos_; |
7071 const intptr_t loop_depth_; | 7060 const intptr_t loop_depth_; |
7072 | 7061 |
7073 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); | 7062 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); |
7074 }; | 7063 }; |
7075 | 7064 |
7076 | 7065 |
7077 // TODO(vegorov): remove this instruction in favor of Int32ToDouble. | 7066 // TODO(vegorov): remove this instruction in favor of Int32ToDouble. |
7078 class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { | 7067 class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { |
7079 public: | 7068 public: |
7080 SmiToDoubleInstr(Value* value, TokenPosition token_pos) | 7069 SmiToDoubleInstr(Value* value, TokenPosition token_pos) |
7081 : token_pos_(token_pos) { | 7070 : token_pos_(token_pos) { |
7082 SetInputAt(0, value); | 7071 SetInputAt(0, value); |
7083 } | 7072 } |
7084 | 7073 |
7085 Value* value() const { return inputs_[0]; } | 7074 Value* value() const { return inputs_[0]; } |
7086 virtual TokenPosition token_pos() const { return token_pos_; } | 7075 virtual TokenPosition token_pos() const { return token_pos_; } |
7087 | 7076 |
7088 DECLARE_INSTRUCTION(SmiToDouble) | 7077 DECLARE_INSTRUCTION(SmiToDouble) |
7089 virtual CompileType ComputeType() const; | 7078 virtual CompileType ComputeType() const; |
7090 | 7079 |
7091 virtual Representation representation() const { return kUnboxedDouble; } | 7080 virtual Representation representation() const { return kUnboxedDouble; } |
7092 | 7081 |
7093 virtual bool CanDeoptimize() const { return false; } | 7082 virtual bool ComputeCanDeoptimize() const { return false; } |
7094 | 7083 |
7095 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7084 virtual bool AttributesEqual(Instruction* other) const { return true; } |
7096 | 7085 |
7097 private: | 7086 private: |
7098 const TokenPosition token_pos_; | 7087 const TokenPosition token_pos_; |
7099 | 7088 |
7100 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr); | 7089 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr); |
7101 }; | 7090 }; |
7102 | 7091 |
7103 | 7092 |
7104 class Int32ToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { | 7093 class Int32ToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { |
7105 public: | 7094 public: |
7106 explicit Int32ToDoubleInstr(Value* value) { SetInputAt(0, value); } | 7095 explicit Int32ToDoubleInstr(Value* value) { SetInputAt(0, value); } |
7107 | 7096 |
7108 Value* value() const { return inputs_[0]; } | 7097 Value* value() const { return inputs_[0]; } |
7109 | 7098 |
7110 DECLARE_INSTRUCTION(Int32ToDouble) | 7099 DECLARE_INSTRUCTION(Int32ToDouble) |
7111 virtual CompileType ComputeType() const; | 7100 virtual CompileType ComputeType() const; |
7112 | 7101 |
7113 virtual Representation RequiredInputRepresentation(intptr_t index) const { | 7102 virtual Representation RequiredInputRepresentation(intptr_t index) const { |
7114 ASSERT(index == 0); | 7103 ASSERT(index == 0); |
7115 return kUnboxedInt32; | 7104 return kUnboxedInt32; |
7116 } | 7105 } |
7117 | 7106 |
7118 virtual Representation representation() const { return kUnboxedDouble; } | 7107 virtual Representation representation() const { return kUnboxedDouble; } |
7119 | 7108 |
7120 virtual bool CanDeoptimize() const { return false; } | 7109 virtual bool ComputeCanDeoptimize() const { return false; } |
7121 | 7110 |
7122 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7111 virtual bool AttributesEqual(Instruction* other) const { return true; } |
7123 | 7112 |
7124 private: | 7113 private: |
7125 DISALLOW_COPY_AND_ASSIGN(Int32ToDoubleInstr); | 7114 DISALLOW_COPY_AND_ASSIGN(Int32ToDoubleInstr); |
7126 }; | 7115 }; |
7127 | 7116 |
7128 | 7117 |
7129 class MintToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { | 7118 class MintToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> { |
7130 public: | 7119 public: |
(...skipping 13 matching lines...) Expand all Loading... | |
7144 } | 7133 } |
7145 | 7134 |
7146 virtual Representation representation() const { return kUnboxedDouble; } | 7135 virtual Representation representation() const { return kUnboxedDouble; } |
7147 | 7136 |
7148 virtual intptr_t DeoptimizationTarget() const { | 7137 virtual intptr_t DeoptimizationTarget() const { |
7149 // Direct access since this instruction cannot deoptimize, and the deopt-id | 7138 // Direct access since this instruction cannot deoptimize, and the deopt-id |
7150 // was inherited from another instruction that could deoptimize. | 7139 // was inherited from another instruction that could deoptimize. |
7151 return GetDeoptId(); | 7140 return GetDeoptId(); |
7152 } | 7141 } |
7153 | 7142 |
7154 virtual bool CanDeoptimize() const { return false; } | 7143 virtual bool ComputeCanDeoptimize() const { return false; } |
7155 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7144 virtual bool AttributesEqual(Instruction* other) const { return true; } |
7156 | 7145 |
7157 private: | 7146 private: |
7158 DISALLOW_COPY_AND_ASSIGN(MintToDoubleInstr); | 7147 DISALLOW_COPY_AND_ASSIGN(MintToDoubleInstr); |
7159 }; | 7148 }; |
7160 | 7149 |
7161 | 7150 |
7162 class DoubleToIntegerInstr : public TemplateDefinition<1, Throws> { | 7151 class DoubleToIntegerInstr : public TemplateDefinition<1, Throws> { |
7163 public: | 7152 public: |
7164 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) | 7153 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) |
7165 : TemplateDefinition(instance_call->deopt_id()), | 7154 : TemplateDefinition(instance_call->deopt_id()), |
7166 instance_call_(instance_call) { | 7155 instance_call_(instance_call) { |
7167 SetInputAt(0, value); | 7156 SetInputAt(0, value); |
7168 } | 7157 } |
7169 | 7158 |
7170 Value* value() const { return inputs_[0]; } | 7159 Value* value() const { return inputs_[0]; } |
7171 InstanceCallInstr* instance_call() const { return instance_call_; } | 7160 InstanceCallInstr* instance_call() const { return instance_call_; } |
7172 | 7161 |
7173 DECLARE_INSTRUCTION(DoubleToInteger) | 7162 DECLARE_INSTRUCTION(DoubleToInteger) |
7174 virtual CompileType ComputeType() const; | 7163 virtual CompileType ComputeType() const; |
7175 | 7164 |
7176 virtual intptr_t ArgumentCount() const { return 1; } | 7165 virtual intptr_t ArgumentCount() const { return 1; } |
7177 | 7166 |
7178 virtual bool CanDeoptimize() const { return true; } | 7167 virtual bool ComputeCanDeoptimize() const { return true; } |
7179 | 7168 |
7180 virtual EffectSet Effects() const { return EffectSet::None(); } | 7169 virtual EffectSet Effects() const { return EffectSet::None(); } |
7181 | 7170 |
7182 private: | 7171 private: |
7183 InstanceCallInstr* instance_call_; | 7172 InstanceCallInstr* instance_call_; |
7184 | 7173 |
7185 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr); | 7174 DISALLOW_COPY_AND_ASSIGN(DoubleToIntegerInstr); |
7186 }; | 7175 }; |
7187 | 7176 |
7188 | 7177 |
7189 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input | 7178 // Similar to 'DoubleToIntegerInstr' but expects unboxed double as input |
7190 // and creates a Smi. | 7179 // and creates a Smi. |
7191 class DoubleToSmiInstr : public TemplateDefinition<1, NoThrow, Pure> { | 7180 class DoubleToSmiInstr : public TemplateDefinition<1, NoThrow, Pure> { |
7192 public: | 7181 public: |
7193 DoubleToSmiInstr(Value* value, intptr_t deopt_id) | 7182 DoubleToSmiInstr(Value* value, intptr_t deopt_id) |
7194 : TemplateDefinition(deopt_id) { | 7183 : TemplateDefinition(deopt_id) { |
7195 SetInputAt(0, value); | 7184 SetInputAt(0, value); |
7196 } | 7185 } |
7197 | 7186 |
7198 Value* value() const { return inputs_[0]; } | 7187 Value* value() const { return inputs_[0]; } |
7199 | 7188 |
7200 DECLARE_INSTRUCTION(DoubleToSmi) | 7189 DECLARE_INSTRUCTION(DoubleToSmi) |
7201 virtual CompileType ComputeType() const; | 7190 virtual CompileType ComputeType() const; |
7202 | 7191 |
7203 virtual bool CanDeoptimize() const { return true; } | 7192 virtual bool ComputeCanDeoptimize() const { return true; } |
7204 | 7193 |
7205 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7194 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
7206 ASSERT(idx == 0); | 7195 ASSERT(idx == 0); |
7207 return kUnboxedDouble; | 7196 return kUnboxedDouble; |
7208 } | 7197 } |
7209 | 7198 |
7210 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } | 7199 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } |
7211 | 7200 |
7212 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7201 virtual bool AttributesEqual(Instruction* other) const { return true; } |
7213 | 7202 |
(...skipping 11 matching lines...) Expand all Loading... | |
7225 SetInputAt(0, value); | 7214 SetInputAt(0, value); |
7226 } | 7215 } |
7227 | 7216 |
7228 Value* value() const { return inputs_[0]; } | 7217 Value* value() const { return inputs_[0]; } |
7229 | 7218 |
7230 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } | 7219 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } |
7231 | 7220 |
7232 DECLARE_INSTRUCTION(DoubleToDouble) | 7221 DECLARE_INSTRUCTION(DoubleToDouble) |
7233 virtual CompileType ComputeType() const; | 7222 virtual CompileType ComputeType() const; |
7234 | 7223 |
7235 virtual bool CanDeoptimize() const { return false; } | 7224 virtual bool ComputeCanDeoptimize() const { return false; } |
7236 | 7225 |
7237 virtual Representation representation() const { return kUnboxedDouble; } | 7226 virtual Representation representation() const { return kUnboxedDouble; } |
7238 | 7227 |
7239 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7228 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
7240 ASSERT(idx == 0); | 7229 ASSERT(idx == 0); |
7241 return kUnboxedDouble; | 7230 return kUnboxedDouble; |
7242 } | 7231 } |
7243 | 7232 |
7244 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } | 7233 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } |
7245 | 7234 |
(...skipping 14 matching lines...) Expand all Loading... | |
7260 : TemplateDefinition(deopt_id) { | 7249 : TemplateDefinition(deopt_id) { |
7261 SetInputAt(0, value); | 7250 SetInputAt(0, value); |
7262 } | 7251 } |
7263 | 7252 |
7264 Value* value() const { return inputs_[0]; } | 7253 Value* value() const { return inputs_[0]; } |
7265 | 7254 |
7266 DECLARE_INSTRUCTION(DoubleToFloat) | 7255 DECLARE_INSTRUCTION(DoubleToFloat) |
7267 | 7256 |
7268 virtual CompileType ComputeType() const; | 7257 virtual CompileType ComputeType() const; |
7269 | 7258 |
7270 virtual bool CanDeoptimize() const { return false; } | 7259 virtual bool ComputeCanDeoptimize() const { return false; } |
7271 | 7260 |
7272 virtual Representation representation() const { | 7261 virtual Representation representation() const { |
7273 // This works since double is the representation that the typed array | 7262 // This works since double is the representation that the typed array |
7274 // store expects. | 7263 // store expects. |
7275 // TODO(fschneider): Change this to a genuine float representation once it | 7264 // TODO(fschneider): Change this to a genuine float representation once it |
7276 // is supported. | 7265 // is supported. |
7277 return kUnboxedDouble; | 7266 return kUnboxedDouble; |
7278 } | 7267 } |
7279 | 7268 |
7280 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7269 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
(...skipping 18 matching lines...) Expand all Loading... | |
7299 : TemplateDefinition(deopt_id) { | 7288 : TemplateDefinition(deopt_id) { |
7300 SetInputAt(0, value); | 7289 SetInputAt(0, value); |
7301 } | 7290 } |
7302 | 7291 |
7303 Value* value() const { return inputs_[0]; } | 7292 Value* value() const { return inputs_[0]; } |
7304 | 7293 |
7305 DECLARE_INSTRUCTION(FloatToDouble) | 7294 DECLARE_INSTRUCTION(FloatToDouble) |
7306 | 7295 |
7307 virtual CompileType ComputeType() const; | 7296 virtual CompileType ComputeType() const; |
7308 | 7297 |
7309 virtual bool CanDeoptimize() const { return false; } | 7298 virtual bool ComputeCanDeoptimize() const { return false; } |
7310 | 7299 |
7311 virtual Representation representation() const { return kUnboxedDouble; } | 7300 virtual Representation representation() const { return kUnboxedDouble; } |
7312 | 7301 |
7313 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7302 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
7314 ASSERT(idx == 0); | 7303 ASSERT(idx == 0); |
7315 return kUnboxedDouble; | 7304 return kUnboxedDouble; |
7316 } | 7305 } |
7317 | 7306 |
7318 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } | 7307 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } |
7319 | 7308 |
(...skipping 17 matching lines...) Expand all Loading... | |
7337 | 7326 |
7338 const RuntimeEntry& TargetFunction() const; | 7327 const RuntimeEntry& TargetFunction() const; |
7339 | 7328 |
7340 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } | 7329 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } |
7341 | 7330 |
7342 virtual TokenPosition token_pos() const { return token_pos_; } | 7331 virtual TokenPosition token_pos() const { return token_pos_; } |
7343 | 7332 |
7344 DECLARE_INSTRUCTION(InvokeMathCFunction) | 7333 DECLARE_INSTRUCTION(InvokeMathCFunction) |
7345 virtual CompileType ComputeType() const; | 7334 virtual CompileType ComputeType() const; |
7346 | 7335 |
7347 virtual bool CanDeoptimize() const { return false; } | 7336 virtual bool ComputeCanDeoptimize() const { return false; } |
7348 | 7337 |
7349 virtual Representation representation() const { return kUnboxedDouble; } | 7338 virtual Representation representation() const { return kUnboxedDouble; } |
7350 | 7339 |
7351 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7340 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
7352 ASSERT((0 <= idx) && (idx < InputCount())); | 7341 ASSERT((0 <= idx) && (idx < InputCount())); |
7353 return kUnboxedDouble; | 7342 return kUnboxedDouble; |
7354 } | 7343 } |
7355 | 7344 |
7356 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } | 7345 virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); } |
7357 | 7346 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7396 definition_rep_(definition_rep), | 7385 definition_rep_(definition_rep), |
7397 definition_cid_(definition_cid) { | 7386 definition_cid_(definition_cid) { |
7398 SetInputAt(0, value); | 7387 SetInputAt(0, value); |
7399 } | 7388 } |
7400 | 7389 |
7401 Value* value() const { return inputs_[0]; } | 7390 Value* value() const { return inputs_[0]; } |
7402 | 7391 |
7403 DECLARE_INSTRUCTION(ExtractNthOutput) | 7392 DECLARE_INSTRUCTION(ExtractNthOutput) |
7404 | 7393 |
7405 virtual CompileType ComputeType() const; | 7394 virtual CompileType ComputeType() const; |
7406 virtual bool CanDeoptimize() const { return false; } | 7395 virtual bool ComputeCanDeoptimize() const { return false; } |
7407 | 7396 |
7408 intptr_t index() const { return index_; } | 7397 intptr_t index() const { return index_; } |
7409 | 7398 |
7410 virtual Representation representation() const { return definition_rep_; } | 7399 virtual Representation representation() const { return definition_rep_; } |
7411 | 7400 |
7412 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7401 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
7413 ASSERT(idx == 0); | 7402 ASSERT(idx == 0); |
7414 if (representation() == kTagged) { | 7403 if (representation() == kTagged) { |
7415 return kPairOfTagged; | 7404 return kPairOfTagged; |
7416 } | 7405 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7457 | 7446 |
7458 virtual intptr_t InputCount() const { return inputs_->length(); } | 7447 virtual intptr_t InputCount() const { return inputs_->length(); } |
7459 | 7448 |
7460 virtual Value* InputAt(intptr_t i) const { return (*inputs_)[i]; } | 7449 virtual Value* InputAt(intptr_t i) const { return (*inputs_)[i]; } |
7461 | 7450 |
7462 static intptr_t OutputIndexOf(MethodRecognizer::Kind kind); | 7451 static intptr_t OutputIndexOf(MethodRecognizer::Kind kind); |
7463 static intptr_t OutputIndexOf(Token::Kind token); | 7452 static intptr_t OutputIndexOf(Token::Kind token); |
7464 | 7453 |
7465 virtual CompileType ComputeType() const; | 7454 virtual CompileType ComputeType() const; |
7466 | 7455 |
7467 virtual bool CanDeoptimize() const { | 7456 virtual bool ComputeCanDeoptimize() const { |
7468 if (kind_ == kTruncDivMod) { | 7457 if (kind_ == kTruncDivMod) { |
7469 return true; | 7458 return true; |
7470 } else { | 7459 } else { |
7471 UNIMPLEMENTED(); | 7460 UNIMPLEMENTED(); |
7472 return false; | 7461 return false; |
7473 } | 7462 } |
7474 } | 7463 } |
7475 | 7464 |
7476 virtual Representation representation() const { | 7465 virtual Representation representation() const { |
7477 if (kind_ == kTruncDivMod) { | 7466 if (kind_ == kTruncDivMod) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7523 | 7512 |
7524 class CheckClassInstr : public TemplateInstruction<1, NoThrow> { | 7513 class CheckClassInstr : public TemplateInstruction<1, NoThrow> { |
7525 public: | 7514 public: |
7526 CheckClassInstr(Value* value, | 7515 CheckClassInstr(Value* value, |
7527 intptr_t deopt_id, | 7516 intptr_t deopt_id, |
7528 const ICData& unary_checks, | 7517 const ICData& unary_checks, |
7529 TokenPosition token_pos); | 7518 TokenPosition token_pos); |
7530 | 7519 |
7531 DECLARE_INSTRUCTION(CheckClass) | 7520 DECLARE_INSTRUCTION(CheckClass) |
7532 | 7521 |
7533 virtual bool CanDeoptimize() const { return true; } | 7522 virtual bool ComputeCanDeoptimize() const { return true; } |
7534 | 7523 |
7535 virtual TokenPosition token_pos() const { return token_pos_; } | 7524 virtual TokenPosition token_pos() const { return token_pos_; } |
7536 | 7525 |
7537 Value* value() const { return inputs_[0]; } | 7526 Value* value() const { return inputs_[0]; } |
7538 | 7527 |
7539 const ICData& unary_checks() const { return unary_checks_; } | 7528 const ICData& unary_checks() const { return unary_checks_; } |
7540 | 7529 |
7541 const GrowableArray<intptr_t>& cids() const { return cids_; } | 7530 const GrowableArray<intptr_t>& cids() const { return cids_; } |
7542 | 7531 |
7543 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 7532 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7580 token_pos_(token_pos), | 7569 token_pos_(token_pos), |
7581 licm_hoisted_(false) { | 7570 licm_hoisted_(false) { |
7582 SetInputAt(0, value); | 7571 SetInputAt(0, value); |
7583 } | 7572 } |
7584 | 7573 |
7585 Value* value() const { return inputs_[0]; } | 7574 Value* value() const { return inputs_[0]; } |
7586 virtual TokenPosition token_pos() const { return token_pos_; } | 7575 virtual TokenPosition token_pos() const { return token_pos_; } |
7587 | 7576 |
7588 DECLARE_INSTRUCTION(CheckSmi) | 7577 DECLARE_INSTRUCTION(CheckSmi) |
7589 | 7578 |
7590 virtual bool CanDeoptimize() const { return true; } | 7579 virtual bool ComputeCanDeoptimize() const { return true; } |
7591 | 7580 |
7592 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 7581 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
7593 | 7582 |
7594 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7583 virtual bool AttributesEqual(Instruction* other) const { return true; } |
7595 | 7584 |
7596 bool licm_hoisted() const { return licm_hoisted_; } | 7585 bool licm_hoisted() const { return licm_hoisted_; } |
7597 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } | 7586 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } |
7598 | 7587 |
7599 private: | 7588 private: |
7600 const TokenPosition token_pos_; | 7589 const TokenPosition token_pos_; |
7601 bool licm_hoisted_; | 7590 bool licm_hoisted_; |
7602 | 7591 |
7603 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); | 7592 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); |
7604 }; | 7593 }; |
7605 | 7594 |
7606 | 7595 |
7607 class CheckClassIdInstr : public TemplateInstruction<1, NoThrow> { | 7596 class CheckClassIdInstr : public TemplateInstruction<1, NoThrow> { |
7608 public: | 7597 public: |
7609 CheckClassIdInstr(Value* value, intptr_t cid, intptr_t deopt_id) | 7598 CheckClassIdInstr(Value* value, intptr_t cid, intptr_t deopt_id) |
7610 : TemplateInstruction(deopt_id), cid_(cid) { | 7599 : TemplateInstruction(deopt_id), cid_(cid) { |
7611 SetInputAt(0, value); | 7600 SetInputAt(0, value); |
7612 } | 7601 } |
7613 | 7602 |
7614 Value* value() const { return inputs_[0]; } | 7603 Value* value() const { return inputs_[0]; } |
7615 intptr_t cid() const { return cid_; } | 7604 intptr_t cid() const { return cid_; } |
7616 | 7605 |
7617 DECLARE_INSTRUCTION(CheckClassId) | 7606 DECLARE_INSTRUCTION(CheckClassId) |
7618 | 7607 |
7619 virtual bool CanDeoptimize() const { return true; } | 7608 virtual bool ComputeCanDeoptimize() const { return true; } |
7620 | 7609 |
7621 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 7610 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
7622 | 7611 |
7623 virtual bool AllowsCSE() const { return true; } | 7612 virtual bool AllowsCSE() const { return true; } |
7624 virtual EffectSet Dependencies() const; | 7613 virtual EffectSet Dependencies() const; |
7625 virtual EffectSet Effects() const { return EffectSet::None(); } | 7614 virtual EffectSet Effects() const { return EffectSet::None(); } |
7626 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7615 virtual bool AttributesEqual(Instruction* other) const { return true; } |
7627 | 7616 |
7628 PRINT_OPERANDS_TO_SUPPORT | 7617 PRINT_OPERANDS_TO_SUPPORT |
7629 | 7618 |
(...skipping 12 matching lines...) Expand all Loading... | |
7642 licm_hoisted_(false) { | 7631 licm_hoisted_(false) { |
7643 SetInputAt(kLengthPos, length); | 7632 SetInputAt(kLengthPos, length); |
7644 SetInputAt(kIndexPos, index); | 7633 SetInputAt(kIndexPos, index); |
7645 } | 7634 } |
7646 | 7635 |
7647 Value* length() const { return inputs_[kLengthPos]; } | 7636 Value* length() const { return inputs_[kLengthPos]; } |
7648 Value* index() const { return inputs_[kIndexPos]; } | 7637 Value* index() const { return inputs_[kIndexPos]; } |
7649 | 7638 |
7650 DECLARE_INSTRUCTION(CheckArrayBound) | 7639 DECLARE_INSTRUCTION(CheckArrayBound) |
7651 | 7640 |
7652 virtual bool CanDeoptimize() const { return true; } | 7641 virtual bool ComputeCanDeoptimize() const { return true; } |
7653 | 7642 |
7654 bool IsRedundant(const RangeBoundary& length); | 7643 bool IsRedundant(const RangeBoundary& length); |
7655 | 7644 |
7656 void mark_generalized() { generalized_ = true; } | 7645 void mark_generalized() { generalized_ = true; } |
7657 | 7646 |
7658 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 7647 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
7659 | 7648 |
7660 // Returns the length offset for array and string types. | 7649 // Returns the length offset for array and string types. |
7661 static intptr_t LengthOffsetFor(intptr_t class_id); | 7650 static intptr_t LengthOffsetFor(intptr_t class_id); |
7662 | 7651 |
(...skipping 23 matching lines...) Expand all Loading... | |
7686 } | 7675 } |
7687 | 7676 |
7688 Value* length() const { return inputs_[kLengthPos]; } | 7677 Value* length() const { return inputs_[kLengthPos]; } |
7689 Value* index() const { return inputs_[kIndexPos]; } | 7678 Value* index() const { return inputs_[kIndexPos]; } |
7690 | 7679 |
7691 virtual EffectSet Effects() const { return EffectSet::None(); } | 7680 virtual EffectSet Effects() const { return EffectSet::None(); } |
7692 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 7681 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
7693 | 7682 |
7694 DECLARE_INSTRUCTION(GenericCheckBound) | 7683 DECLARE_INSTRUCTION(GenericCheckBound) |
7695 | 7684 |
7696 virtual bool CanDeoptimize() const { return true; } | 7685 virtual bool ComputeCanDeoptimize() const { return true; } |
7697 | 7686 |
7698 // Give a name to the location/input indices. | 7687 // Give a name to the location/input indices. |
7699 enum { kLengthPos = 0, kIndexPos = 1 }; | 7688 enum { kLengthPos = 0, kIndexPos = 1 }; |
7700 | 7689 |
7701 private: | 7690 private: |
7702 DISALLOW_COPY_AND_ASSIGN(GenericCheckBoundInstr); | 7691 DISALLOW_COPY_AND_ASSIGN(GenericCheckBoundInstr); |
7703 }; | 7692 }; |
7704 | 7693 |
7705 | 7694 |
7706 class UnboxedIntConverterInstr : public TemplateDefinition<1, NoThrow> { | 7695 class UnboxedIntConverterInstr : public TemplateDefinition<1, NoThrow> { |
(...skipping 17 matching lines...) Expand all Loading... | |
7724 Value* value() const { return inputs_[0]; } | 7713 Value* value() const { return inputs_[0]; } |
7725 | 7714 |
7726 Representation from() const { return from_representation_; } | 7715 Representation from() const { return from_representation_; } |
7727 Representation to() const { return to_representation_; } | 7716 Representation to() const { return to_representation_; } |
7728 bool is_truncating() const { return is_truncating_; } | 7717 bool is_truncating() const { return is_truncating_; } |
7729 | 7718 |
7730 void mark_truncating() { is_truncating_ = true; } | 7719 void mark_truncating() { is_truncating_ = true; } |
7731 | 7720 |
7732 Definition* Canonicalize(FlowGraph* flow_graph); | 7721 Definition* Canonicalize(FlowGraph* flow_graph); |
7733 | 7722 |
7734 virtual bool CanDeoptimize() const; | 7723 virtual bool ComputeCanDeoptimize() const; |
7735 | 7724 |
7736 virtual Representation representation() const { return to(); } | 7725 virtual Representation representation() const { return to(); } |
7737 | 7726 |
7738 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 7727 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
7739 ASSERT(idx == 0); | 7728 ASSERT(idx == 0); |
7740 return from(); | 7729 return from(); |
7741 } | 7730 } |
7742 | 7731 |
7743 virtual EffectSet Effects() const { return EffectSet::None(); } | 7732 virtual EffectSet Effects() const { return EffectSet::None(); } |
7744 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 7733 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
(...skipping 25 matching lines...) Expand all Loading... | |
7770 | 7759 |
7771 | 7760 |
7772 class GrowRegExpStackInstr : public TemplateDefinition<1, Throws> { | 7761 class GrowRegExpStackInstr : public TemplateDefinition<1, Throws> { |
7773 public: | 7762 public: |
7774 explicit GrowRegExpStackInstr(Value* typed_data_cell) { | 7763 explicit GrowRegExpStackInstr(Value* typed_data_cell) { |
7775 SetInputAt(0, typed_data_cell); | 7764 SetInputAt(0, typed_data_cell); |
7776 } | 7765 } |
7777 | 7766 |
7778 Value* typed_data_cell() const { return inputs_[0]; } | 7767 Value* typed_data_cell() const { return inputs_[0]; } |
7779 | 7768 |
7780 virtual bool CanDeoptimize() const { return MayThrow(); } | 7769 virtual bool ComputeCanDeoptimize() const { return MayThrow(); } |
7781 virtual EffectSet Effects() const { return EffectSet::None(); } | 7770 virtual EffectSet Effects() const { return EffectSet::None(); } |
7782 | 7771 |
7783 DECLARE_INSTRUCTION(GrowRegExpStack); | 7772 DECLARE_INSTRUCTION(GrowRegExpStack); |
7784 | 7773 |
7785 private: | 7774 private: |
7786 DISALLOW_COPY_AND_ASSIGN(GrowRegExpStackInstr); | 7775 DISALLOW_COPY_AND_ASSIGN(GrowRegExpStackInstr); |
7787 }; | 7776 }; |
7788 | 7777 |
7789 | 7778 |
7790 #undef DECLARE_INSTRUCTION | 7779 #undef DECLARE_INSTRUCTION |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7976 // On all other architectures caller drops outgoing arguments itself | 7965 // On all other architectures caller drops outgoing arguments itself |
7977 // hence the difference. | 7966 // hence the difference. |
7978 // Note: this method can only be used at the code generation stage because | 7967 // Note: this method can only be used at the code generation stage because |
7979 // it mutates environment in unsafe way (e.g. does not update def-use | 7968 // it mutates environment in unsafe way (e.g. does not update def-use |
7980 // chains). | 7969 // chains). |
7981 void DropArguments(intptr_t argc); | 7970 void DropArguments(intptr_t argc); |
7982 #endif | 7971 #endif |
7983 | 7972 |
7984 private: | 7973 private: |
7985 friend class ShallowIterator; | 7974 friend class ShallowIterator; |
7975 friend class BlockBuilder; // For Environment constructor. | |
7986 | 7976 |
7987 Environment(intptr_t length, | 7977 Environment(intptr_t length, |
7988 intptr_t fixed_parameter_count, | 7978 intptr_t fixed_parameter_count, |
7989 intptr_t deopt_id, | 7979 intptr_t deopt_id, |
7990 const ParsedFunction& parsed_function, | 7980 const ParsedFunction& parsed_function, |
7991 Environment* outer) | 7981 Environment* outer) |
7992 : values_(length), | 7982 : values_(length), |
7993 locations_(NULL), | 7983 locations_(NULL), |
7994 fixed_parameter_count_(fixed_parameter_count), | 7984 fixed_parameter_count_(fixed_parameter_count), |
7995 deopt_id_(deopt_id), | 7985 deopt_id_(deopt_id), |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8047 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8037 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
8048 UNIMPLEMENTED(); \ | 8038 UNIMPLEMENTED(); \ |
8049 return NULL; \ | 8039 return NULL; \ |
8050 } \ | 8040 } \ |
8051 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8041 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
8052 | 8042 |
8053 | 8043 |
8054 } // namespace dart | 8044 } // namespace dart |
8055 | 8045 |
8056 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ | 8046 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |