| 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 }; | 604 }; |
| 605 #undef DECLARE_TAG | 605 #undef DECLARE_TAG |
| 606 | 606 |
| 607 explicit Instruction(intptr_t deopt_id = Isolate::kNoDeoptId) | 607 explicit Instruction(intptr_t deopt_id = Isolate::kNoDeoptId) |
| 608 : deopt_id_(deopt_id), | 608 : deopt_id_(deopt_id), |
| 609 lifetime_position_(-1), | 609 lifetime_position_(-1), |
| 610 previous_(NULL), | 610 previous_(NULL), |
| 611 next_(NULL), | 611 next_(NULL), |
| 612 env_(NULL), | 612 env_(NULL), |
| 613 locs_(NULL), | 613 locs_(NULL), |
| 614 inlining_id_(-1), |
| 614 place_id_(kNoPlaceId) { } | 615 place_id_(kNoPlaceId) { } |
| 615 | 616 |
| 616 virtual ~Instruction() { } | 617 virtual ~Instruction() { } |
| 617 | 618 |
| 618 virtual Tag tag() const = 0; | 619 virtual Tag tag() const = 0; |
| 619 | 620 |
| 620 intptr_t deopt_id() const { | 621 intptr_t deopt_id() const { |
| 621 ASSERT(CanDeoptimize() || CanBecomeDeoptimizationTarget()); | 622 ASSERT(CanDeoptimize() || CanBecomeDeoptimizationTarget()); |
| 622 return GetDeoptId(); | 623 return GetDeoptId(); |
| 623 } | 624 } |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 } | 809 } |
| 809 | 810 |
| 810 // Get the block entry for this instruction. | 811 // Get the block entry for this instruction. |
| 811 virtual BlockEntryInstr* GetBlock() const; | 812 virtual BlockEntryInstr* GetBlock() const; |
| 812 | 813 |
| 813 // Place identifiers used by the load optimization pass. | 814 // Place identifiers used by the load optimization pass. |
| 814 intptr_t place_id() const { return place_id_; } | 815 intptr_t place_id() const { return place_id_; } |
| 815 void set_place_id(intptr_t place_id) { place_id_ = place_id; } | 816 void set_place_id(intptr_t place_id) { place_id_ = place_id; } |
| 816 bool HasPlaceId() const { return place_id_ != kNoPlaceId; } | 817 bool HasPlaceId() const { return place_id_ != kNoPlaceId; } |
| 817 | 818 |
| 819 intptr_t inlining_id() const { return inlining_id_; } |
| 820 void set_inlining_id(intptr_t value) { |
| 821 ASSERT(value >= 0); |
| 822 inlining_id_ = value; |
| 823 } |
| 824 bool has_inlining_id() const { return inlining_id_ >= 0; } |
| 825 |
| 818 // Returns a hash code for use with hash maps. | 826 // Returns a hash code for use with hash maps. |
| 819 virtual intptr_t Hashcode() const; | 827 virtual intptr_t Hashcode() const; |
| 820 | 828 |
| 821 // Compares two instructions. Returns true, iff: | 829 // Compares two instructions. Returns true, iff: |
| 822 // 1. They have the same tag. | 830 // 1. They have the same tag. |
| 823 // 2. All input operands are Equals. | 831 // 2. All input operands are Equals. |
| 824 // 3. They satisfy AttributesEqual. | 832 // 3. They satisfy AttributesEqual. |
| 825 bool Equals(Instruction* other) const; | 833 bool Equals(Instruction* other) const; |
| 826 | 834 |
| 827 // Compare attributes of a instructions (except input operands and tag). | 835 // Compare attributes of a instructions (except input operands and tag). |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 enum { | 883 enum { |
| 876 kNoPlaceId = -1 | 884 kNoPlaceId = -1 |
| 877 }; | 885 }; |
| 878 | 886 |
| 879 intptr_t deopt_id_; | 887 intptr_t deopt_id_; |
| 880 intptr_t lifetime_position_; // Position used by register allocator. | 888 intptr_t lifetime_position_; // Position used by register allocator. |
| 881 Instruction* previous_; | 889 Instruction* previous_; |
| 882 Instruction* next_; | 890 Instruction* next_; |
| 883 Environment* env_; | 891 Environment* env_; |
| 884 LocationSummary* locs_; | 892 LocationSummary* locs_; |
| 893 intptr_t inlining_id_; |
| 885 intptr_t place_id_; | 894 intptr_t place_id_; |
| 886 | 895 |
| 887 DISALLOW_COPY_AND_ASSIGN(Instruction); | 896 DISALLOW_COPY_AND_ASSIGN(Instruction); |
| 888 }; | 897 }; |
| 889 | 898 |
| 890 | 899 |
| 891 class PureInstruction : public Instruction { | 900 class PureInstruction : public Instruction { |
| 892 public: | 901 public: |
| 893 explicit PureInstruction(intptr_t deopt_id) | 902 explicit PureInstruction(intptr_t deopt_id) |
| 894 : Instruction(deopt_id) { } | 903 : Instruction(deopt_id) { } |
| (...skipping 7111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8006 Isolate* isolate, bool opt) const { \ | 8015 Isolate* isolate, bool opt) const { \ |
| 8007 UNIMPLEMENTED(); \ | 8016 UNIMPLEMENTED(); \ |
| 8008 return NULL; \ | 8017 return NULL; \ |
| 8009 } \ | 8018 } \ |
| 8010 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8019 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8011 | 8020 |
| 8012 | 8021 |
| 8013 } // namespace dart | 8022 } // namespace dart |
| 8014 | 8023 |
| 8015 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8024 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |