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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) | 790 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) |
791 #undef FORWARD_DECLARATION | 791 #undef FORWARD_DECLARATION |
792 | 792 |
793 | 793 |
794 // Functions required in all concrete instruction classes. | 794 // Functions required in all concrete instruction classes. |
795 #define DECLARE_INSTRUCTION(type) \ | 795 #define DECLARE_INSTRUCTION(type) \ |
796 virtual Tag tag() const { return k##type; } \ | 796 virtual Tag tag() const { return k##type; } \ |
797 virtual void Accept(FlowGraphVisitor* visitor); \ | 797 virtual void Accept(FlowGraphVisitor* visitor); \ |
798 virtual type##Instr* As##type() { return this; } \ | 798 virtual type##Instr* As##type() { return this; } \ |
799 virtual const char* DebugName() const { return #type; } \ | 799 virtual const char* DebugName() const { return #type; } \ |
800 virtual LocationSummary* MakeLocationSummary(bool optimizing) const; \ | 800 virtual LocationSummary* MakeLocationSummary(Isolate* isolate, \ |
| 801 bool optimizing) const; \ |
801 virtual void EmitNativeCode(FlowGraphCompiler* compiler); \ | 802 virtual void EmitNativeCode(FlowGraphCompiler* compiler); \ |
802 | 803 |
803 | 804 |
804 class Instruction : public ZoneAllocated { | 805 class Instruction : public ZoneAllocated { |
805 public: | 806 public: |
806 #define DECLARE_TAG(type) k##type, | 807 #define DECLARE_TAG(type) k##type, |
807 enum Tag { | 808 enum Tag { |
808 FOR_EACH_INSTRUCTION(DECLARE_TAG) | 809 FOR_EACH_INSTRUCTION(DECLARE_TAG) |
809 }; | 810 }; |
810 #undef DECLARE_TAG | 811 #undef DECLARE_TAG |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK) | 917 FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK) |
917 #undef INSTRUCTION_TYPE_CHECK | 918 #undef INSTRUCTION_TYPE_CHECK |
918 | 919 |
919 // Returns structure describing location constraints required | 920 // Returns structure describing location constraints required |
920 // to emit native code for this instruction. | 921 // to emit native code for this instruction. |
921 virtual LocationSummary* locs() { | 922 virtual LocationSummary* locs() { |
922 ASSERT(locs_ != NULL); | 923 ASSERT(locs_ != NULL); |
923 return locs_; | 924 return locs_; |
924 } | 925 } |
925 | 926 |
926 virtual LocationSummary* MakeLocationSummary(bool is_optimizing) const = 0; | 927 virtual LocationSummary* MakeLocationSummary(Isolate* isolate, |
| 928 bool is_optimizing) const = 0; |
927 | 929 |
928 void InitializeLocationSummary(bool optimizing) { | 930 void InitializeLocationSummary(Isolate* isolate, bool optimizing) { |
929 ASSERT(locs_ == NULL); | 931 ASSERT(locs_ == NULL); |
930 locs_ = MakeLocationSummary(optimizing); | 932 locs_ = MakeLocationSummary(isolate, optimizing); |
931 } | 933 } |
932 | 934 |
933 static LocationSummary* MakeCallSummary(); | 935 static LocationSummary* MakeCallSummary(); |
934 | 936 |
935 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 937 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
936 UNIMPLEMENTED(); | 938 UNIMPLEMENTED(); |
937 } | 939 } |
938 | 940 |
939 Environment* env() const { return env_; } | 941 Environment* env() const { return env_; } |
940 void SetEnvironment(Environment* deopt_env); | 942 void SetEnvironment(Environment* deopt_env); |
(...skipping 7019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7960 ForwardInstructionIterator* current_iterator_; | 7962 ForwardInstructionIterator* current_iterator_; |
7961 | 7963 |
7962 private: | 7964 private: |
7963 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7965 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
7964 }; | 7966 }; |
7965 | 7967 |
7966 | 7968 |
7967 } // namespace dart | 7969 } // namespace dart |
7968 | 7970 |
7969 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7971 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |