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

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

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

Powered by Google App Engine
This is Rietveld 408576698