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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 HValue* val, | 913 HValue* val, |
914 HCheckMaps* mapcheck, | 914 HCheckMaps* mapcheck, |
915 bool is_js_array, | 915 bool is_js_array, |
916 ElementsKind elements_kind, | 916 ElementsKind elements_kind, |
917 bool is_store, | 917 bool is_store, |
918 Representation checked_index_representation = Representation::None()); | 918 Representation checked_index_representation = Representation::None()); |
919 | 919 |
920 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id); | 920 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id); |
921 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); | 921 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); |
922 | 922 |
| 923 class CheckBuilder { |
| 924 public: |
| 925 CheckBuilder(HGraphBuilder* builder, BailoutId id); |
| 926 ~CheckBuilder() { |
| 927 if (!finished_) End(); |
| 928 } |
| 929 |
| 930 void CheckNotUndefined(HValue* value); |
| 931 void CheckIntegerEq(HValue* left, HValue* right); |
| 932 void End(); |
| 933 |
| 934 private: |
| 935 Zone* zone() { return builder_->zone(); } |
| 936 |
| 937 HGraphBuilder* builder_; |
| 938 bool finished_; |
| 939 HBasicBlock* failure_block_; |
| 940 HBasicBlock* merge_block_; |
| 941 BailoutId id_; |
| 942 }; |
| 943 |
923 class IfBuilder { | 944 class IfBuilder { |
924 public: | 945 public: |
925 IfBuilder(HGraphBuilder* builder, | 946 IfBuilder(HGraphBuilder* builder, BailoutId id); |
926 BailoutId id = BailoutId::StubEntry()); | |
927 ~IfBuilder() { | 947 ~IfBuilder() { |
928 if (!finished_) End(); | 948 if (!finished_) End(); |
929 } | 949 } |
930 | 950 |
931 HInstruction* BeginTrue( | 951 HInstruction* BeginTrue( |
932 HValue* left, | 952 HValue* left, |
933 HValue* right, | 953 HValue* right, |
934 Token::Value token, | 954 Token::Value token, |
935 Representation input_representation = Representation::Integer32()); | 955 Representation input_representation = Representation::Integer32()); |
936 void BeginFalse(); | 956 void BeginFalse(); |
937 void End(); | 957 void End(); |
938 | 958 |
939 private: | 959 private: |
| 960 Zone* zone() { return builder_->zone(); } |
| 961 |
940 HGraphBuilder* builder_; | 962 HGraphBuilder* builder_; |
941 bool finished_; | 963 bool finished_; |
942 HBasicBlock* first_true_block_; | 964 HBasicBlock* first_true_block_; |
943 HBasicBlock* last_true_block_; | 965 HBasicBlock* last_true_block_; |
944 HBasicBlock* first_false_block_; | 966 HBasicBlock* first_false_block_; |
945 HBasicBlock* merge_block_; | 967 HBasicBlock* merge_block_; |
946 BailoutId id_; | 968 BailoutId id_; |
947 | |
948 Zone* zone() { return builder_->zone(); } | |
949 }; | 969 }; |
950 | 970 |
951 class LoopBuilder { | 971 class LoopBuilder { |
952 public: | 972 public: |
953 enum Direction { | 973 enum Direction { |
954 kPreIncrement, | 974 kPreIncrement, |
955 kPostIncrement, | 975 kPostIncrement, |
956 kPreDecrement, | 976 kPreDecrement, |
957 kPostDecrement | 977 kPostDecrement |
958 }; | 978 }; |
959 | 979 |
960 LoopBuilder(HGraphBuilder* builder, | 980 LoopBuilder(HGraphBuilder* builder, |
961 HValue* context, | 981 HValue* context, |
962 Direction direction, | 982 Direction direction, |
963 BailoutId id = BailoutId::StubEntry()); | 983 BailoutId id); |
964 ~LoopBuilder() { | 984 ~LoopBuilder() { |
965 ASSERT(finished_); | 985 ASSERT(finished_); |
966 } | 986 } |
967 | 987 |
968 HValue* BeginBody( | 988 HValue* BeginBody( |
969 HValue* initial, | 989 HValue* initial, |
970 HValue* terminating, | 990 HValue* terminating, |
971 Token::Value token, | 991 Token::Value token, |
972 Representation input_representation = Representation::Integer32()); | 992 Representation input_representation = Representation::Integer32()); |
973 void EndBody(); | 993 void EndBody(); |
974 | 994 |
975 private: | 995 private: |
| 996 Zone* zone() { return builder_->zone(); } |
| 997 |
976 HGraphBuilder* builder_; | 998 HGraphBuilder* builder_; |
977 HValue* context_; | 999 HValue* context_; |
978 HInstruction* increment_; | 1000 HInstruction* increment_; |
979 HPhi* phi_; | 1001 HPhi* phi_; |
980 HBasicBlock* header_block_; | 1002 HBasicBlock* header_block_; |
981 HBasicBlock* body_block_; | 1003 HBasicBlock* body_block_; |
982 HBasicBlock* exit_block_; | 1004 HBasicBlock* exit_block_; |
983 Direction direction_; | 1005 Direction direction_; |
984 BailoutId id_; | 1006 BailoutId id_; |
985 bool finished_; | 1007 bool finished_; |
986 | |
987 Zone* zone() { return builder_->zone(); } | |
988 }; | 1008 }; |
989 | 1009 |
990 HValue* BuildAllocateElements(HContext* context, | 1010 HValue* BuildAllocateElements(HContext* context, |
991 ElementsKind kind, | 1011 ElementsKind kind, |
992 HValue* capacity); | 1012 HValue* capacity); |
993 | 1013 |
994 void BuildCopyElements(HContext* context, | 1014 void BuildCopyElements(HContext* context, |
995 HValue* from_elements, | 1015 HValue* from_elements, |
996 ElementsKind from_elements_kind, | 1016 ElementsKind from_elements_kind, |
997 HValue* to_elements, | 1017 HValue* to_elements, |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1674 const char* filename_; | 1694 const char* filename_; |
1675 HeapStringAllocator string_allocator_; | 1695 HeapStringAllocator string_allocator_; |
1676 StringStream trace_; | 1696 StringStream trace_; |
1677 int indent_; | 1697 int indent_; |
1678 }; | 1698 }; |
1679 | 1699 |
1680 | 1700 |
1681 } } // namespace v8::internal | 1701 } } // namespace v8::internal |
1682 | 1702 |
1683 #endif // V8_HYDROGEN_H_ | 1703 #endif // V8_HYDROGEN_H_ |
OLD | NEW |