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