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 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2823 BranchInstr* branch) = 0; | 2823 BranchInstr* branch) = 0; |
| 2824 | 2824 |
| 2825 void SetDeoptId(intptr_t deopt_id) { | 2825 void SetDeoptId(intptr_t deopt_id) { |
| 2826 deopt_id_ = deopt_id; | 2826 deopt_id_ = deopt_id; |
| 2827 } | 2827 } |
| 2828 | 2828 |
| 2829 // Operation class id is computed from collected ICData. | 2829 // Operation class id is computed from collected ICData. |
| 2830 void set_operation_cid(intptr_t value) { operation_cid_ = value; } | 2830 void set_operation_cid(intptr_t value) { operation_cid_ = value; } |
| 2831 intptr_t operation_cid() const { return operation_cid_; } | 2831 intptr_t operation_cid() const { return operation_cid_; } |
| 2832 | 2832 |
| 2833 void NegateComparison() { | |
| 2834 kind_ = Token::NegateComparison(kind_); | |
| 2835 } | |
| 2836 | |
| 2833 protected: | 2837 protected: |
| 2834 ComparisonInstr(intptr_t token_pos, | 2838 ComparisonInstr(intptr_t token_pos, |
| 2835 Token::Kind kind, | 2839 Token::Kind kind, |
| 2836 Value* left, | 2840 Value* left, |
| 2837 Value* right) | 2841 Value* right) |
| 2838 : token_pos_(token_pos), kind_(kind), operation_cid_(kIllegalCid) { | 2842 : token_pos_(token_pos), kind_(kind), operation_cid_(kIllegalCid) { |
| 2839 SetInputAt(0, left); | 2843 SetInputAt(0, left); |
| 2840 SetInputAt(1, right); | 2844 SetInputAt(1, right); |
| 2841 } | 2845 } |
| 2842 | 2846 |
| 2847 private: | |
| 2843 intptr_t token_pos_; | 2848 intptr_t token_pos_; |
|
srdjan
2013/10/15 15:10:16
const
Florian Schneider
2013/10/15 15:15:03
Done.
| |
| 2844 Token::Kind kind_; | 2849 Token::Kind kind_; |
| 2845 | |
| 2846 private: | |
| 2847 intptr_t operation_cid_; // Set by optimizer. | 2850 intptr_t operation_cid_; // Set by optimizer. |
| 2848 | 2851 |
| 2849 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr); | 2852 DISALLOW_COPY_AND_ASSIGN(ComparisonInstr); |
| 2850 }; | 2853 }; |
| 2851 | 2854 |
| 2852 | 2855 |
| 2853 // Inlined functions from class BranchInstr that forward to their comparison. | 2856 // Inlined functions from class BranchInstr that forward to their comparison. |
| 2854 inline intptr_t BranchInstr::ArgumentCount() const { | 2857 inline intptr_t BranchInstr::ArgumentCount() const { |
| 2855 return comparison()->ArgumentCount(); | 2858 return comparison()->ArgumentCount(); |
| 2856 } | 2859 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2929 | 2932 |
| 2930 virtual bool CanDeoptimize() const { return false; } | 2933 virtual bool CanDeoptimize() const { return false; } |
| 2931 | 2934 |
| 2932 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 2935 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| 2933 | 2936 |
| 2934 virtual void EmitBranchCode(FlowGraphCompiler* compiler, | 2937 virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
| 2935 BranchInstr* branch); | 2938 BranchInstr* branch); |
| 2936 | 2939 |
| 2937 bool needs_number_check() const { return needs_number_check_; } | 2940 bool needs_number_check() const { return needs_number_check_; } |
| 2938 void set_needs_number_check(bool value) { needs_number_check_ = value; } | 2941 void set_needs_number_check(bool value) { needs_number_check_ = value; } |
| 2939 void set_kind(Token::Kind value) { kind_ = value; } | |
| 2940 | 2942 |
| 2941 virtual bool AllowsCSE() const { return true; } | 2943 virtual bool AllowsCSE() const { return true; } |
| 2942 virtual EffectSet Effects() const { return EffectSet::None(); } | 2944 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2943 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 2945 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 2944 virtual bool AttributesEqual(Instruction* other) const; | 2946 virtual bool AttributesEqual(Instruction* other) const; |
| 2945 | 2947 |
| 2946 virtual bool MayThrow() const { return false; } | 2948 virtual bool MayThrow() const { return false; } |
| 2947 | 2949 |
| 2948 private: | 2950 private: |
| 2949 // True if the comparison must check for double, Mint or Bigint and | 2951 // True if the comparison must check for double, Mint or Bigint and |
| (...skipping 3870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6820 ForwardInstructionIterator* current_iterator_; | 6822 ForwardInstructionIterator* current_iterator_; |
| 6821 | 6823 |
| 6822 private: | 6824 private: |
| 6823 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6825 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6824 }; | 6826 }; |
| 6825 | 6827 |
| 6826 | 6828 |
| 6827 } // namespace dart | 6829 } // namespace dart |
| 6828 | 6830 |
| 6829 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6831 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |