| 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 // ConstrainedCompileType represents a compile type that is computed from |
| 264 // another compile type. |
| 265 class ConstrainedCompileType : public ZoneCompileType { |
| 266 public: |
| 267 // Recompute compile type. |
| 268 virtual void Update() = 0; |
| 269 |
| 270 protected: |
| 271 explicit ConstrainedCompileType(const CompileType& type) |
| 272 : ZoneCompileType(type) { } |
| 273 }; |
| 274 |
| 275 |
| 276 // NotNullConstrainedCompileType represents not-null constraint applied to |
| 277 // the source compile type. Result is non-nullable version of the incomming |
| 278 // compile type. It is used to represent compile type propagated downwards |
| 279 // from strict comparison with the null constant. |
| 280 class NotNullConstrainedCompileType : public ConstrainedCompileType { |
| 281 public: |
| 282 explicit NotNullConstrainedCompileType(CompileType* source) |
| 283 : ConstrainedCompileType(source->CopyNonNullable()), source_(source) { } |
| 284 |
| 285 virtual void Update() { |
| 286 type_ = source_->CopyNonNullable(); |
| 287 } |
| 288 |
| 289 private: |
| 290 CompileType* source_; |
| 291 }; |
| 292 |
| 293 |
| 249 class Value : public ZoneAllocated { | 294 class Value : public ZoneAllocated { |
| 250 public: | 295 public: |
| 251 // A forward iterator that allows removing the current value from the | 296 // A forward iterator that allows removing the current value from the |
| 252 // underlying use list during iteration. | 297 // underlying use list during iteration. |
| 253 class Iterator { | 298 class Iterator { |
| 254 public: | 299 public: |
| 255 explicit Iterator(Value* head) : next_(head) { Advance(); } | 300 explicit Iterator(Value* head) : next_(head) { Advance(); } |
| 256 Value* Current() const { return current_; } | 301 Value* Current() const { return current_; } |
| 257 bool Done() const { return current_ == NULL; } | 302 bool Done() const { return current_ == NULL; } |
| 258 void Advance() { | 303 void Advance() { |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 M(BoxDouble) \ | 519 M(BoxDouble) \ |
| 475 M(UnboxInteger) \ | 520 M(UnboxInteger) \ |
| 476 M(BoxInteger) \ | 521 M(BoxInteger) \ |
| 477 M(BinaryMintOp) \ | 522 M(BinaryMintOp) \ |
| 478 M(ShiftMintOp) \ | 523 M(ShiftMintOp) \ |
| 479 M(UnaryMintOp) \ | 524 M(UnaryMintOp) \ |
| 480 M(CheckArrayBound) \ | 525 M(CheckArrayBound) \ |
| 481 M(Constraint) \ | 526 M(Constraint) \ |
| 482 M(StringFromCharCode) \ | 527 M(StringFromCharCode) \ |
| 483 M(InvokeMathCFunction) \ | 528 M(InvokeMathCFunction) \ |
| 529 M(GuardField) \ |
| 484 | 530 |
| 485 | 531 |
| 486 #define FORWARD_DECLARATION(type) class type##Instr; | 532 #define FORWARD_DECLARATION(type) class type##Instr; |
| 487 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) | 533 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) |
| 488 #undef FORWARD_DECLARATION | 534 #undef FORWARD_DECLARATION |
| 489 | 535 |
| 490 | 536 |
| 491 // Functions required in all concrete instruction classes. | 537 // Functions required in all concrete instruction classes. |
| 492 #define DECLARE_INSTRUCTION(type) \ | 538 #define DECLARE_INSTRUCTION(type) \ |
| 493 virtual Tag tag() const { return k##type; } \ | 539 virtual Tag tag() const { return k##type; } \ |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 friend class UnboxIntegerInstr; | 769 friend class UnboxIntegerInstr; |
| 724 friend class UnboxDoubleInstr; | 770 friend class UnboxDoubleInstr; |
| 725 friend class BinaryDoubleOpInstr; | 771 friend class BinaryDoubleOpInstr; |
| 726 friend class BinaryMintOpInstr; | 772 friend class BinaryMintOpInstr; |
| 727 friend class BinarySmiOpInstr; | 773 friend class BinarySmiOpInstr; |
| 728 friend class UnarySmiOpInstr; | 774 friend class UnarySmiOpInstr; |
| 729 friend class ShiftMintOpInstr; | 775 friend class ShiftMintOpInstr; |
| 730 friend class UnaryMintOpInstr; | 776 friend class UnaryMintOpInstr; |
| 731 friend class MathSqrtInstr; | 777 friend class MathSqrtInstr; |
| 732 friend class CheckClassInstr; | 778 friend class CheckClassInstr; |
| 779 friend class GuardFieldInstr; |
| 733 friend class CheckSmiInstr; | 780 friend class CheckSmiInstr; |
| 734 friend class CheckArrayBoundInstr; | 781 friend class CheckArrayBoundInstr; |
| 735 friend class CheckEitherNonSmiInstr; | 782 friend class CheckEitherNonSmiInstr; |
| 736 friend class LICM; | 783 friend class LICM; |
| 737 friend class DoubleToSmiInstr; | 784 friend class DoubleToSmiInstr; |
| 738 friend class DoubleToDoubleInstr; | 785 friend class DoubleToDoubleInstr; |
| 739 friend class InvokeMathCFunctionInstr; | 786 friend class InvokeMathCFunctionInstr; |
| 740 friend class FlowGraphOptimizer; | 787 friend class FlowGraphOptimizer; |
| 741 friend class LoadIndexedInstr; | 788 friend class LoadIndexedInstr; |
| 742 friend class StoreIndexedInstr; | 789 friend class StoreIndexedInstr; |
| 790 friend class StoreInstanceFieldInstr; |
| 743 | 791 |
| 744 virtual void RawSetInputAt(intptr_t i, Value* value) = 0; | 792 virtual void RawSetInputAt(intptr_t i, Value* value) = 0; |
| 745 | 793 |
| 746 intptr_t deopt_id_; | 794 intptr_t deopt_id_; |
| 747 intptr_t lifetime_position_; // Position used by register allocator. | 795 intptr_t lifetime_position_; // Position used by register allocator. |
| 748 Instruction* previous_; | 796 Instruction* previous_; |
| 749 Instruction* next_; | 797 Instruction* next_; |
| 750 Environment* env_; | 798 Environment* env_; |
| 751 intptr_t expr_id_; | 799 intptr_t expr_id_; |
| 752 | 800 |
| (...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 | 1807 // its comparison with another comparison that has been removed from the |
| 1760 // graph but still has uses properly linked into their definition's use | 1808 // graph but still has uses properly linked into their definition's use |
| 1761 // list. | 1809 // list. |
| 1762 void ReplaceWith(ComparisonInstr* other, | 1810 void ReplaceWith(ComparisonInstr* other, |
| 1763 ForwardInstructionIterator* ignored); | 1811 ForwardInstructionIterator* ignored); |
| 1764 | 1812 |
| 1765 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | 1813 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 1766 | 1814 |
| 1767 virtual void PrintTo(BufferFormatter* f) const; | 1815 virtual void PrintTo(BufferFormatter* f) const; |
| 1768 | 1816 |
| 1817 // Set compile type constrained by the comparison of this branch. |
| 1818 // FlowGraphPropagator propagates it downwards into either true or false |
| 1819 // successor. |
| 1820 void set_constrained_type(ConstrainedCompileType* type) { |
| 1821 constrained_type_ = type; |
| 1822 } |
| 1823 |
| 1824 // Return compile type constrained by the comparison of this branch. |
| 1825 ConstrainedCompileType* constrained_type() const { |
| 1826 return constrained_type_; |
| 1827 } |
| 1828 |
| 1769 private: | 1829 private: |
| 1770 virtual void RawSetInputAt(intptr_t i, Value* value); | 1830 virtual void RawSetInputAt(intptr_t i, Value* value); |
| 1771 | 1831 |
| 1772 ComparisonInstr* comparison_; | 1832 ComparisonInstr* comparison_; |
| 1773 const bool is_checked_; | 1833 const bool is_checked_; |
| 1774 | 1834 |
| 1835 ConstrainedCompileType* constrained_type_; |
| 1836 |
| 1775 DISALLOW_COPY_AND_ASSIGN(BranchInstr); | 1837 DISALLOW_COPY_AND_ASSIGN(BranchInstr); |
| 1776 }; | 1838 }; |
| 1777 | 1839 |
| 1778 | 1840 |
| 1779 class StoreContextInstr : public TemplateInstruction<1> { | 1841 class StoreContextInstr : public TemplateInstruction<1> { |
| 1780 public: | 1842 public: |
| 1781 explicit StoreContextInstr(Value* value) { | 1843 explicit StoreContextInstr(Value* value) { |
| 1782 SetInputAt(0, value); | 1844 SetInputAt(0, value); |
| 1783 } | 1845 } |
| 1784 | 1846 |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 kEmitStoreBarrier | 2811 kEmitStoreBarrier |
| 2750 }; | 2812 }; |
| 2751 | 2813 |
| 2752 | 2814 |
| 2753 class StoreInstanceFieldInstr : public TemplateDefinition<2> { | 2815 class StoreInstanceFieldInstr : public TemplateDefinition<2> { |
| 2754 public: | 2816 public: |
| 2755 StoreInstanceFieldInstr(const Field& field, | 2817 StoreInstanceFieldInstr(const Field& field, |
| 2756 Value* instance, | 2818 Value* instance, |
| 2757 Value* value, | 2819 Value* value, |
| 2758 StoreBarrierType emit_store_barrier) | 2820 StoreBarrierType emit_store_barrier) |
| 2759 : field_(field), emit_store_barrier_(emit_store_barrier) { | 2821 : field_(field), |
| 2822 emit_store_barrier_(emit_store_barrier) { |
| 2760 SetInputAt(0, instance); | 2823 SetInputAt(0, instance); |
| 2761 SetInputAt(1, value); | 2824 SetInputAt(1, value); |
| 2762 } | 2825 } |
| 2763 | 2826 |
| 2827 void SetDeoptId(intptr_t deopt_id) { |
| 2828 ASSERT(CanDeoptimize()); |
| 2829 deopt_id_ = deopt_id; |
| 2830 } |
| 2831 |
| 2764 DECLARE_INSTRUCTION(StoreInstanceField) | 2832 DECLARE_INSTRUCTION(StoreInstanceField) |
| 2765 virtual CompileType* ComputeInitialType() const; | 2833 virtual CompileType* ComputeInitialType() const; |
| 2766 | 2834 |
| 2767 const Field& field() const { return field_; } | 2835 const Field& field() const { return field_; } |
| 2768 | 2836 |
| 2769 Value* instance() const { return inputs_[0]; } | 2837 Value* instance() const { return inputs_[0]; } |
| 2770 Value* value() const { return inputs_[1]; } | 2838 Value* value() const { return inputs_[1]; } |
| 2771 bool ShouldEmitStoreBarrier() const { | 2839 bool ShouldEmitStoreBarrier() const { |
| 2772 return value()->NeedsStoreBuffer() | 2840 return value()->NeedsStoreBuffer() |
| 2773 && (emit_store_barrier_ == kEmitStoreBarrier); | 2841 && (emit_store_barrier_ == kEmitStoreBarrier); |
| 2774 } | 2842 } |
| 2775 | 2843 |
| 2776 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2844 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2777 | 2845 |
| 2778 virtual bool CanDeoptimize() const { return false; } | 2846 virtual bool CanDeoptimize() const { return false; } |
| 2779 | 2847 |
| 2780 virtual bool HasSideEffect() const { return true; } | 2848 virtual bool HasSideEffect() const { return true; } |
| 2781 | 2849 |
| 2782 private: | 2850 private: |
| 2783 const Field& field_; | 2851 const Field& field_; |
| 2784 const StoreBarrierType emit_store_barrier_; | 2852 const StoreBarrierType emit_store_barrier_; |
| 2785 | 2853 |
| 2786 DISALLOW_COPY_AND_ASSIGN(StoreInstanceFieldInstr); | 2854 DISALLOW_COPY_AND_ASSIGN(StoreInstanceFieldInstr); |
| 2787 }; | 2855 }; |
| 2788 | 2856 |
| 2789 | 2857 |
| 2858 class GuardFieldInstr : public TemplateInstruction<1> { |
| 2859 public: |
| 2860 GuardFieldInstr(Value* value, |
| 2861 const Field& field, |
| 2862 intptr_t deopt_id) |
| 2863 : field_(field) { |
| 2864 deopt_id_ = deopt_id; |
| 2865 SetInputAt(0, value); |
| 2866 } |
| 2867 |
| 2868 DECLARE_INSTRUCTION(GuardField) |
| 2869 |
| 2870 virtual intptr_t ArgumentCount() const { return 0; } |
| 2871 |
| 2872 virtual bool CanDeoptimize() const { return true; } |
| 2873 |
| 2874 virtual bool HasSideEffect() const { return false; } |
| 2875 |
| 2876 virtual bool AttributesEqual(Instruction* other) const; |
| 2877 |
| 2878 virtual bool AffectedBySideEffect() const; |
| 2879 |
| 2880 Value* value() const { return inputs_[0]; } |
| 2881 |
| 2882 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 2883 |
| 2884 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2885 |
| 2886 const Field& field() const { return field_; } |
| 2887 |
| 2888 private: |
| 2889 const Field& field_; |
| 2890 |
| 2891 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); |
| 2892 }; |
| 2893 |
| 2894 |
| 2790 class LoadStaticFieldInstr : public TemplateDefinition<0> { | 2895 class LoadStaticFieldInstr : public TemplateDefinition<0> { |
| 2791 public: | 2896 public: |
| 2792 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} | 2897 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} |
| 2793 | 2898 |
| 2794 DECLARE_INSTRUCTION(LoadStaticField); | 2899 DECLARE_INSTRUCTION(LoadStaticField); |
| 2795 virtual CompileType ComputeType() const; | 2900 virtual CompileType ComputeType() const; |
| 2796 | 2901 |
| 2797 const Field& field() const { return field_; } | 2902 const Field& field() const { return field_; } |
| 2798 | 2903 |
| 2799 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2904 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> { | 3278 class LoadFieldInstr : public TemplateDefinition<1> { |
| 3174 public: | 3279 public: |
| 3175 LoadFieldInstr(Value* value, | 3280 LoadFieldInstr(Value* value, |
| 3176 intptr_t offset_in_bytes, | 3281 intptr_t offset_in_bytes, |
| 3177 const AbstractType& type, | 3282 const AbstractType& type, |
| 3178 bool immutable = false) | 3283 bool immutable = false) |
| 3179 : offset_in_bytes_(offset_in_bytes), | 3284 : offset_in_bytes_(offset_in_bytes), |
| 3180 type_(type), | 3285 type_(type), |
| 3181 result_cid_(kDynamicCid), | 3286 result_cid_(kDynamicCid), |
| 3182 immutable_(immutable), | 3287 immutable_(immutable), |
| 3183 recognized_kind_(MethodRecognizer::kUnknown) { | 3288 recognized_kind_(MethodRecognizer::kUnknown), |
| 3289 field_name_(NULL), |
| 3290 field_(NULL) { |
| 3184 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. | 3291 ASSERT(type.IsZoneHandle()); // May be null if field is not an instance. |
| 3185 SetInputAt(0, value); | 3292 SetInputAt(0, value); |
| 3186 } | 3293 } |
| 3187 | 3294 |
| 3188 DECLARE_INSTRUCTION(LoadField) | 3295 DECLARE_INSTRUCTION(LoadField) |
| 3189 virtual CompileType ComputeType() const; | 3296 virtual CompileType ComputeType() const; |
| 3190 | 3297 |
| 3191 Value* value() const { return inputs_[0]; } | 3298 Value* value() const { return inputs_[0]; } |
| 3192 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 3299 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
| 3193 const AbstractType& type() const { return type_; } | 3300 const AbstractType& type() const { return type_; } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3214 } | 3321 } |
| 3215 | 3322 |
| 3216 bool IsImmutableLengthLoad() const; | 3323 bool IsImmutableLengthLoad() const; |
| 3217 | 3324 |
| 3218 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); | 3325 virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer); |
| 3219 | 3326 |
| 3220 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); | 3327 static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid); |
| 3221 | 3328 |
| 3222 static bool IsFixedLengthArrayCid(intptr_t cid); | 3329 static bool IsFixedLengthArrayCid(intptr_t cid); |
| 3223 | 3330 |
| 3331 void set_field_name(const char* name) { field_name_ = name; } |
| 3332 const char* field_name() const { return field_name_; } |
| 3333 |
| 3334 Field* field() const { return field_; } |
| 3335 void set_field(Field* field) { field_ = field; } |
| 3336 |
| 3224 private: | 3337 private: |
| 3225 const intptr_t offset_in_bytes_; | 3338 const intptr_t offset_in_bytes_; |
| 3226 const AbstractType& type_; | 3339 const AbstractType& type_; |
| 3227 intptr_t result_cid_; | 3340 intptr_t result_cid_; |
| 3228 const bool immutable_; | 3341 const bool immutable_; |
| 3229 | 3342 |
| 3230 MethodRecognizer::Kind recognized_kind_; | 3343 MethodRecognizer::Kind recognized_kind_; |
| 3231 | 3344 |
| 3345 const char* field_name_; |
| 3346 Field* field_; |
| 3347 |
| 3232 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); | 3348 DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr); |
| 3233 }; | 3349 }; |
| 3234 | 3350 |
| 3235 | 3351 |
| 3236 class StoreVMFieldInstr : public TemplateDefinition<2> { | 3352 class StoreVMFieldInstr : public TemplateDefinition<2> { |
| 3237 public: | 3353 public: |
| 3238 StoreVMFieldInstr(Value* dest, | 3354 StoreVMFieldInstr(Value* dest, |
| 3239 intptr_t offset_in_bytes, | 3355 intptr_t offset_in_bytes, |
| 3240 Value* value, | 3356 Value* value, |
| 3241 const AbstractType& type) | 3357 const AbstractType& type) |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4206 virtual bool AffectedBySideEffect() const; | 4322 virtual bool AffectedBySideEffect() const; |
| 4207 | 4323 |
| 4208 Value* value() const { return inputs_[0]; } | 4324 Value* value() const { return inputs_[0]; } |
| 4209 | 4325 |
| 4210 const ICData& unary_checks() const { return unary_checks_; } | 4326 const ICData& unary_checks() const { return unary_checks_; } |
| 4211 | 4327 |
| 4212 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); | 4328 virtual Instruction* Canonicalize(FlowGraphOptimizer* optimizer); |
| 4213 | 4329 |
| 4214 virtual void PrintOperandsTo(BufferFormatter* f) const; | 4330 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 4215 | 4331 |
| 4332 void set_null_check(bool flag) { null_check_ = flag; } |
| 4333 |
| 4334 bool null_check() const { return null_check_; } |
| 4335 |
| 4216 private: | 4336 private: |
| 4217 const ICData& unary_checks_; | 4337 const ICData& unary_checks_; |
| 4218 | 4338 |
| 4339 bool null_check_; |
| 4340 |
| 4219 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); | 4341 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); |
| 4220 }; | 4342 }; |
| 4221 | 4343 |
| 4222 | 4344 |
| 4223 class CheckSmiInstr : public TemplateInstruction<1> { | 4345 class CheckSmiInstr : public TemplateInstruction<1> { |
| 4224 public: | 4346 public: |
| 4225 CheckSmiInstr(Value* value, intptr_t original_deopt_id) { | 4347 CheckSmiInstr(Value* value, intptr_t original_deopt_id) { |
| 4226 ASSERT(original_deopt_id != Isolate::kNoDeoptId); | 4348 ASSERT(original_deopt_id != Isolate::kNoDeoptId); |
| 4227 SetInputAt(0, value); | 4349 SetInputAt(0, value); |
| 4228 deopt_id_ = original_deopt_id; | 4350 deopt_id_ = original_deopt_id; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4514 ForwardInstructionIterator* current_iterator_; | 4636 ForwardInstructionIterator* current_iterator_; |
| 4515 | 4637 |
| 4516 private: | 4638 private: |
| 4517 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4639 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4518 }; | 4640 }; |
| 4519 | 4641 |
| 4520 | 4642 |
| 4521 } // namespace dart | 4643 } // namespace dart |
| 4522 | 4644 |
| 4523 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4645 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |