Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 35 M(CurrentContext, CurrentContextComp) \ | 35 M(CurrentContext, CurrentContextComp) \ |
| 36 M(StoreContext, StoreContextComp) \ | 36 M(StoreContext, StoreContextComp) \ |
| 37 M(ClosureCall, ClosureCallComp) \ | 37 M(ClosureCall, ClosureCallComp) \ |
| 38 M(InstanceCall, InstanceCallComp) \ | 38 M(InstanceCall, InstanceCallComp) \ |
| 39 M(StaticCall, StaticCallComp) \ | 39 M(StaticCall, StaticCallComp) \ |
| 40 M(LoadLocal, LoadLocalComp) \ | 40 M(LoadLocal, LoadLocalComp) \ |
| 41 M(StoreLocal, StoreLocalComp) \ | 41 M(StoreLocal, StoreLocalComp) \ |
| 42 M(StrictCompare, StrictCompareComp) \ | 42 M(StrictCompare, StrictCompareComp) \ |
| 43 M(EqualityCompare, EqualityCompareComp) \ | 43 M(EqualityCompare, EqualityCompareComp) \ |
| 44 M(NativeCall, NativeCallComp) \ | 44 M(NativeCall, NativeCallComp) \ |
| 45 M(LoadIndexed, LoadIndexedComp) \ | |
| 45 M(StoreIndexed, StoreIndexedComp) \ | 46 M(StoreIndexed, StoreIndexedComp) \ |
| 46 M(InstanceSetter, InstanceSetterComp) \ | 47 M(InstanceSetter, InstanceSetterComp) \ |
| 47 M(StaticSetter, StaticSetterComp) \ | 48 M(StaticSetter, StaticSetterComp) \ |
| 48 M(LoadInstanceField, LoadInstanceFieldComp) \ | 49 M(LoadInstanceField, LoadInstanceFieldComp) \ |
| 49 M(StoreInstanceField, StoreInstanceFieldComp) \ | 50 M(StoreInstanceField, StoreInstanceFieldComp) \ |
| 50 M(LoadStaticField, LoadStaticFieldComp) \ | 51 M(LoadStaticField, LoadStaticFieldComp) \ |
| 51 M(StoreStaticField, StoreStaticFieldComp) \ | 52 M(StoreStaticField, StoreStaticFieldComp) \ |
| 52 M(BooleanNegate, BooleanNegateComp) \ | 53 M(BooleanNegate, BooleanNegateComp) \ |
| 53 M(InstanceOf, InstanceOfComp) \ | 54 M(InstanceOf, InstanceOfComp) \ |
| 54 M(CreateArray, CreateArrayComp) \ | 55 M(CreateArray, CreateArrayComp) \ |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 774 | 775 |
| 775 virtual void PrintOperandsTo(BufferFormatter* f) const; | 776 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 776 | 777 |
| 777 private: | 778 private: |
| 778 const Field& field_; | 779 const Field& field_; |
| 779 | 780 |
| 780 DISALLOW_COPY_AND_ASSIGN(StoreStaticFieldComp); | 781 DISALLOW_COPY_AND_ASSIGN(StoreStaticFieldComp); |
| 781 }; | 782 }; |
| 782 | 783 |
| 783 | 784 |
| 785 class LoadIndexedComp : public TemplateComputation<2> { | |
| 786 public: | |
| 787 LoadIndexedComp(intptr_t token_index, | |
| 788 intptr_t try_index, | |
| 789 Value* array, | |
| 790 Value* index) | |
| 791 : token_index_(token_index), | |
| 792 try_index_(try_index), | |
| 793 receiver_type_(kIllegalObjectKind) { | |
|
srdjan
2012/06/08 19:16:08
ASSERT array and index are not NULL.
Vyacheslav Egorov (Google)
2012/06/08 19:23:33
Done.
| |
| 794 inputs_[0] = array; | |
| 795 inputs_[1] = index; | |
| 796 } | |
| 797 | |
| 798 DECLARE_COMPUTATION(LoadIndexed) | |
| 799 | |
| 800 intptr_t token_index() const { return token_index_; } | |
| 801 intptr_t try_index() const { return try_index_; } | |
| 802 Value* array() const { return inputs_[0]; } | |
| 803 Value* index() const { return inputs_[1]; } | |
| 804 | |
| 805 void set_receiver_type(ObjectKind receiver_type) { | |
| 806 receiver_type_ = receiver_type; | |
| 807 } | |
| 808 | |
| 809 ObjectKind receiver_type() const { | |
| 810 return receiver_type_; | |
| 811 } | |
| 812 | |
| 813 private: | |
| 814 const intptr_t token_index_; | |
| 815 const intptr_t try_index_; | |
| 816 ObjectKind receiver_type_; | |
| 817 | |
| 818 DISALLOW_COPY_AND_ASSIGN(LoadIndexedComp); | |
| 819 }; | |
| 820 | |
| 821 | |
| 784 // Not simply an InstanceCall because it has somewhat more complicated | 822 // Not simply an InstanceCall because it has somewhat more complicated |
| 785 // semantics: the value operand is preserved before the call. | 823 // semantics: the value operand is preserved before the call. |
| 786 class StoreIndexedComp : public TemplateComputation<3> { | 824 class StoreIndexedComp : public TemplateComputation<3> { |
| 787 public: | 825 public: |
| 788 StoreIndexedComp(intptr_t token_index, | 826 StoreIndexedComp(intptr_t token_index, |
| 789 intptr_t try_index, | 827 intptr_t try_index, |
| 790 Value* array, | 828 Value* array, |
| 791 Value* index, | 829 Value* index, |
| 792 Value* value) | 830 Value* value) |
| 793 : token_index_(token_index), | 831 : token_index_(token_index), |
| (...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2053 const GrowableArray<BlockEntryInstr*>& block_order_; | 2091 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 2054 | 2092 |
| 2055 private: | 2093 private: |
| 2056 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 2094 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 2057 }; | 2095 }; |
| 2058 | 2096 |
| 2059 | 2097 |
| 2060 } // namespace dart | 2098 } // namespace dart |
| 2061 | 2099 |
| 2062 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 2100 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |