| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 25 matching lines...) Expand all Loading... |
| 36 RECOGNIZED_LIST(DEFINE_ENUM_LIST) | 36 RECOGNIZED_LIST(DEFINE_ENUM_LIST) |
| 37 #undef DEFINE_ENUM_LIST | 37 #undef DEFINE_ENUM_LIST |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 static Kind RecognizeKind(const Function& function); | 40 static Kind RecognizeKind(const Function& function); |
| 41 static const char* KindToCString(Kind kind); | 41 static const char* KindToCString(Kind kind); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 | 44 |
| 45 class BitVector; | 45 class BitVector; |
| 46 class FlowGraphAllocator; |
| 46 class FlowGraphCompiler; | 47 class FlowGraphCompiler; |
| 47 class FlowGraphVisitor; | 48 class FlowGraphVisitor; |
| 48 class Function; | 49 class Function; |
| 49 class LocalVariable; | 50 class LocalVariable; |
| 50 | 51 |
| 51 // M is a two argument macro. It is applied to each concrete value's | 52 // M is a two argument macro. It is applied to each concrete value's |
| 52 // typename and classname. | 53 // typename and classname. |
| 53 #define FOR_EACH_VALUE(M) \ | 54 #define FOR_EACH_VALUE(M) \ |
| 54 M(Use, UseVal) \ | 55 M(Use, UseVal) \ |
| 55 M(Constant, ConstantVal) \ | 56 M(Constant, ConstantVal) \ |
| (...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2683 location_count_(0), | 2684 location_count_(0), |
| 2684 locations_(NULL), | 2685 locations_(NULL), |
| 2685 fixed_parameter_count_(fixed_parameter_count) { | 2686 fixed_parameter_count_(fixed_parameter_count) { |
| 2686 values_.AddArray(values); | 2687 values_.AddArray(values); |
| 2687 } | 2688 } |
| 2688 | 2689 |
| 2689 const GrowableArray<Value*>& values() const { | 2690 const GrowableArray<Value*>& values() const { |
| 2690 return values_; | 2691 return values_; |
| 2691 } | 2692 } |
| 2692 | 2693 |
| 2693 void InitializeLocations() { | 2694 // Initialize locations for the environment values on behalf of the |
| 2694 location_count_ = values_.length(); | 2695 // register allocator. The initial live ranges of environment uses extend |
| 2695 if (location_count_ > 0) { | 2696 // from the block start position to the environment position. |
| 2696 locations_ = | 2697 void InitializeLocations(FlowGraphAllocator* allocator, |
| 2697 Isolate::Current()->current_zone()->Alloc<Location>(location_count_); | 2698 intptr_t block_start_pos, |
| 2698 } | 2699 intptr_t environment_pos); |
| 2699 } | |
| 2700 | 2700 |
| 2701 Location LocationAt(intptr_t ix) const { | 2701 Location LocationAt(intptr_t ix) const { |
| 2702 ASSERT((ix >= 0) && (ix < location_count_)); | 2702 ASSERT((ix >= 0) && (ix < location_count_)); |
| 2703 return locations_[ix]; | 2703 return locations_[ix]; |
| 2704 } | 2704 } |
| 2705 | 2705 |
| 2706 Location* LocationSlotAt(intptr_t ix) const { | 2706 Location* LocationSlotAt(intptr_t ix) const { |
| 2707 ASSERT((ix >= 0) && (ix < location_count_)); | 2707 ASSERT((ix >= 0) && (ix < location_count_)); |
| 2708 return &locations_[ix]; | 2708 return &locations_[ix]; |
| 2709 } | 2709 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2754 const GrowableArray<BlockEntryInstr*>& block_order_; | 2754 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 2755 | 2755 |
| 2756 private: | 2756 private: |
| 2757 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 2757 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 2758 }; | 2758 }; |
| 2759 | 2759 |
| 2760 | 2760 |
| 2761 } // namespace dart | 2761 } // namespace dart |
| 2762 | 2762 |
| 2763 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 2763 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |