| 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 6829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6840 } | 6840 } |
| 6841 return env->ValueAt(index); | 6841 return env->ValueAt(index); |
| 6842 } | 6842 } |
| 6843 | 6843 |
| 6844 intptr_t fixed_parameter_count() const { | 6844 intptr_t fixed_parameter_count() const { |
| 6845 return fixed_parameter_count_; | 6845 return fixed_parameter_count_; |
| 6846 } | 6846 } |
| 6847 | 6847 |
| 6848 const Function& function() const { return function_; } | 6848 const Function& function() const { return function_; } |
| 6849 | 6849 |
| 6850 const Code& code() const { return code_; } |
| 6851 |
| 6850 Environment* DeepCopy() const { return DeepCopy(Length()); } | 6852 Environment* DeepCopy() const { return DeepCopy(Length()); } |
| 6851 | 6853 |
| 6852 void DeepCopyTo(Instruction* instr) const; | 6854 void DeepCopyTo(Instruction* instr) const; |
| 6853 void DeepCopyToOuter(Instruction* instr) const; | 6855 void DeepCopyToOuter(Instruction* instr) const; |
| 6854 | 6856 |
| 6855 void PrintTo(BufferFormatter* f) const; | 6857 void PrintTo(BufferFormatter* f) const; |
| 6856 | 6858 |
| 6857 private: | 6859 private: |
| 6858 friend class ShallowIterator; | 6860 friend class ShallowIterator; |
| 6859 | 6861 |
| 6860 Environment(intptr_t length, | 6862 Environment(intptr_t length, |
| 6861 intptr_t fixed_parameter_count, | 6863 intptr_t fixed_parameter_count, |
| 6862 intptr_t deopt_id, | 6864 intptr_t deopt_id, |
| 6863 const Function& function, | 6865 const Function& function, |
| 6864 Environment* outer) | 6866 Environment* outer) |
| 6865 : values_(length), | 6867 : values_(length), |
| 6866 locations_(NULL), | 6868 locations_(NULL), |
| 6867 fixed_parameter_count_(fixed_parameter_count), | 6869 fixed_parameter_count_(fixed_parameter_count), |
| 6868 deopt_id_(deopt_id), | 6870 deopt_id_(deopt_id), |
| 6869 function_(function), | 6871 function_(function), |
| 6872 code_(Code::Handle(function.unoptimized_code())), |
| 6870 outer_(outer) { } | 6873 outer_(outer) { } |
| 6871 | 6874 |
| 6872 // Deep copy an environment. The 'length' parameter may be less than the | 6875 // Deep copy an environment. The 'length' parameter may be less than the |
| 6873 // environment's length in order to drop values (e.g., passed arguments) | 6876 // environment's length in order to drop values (e.g., passed arguments) |
| 6874 // from the copy. | 6877 // from the copy. |
| 6875 Environment* DeepCopy(intptr_t length) const; | 6878 Environment* DeepCopy(intptr_t length) const; |
| 6876 | 6879 |
| 6877 GrowableArray<Value*> values_; | 6880 GrowableArray<Value*> values_; |
| 6878 Location* locations_; | 6881 Location* locations_; |
| 6879 const intptr_t fixed_parameter_count_; | 6882 const intptr_t fixed_parameter_count_; |
| 6880 intptr_t deopt_id_; | 6883 intptr_t deopt_id_; |
| 6881 const Function& function_; | 6884 const Function& function_; |
| 6885 const Code& code_; |
| 6882 Environment* outer_; | 6886 Environment* outer_; |
| 6883 | 6887 |
| 6884 DISALLOW_COPY_AND_ASSIGN(Environment); | 6888 DISALLOW_COPY_AND_ASSIGN(Environment); |
| 6885 }; | 6889 }; |
| 6886 | 6890 |
| 6887 | 6891 |
| 6888 // Visitor base class to visit each instruction and computation in a flow | 6892 // Visitor base class to visit each instruction and computation in a flow |
| 6889 // graph as defined by a reversed list of basic blocks. | 6893 // graph as defined by a reversed list of basic blocks. |
| 6890 class FlowGraphVisitor : public ValueObject { | 6894 class FlowGraphVisitor : public ValueObject { |
| 6891 public: | 6895 public: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 6915 ForwardInstructionIterator* current_iterator_; | 6919 ForwardInstructionIterator* current_iterator_; |
| 6916 | 6920 |
| 6917 private: | 6921 private: |
| 6918 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6922 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6919 }; | 6923 }; |
| 6920 | 6924 |
| 6921 | 6925 |
| 6922 } // namespace dart | 6926 } // namespace dart |
| 6923 | 6927 |
| 6924 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6928 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |