| 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 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 const AbstractType& dst_type() const { return dst_type_; } | 2491 const AbstractType& dst_type() const { return dst_type_; } |
| 2492 void set_dst_type(const AbstractType& dst_type) { | 2492 void set_dst_type(const AbstractType& dst_type) { |
| 2493 dst_type_ = dst_type.raw(); | 2493 dst_type_ = dst_type.raw(); |
| 2494 } | 2494 } |
| 2495 const String& dst_name() const { return dst_name_; } | 2495 const String& dst_name() const { return dst_name_; } |
| 2496 | 2496 |
| 2497 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2497 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2498 | 2498 |
| 2499 virtual bool CanDeoptimize() const { return true; } | 2499 virtual bool CanDeoptimize() const { return true; } |
| 2500 | 2500 |
| 2501 virtual bool CanBecomeDeoptimizationTarget() const { |
| 2502 // AssertAssignable instructions that are specialized by the optimizer |
| 2503 // (e.g. replaced with CheckClass) need a deoptimization descriptor before. |
| 2504 return true; |
| 2505 } |
| 2506 |
| 2501 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2507 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| 2502 | 2508 |
| 2503 virtual bool AllowsCSE() const { return true; } | 2509 virtual bool AllowsCSE() const { return true; } |
| 2504 virtual EffectSet Effects() const { return EffectSet::None(); } | 2510 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2505 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2511 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2506 virtual bool AttributesEqual(Instruction* other) const; | 2512 virtual bool AttributesEqual(Instruction* other) const; |
| 2507 | 2513 |
| 2508 virtual bool MayThrow() const { return true; } | 2514 virtual bool MayThrow() const { return true; } |
| 2509 | 2515 |
| 2510 private: | 2516 private: |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 2664 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
| 2659 return (*arguments_)[index]; | 2665 return (*arguments_)[index]; |
| 2660 } | 2666 } |
| 2661 const Array& argument_names() const { return argument_names_; } | 2667 const Array& argument_names() const { return argument_names_; } |
| 2662 intptr_t checked_argument_count() const { return checked_argument_count_; } | 2668 intptr_t checked_argument_count() const { return checked_argument_count_; } |
| 2663 | 2669 |
| 2664 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2670 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2665 | 2671 |
| 2666 virtual bool CanDeoptimize() const { return true; } | 2672 virtual bool CanDeoptimize() const { return true; } |
| 2667 | 2673 |
| 2674 virtual bool CanBecomeDeoptimizationTarget() const { |
| 2675 // Instance calls that are specialized by the optimizer need a |
| 2676 // deoptimization descriptor before the call. |
| 2677 return true; |
| 2678 } |
| 2679 |
| 2668 virtual EffectSet Effects() const { return EffectSet::All(); } | 2680 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 2669 | 2681 |
| 2670 virtual bool MayThrow() const { return true; } | 2682 virtual bool MayThrow() const { return true; } |
| 2671 | 2683 |
| 2672 protected: | 2684 protected: |
| 2673 friend class FlowGraphOptimizer; | 2685 friend class FlowGraphOptimizer; |
| 2674 void set_ic_data(ICData* value) { ic_data_ = value; } | 2686 void set_ic_data(ICData* value) { ic_data_ = value; } |
| 2675 | 2687 |
| 2676 private: | 2688 private: |
| 2677 const ICData* ic_data_; | 2689 const ICData* ic_data_; |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3130 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { | 3142 virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const { |
| 3131 return (*arguments_)[index]; | 3143 return (*arguments_)[index]; |
| 3132 } | 3144 } |
| 3133 | 3145 |
| 3134 virtual intptr_t CallCount() const { return ic_data()->AggregateCount(); } | 3146 virtual intptr_t CallCount() const { return ic_data()->AggregateCount(); } |
| 3135 | 3147 |
| 3136 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3148 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3137 | 3149 |
| 3138 virtual bool CanDeoptimize() const { return true; } | 3150 virtual bool CanDeoptimize() const { return true; } |
| 3139 | 3151 |
| 3152 virtual bool CanBecomeDeoptimizationTarget() const { |
| 3153 // Static calls that are specialized by the optimizer (e.g. sqrt) need a |
| 3154 // deoptimization descriptor before the call. |
| 3155 return true; |
| 3156 } |
| 3157 |
| 3140 virtual EffectSet Effects() const { return EffectSet::All(); } | 3158 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 3141 | 3159 |
| 3142 void set_result_cid(intptr_t value) { result_cid_ = value; } | 3160 void set_result_cid(intptr_t value) { result_cid_ = value; } |
| 3143 | 3161 |
| 3144 bool is_known_list_constructor() const { return is_known_list_constructor_; } | 3162 bool is_known_list_constructor() const { return is_known_list_constructor_; } |
| 3145 void set_is_known_list_constructor(bool value) { | 3163 void set_is_known_list_constructor(bool value) { |
| 3146 is_known_list_constructor_ = value; | 3164 is_known_list_constructor_ = value; |
| 3147 } | 3165 } |
| 3148 | 3166 |
| 3149 bool is_native_list_factory() const { return is_native_list_factory_; } | 3167 bool is_native_list_factory() const { return is_native_list_factory_; } |
| (...skipping 5252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8402 Isolate* isolate, bool opt) const { \ | 8420 Isolate* isolate, bool opt) const { \ |
| 8403 UNIMPLEMENTED(); \ | 8421 UNIMPLEMENTED(); \ |
| 8404 return NULL; \ | 8422 return NULL; \ |
| 8405 } \ | 8423 } \ |
| 8406 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8424 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8407 | 8425 |
| 8408 | 8426 |
| 8409 } // namespace dart | 8427 } // namespace dart |
| 8410 | 8428 |
| 8411 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8429 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |