OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
592 | 592 |
593 #define DECLARE_INSTRUCTION_BACKEND() \ | 593 #define DECLARE_INSTRUCTION_BACKEND() \ |
594 virtual LocationSummary* MakeLocationSummary(Zone* zone, \ | 594 virtual LocationSummary* MakeLocationSummary(Zone* zone, \ |
595 bool optimizing) const; \ | 595 bool optimizing) const; \ |
596 virtual void EmitNativeCode(FlowGraphCompiler* compiler); \ | 596 virtual void EmitNativeCode(FlowGraphCompiler* compiler); \ |
597 | 597 |
598 // Functions required in all concrete instruction classes. | 598 // Functions required in all concrete instruction classes. |
599 #define DECLARE_INSTRUCTION(type) \ | 599 #define DECLARE_INSTRUCTION(type) \ |
600 DECLARE_INSTRUCTION_NO_BACKEND(type) \ | 600 DECLARE_INSTRUCTION_NO_BACKEND(type) \ |
601 DECLARE_INSTRUCTION_BACKEND() \ | 601 DECLARE_INSTRUCTION_BACKEND() \ |
602 | 602 |
Florian Schneider
2015/10/13 09:35:27
Wouldn't it make sense to make kNoDeoptId top-leve
srdjan
2015/10/13 19:23:15
Good point. Note that Thread::kNoDeoptId is shorte
| |
603 class Instruction : public ZoneAllocated { | 603 class Instruction : public ZoneAllocated { |
604 public: | 604 public: |
605 #define DECLARE_TAG(type) k##type, | 605 #define DECLARE_TAG(type) k##type, |
606 enum Tag { | 606 enum Tag { |
607 FOR_EACH_INSTRUCTION(DECLARE_TAG) | 607 FOR_EACH_INSTRUCTION(DECLARE_TAG) |
608 }; | 608 }; |
609 #undef DECLARE_TAG | 609 #undef DECLARE_TAG |
610 | 610 |
611 explicit Instruction(intptr_t deopt_id = Isolate::kNoDeoptId) | 611 explicit Instruction(intptr_t deopt_id = Thread::kNoDeoptId) |
612 : deopt_id_(deopt_id), | 612 : deopt_id_(deopt_id), |
613 lifetime_position_(kNoPlaceId), | 613 lifetime_position_(kNoPlaceId), |
614 previous_(NULL), | 614 previous_(NULL), |
615 next_(NULL), | 615 next_(NULL), |
616 env_(NULL), | 616 env_(NULL), |
617 locs_(NULL), | 617 locs_(NULL), |
618 inlining_id_(-1) { } | 618 inlining_id_(-1) { } |
619 | 619 |
620 virtual ~Instruction() { } | 620 virtual ~Instruction() { } |
621 | 621 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 | 765 |
766 bool WasEliminated() const { | 766 bool WasEliminated() const { |
767 return next() == NULL; | 767 return next() == NULL; |
768 } | 768 } |
769 | 769 |
770 // Returns deoptimization id that corresponds to the deoptimization target | 770 // Returns deoptimization id that corresponds to the deoptimization target |
771 // that input operands conversions inserted for this instruction can jump | 771 // that input operands conversions inserted for this instruction can jump |
772 // to. | 772 // to. |
773 virtual intptr_t DeoptimizationTarget() const { | 773 virtual intptr_t DeoptimizationTarget() const { |
774 UNREACHABLE(); | 774 UNREACHABLE(); |
775 return Isolate::kNoDeoptId; | 775 return Thread::kNoDeoptId; |
776 } | 776 } |
777 | 777 |
778 // Returns a replacement for the instruction or NULL if the instruction can | 778 // Returns a replacement for the instruction or NULL if the instruction can |
779 // be eliminated. By default returns the this instruction which means no | 779 // be eliminated. By default returns the this instruction which means no |
780 // change. | 780 // change. |
781 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 781 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
782 | 782 |
783 // Insert this instruction before 'next' after use lists are computed. | 783 // Insert this instruction before 'next' after use lists are computed. |
784 // Instructions cannot be inserted before a block entry or any other | 784 // Instructions cannot be inserted before a block entry or any other |
785 // instruction without a previous instruction. | 785 // instruction without a previous instruction. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
938 struct NoCSE { | 938 struct NoCSE { |
939 typedef DefaultBase Base; | 939 typedef DefaultBase Base; |
940 }; | 940 }; |
941 | 941 |
942 | 942 |
943 template<intptr_t N, | 943 template<intptr_t N, |
944 typename ThrowsTrait, | 944 typename ThrowsTrait, |
945 template<typename Default, typename Pure> class CSETrait = NoCSE> | 945 template<typename Default, typename Pure> class CSETrait = NoCSE> |
946 class TemplateInstruction: public CSETrait<Instruction, PureInstruction>::Base { | 946 class TemplateInstruction: public CSETrait<Instruction, PureInstruction>::Base { |
947 public: | 947 public: |
948 explicit TemplateInstruction(intptr_t deopt_id = Isolate::kNoDeoptId) | 948 explicit TemplateInstruction(intptr_t deopt_id = Thread::kNoDeoptId) |
949 : CSETrait<Instruction, PureInstruction>::Base(deopt_id), inputs_() { } | 949 : CSETrait<Instruction, PureInstruction>::Base(deopt_id), inputs_() { } |
950 | 950 |
951 virtual intptr_t InputCount() const { return N; } | 951 virtual intptr_t InputCount() const { return N; } |
952 virtual Value* InputAt(intptr_t i) const { return inputs_[i]; } | 952 virtual Value* InputAt(intptr_t i) const { return inputs_[i]; } |
953 | 953 |
954 virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; } | 954 virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; } |
955 | 955 |
956 protected: | 956 protected: |
957 EmbeddedArray<Value*, N> inputs_; | 957 EmbeddedArray<Value*, N> inputs_; |
958 | 958 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1198 void set_offset(intptr_t offset) { offset_ = offset; } | 1198 void set_offset(intptr_t offset) { offset_ = offset; } |
1199 | 1199 |
1200 // For all instruction in this block: Remove all inputs (including in the | 1200 // For all instruction in this block: Remove all inputs (including in the |
1201 // environment) from their definition's use lists for all instructions. | 1201 // environment) from their definition's use lists for all instructions. |
1202 void ClearAllInstructions(); | 1202 void ClearAllInstructions(); |
1203 | 1203 |
1204 DEFINE_INSTRUCTION_TYPE_CHECK(BlockEntry) | 1204 DEFINE_INSTRUCTION_TYPE_CHECK(BlockEntry) |
1205 | 1205 |
1206 protected: | 1206 protected: |
1207 BlockEntryInstr(intptr_t block_id, intptr_t try_index) | 1207 BlockEntryInstr(intptr_t block_id, intptr_t try_index) |
1208 : Instruction(Isolate::Current()->GetNextDeoptId()), | 1208 : Instruction(Thread::Current()->GetNextDeoptId()), |
1209 block_id_(block_id), | 1209 block_id_(block_id), |
1210 try_index_(try_index), | 1210 try_index_(try_index), |
1211 preorder_number_(-1), | 1211 preorder_number_(-1), |
1212 postorder_number_(-1), | 1212 postorder_number_(-1), |
1213 dominator_(NULL), | 1213 dominator_(NULL), |
1214 dominated_blocks_(1), | 1214 dominated_blocks_(1), |
1215 last_instruction_(NULL), | 1215 last_instruction_(NULL), |
1216 offset_(-1), | 1216 offset_(-1), |
1217 parallel_move_(NULL), | 1217 parallel_move_(NULL), |
1218 loop_info_(NULL) { | 1218 loop_info_(NULL) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1324 | 1324 |
1325 void AddIndirectEntry(IndirectEntryInstr* entry) { | 1325 void AddIndirectEntry(IndirectEntryInstr* entry) { |
1326 indirect_entries_.Add(entry); | 1326 indirect_entries_.Add(entry); |
1327 } | 1327 } |
1328 | 1328 |
1329 GrowableArray<Definition*>* initial_definitions() { | 1329 GrowableArray<Definition*>* initial_definitions() { |
1330 return &initial_definitions_; | 1330 return &initial_definitions_; |
1331 } | 1331 } |
1332 ConstantInstr* constant_null(); | 1332 ConstantInstr* constant_null(); |
1333 | 1333 |
1334 bool IsCompiledForOsr() const { return osr_id_ != Isolate::kNoDeoptId; } | 1334 bool IsCompiledForOsr() const { return osr_id_ != Thread::kNoDeoptId; } |
1335 | 1335 |
1336 intptr_t entry_count() const { return entry_count_; } | 1336 intptr_t entry_count() const { return entry_count_; } |
1337 void set_entry_count(intptr_t count) { entry_count_ = count; } | 1337 void set_entry_count(intptr_t count) { entry_count_ = count; } |
1338 | 1338 |
1339 intptr_t spill_slot_count() const { return spill_slot_count_; } | 1339 intptr_t spill_slot_count() const { return spill_slot_count_; } |
1340 void set_spill_slot_count(intptr_t count) { | 1340 void set_spill_slot_count(intptr_t count) { |
1341 ASSERT(count >= 0); | 1341 ASSERT(count >= 0); |
1342 spill_slot_count_ = count; | 1342 spill_slot_count_ = count; |
1343 } | 1343 } |
1344 | 1344 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1632 COMPILE_ASSERT((kAliased & kNotAliased) == 0); | 1632 COMPILE_ASSERT((kAliased & kNotAliased) == 0); |
1633 COMPILE_ASSERT((kAllocationSinkingCandidate & kNotAliased) != 0); | 1633 COMPILE_ASSERT((kAllocationSinkingCandidate & kNotAliased) != 0); |
1634 | 1634 |
1635 intptr_t value_; | 1635 intptr_t value_; |
1636 }; | 1636 }; |
1637 | 1637 |
1638 | 1638 |
1639 // Abstract super-class of all instructions that define a value (Bind, Phi). | 1639 // Abstract super-class of all instructions that define a value (Bind, Phi). |
1640 class Definition : public Instruction { | 1640 class Definition : public Instruction { |
1641 public: | 1641 public: |
1642 explicit Definition(intptr_t deopt_id = Isolate::kNoDeoptId); | 1642 explicit Definition(intptr_t deopt_id = Thread::kNoDeoptId); |
1643 | 1643 |
1644 // Overridden by definitions that have call counts. | 1644 // Overridden by definitions that have call counts. |
1645 virtual intptr_t CallCount() const { | 1645 virtual intptr_t CallCount() const { |
1646 UNREACHABLE(); | 1646 UNREACHABLE(); |
1647 return -1; | 1647 return -1; |
1648 } | 1648 } |
1649 | 1649 |
1650 intptr_t temp_index() const { return temp_index_; } | 1650 intptr_t temp_index() const { return temp_index_; } |
1651 void set_temp_index(intptr_t index) { temp_index_ = index; } | 1651 void set_temp_index(intptr_t index) { temp_index_ = index; } |
1652 void ClearTempIndex() { temp_index_ = -1; } | 1652 void ClearTempIndex() { temp_index_ = -1; } |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1835 | 1835 |
1836 virtual EffectSet Effects() const { return EffectSet::None(); } | 1836 virtual EffectSet Effects() const { return EffectSet::None(); } |
1837 }; | 1837 }; |
1838 | 1838 |
1839 | 1839 |
1840 template<intptr_t N, | 1840 template<intptr_t N, |
1841 typename ThrowsTrait, | 1841 typename ThrowsTrait, |
1842 template<typename Impure, typename Pure> class CSETrait = NoCSE> | 1842 template<typename Impure, typename Pure> class CSETrait = NoCSE> |
1843 class TemplateDefinition : public CSETrait<Definition, PureDefinition>::Base { | 1843 class TemplateDefinition : public CSETrait<Definition, PureDefinition>::Base { |
1844 public: | 1844 public: |
1845 explicit TemplateDefinition(intptr_t deopt_id = Isolate::kNoDeoptId) | 1845 explicit TemplateDefinition(intptr_t deopt_id = Thread::kNoDeoptId) |
1846 : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() { } | 1846 : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() { } |
1847 | 1847 |
1848 virtual intptr_t InputCount() const { return N; } | 1848 virtual intptr_t InputCount() const { return N; } |
1849 virtual Value* InputAt(intptr_t i) const { return inputs_[i]; } | 1849 virtual Value* InputAt(intptr_t i) const { return inputs_[i]; } |
1850 | 1850 |
1851 virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; } | 1851 virtual bool MayThrow() const { return ThrowsTrait::kCanThrow; } |
1852 | 1852 |
1853 protected: | 1853 protected: |
1854 EmbeddedArray<Value*, N> inputs_; | 1854 EmbeddedArray<Value*, N> inputs_; |
1855 | 1855 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2042 | 2042 |
2043 | 2043 |
2044 inline Definition* Instruction::ArgumentAt(intptr_t index) const { | 2044 inline Definition* Instruction::ArgumentAt(intptr_t index) const { |
2045 return PushArgumentAt(index)->value()->definition(); | 2045 return PushArgumentAt(index)->value()->definition(); |
2046 } | 2046 } |
2047 | 2047 |
2048 | 2048 |
2049 class ReturnInstr : public TemplateInstruction<1, NoThrow> { | 2049 class ReturnInstr : public TemplateInstruction<1, NoThrow> { |
2050 public: | 2050 public: |
2051 ReturnInstr(intptr_t token_pos, Value* value) | 2051 ReturnInstr(intptr_t token_pos, Value* value) |
2052 : TemplateInstruction(Isolate::Current()->GetNextDeoptId()), | 2052 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
2053 token_pos_(token_pos) { | 2053 token_pos_(token_pos) { |
2054 SetInputAt(0, value); | 2054 SetInputAt(0, value); |
2055 } | 2055 } |
2056 | 2056 |
2057 DECLARE_INSTRUCTION(Return) | 2057 DECLARE_INSTRUCTION(Return) |
2058 | 2058 |
2059 virtual intptr_t token_pos() const { return token_pos_; } | 2059 virtual intptr_t token_pos() const { return token_pos_; } |
2060 Value* value() const { return inputs_[0]; } | 2060 Value* value() const { return inputs_[0]; } |
2061 | 2061 |
2062 virtual bool CanBecomeDeoptimizationTarget() const { | 2062 virtual bool CanBecomeDeoptimizationTarget() const { |
2063 // Return instruction might turn into a Goto instruction after inlining. | 2063 // Return instruction might turn into a Goto instruction after inlining. |
2064 // Every Goto must have an environment. | 2064 // Every Goto must have an environment. |
2065 return true; | 2065 return true; |
2066 } | 2066 } |
2067 | 2067 |
2068 virtual bool CanDeoptimize() const { return false; } | 2068 virtual bool CanDeoptimize() const { return false; } |
2069 | 2069 |
2070 virtual EffectSet Effects() const { return EffectSet::None(); } | 2070 virtual EffectSet Effects() const { return EffectSet::None(); } |
2071 | 2071 |
2072 private: | 2072 private: |
2073 const intptr_t token_pos_; | 2073 const intptr_t token_pos_; |
2074 | 2074 |
2075 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); | 2075 DISALLOW_COPY_AND_ASSIGN(ReturnInstr); |
2076 }; | 2076 }; |
2077 | 2077 |
2078 | 2078 |
2079 class ThrowInstr : public TemplateInstruction<0, Throws> { | 2079 class ThrowInstr : public TemplateInstruction<0, Throws> { |
2080 public: | 2080 public: |
2081 explicit ThrowInstr(intptr_t token_pos) | 2081 explicit ThrowInstr(intptr_t token_pos) |
2082 : TemplateInstruction(Isolate::Current()->GetNextDeoptId()), | 2082 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
2083 token_pos_(token_pos) { | 2083 token_pos_(token_pos) { |
2084 } | 2084 } |
2085 | 2085 |
2086 DECLARE_INSTRUCTION(Throw) | 2086 DECLARE_INSTRUCTION(Throw) |
2087 | 2087 |
2088 virtual intptr_t ArgumentCount() const { return 1; } | 2088 virtual intptr_t ArgumentCount() const { return 1; } |
2089 | 2089 |
2090 virtual intptr_t token_pos() const { return token_pos_; } | 2090 virtual intptr_t token_pos() const { return token_pos_; } |
2091 | 2091 |
2092 virtual bool CanDeoptimize() const { return true; } | 2092 virtual bool CanDeoptimize() const { return true; } |
2093 | 2093 |
2094 virtual EffectSet Effects() const { return EffectSet::None(); } | 2094 virtual EffectSet Effects() const { return EffectSet::None(); } |
2095 | 2095 |
2096 private: | 2096 private: |
2097 const intptr_t token_pos_; | 2097 const intptr_t token_pos_; |
2098 | 2098 |
2099 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); | 2099 DISALLOW_COPY_AND_ASSIGN(ThrowInstr); |
2100 }; | 2100 }; |
2101 | 2101 |
2102 | 2102 |
2103 class ReThrowInstr : public TemplateInstruction<0, Throws> { | 2103 class ReThrowInstr : public TemplateInstruction<0, Throws> { |
2104 public: | 2104 public: |
2105 // 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the | 2105 // 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the |
2106 // rethrow has been artifically generated by the parser. | 2106 // rethrow has been artifically generated by the parser. |
2107 ReThrowInstr(intptr_t token_pos, intptr_t catch_try_index) | 2107 ReThrowInstr(intptr_t token_pos, intptr_t catch_try_index) |
2108 : TemplateInstruction(Isolate::Current()->GetNextDeoptId()), | 2108 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
2109 token_pos_(token_pos), | 2109 token_pos_(token_pos), |
2110 catch_try_index_(catch_try_index) { | 2110 catch_try_index_(catch_try_index) { |
2111 } | 2111 } |
2112 | 2112 |
2113 DECLARE_INSTRUCTION(ReThrow) | 2113 DECLARE_INSTRUCTION(ReThrow) |
2114 | 2114 |
2115 virtual intptr_t ArgumentCount() const { return 2; } | 2115 virtual intptr_t ArgumentCount() const { return 2; } |
2116 | 2116 |
2117 virtual intptr_t token_pos() const { return token_pos_; } | 2117 virtual intptr_t token_pos() const { return token_pos_; } |
2118 intptr_t catch_try_index() const { return catch_try_index_; } | 2118 intptr_t catch_try_index() const { return catch_try_index_; } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2151 private: | 2151 private: |
2152 const char* message_; | 2152 const char* message_; |
2153 | 2153 |
2154 DISALLOW_COPY_AND_ASSIGN(StopInstr); | 2154 DISALLOW_COPY_AND_ASSIGN(StopInstr); |
2155 }; | 2155 }; |
2156 | 2156 |
2157 | 2157 |
2158 class GotoInstr : public TemplateInstruction<0, NoThrow> { | 2158 class GotoInstr : public TemplateInstruction<0, NoThrow> { |
2159 public: | 2159 public: |
2160 explicit GotoInstr(JoinEntryInstr* entry) | 2160 explicit GotoInstr(JoinEntryInstr* entry) |
2161 : TemplateInstruction(Isolate::Current()->GetNextDeoptId()), | 2161 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
2162 block_(NULL), | 2162 block_(NULL), |
2163 successor_(entry), | 2163 successor_(entry), |
2164 edge_weight_(0.0), | 2164 edge_weight_(0.0), |
2165 parallel_move_(NULL) { | 2165 parallel_move_(NULL) { |
2166 } | 2166 } |
2167 | 2167 |
2168 DECLARE_INSTRUCTION(Goto) | 2168 DECLARE_INSTRUCTION(Goto) |
2169 | 2169 |
2170 BlockEntryInstr* block() const { return block_; } | 2170 BlockEntryInstr* block() const { return block_; } |
2171 void set_block(BlockEntryInstr* block) { block_ = block; } | 2171 void set_block(BlockEntryInstr* block) { block_ = block; } |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2315 (operation_cid() == other_comparison->operation_cid()); | 2315 (operation_cid() == other_comparison->operation_cid()); |
2316 } | 2316 } |
2317 | 2317 |
2318 DEFINE_INSTRUCTION_TYPE_CHECK(Comparison) | 2318 DEFINE_INSTRUCTION_TYPE_CHECK(Comparison) |
2319 | 2319 |
2320 protected: | 2320 protected: |
2321 ComparisonInstr(intptr_t token_pos, | 2321 ComparisonInstr(intptr_t token_pos, |
2322 Token::Kind kind, | 2322 Token::Kind kind, |
2323 Value* left, | 2323 Value* left, |
2324 Value* right, | 2324 Value* right, |
2325 intptr_t deopt_id = Isolate::kNoDeoptId) | 2325 intptr_t deopt_id = Thread::kNoDeoptId) |
2326 : TemplateDefinition(deopt_id), | 2326 : TemplateDefinition(deopt_id), |
2327 token_pos_(token_pos), | 2327 token_pos_(token_pos), |
2328 kind_(kind), | 2328 kind_(kind), |
2329 operation_cid_(kIllegalCid) { | 2329 operation_cid_(kIllegalCid) { |
2330 SetInputAt(0, left); | 2330 SetInputAt(0, left); |
2331 if (right != NULL) { | 2331 if (right != NULL) { |
2332 SetInputAt(1, right); | 2332 SetInputAt(1, right); |
2333 } | 2333 } |
2334 } | 2334 } |
2335 | 2335 |
2336 private: | 2336 private: |
2337 const intptr_t token_pos_; | 2337 const intptr_t token_pos_; |
2338 Token::Kind kind_; | 2338 Token::Kind kind_; |
2339 intptr_t operation_cid_; // Set by optimizer. | 2339 intptr_t operation_cid_; // Set by optimizer. |
2340 | 2340 |
2341 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr); | 2341 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr); |
2342 }; | 2342 }; |
2343 | 2343 |
2344 | 2344 |
2345 class BranchInstr : public Instruction { | 2345 class BranchInstr : public Instruction { |
2346 public: | 2346 public: |
2347 explicit BranchInstr(ComparisonInstr* comparison) | 2347 explicit BranchInstr(ComparisonInstr* comparison) |
2348 : Instruction(Isolate::Current()->GetNextDeoptId()), | 2348 : Instruction(Thread::Current()->GetNextDeoptId()), |
2349 comparison_(comparison), | 2349 comparison_(comparison), |
2350 is_checked_(false), | 2350 is_checked_(false), |
2351 constrained_type_(NULL), | 2351 constrained_type_(NULL), |
2352 constant_target_(NULL) { | 2352 constant_target_(NULL) { |
2353 ASSERT(comparison->env() == NULL); | 2353 ASSERT(comparison->env() == NULL); |
2354 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { | 2354 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { |
2355 comparison->InputAt(i)->set_instruction(this); | 2355 comparison->InputAt(i)->set_instruction(this); |
2356 } | 2356 } |
2357 } | 2357 } |
2358 | 2358 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2646 AbstractType& dst_type_; | 2646 AbstractType& dst_type_; |
2647 const String& dst_name_; | 2647 const String& dst_name_; |
2648 | 2648 |
2649 DISALLOW_COPY_AND_ASSIGN(AssertAssignableInstr); | 2649 DISALLOW_COPY_AND_ASSIGN(AssertAssignableInstr); |
2650 }; | 2650 }; |
2651 | 2651 |
2652 | 2652 |
2653 class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> { | 2653 class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> { |
2654 public: | 2654 public: |
2655 AssertBooleanInstr(intptr_t token_pos, Value* value) | 2655 AssertBooleanInstr(intptr_t token_pos, Value* value) |
2656 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 2656 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
2657 token_pos_(token_pos) { | 2657 token_pos_(token_pos) { |
2658 SetInputAt(0, value); | 2658 SetInputAt(0, value); |
2659 } | 2659 } |
2660 | 2660 |
2661 DECLARE_INSTRUCTION(AssertBoolean) | 2661 DECLARE_INSTRUCTION(AssertBoolean) |
2662 virtual CompileType ComputeType() const; | 2662 virtual CompileType ComputeType() const; |
2663 | 2663 |
2664 virtual intptr_t token_pos() const { return token_pos_; } | 2664 virtual intptr_t token_pos() const { return token_pos_; } |
2665 Value* value() const { return inputs_[0]; } | 2665 Value* value() const { return inputs_[0]; } |
2666 | 2666 |
(...skipping 10 matching lines...) Expand all Loading... | |
2677 | 2677 |
2678 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); | 2678 DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr); |
2679 }; | 2679 }; |
2680 | 2680 |
2681 | 2681 |
2682 // Denotes the current context, normally held in a register. This is | 2682 // Denotes the current context, normally held in a register. This is |
2683 // a computation, not a value, because it's mutable. | 2683 // a computation, not a value, because it's mutable. |
2684 class CurrentContextInstr : public TemplateDefinition<0, NoThrow> { | 2684 class CurrentContextInstr : public TemplateDefinition<0, NoThrow> { |
2685 public: | 2685 public: |
2686 CurrentContextInstr() | 2686 CurrentContextInstr() |
2687 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()) { | 2687 : TemplateDefinition(Thread::Current()->GetNextDeoptId()) { |
2688 } | 2688 } |
2689 | 2689 |
2690 DECLARE_INSTRUCTION(CurrentContext) | 2690 DECLARE_INSTRUCTION(CurrentContext) |
2691 virtual CompileType ComputeType() const; | 2691 virtual CompileType ComputeType() const; |
2692 | 2692 |
2693 virtual bool CanDeoptimize() const { return false; } | 2693 virtual bool CanDeoptimize() const { return false; } |
2694 | 2694 |
2695 virtual EffectSet Effects() const { return EffectSet::None(); } | 2695 virtual EffectSet Effects() const { return EffectSet::None(); } |
2696 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2696 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
2697 virtual bool AttributesEqual(Instruction* other) const { return true; } | 2697 virtual bool AttributesEqual(Instruction* other) const { return true; } |
2698 | 2698 |
2699 private: | 2699 private: |
2700 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); | 2700 DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); |
2701 }; | 2701 }; |
2702 | 2702 |
2703 | 2703 |
2704 class ClosureCallInstr : public TemplateDefinition<1, Throws> { | 2704 class ClosureCallInstr : public TemplateDefinition<1, Throws> { |
2705 public: | 2705 public: |
2706 ClosureCallInstr(Value* function, | 2706 ClosureCallInstr(Value* function, |
2707 ClosureCallNode* node, | 2707 ClosureCallNode* node, |
2708 ZoneGrowableArray<PushArgumentInstr*>* arguments) | 2708 ZoneGrowableArray<PushArgumentInstr*>* arguments) |
2709 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 2709 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
2710 ast_node_(*node), | 2710 ast_node_(*node), |
2711 arguments_(arguments) { | 2711 arguments_(arguments) { |
2712 SetInputAt(0, function); | 2712 SetInputAt(0, function); |
2713 } | 2713 } |
2714 | 2714 |
2715 DECLARE_INSTRUCTION(ClosureCall) | 2715 DECLARE_INSTRUCTION(ClosureCall) |
2716 | 2716 |
2717 const Array& argument_names() const { return ast_node_.arguments()->names(); } | 2717 const Array& argument_names() const { return ast_node_.arguments()->names(); } |
2718 virtual intptr_t token_pos() const { return ast_node_.token_pos(); } | 2718 virtual intptr_t token_pos() const { return ast_node_.token_pos(); } |
2719 | 2719 |
(...skipping 21 matching lines...) Expand all Loading... | |
2741 | 2741 |
2742 class InstanceCallInstr : public TemplateDefinition<0, Throws> { | 2742 class InstanceCallInstr : public TemplateDefinition<0, Throws> { |
2743 public: | 2743 public: |
2744 InstanceCallInstr(intptr_t token_pos, | 2744 InstanceCallInstr(intptr_t token_pos, |
2745 const String& function_name, | 2745 const String& function_name, |
2746 Token::Kind token_kind, | 2746 Token::Kind token_kind, |
2747 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 2747 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
2748 const Array& argument_names, | 2748 const Array& argument_names, |
2749 intptr_t checked_argument_count, | 2749 intptr_t checked_argument_count, |
2750 const ZoneGrowableArray<const ICData*>& ic_data_array) | 2750 const ZoneGrowableArray<const ICData*>& ic_data_array) |
2751 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 2751 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
2752 ic_data_(NULL), | 2752 ic_data_(NULL), |
2753 token_pos_(token_pos), | 2753 token_pos_(token_pos), |
2754 function_name_(function_name), | 2754 function_name_(function_name), |
2755 token_kind_(token_kind), | 2755 token_kind_(token_kind), |
2756 arguments_(arguments), | 2756 arguments_(arguments), |
2757 argument_names_(argument_names), | 2757 argument_names_(argument_names), |
2758 checked_argument_count_(checked_argument_count) { | 2758 checked_argument_count_(checked_argument_count) { |
2759 ic_data_ = GetICData(ic_data_array); | 2759 ic_data_ = GetICData(ic_data_array); |
2760 ASSERT(function_name.IsNotTemporaryScopedHandle()); | 2760 ASSERT(function_name.IsNotTemporaryScopedHandle()); |
2761 ASSERT(!arguments->is_empty()); | 2761 ASSERT(!arguments->is_empty()); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2965 return cid_results_; | 2965 return cid_results_; |
2966 } | 2966 } |
2967 | 2967 |
2968 DECLARE_INSTRUCTION(TestCids); | 2968 DECLARE_INSTRUCTION(TestCids); |
2969 | 2969 |
2970 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); | 2970 virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right); |
2971 | 2971 |
2972 virtual CompileType ComputeType() const; | 2972 virtual CompileType ComputeType() const; |
2973 | 2973 |
2974 virtual bool CanDeoptimize() const { | 2974 virtual bool CanDeoptimize() const { |
2975 return GetDeoptId() != Isolate::kNoDeoptId; | 2975 return GetDeoptId() != Thread::kNoDeoptId; |
2976 } | 2976 } |
2977 | 2977 |
2978 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 2978 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
2979 return kTagged; | 2979 return kTagged; |
2980 } | 2980 } |
2981 | 2981 |
2982 virtual bool AttributesEqual(Instruction* other) const; | 2982 virtual bool AttributesEqual(Instruction* other) const; |
2983 | 2983 |
2984 virtual void EmitBranchCode(FlowGraphCompiler* compiler, | 2984 virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
2985 BranchInstr* branch); | 2985 BranchInstr* branch); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3077 }; | 3077 }; |
3078 | 3078 |
3079 | 3079 |
3080 // TODO(vegorov): ComparisonInstr should be switched to use IfTheElseInstr for | 3080 // TODO(vegorov): ComparisonInstr should be switched to use IfTheElseInstr for |
3081 // materialization of true and false constants. | 3081 // materialization of true and false constants. |
3082 class IfThenElseInstr : public Definition { | 3082 class IfThenElseInstr : public Definition { |
3083 public: | 3083 public: |
3084 IfThenElseInstr(ComparisonInstr* comparison, | 3084 IfThenElseInstr(ComparisonInstr* comparison, |
3085 Value* if_true, | 3085 Value* if_true, |
3086 Value* if_false) | 3086 Value* if_false) |
3087 : Definition(Isolate::Current()->GetNextDeoptId()), | 3087 : Definition(Thread::Current()->GetNextDeoptId()), |
3088 comparison_(comparison), | 3088 comparison_(comparison), |
3089 if_true_(Smi::Cast(if_true->BoundConstant()).Value()), | 3089 if_true_(Smi::Cast(if_true->BoundConstant()).Value()), |
3090 if_false_(Smi::Cast(if_false->BoundConstant()).Value()) { | 3090 if_false_(Smi::Cast(if_false->BoundConstant()).Value()) { |
3091 // Adjust uses at the comparison. | 3091 // Adjust uses at the comparison. |
3092 ASSERT(comparison->env() == NULL); | 3092 ASSERT(comparison->env() == NULL); |
3093 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { | 3093 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { |
3094 comparison->InputAt(i)->set_instruction(this); | 3094 comparison->InputAt(i)->set_instruction(this); |
3095 } | 3095 } |
3096 } | 3096 } |
3097 | 3097 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3158 }; | 3158 }; |
3159 | 3159 |
3160 | 3160 |
3161 class StaticCallInstr : public TemplateDefinition<0, Throws> { | 3161 class StaticCallInstr : public TemplateDefinition<0, Throws> { |
3162 public: | 3162 public: |
3163 StaticCallInstr(intptr_t token_pos, | 3163 StaticCallInstr(intptr_t token_pos, |
3164 const Function& function, | 3164 const Function& function, |
3165 const Array& argument_names, | 3165 const Array& argument_names, |
3166 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 3166 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
3167 const ZoneGrowableArray<const ICData*>& ic_data_array) | 3167 const ZoneGrowableArray<const ICData*>& ic_data_array) |
3168 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 3168 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
3169 ic_data_(NULL), | 3169 ic_data_(NULL), |
3170 token_pos_(token_pos), | 3170 token_pos_(token_pos), |
3171 function_(function), | 3171 function_(function), |
3172 argument_names_(argument_names), | 3172 argument_names_(argument_names), |
3173 arguments_(arguments), | 3173 arguments_(arguments), |
3174 result_cid_(kDynamicCid), | 3174 result_cid_(kDynamicCid), |
3175 is_known_list_constructor_(false), | 3175 is_known_list_constructor_(false), |
3176 is_native_list_factory_(false), | 3176 is_native_list_factory_(false), |
3177 identity_(AliasIdentity::Unknown()) { | 3177 identity_(AliasIdentity::Unknown()) { |
3178 ic_data_ = GetICData(ic_data_array); | 3178 ic_data_ = GetICData(ic_data_array); |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3733 bool IsExternal() const { | 3733 bool IsExternal() const { |
3734 return array()->definition()->representation() == kUntagged; | 3734 return array()->definition()->representation() == kUntagged; |
3735 } | 3735 } |
3736 | 3736 |
3737 Value* array() const { return inputs_[0]; } | 3737 Value* array() const { return inputs_[0]; } |
3738 Value* index() const { return inputs_[1]; } | 3738 Value* index() const { return inputs_[1]; } |
3739 intptr_t index_scale() const { return index_scale_; } | 3739 intptr_t index_scale() const { return index_scale_; } |
3740 intptr_t class_id() const { return class_id_; } | 3740 intptr_t class_id() const { return class_id_; } |
3741 | 3741 |
3742 virtual bool CanDeoptimize() const { | 3742 virtual bool CanDeoptimize() const { |
3743 return GetDeoptId() != Isolate::kNoDeoptId; | 3743 return GetDeoptId() != Thread::kNoDeoptId; |
3744 } | 3744 } |
3745 | 3745 |
3746 virtual Representation representation() const; | 3746 virtual Representation representation() const; |
3747 virtual void InferRange(RangeAnalysis* analysis, Range* range); | 3747 virtual void InferRange(RangeAnalysis* analysis, Range* range); |
3748 | 3748 |
3749 virtual EffectSet Effects() const { return EffectSet::None(); } | 3749 virtual EffectSet Effects() const { return EffectSet::None(); } |
3750 | 3750 |
3751 private: | 3751 private: |
3752 const intptr_t index_scale_; | 3752 const intptr_t index_scale_; |
3753 const intptr_t class_id_; | 3753 const intptr_t class_id_; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3876 private: | 3876 private: |
3877 const intptr_t cid_; | 3877 const intptr_t cid_; |
3878 | 3878 |
3879 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr); | 3879 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr); |
3880 }; | 3880 }; |
3881 | 3881 |
3882 | 3882 |
3883 class StringInterpolateInstr : public TemplateDefinition<1, Throws> { | 3883 class StringInterpolateInstr : public TemplateDefinition<1, Throws> { |
3884 public: | 3884 public: |
3885 StringInterpolateInstr(Value* value, intptr_t token_pos) | 3885 StringInterpolateInstr(Value* value, intptr_t token_pos) |
3886 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 3886 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
3887 token_pos_(token_pos), | 3887 token_pos_(token_pos), |
3888 function_(Function::ZoneHandle()) { | 3888 function_(Function::ZoneHandle()) { |
3889 SetInputAt(0, value); | 3889 SetInputAt(0, value); |
3890 } | 3890 } |
3891 | 3891 |
3892 Value* value() const { return inputs_[0]; } | 3892 Value* value() const { return inputs_[0]; } |
3893 virtual intptr_t token_pos() const { return token_pos_; } | 3893 virtual intptr_t token_pos() const { return token_pos_; } |
3894 | 3894 |
3895 virtual CompileType ComputeType() const; | 3895 virtual CompileType ComputeType() const; |
3896 // Issues a static call to Dart code which calls toString on objects. | 3896 // Issues a static call to Dart code which calls toString on objects. |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4243 | 4243 |
4244 DISALLOW_COPY_AND_ASSIGN(MaterializeObjectInstr); | 4244 DISALLOW_COPY_AND_ASSIGN(MaterializeObjectInstr); |
4245 }; | 4245 }; |
4246 | 4246 |
4247 | 4247 |
4248 class CreateArrayInstr : public TemplateDefinition<2, Throws> { | 4248 class CreateArrayInstr : public TemplateDefinition<2, Throws> { |
4249 public: | 4249 public: |
4250 CreateArrayInstr(intptr_t token_pos, | 4250 CreateArrayInstr(intptr_t token_pos, |
4251 Value* element_type, | 4251 Value* element_type, |
4252 Value* num_elements) | 4252 Value* num_elements) |
4253 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 4253 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
4254 token_pos_(token_pos), | 4254 token_pos_(token_pos), |
4255 identity_(AliasIdentity::Unknown()) { | 4255 identity_(AliasIdentity::Unknown()) { |
4256 SetInputAt(kElementTypePos, element_type); | 4256 SetInputAt(kElementTypePos, element_type); |
4257 SetInputAt(kLengthPos, num_elements); | 4257 SetInputAt(kLengthPos, num_elements); |
4258 } | 4258 } |
4259 | 4259 |
4260 enum { | 4260 enum { |
4261 kElementTypePos = 0, | 4261 kElementTypePos = 0, |
4262 kLengthPos = 1 | 4262 kLengthPos = 1 |
4263 }; | 4263 }; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4446 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); | 4446 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); |
4447 }; | 4447 }; |
4448 | 4448 |
4449 | 4449 |
4450 class InstantiateTypeInstr : public TemplateDefinition<1, Throws> { | 4450 class InstantiateTypeInstr : public TemplateDefinition<1, Throws> { |
4451 public: | 4451 public: |
4452 InstantiateTypeInstr(intptr_t token_pos, | 4452 InstantiateTypeInstr(intptr_t token_pos, |
4453 const AbstractType& type, | 4453 const AbstractType& type, |
4454 const Class& instantiator_class, | 4454 const Class& instantiator_class, |
4455 Value* instantiator) | 4455 Value* instantiator) |
4456 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 4456 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
4457 token_pos_(token_pos), | 4457 token_pos_(token_pos), |
4458 type_(type), | 4458 type_(type), |
4459 instantiator_class_(instantiator_class) { | 4459 instantiator_class_(instantiator_class) { |
4460 ASSERT(type.IsZoneHandle()); | 4460 ASSERT(type.IsZoneHandle()); |
4461 SetInputAt(0, instantiator); | 4461 SetInputAt(0, instantiator); |
4462 } | 4462 } |
4463 | 4463 |
4464 DECLARE_INSTRUCTION(InstantiateType) | 4464 DECLARE_INSTRUCTION(InstantiateType) |
4465 | 4465 |
4466 Value* instantiator() const { return inputs_[0]; } | 4466 Value* instantiator() const { return inputs_[0]; } |
(...skipping 16 matching lines...) Expand all Loading... | |
4483 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr); | 4483 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr); |
4484 }; | 4484 }; |
4485 | 4485 |
4486 | 4486 |
4487 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> { | 4487 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> { |
4488 public: | 4488 public: |
4489 InstantiateTypeArgumentsInstr(intptr_t token_pos, | 4489 InstantiateTypeArgumentsInstr(intptr_t token_pos, |
4490 const TypeArguments& type_arguments, | 4490 const TypeArguments& type_arguments, |
4491 const Class& instantiator_class, | 4491 const Class& instantiator_class, |
4492 Value* instantiator) | 4492 Value* instantiator) |
4493 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 4493 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
4494 token_pos_(token_pos), | 4494 token_pos_(token_pos), |
4495 type_arguments_(type_arguments), | 4495 type_arguments_(type_arguments), |
4496 instantiator_class_(instantiator_class) { | 4496 instantiator_class_(instantiator_class) { |
4497 ASSERT(type_arguments.IsZoneHandle()); | 4497 ASSERT(type_arguments.IsZoneHandle()); |
4498 SetInputAt(0, instantiator); | 4498 SetInputAt(0, instantiator); |
4499 } | 4499 } |
4500 | 4500 |
4501 DECLARE_INSTRUCTION(InstantiateTypeArguments) | 4501 DECLARE_INSTRUCTION(InstantiateTypeArguments) |
4502 | 4502 |
4503 Value* instantiator() const { return inputs_[0]; } | 4503 Value* instantiator() const { return inputs_[0]; } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4547 const intptr_t token_pos_; | 4547 const intptr_t token_pos_; |
4548 const intptr_t num_context_variables_; | 4548 const intptr_t num_context_variables_; |
4549 | 4549 |
4550 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); | 4550 DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr); |
4551 }; | 4551 }; |
4552 | 4552 |
4553 | 4553 |
4554 class InitStaticFieldInstr : public TemplateInstruction<1, Throws> { | 4554 class InitStaticFieldInstr : public TemplateInstruction<1, Throws> { |
4555 public: | 4555 public: |
4556 InitStaticFieldInstr(Value* input, const Field& field) | 4556 InitStaticFieldInstr(Value* input, const Field& field) |
4557 : TemplateInstruction(Isolate::Current()->GetNextDeoptId()), | 4557 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
4558 field_(field) { | 4558 field_(field) { |
4559 SetInputAt(0, input); | 4559 SetInputAt(0, input); |
4560 } | 4560 } |
4561 | 4561 |
4562 virtual intptr_t token_pos() const { return field_.token_pos(); } | 4562 virtual intptr_t token_pos() const { return field_.token_pos(); } |
4563 const Field& field() const { return field_; } | 4563 const Field& field() const { return field_; } |
4564 | 4564 |
4565 DECLARE_INSTRUCTION(InitStaticField) | 4565 DECLARE_INSTRUCTION(InitStaticField) |
4566 | 4566 |
4567 virtual bool CanDeoptimize() const { return true; } | 4567 virtual bool CanDeoptimize() const { return true; } |
4568 virtual EffectSet Effects() const { return EffectSet::All(); } | 4568 virtual EffectSet Effects() const { return EffectSet::All(); } |
4569 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 4569 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
4570 | 4570 |
4571 private: | 4571 private: |
4572 const Field& field_; | 4572 const Field& field_; |
4573 | 4573 |
4574 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldInstr); | 4574 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldInstr); |
4575 }; | 4575 }; |
4576 | 4576 |
4577 | 4577 |
4578 class CloneContextInstr : public TemplateDefinition<1, NoThrow> { | 4578 class CloneContextInstr : public TemplateDefinition<1, NoThrow> { |
4579 public: | 4579 public: |
4580 CloneContextInstr(intptr_t token_pos, Value* context_value) | 4580 CloneContextInstr(intptr_t token_pos, Value* context_value) |
4581 : TemplateDefinition(Isolate::Current()->GetNextDeoptId()), | 4581 : TemplateDefinition(Thread::Current()->GetNextDeoptId()), |
4582 token_pos_(token_pos) { | 4582 token_pos_(token_pos) { |
4583 SetInputAt(0, context_value); | 4583 SetInputAt(0, context_value); |
4584 } | 4584 } |
4585 | 4585 |
4586 virtual intptr_t token_pos() const { return token_pos_; } | 4586 virtual intptr_t token_pos() const { return token_pos_; } |
4587 Value* context_value() const { return inputs_[0]; } | 4587 Value* context_value() const { return inputs_[0]; } |
4588 | 4588 |
4589 DECLARE_INSTRUCTION(CloneContext) | 4589 DECLARE_INSTRUCTION(CloneContext) |
4590 virtual CompileType ComputeType() const; | 4590 virtual CompileType ComputeType() const; |
4591 | 4591 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4693 static BoxInstr* Create(Representation from, Value* value); | 4693 static BoxInstr* Create(Representation from, Value* value); |
4694 | 4694 |
4695 Value* value() const { return inputs_[0]; } | 4695 Value* value() const { return inputs_[0]; } |
4696 Representation from_representation() const { return from_representation_; } | 4696 Representation from_representation() const { return from_representation_; } |
4697 | 4697 |
4698 DECLARE_INSTRUCTION(Box) | 4698 DECLARE_INSTRUCTION(Box) |
4699 virtual CompileType ComputeType() const; | 4699 virtual CompileType ComputeType() const; |
4700 | 4700 |
4701 virtual bool CanDeoptimize() const { return false; } | 4701 virtual bool CanDeoptimize() const { return false; } |
4702 virtual intptr_t DeoptimizationTarget() const { | 4702 virtual intptr_t DeoptimizationTarget() const { |
4703 return Isolate::kNoDeoptId; | 4703 return Thread::kNoDeoptId; |
4704 } | 4704 } |
4705 | 4705 |
4706 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4706 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
4707 ASSERT(idx == 0); | 4707 ASSERT(idx == 0); |
4708 return from_representation(); | 4708 return from_representation(); |
4709 } | 4709 } |
4710 | 4710 |
4711 virtual bool AttributesEqual(Instruction* other) const { | 4711 virtual bool AttributesEqual(Instruction* other) const { |
4712 return other->AsBox()->from_representation() == from_representation(); | 4712 return other->AsBox()->from_representation() == from_representation(); |
4713 } | 4713 } |
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7095 private: | 7095 private: |
7096 const Token::Kind op_kind_; | 7096 const Token::Kind op_kind_; |
7097 | 7097 |
7098 DISALLOW_COPY_AND_ASSIGN(UnaryDoubleOpInstr); | 7098 DISALLOW_COPY_AND_ASSIGN(UnaryDoubleOpInstr); |
7099 }; | 7099 }; |
7100 | 7100 |
7101 | 7101 |
7102 class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> { | 7102 class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> { |
7103 public: | 7103 public: |
7104 CheckStackOverflowInstr(intptr_t token_pos, intptr_t loop_depth) | 7104 CheckStackOverflowInstr(intptr_t token_pos, intptr_t loop_depth) |
7105 : TemplateInstruction(Isolate::Current()->GetNextDeoptId()), | 7105 : TemplateInstruction(Thread::Current()->GetNextDeoptId()), |
7106 token_pos_(token_pos), | 7106 token_pos_(token_pos), |
7107 loop_depth_(loop_depth) { | 7107 loop_depth_(loop_depth) { |
7108 } | 7108 } |
7109 | 7109 |
7110 virtual intptr_t token_pos() const { return token_pos_; } | 7110 virtual intptr_t token_pos() const { return token_pos_; } |
7111 bool in_loop() const { return loop_depth_ > 0; } | 7111 bool in_loop() const { return loop_depth_ > 0; } |
7112 intptr_t loop_depth() const { return loop_depth_; } | 7112 intptr_t loop_depth() const { return loop_depth_; } |
7113 | 7113 |
7114 DECLARE_INSTRUCTION(CheckStackOverflow) | 7114 DECLARE_INSTRUCTION(CheckStackOverflow) |
7115 | 7115 |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8111 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8111 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
8112 UNIMPLEMENTED(); \ | 8112 UNIMPLEMENTED(); \ |
8113 return NULL; \ | 8113 return NULL; \ |
8114 } \ | 8114 } \ |
8115 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8115 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
8116 | 8116 |
8117 | 8117 |
8118 } // namespace dart | 8118 } // namespace dart |
8119 | 8119 |
8120 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8120 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |