| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 M(InstanceOf, InstanceOfComp) \ | 48 M(InstanceOf, InstanceOfComp) \ |
| 49 M(CreateArray, CreateArrayComp) \ | 49 M(CreateArray, CreateArrayComp) \ |
| 50 M(CreateClosure, CreateClosureComp) \ | 50 M(CreateClosure, CreateClosureComp) \ |
| 51 M(AllocateObject, AllocateObjectComp) \ | 51 M(AllocateObject, AllocateObjectComp) \ |
| 52 M(NativeLoadField, NativeLoadFieldComp) \ | 52 M(NativeLoadField, NativeLoadFieldComp) \ |
| 53 M(ExtractFactoryTypeArguments, ExtractFactoryTypeArgumentsComp) \ | 53 M(ExtractFactoryTypeArguments, ExtractFactoryTypeArgumentsComp) \ |
| 54 M(ExtractConstructorTypeArguments, ExtractConstructorTypeArgumentsComp) \ | 54 M(ExtractConstructorTypeArguments, ExtractConstructorTypeArgumentsComp) \ |
| 55 M(ExtractConstructorInstantiator, ExtractConstructorInstantiatorComp) \ | 55 M(ExtractConstructorInstantiator, ExtractConstructorInstantiatorComp) \ |
| 56 M(AllocateContext, AllocateContextComp) \ | 56 M(AllocateContext, AllocateContextComp) \ |
| 57 M(ChainContext, ChainContextComp) \ | 57 M(ChainContext, ChainContextComp) \ |
| 58 M(CloneContext, CloneContextComp) \ |
| 58 | 59 |
| 59 | 60 |
| 60 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName; | 61 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName; |
| 61 FOR_EACH_COMPUTATION(FORWARD_DECLARATION) | 62 FOR_EACH_COMPUTATION(FORWARD_DECLARATION) |
| 62 #undef FORWARD_DECLARATION | 63 #undef FORWARD_DECLARATION |
| 63 | 64 |
| 64 class Computation : public ZoneAllocated { | 65 class Computation : public ZoneAllocated { |
| 65 public: | 66 public: |
| 66 Computation() { } | 67 Computation() { } |
| 67 | 68 |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 | 802 |
| 802 Value* context_value() const { return context_value_; } | 803 Value* context_value() const { return context_value_; } |
| 803 | 804 |
| 804 private: | 805 private: |
| 805 Value* context_value_; | 806 Value* context_value_; |
| 806 | 807 |
| 807 DISALLOW_COPY_AND_ASSIGN(ChainContextComp); | 808 DISALLOW_COPY_AND_ASSIGN(ChainContextComp); |
| 808 }; | 809 }; |
| 809 | 810 |
| 810 | 811 |
| 812 class CloneContextComp : public Computation { |
| 813 public: |
| 814 CloneContextComp(intptr_t node_id, |
| 815 intptr_t token_index, |
| 816 Value* context_value) |
| 817 : node_id_(node_id), |
| 818 token_index_(token_index), |
| 819 context_value_(context_value) { |
| 820 ASSERT(context_value_ != NULL); |
| 821 } |
| 822 |
| 823 intptr_t node_id() const { return node_id_; } |
| 824 intptr_t token_index() const { return token_index_; } |
| 825 Value* context_value() const { return context_value_; } |
| 826 |
| 827 DECLARE_COMPUTATION(CloneContext) |
| 828 |
| 829 private: |
| 830 const intptr_t node_id_; |
| 831 const intptr_t token_index_; |
| 832 Value* context_value_; |
| 833 |
| 834 DISALLOW_COPY_AND_ASSIGN(CloneContextComp); |
| 835 }; |
| 836 |
| 837 |
| 811 #undef DECLARE_COMPUTATION | 838 #undef DECLARE_COMPUTATION |
| 812 | 839 |
| 813 | 840 |
| 814 // Instructions. | 841 // Instructions. |
| 815 // | 842 // |
| 816 // <Instruction> ::= JoinEntry <Instruction> | 843 // <Instruction> ::= JoinEntry <Instruction> |
| 817 // | TargetEntry <Instruction> | 844 // | TargetEntry <Instruction> |
| 818 // | PickTemp <int> <int> <Instruction> | 845 // | PickTemp <int> <int> <Instruction> |
| 819 // | TuckTemp <int> <int> <Instruction> | 846 // | TuckTemp <int> <int> <Instruction> |
| 820 // | Do <Computation> <Instruction> | 847 // | Do <Computation> <Instruction> |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 const GrowableArray<BlockEntryInstr*>& block_order_; | 1315 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 1289 | 1316 |
| 1290 private: | 1317 private: |
| 1291 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 1318 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 1292 }; | 1319 }; |
| 1293 | 1320 |
| 1294 | 1321 |
| 1295 } // namespace dart | 1322 } // namespace dart |
| 1296 | 1323 |
| 1297 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 1324 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |