Chromium Code Reviews| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 cid_(other.cid_), | 135 cid_(other.cid_), |
| 136 type_(other.type_) { } | 136 type_(other.type_) { } |
| 137 | 137 |
| 138 CompileType& operator=(const CompileType& other) { | 138 CompileType& operator=(const CompileType& other) { |
| 139 is_nullable_ = other.is_nullable_; | 139 is_nullable_ = other.is_nullable_; |
| 140 cid_ = other.cid_; | 140 cid_ = other.cid_; |
| 141 type_ = other.type_; | 141 type_ = other.type_; |
| 142 return *this; | 142 return *this; |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool is_nullable() const { return is_nullable_; } | |
| 146 | |
| 145 // Return type such that concrete value's type in runtime is guaranteed to | 147 // Return type such that concrete value's type in runtime is guaranteed to |
| 146 // be subtype of it. | 148 // be subtype of it. |
| 147 const AbstractType* ToAbstractType(); | 149 const AbstractType* ToAbstractType(); |
| 148 | 150 |
| 149 // Return class id such that it is either kDynamicCid or in runtime | 151 // Return class id such that it is either kDynamicCid or in runtime |
| 150 // value is guaranteed to have an equal class id. | 152 // value is guaranteed to have an equal class id. |
| 151 intptr_t ToCid(); | 153 intptr_t ToCid(); |
| 152 | 154 |
| 153 // Return class id such that it is either kDynamicCid or in runtime | 155 // Return class id such that it is either kDynamicCid or in runtime |
| 154 // value is guaranteed to be either null or have an equal class id. | 156 // value is guaranteed to be either null or have an equal class id. |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 169 bool IsAssignableTo(const AbstractType& type) { | 171 bool IsAssignableTo(const AbstractType& type) { |
| 170 bool is_instance; | 172 bool is_instance; |
| 171 return CanComputeIsInstanceOf(type, kNullable, &is_instance) && | 173 return CanComputeIsInstanceOf(type, kNullable, &is_instance) && |
| 172 is_instance; | 174 is_instance; |
| 173 } | 175 } |
| 174 | 176 |
| 175 // Create a new CompileType representing given combination of class id and | 177 // Create a new CompileType representing given combination of class id and |
| 176 // abstract type. The pair is assumed to be coherent. | 178 // abstract type. The pair is assumed to be coherent. |
| 177 static CompileType Create(intptr_t cid, const AbstractType& type); | 179 static CompileType Create(intptr_t cid, const AbstractType& type); |
| 178 | 180 |
| 181 CompileType CopyNonNullable() const { | |
| 182 return CompileType(kNonNullable, cid_, type_); | |
| 183 } | |
| 184 | |
| 185 static CompileType CreateNullable(bool is_nullable, intptr_t cid) { | |
| 186 return CompileType(is_nullable, cid, NULL); | |
| 187 } | |
| 188 | |
| 179 // Create a new CompileType representing given abstract type. By default | 189 // Create a new CompileType representing given abstract type. By default |
| 180 // values as assumed to be nullable. | 190 // values as assumed to be nullable. |
| 181 static CompileType FromAbstractType(const AbstractType& type, | 191 static CompileType FromAbstractType(const AbstractType& type, |
| 182 bool is_nullable = kNullable); | 192 bool is_nullable = kNullable); |
| 183 | 193 |
| 184 // Create a new CompileType representing an value with the given class id. | 194 // Create a new CompileType representing an value with the given class id. |
| 185 // Resulting CompileType is nullable only if cid is kDynamicCid or kNullCid. | 195 // Resulting CompileType is nullable only if cid is kDynamicCid or kNullCid. |
| 186 static CompileType FromCid(intptr_t cid); | 196 static CompileType FromCid(intptr_t cid); |
| 187 | 197 |
| 188 // Create None CompileType. It is the bottom of the lattice and is used to | 198 // Create None CompileType. It is the bottom of the lattice and is used to |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 intptr_t cid_; | 239 intptr_t cid_; |
| 230 const AbstractType* type_; | 240 const AbstractType* type_; |
| 231 }; | 241 }; |
| 232 | 242 |
| 233 | 243 |
| 234 // Zone allocated wrapper for the CompileType value. | 244 // Zone allocated wrapper for the CompileType value. |
| 235 class ZoneCompileType : public ZoneAllocated { | 245 class ZoneCompileType : public ZoneAllocated { |
| 236 public: | 246 public: |
| 237 static CompileType* Wrap(const CompileType& type) { | 247 static CompileType* Wrap(const CompileType& type) { |
| 238 ZoneCompileType* zone_type = new ZoneCompileType(type); | 248 ZoneCompileType* zone_type = new ZoneCompileType(type); |
| 239 return &zone_type->type_; | 249 return zone_type->ToCompileType(); |
| 240 } | 250 } |
| 241 | 251 |
| 242 private: | 252 CompileType* ToCompileType() { |
| 253 return &type_; | |
| 254 } | |
| 255 | |
| 256 protected: | |
| 243 explicit ZoneCompileType(const CompileType& type) : type_(type) { } | 257 explicit ZoneCompileType(const CompileType& type) : type_(type) { } |
| 244 | 258 |
| 245 CompileType type_; | 259 CompileType type_; |
| 246 }; | 260 }; |
| 247 | 261 |
| 248 | 262 |
| 263 class ConstrainedCompileType : public ZoneCompileType { | |
|
srdjan
2013/03/18 18:54:35
Please add comments, documenting the two added cla
Vyacheslav Egorov (Google)
2013/03/18 19:41:18
Done.
| |
| 264 public: | |
| 265 virtual void Update() = 0; | |
| 266 | |
| 267 protected: | |
| 268 explicit ConstrainedCompileType(const CompileType& type) | |
| 269 : ZoneCompileType(type) { } | |
| 270 }; | |
| 271 | |
| 272 | |
| 273 class NotNullConstrainedCompileType : public ConstrainedCompileType { | |
| 274 public: | |
| 275 explicit NotNullConstrainedCompileType(CompileType* source) | |
| 276 : ConstrainedCompileType(source->CopyNonNullable()), source_(source) { } | |
| 277 | |
| 278 virtual void Update() { | |
| 279 type_ = source_->CopyNonNullable(); | |
| 280 } | |
| 281 | |
| 282 private: | |
| 283 CompileType* source_; | |
| 284 }; | |
| 285 | |
| 286 | |
| 249 class Value : public ZoneAllocated { | 287 class Value : public ZoneAllocated { |
| 250 public: | 288 public: |
| 251 // A forward iterator that allows removing the current value from the | 289 // A forward iterator that allows removing the current value from the |
| 252 // underlying use list during iteration. | 290 // underlying use list during iteration. |
| 253 class Iterator { | 291 class Iterator { |
| 254 public: | 292 public: |
| 255 explicit Iterator(Value* head) : next_(head) { Advance(); } | 293 explicit Iterator(Value* head) : next_(head) { Advance(); } |
| 256 Value* Current() const { return current_; } | 294 Value* Current() const { return current_; } |
| 257 bool Done() const { return current_ == NULL; } | 295 bool Done() const { return current_ == NULL; } |
| 258 void Advance() { | 296 void Advance() { |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 474 M(BoxDouble) \ | 512 M(BoxDouble) \ |
| 475 M(UnboxInteger) \ | 513 M(UnboxInteger) \ |
| 476 M(BoxInteger) \ | 514 M(BoxInteger) \ |
| 477 M(BinaryMintOp) \ | 515 M(BinaryMintOp) \ |
| 478 M(ShiftMintOp) \ | 516 M(ShiftMintOp) \ |
| 479 M(UnaryMintOp) \ | 517 M(UnaryMintOp) \ |
| 480 M(CheckArrayBound) \ | 518 M(CheckArrayBound) \ |
| 481 M(Constraint) \ | 519 M(Constraint) \ |
| 482 M(StringFromCharCode) \ | 520 M(StringFromCharCode) \ |
| 483 M(InvokeMathCFunction) \ | 521 M(InvokeMathCFunction) \ |
| 522 M(GuardField) \ | |
| 484 | 523 |
| 485 | 524 |
| 486 #define FORWARD_DECLARATION(type) class type##Instr; | 525 #define FORWARD_DECLARATION(type) class type##Instr; |
| 487 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) | 526 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) |
| 488 #undef FORWARD_DECLARATION | 527 #undef FORWARD_DECLARATION |
| 489 | 528 |
| 490 | 529 |
| 491 // Functions required in all concrete instruction classes. | 530 // Functions required in all concrete instruction classes. |
| 492 #define DECLARE_INSTRUCTION(type) \ | 531 #define DECLARE_INSTRUCTION(type) \ |
| 493 virtual Tag tag() const { return k##type; } \ | 532 virtual Tag tag() const { return k##type; } \ |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 723 friend class UnboxIntegerInstr; | 762 friend class UnboxIntegerInstr; |
| 724 friend class UnboxDoubleInstr; | 763 friend class UnboxDoubleInstr; |
| 725 friend class BinaryDoubleOpInstr; | 764 friend class BinaryDoubleOpInstr; |
| 726 friend class BinaryMintOpInstr; | 765 friend class BinaryMintOpInstr; |
| 727 friend class BinarySmiOpInstr; | 766 friend class BinarySmiOpInstr; |
| 728 friend class UnarySmiOpInstr; | 767 friend class UnarySmiOpInstr; |
| 729 friend class ShiftMintOpInstr; | 768 friend class ShiftMintOpInstr; |
| 730 friend class UnaryMintOpInstr; | 769 friend class UnaryMintOpInstr; |
| 731 friend class MathSqrtInstr; | 770 friend class MathSqrtInstr; |
| 732 friend class CheckClassInstr; | 771 friend class CheckClassInstr; |
| 772 friend class GuardFieldInstr; | |
| 733 friend class CheckSmiInstr; | 773 friend class CheckSmiInstr; |
| 734 friend class CheckArrayBoundInstr; | 774 friend class CheckArrayBoundInstr; |
| 735 friend class CheckEitherNonSmiInstr; | 775 friend class CheckEitherNonSmiInstr; |
| 736 friend class LICM; | 776 friend class LICM; |
| 737 friend class DoubleToSmiInstr; | 777 friend class DoubleToSmiInstr; |
| 738 friend class DoubleToDoubleInstr; | 778 friend class DoubleToDoubleInstr; |
| 739 friend class InvokeMathCFunctionInstr; | 779 friend class InvokeMathCFunctionInstr; |
| 740 friend class FlowGraphOptimizer; | 780 friend class FlowGraphOptimizer; |
| 741 friend class LoadIndexedInstr; | 781 friend class LoadIndexedInstr; |
| 742 friend class StoreIndexedInstr; | 782 friend class StoreIndexedInstr; |
| 783 friend class StoreInstanceFieldInstr; | |
| 743 | 784 |
| 744 virtual void RawSetInputAt(intptr_t i, Value* value) = 0; | 785 virtual void RawSetInputAt(intptr_t i, Value* value) = 0; |
| 745 | 786 |
| 746 intptr_t deopt_id_; | 787 intptr_t deopt_id_; |
| 747 intptr_t lifetime_position_; // Position used by register allocator. | 788 intptr_t lifetime_position_; // Position used by register allocator. |
| 748 Instruction* previous_; | 789 Instruction* previous_; |
| 749 Instruction* next_; | 790 Instruction* next_; |
| 750 Environment* env_; | 791 Environment* env_; |
| 751 intptr_t expr_id_; | 792 intptr_t expr_id_; |
| 752 | 793 |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1759 // its comparison with another comparison that has been removed from the | 1800 // its comparison with another comparison that has been removed from the |
| 1760 // graph but still has uses properly linked into their definition's use | 1801 // graph but still has uses properly linked into their definition's use |
| 1761 // list. | 1802 // list. |
| 1762 void ReplaceWith(ComparisonInstr* other, | 1803 void ReplaceWith(ComparisonInstr* other, |
| 1763 ForwardInstructionIterator* ignored); | 1804 ForwardInstructionIterator* ignored); |
| 1764 | 1805 |
| 1765 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | 1806 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 1766 | 1807 |
| 1767 virtual void PrintTo(BufferFormatter* f) const; | 1808 virtual void PrintTo(BufferFormatter* f) const; |
| 1768 | 1809 |
| 1810 ConstrainedCompileType* constrained_type() const { | |
| 1811 return constrained_type_; | |
| 1812 } | |
| 1813 | |
| 1814 void set_constrained_type(ConstrainedCompileType* type) { | |
| 1815 constrained_type_ = type; | |
| 1816 } | |
| 1817 | |
| 1769 private: | 1818 private: |
| 1770 virtual void RawSetInputAt(intptr_t i, Value* value); | 1819 virtual void RawSetInputAt(intptr_t i, Value* value); |
| 1771 | 1820 |
| 1772 ComparisonInstr* comparison_; | 1821 ComparisonInstr* comparison_; |
| 1773 const bool is_checked_; | 1822 const bool is_checked_; |
| 1774 | 1823 |
| 1824 ConstrainedCompileType* constrained_type_; | |
| 1825 | |
| 1775 DISALLOW_COPY_AND_ASSIGN(BranchInstr); | 1826 DISALLOW_COPY_AND_ASSIGN(BranchInstr); |
| 1776 }; | 1827 }; |
| 1777 | 1828 |
| 1778 | 1829 |
| 1779 class StoreContextInstr : public TemplateInstruction<1> { | 1830 class StoreContextInstr : public TemplateInstruction<1> { |
| 1780 public: | 1831 public: |
| 1781 explicit StoreContextInstr(Value* value) { | 1832 explicit StoreContextInstr(Value* value) { |
| 1782 SetInputAt(0, value); | 1833 SetInputAt(0, value); |
| 1783 } | 1834 } |
| 1784 | 1835 |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2749 kEmitStoreBarrier | 2800 kEmitStoreBarrier |
| 2750 }; | 2801 }; |
| 2751 | 2802 |
| 2752 | 2803 |
| 2753 class StoreInstanceFieldInstr : public TemplateDefinition<2> { | 2804 class StoreInstanceFieldInstr : public TemplateDefinition<2> { |
| 2754 public: | 2805 public: |
| 2755 StoreInstanceFieldInstr(const Field& field, | 2806 StoreInstanceFieldInstr(const Field& field, |
| 2756 Value* instance, | 2807 Value* instance, |
| 2757 Value* value, | 2808 Value* value, |
| 2758 StoreBarrierType emit_store_barrier) | 2809 StoreBarrierType emit_store_barrier) |
| 2759 : field_(field), emit_store_barrier_(emit_store_barrier) { | 2810 : field_(field), |
| 2811 emit_store_barrier_(emit_store_barrier) { | |
| 2760 SetInputAt(0, instance); | 2812 SetInputAt(0, instance); |
| 2761 SetInputAt(1, value); | 2813 SetInputAt(1, value); |
| 2762 } | 2814 } |
| 2763 | 2815 |
| 2816 void SetDeoptId(intptr_t deopt_id) { | |
| 2817 ASSERT(CanDeoptimize()); | |
| 2818 deopt_id_ = deopt_id; | |
| 2819 } | |
| 2820 | |
| 2764 DECLARE_INSTRUCTION(StoreInstanceField) | 2821 DECLARE_INSTRUCTION(StoreInstanceField) |
| 2765 virtual CompileType* ComputeInitialType() const; | 2822 virtual CompileType* ComputeInitialType() const; |
| 2766 | 2823 |
| 2767 const Field& field() const { return field_; } | 2824 const Field& field() const { return field_; } |
| 2768 | 2825 |
| 2769 Value* instance() const { return inputs_[0]; } | 2826 Value* instance() const { return inputs_[0]; } |
| 2770 Value* value() const { return inputs_[1]; } | 2827 Value* value() const { return inputs_[1]; } |
| 2771 bool ShouldEmitStoreBarrier() const { | 2828 bool ShouldEmitStoreBarrier() const { |
| 2772 return value()->NeedsStoreBuffer() | 2829 return value()->NeedsStoreBuffer() |
| 2773 && (emit_store_barrier_ == kEmitStoreBarrier); | 2830 && (emit_store_barrier_ == kEmitStoreBarrier); |
| 2774 } | 2831 } |
| 2775 | 2832 |
| 2776 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2833 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2777 | 2834 |
| 2778 virtual bool CanDeoptimize() const { return false; } | 2835 virtual bool CanDeoptimize() const { return false; } |
| 2779 | 2836 |
| 2780 virtual bool HasSideEffect() const { return true; } | 2837 virtual bool HasSideEffect() const { return true; } |
| 2781 | 2838 |
| 2782 private: | 2839 private: |
| 2783 const Field& field_; | 2840 const Field& field_; |
| 2784 const StoreBarrierType emit_store_barrier_; | 2841 const StoreBarrierType emit_store_barrier_; |
| 2785 | 2842 |
| 2786 DISALLOW_COPY_AND_ASSIGN(StoreInstanceFieldInstr); | 2843 DISALLOW_COPY_AND_ASSIGN(StoreInstanceFieldInstr); |
| 2787 }; | 2844 }; |
| 2788 | 2845 |
| 2789 | 2846 |
| 2847 class GuardFieldInstr : public TemplateInstruction<1> { | |
| 2848 public: | |
| 2849 GuardFieldInstr(Value* value, | |
| 2850 const Field& field, | |
| 2851 intptr_t deopt_id) | |
| 2852 : field_(field) { | |
| 2853 deopt_id_ = deopt_id; | |
| 2854 SetInputAt(0, value); | |
| 2855 } | |
| 2856 | |
| 2857 DECLARE_INSTRUCTION(GuardField) | |
| 2858 | |
| 2859 virtual intptr_t ArgumentCount() const { return 0; } | |
| 2860 | |
| 2861 virtual bool CanDeoptimize() const { return true; } | |
| 2862 | |
| 2863 virtual bool HasSideEffect() const { return false; } | |
| 2864 | |
| 2865 virtual bool AttributesEqual(Instruction* other) const; | |
| 2866 | |
| 2867 virtual bool AffectedBySideEffect() const; | |
| 2868 | |
| 2869 Value* value() const { return inputs_[0]; } | |
| 2870 | |
| 2871 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | |
| 2872 | |
| 2873 virtual void PrintOperandsTo(BufferFormatter* f) const; | |
| 2874 | |
| 2875 const Field& field() const { return field_; } | |
| 2876 | |
| 2877 private: | |
| 2878 const Field& field_; | |
| 2879 | |
| 2880 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); | |
| 2881 }; | |
| 2882 | |
| 2883 | |
| 2790 class LoadStaticFieldInstr : public TemplateDefinition<0> { | 2884 class LoadStaticFieldInstr : public TemplateDefinition<0> { |
| 2791 public: | 2885 public: |
| 2792 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} | 2886 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} |
| 2793 | 2887 |
| 2794 DECLARE_INSTRUCTION(LoadStaticField); | 2888 DECLARE_INSTRUCTION(LoadStaticField); |
| 2795 virtual CompileType ComputeType() const; | 2889 virtual CompileType ComputeType() const; |
| 2796 | 2890 |
| 2797 const Field& field() const { return field_; } | 2891 const Field& field() const { return field_; } |
| 2798 | 2892 |
| 2799 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2893 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3173 class LoadFieldInstr : public TemplateDefinition<1> { | 3267 class LoadFieldInstr : public TemplateDefinition<1> { |
| 3174 public: | 3268 public: |
| 3175 LoadFieldInstr(Value* value, | 3269 LoadFieldInstr(Value* value, |
| 3176 intptr_t offset_in_bytes, | 3270 intptr_t offset_in_bytes, |
| 3177 const AbstractType& type, | 3271 const AbstractType& type, |
| 3178 bool immutable = false) | 3272 bool immutable = false) |
| 3179 : offset_in_bytes_(offset_in_bytes), | 3273 : offset_in_bytes_(offset_in_bytes), |
| 3180 type_(type), | 3274 type_(type), |
| 3181 result_cid_(kDynamicCid), | 3275 result_cid_(kDynamicCid), |
| 3182 immutable_(immutable), | 3276 immutable_(immutable), |
| 3183 recognized_kind_(MethodRecognizer::kUnknown) { | 3277 recognized_kind_(MethodRecognizer::kUnknown), |
| 3278 field_name_(NULL), | |
| 3279 field_(NULL) { | |
| 3184 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. | 3280 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. |
| 3185 SetInputAt(0, value); | 3281 SetInputAt(0, value); |
| 3186 } | 3282 } |
| 3187 | 3283 |
| 3188 DECLARE_INSTRUCTION(LoadField) | 3284 DECLARE_INSTRUCTION(LoadField) |
| 3189 virtual CompileType ComputeType() const; | 3285 virtual CompileType ComputeType() const; |
| 3190 | 3286 |
| 3191 Value* value() const { return inputs_[0]; } | 3287 Value* value() const { return inputs_[0]; } |
| 3192 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 3288 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
| 3193 const AbstractType& type() const { return type_; } | 3289 const AbstractType& type() const { return type_; } |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 3214 } | 3310 } |
| 3215 | 3311 |
| 3216 bool IsImmutableLengthLoad() const; | 3312 bool IsImmutableLengthLoad() const; |
| 3217 | 3313 |
| 3218 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 3314 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 3219 | 3315 |
| 3220 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); | 3316 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); |
| 3221 | 3317 |
| 3222 static bool IsFixedLengthArrayCid(intptr_t cid); | 3318 static bool IsFixedLengthArrayCid(intptr_t cid); |
| 3223 | 3319 |
| 3320 void set_field_name(const char* name) { field_name_ = name; } | |
| 3321 const char* field_name() const { return field_name_; } | |
| 3322 | |
| 3323 Field* field() const { return field_; } | |
| 3324 void set_field(Field* field) { field_ = field; } | |
| 3325 | |
| 3224 private: | 3326 private: |
| 3225 const intptr_t offset_in_bytes_; | 3327 const intptr_t offset_in_bytes_; |
| 3226 const AbstractType& type_; | 3328 const AbstractType& type_; |
| 3227 intptr_t result_cid_; | 3329 intptr_t result_cid_; |
| 3228 const bool immutable_; | 3330 const bool immutable_; |
| 3229 | 3331 |
| 3230 MethodRecognizer::Kind recognized_kind_; | 3332 MethodRecognizer::Kind recognized_kind_; |
| 3231 | 3333 |
| 3334 const char* field_name_; | |
| 3335 Field* field_; | |
| 3336 | |
| 3232 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); | 3337 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); |
| 3233 }; | 3338 }; |
| 3234 | 3339 |
| 3235 | 3340 |
| 3236 class StoreVMFieldInstr : public TemplateDefinition<2> { | 3341 class StoreVMFieldInstr : public TemplateDefinition<2> { |
| 3237 public: | 3342 public: |
| 3238 StoreVMFieldInstr(Value* dest, | 3343 StoreVMFieldInstr(Value* dest, |
| 3239 intptr_t offset_in_bytes, | 3344 intptr_t offset_in_bytes, |
| 3240 Value* value, | 3345 Value* value, |
| 3241 const AbstractType& type) | 3346 const AbstractType& type) |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4206 virtual bool AffectedBySideEffect() const; | 4311 virtual bool AffectedBySideEffect() const; |
| 4207 | 4312 |
| 4208 Value* value() const { return inputs_[0]; } | 4313 Value* value() const { return inputs_[0]; } |
| 4209 | 4314 |
| 4210 const ICData& unary_checks() const { return unary_checks_; } | 4315 const ICData& unary_checks() const { return unary_checks_; } |
| 4211 | 4316 |
| 4212 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | 4317 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 4213 | 4318 |
| 4214 virtual void PrintOperandsTo(BufferFormatter* f) const; | 4319 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 4215 | 4320 |
| 4321 void set_null_check(bool flag) { null_check_ = flag; } | |
| 4322 | |
| 4323 bool null_check() const { return null_check_; } | |
| 4324 | |
| 4216 private: | 4325 private: |
| 4217 const ICData& unary_checks_; | 4326 const ICData& unary_checks_; |
| 4218 | 4327 |
| 4328 bool null_check_; | |
| 4329 | |
| 4219 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); | 4330 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); |
| 4220 }; | 4331 }; |
| 4221 | 4332 |
| 4222 | 4333 |
| 4223 class CheckSmiInstr : public TemplateInstruction<1> { | 4334 class CheckSmiInstr : public TemplateInstruction<1> { |
| 4224 public: | 4335 public: |
| 4225 CheckSmiInstr(Value* value, intptr_t original_deopt_id) { | 4336 CheckSmiInstr(Value* value, intptr_t original_deopt_id) { |
| 4226 ASSERT(original_deopt_id != Isolate::kNoDeoptId); | 4337 ASSERT(original_deopt_id != Isolate::kNoDeoptId); |
| 4227 SetInputAt(0, value); | 4338 SetInputAt(0, value); |
| 4228 deopt_id_ = original_deopt_id; | 4339 deopt_id_ = original_deopt_id; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4514 ForwardInstructionIterator* current_iterator_; | 4625 ForwardInstructionIterator* current_iterator_; |
| 4515 | 4626 |
| 4516 private: | 4627 private: |
| 4517 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4628 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4518 }; | 4629 }; |
| 4519 | 4630 |
| 4520 | 4631 |
| 4521 } // namespace dart | 4632 } // namespace dart |
| 4522 | 4633 |
| 4523 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4634 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |