OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
905 HValue* val, | 905 HValue* val, |
906 HCheckMaps* mapcheck, | 906 HCheckMaps* mapcheck, |
907 bool is_js_array, | 907 bool is_js_array, |
908 ElementsKind elements_kind, | 908 ElementsKind elements_kind, |
909 bool is_store, | 909 bool is_store, |
910 Representation checked_index_representation = Representation::None()); | 910 Representation checked_index_representation = Representation::None()); |
911 | 911 |
912 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id); | 912 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id); |
913 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); | 913 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); |
914 | 914 |
915 class CheckBuilder { | |
916 public: | |
917 CheckBuilder(HGraphBuilder* builder, | |
918 BailoutId id = BailoutId::StubEntry()); | |
danno
2013/02/11 14:34:27
I think it's a good idea to not provide a default.
Michael Starzinger
2013/02/11 16:31:11
Done (also for the other builders below).
| |
919 ~CheckBuilder() { | |
920 if (!finished_) End(); | |
921 } | |
922 | |
923 void CheckNotUndefined(HValue* value); | |
924 void CheckIntegerEq(HValue* left, HValue* right); | |
925 void End(); | |
926 | |
927 private: | |
928 Zone* zone() { return builder_->zone(); } | |
929 | |
930 HGraphBuilder* builder_; | |
931 bool finished_; | |
932 HBasicBlock* failure_block_; | |
933 HBasicBlock* merge_block_; | |
934 BailoutId id_; | |
935 }; | |
936 | |
915 class IfBuilder { | 937 class IfBuilder { |
916 public: | 938 public: |
917 IfBuilder(HGraphBuilder* builder, | 939 IfBuilder(HGraphBuilder* builder, |
918 BailoutId id = BailoutId::StubEntry()); | 940 BailoutId id = BailoutId::StubEntry()); |
919 ~IfBuilder() { | 941 ~IfBuilder() { |
920 if (!finished_) End(); | 942 if (!finished_) End(); |
921 } | 943 } |
922 | 944 |
923 void BeginTrue(HValue* left, HValue* right, Token::Value token); | 945 void BeginTrue(HValue* left, HValue* right, Token::Value token); |
924 void BeginFalse(); | 946 void BeginFalse(); |
925 void End(); | 947 void End(); |
926 | 948 |
927 private: | 949 private: |
950 Zone* zone() { return builder_->zone(); } | |
951 | |
928 HGraphBuilder* builder_; | 952 HGraphBuilder* builder_; |
929 bool finished_; | 953 bool finished_; |
930 HBasicBlock* true_block_; | 954 HBasicBlock* true_block_; |
931 HBasicBlock* false_block_; | 955 HBasicBlock* false_block_; |
932 HBasicBlock* merge_block_; | 956 HBasicBlock* merge_block_; |
933 BailoutId id_; | 957 BailoutId id_; |
934 | |
935 Zone* zone() { return builder_->zone(); } | |
936 }; | 958 }; |
937 | 959 |
938 class LoopBuilder { | 960 class LoopBuilder { |
939 public: | 961 public: |
940 enum Direction { | 962 enum Direction { |
941 kPreIncrement, | 963 kPreIncrement, |
942 kPostIncrement, | 964 kPostIncrement, |
943 kPreDecrement, | 965 kPreDecrement, |
944 kPostDecrement | 966 kPostDecrement |
945 }; | 967 }; |
946 | 968 |
947 LoopBuilder(HGraphBuilder* builder, | 969 LoopBuilder(HGraphBuilder* builder, |
948 HValue* context, | 970 HValue* context, |
949 Direction direction, | 971 Direction direction, |
950 BailoutId id = BailoutId::StubEntry()); | 972 BailoutId id = BailoutId::StubEntry()); |
951 ~LoopBuilder() { | 973 ~LoopBuilder() { |
952 ASSERT(finished_); | 974 ASSERT(finished_); |
953 } | 975 } |
954 | 976 |
955 HValue* BeginBody(HValue* initial, HValue* terminating, Token::Value token); | 977 HValue* BeginBody(HValue* initial, HValue* terminating, Token::Value token); |
956 void EndBody(); | 978 void EndBody(); |
957 | 979 |
958 private: | 980 private: |
981 Zone* zone() { return builder_->zone(); } | |
982 | |
959 HGraphBuilder* builder_; | 983 HGraphBuilder* builder_; |
960 HValue* context_; | 984 HValue* context_; |
961 HInstruction* increment_; | 985 HInstruction* increment_; |
962 HPhi* phi_; | 986 HPhi* phi_; |
963 HBasicBlock* header_block_; | 987 HBasicBlock* header_block_; |
964 HBasicBlock* body_block_; | 988 HBasicBlock* body_block_; |
965 HBasicBlock* exit_block_; | 989 HBasicBlock* exit_block_; |
966 Direction direction_; | 990 Direction direction_; |
967 BailoutId id_; | 991 BailoutId id_; |
968 bool finished_; | 992 bool finished_; |
969 | |
970 Zone* zone() { return builder_->zone(); } | |
971 }; | 993 }; |
972 | 994 |
973 HValue* BuildAllocateElements(HContext* context, | 995 HValue* BuildAllocateElements(HContext* context, |
974 ElementsKind kind, | 996 ElementsKind kind, |
975 HValue* capacity); | 997 HValue* capacity); |
976 | 998 |
977 void BuildCopyElements(HContext* context, | 999 void BuildCopyElements(HContext* context, |
978 HValue* from_elements, | 1000 HValue* from_elements, |
979 ElementsKind from_elements_kind, | 1001 ElementsKind from_elements_kind, |
980 HValue* to_elements, | 1002 HValue* to_elements, |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1654 const char* filename_; | 1676 const char* filename_; |
1655 HeapStringAllocator string_allocator_; | 1677 HeapStringAllocator string_allocator_; |
1656 StringStream trace_; | 1678 StringStream trace_; |
1657 int indent_; | 1679 int indent_; |
1658 }; | 1680 }; |
1659 | 1681 |
1660 | 1682 |
1661 } } // namespace v8::internal | 1683 } } // namespace v8::internal |
1662 | 1684 |
1663 #endif // V8_HYDROGEN_H_ | 1685 #endif // V8_HYDROGEN_H_ |
OLD | NEW |