| 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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 | 999 |
| 1000 private: | 1000 private: |
| 1001 const intptr_t token_index_; | 1001 const intptr_t token_index_; |
| 1002 const intptr_t try_index_; | 1002 const intptr_t try_index_; |
| 1003 ZoneGrowableArray<Value*>* const elements_; | 1003 ZoneGrowableArray<Value*>* const elements_; |
| 1004 | 1004 |
| 1005 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); | 1005 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); |
| 1006 }; | 1006 }; |
| 1007 | 1007 |
| 1008 | 1008 |
| 1009 class CreateClosureComp : public Computation { | 1009 class CreateClosureComp : public TemplateComputation<2> { |
| 1010 public: | 1010 public: |
| 1011 // 'type_arguments' is null if function() does not require type arguments. | |
| 1012 CreateClosureComp(ClosureNode* node, | 1011 CreateClosureComp(ClosureNode* node, |
| 1013 intptr_t try_index, | 1012 intptr_t try_index, |
| 1014 Value* type_arguments) | 1013 Value* type_arguments, |
| 1014 Value* receiver) |
| 1015 : ast_node_(*node), | 1015 : ast_node_(*node), |
| 1016 try_index_(try_index), | 1016 try_index_(try_index) { |
| 1017 type_arguments_(type_arguments) {} | 1017 ASSERT(type_arguments != NULL); |
| 1018 ASSERT(receiver != NULL); |
| 1019 inputs_[0] = type_arguments; |
| 1020 inputs_[1] = receiver; |
| 1021 } |
| 1018 | 1022 |
| 1019 DECLARE_COMPUTATION(CreateClosure) | 1023 DECLARE_COMPUTATION(CreateClosure) |
| 1020 | 1024 |
| 1021 intptr_t token_index() const { return ast_node_.token_index(); } | 1025 intptr_t token_index() const { return ast_node_.token_index(); } |
| 1022 intptr_t try_index() const { return try_index_; } | 1026 intptr_t try_index() const { return try_index_; } |
| 1023 const Function& function() const { return ast_node_.function(); } | 1027 const Function& function() const { return ast_node_.function(); } |
| 1024 Value* type_arguments() const { return type_arguments_; } | 1028 Value* type_arguments() const { return inputs_[0]; } |
| 1025 | 1029 Value* receiver() const { return inputs_[1]; } |
| 1026 virtual intptr_t InputCount() const; | |
| 1027 virtual Value* InputAt(intptr_t i) const { | |
| 1028 return i == 0 ? type_arguments() : NULL; | |
| 1029 } | |
| 1030 | 1030 |
| 1031 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1031 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1032 | 1032 |
| 1033 private: | 1033 private: |
| 1034 const ClosureNode& ast_node_; | 1034 const ClosureNode& ast_node_; |
| 1035 const intptr_t try_index_; | 1035 const intptr_t try_index_; |
| 1036 Value* type_arguments_; | |
| 1037 | 1036 |
| 1038 DISALLOW_COPY_AND_ASSIGN(CreateClosureComp); | 1037 DISALLOW_COPY_AND_ASSIGN(CreateClosureComp); |
| 1039 }; | 1038 }; |
| 1040 | 1039 |
| 1041 | 1040 |
| 1042 class LoadVMFieldComp : public TemplateComputation<1> { | 1041 class LoadVMFieldComp : public TemplateComputation<1> { |
| 1043 public: | 1042 public: |
| 1044 LoadVMFieldComp(Value* value, | 1043 LoadVMFieldComp(Value* value, |
| 1045 intptr_t offset_in_bytes, | 1044 intptr_t offset_in_bytes, |
| 1046 const AbstractType& type) | 1045 const AbstractType& type) |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1891 const GrowableArray<BlockEntryInstr*>& block_order_; | 1890 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 1892 | 1891 |
| 1893 private: | 1892 private: |
| 1894 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 1893 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 1895 }; | 1894 }; |
| 1896 | 1895 |
| 1897 | 1896 |
| 1898 } // namespace dart | 1897 } // namespace dart |
| 1899 | 1898 |
| 1900 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 1899 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |