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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 CompilationInfo* top_info() { return info_; } | 987 CompilationInfo* top_info() { return info_; } |
988 | 988 |
989 HGraph* CreateGraph(); | 989 HGraph* CreateGraph(); |
990 | 990 |
991 // Bailout environment manipulation. | 991 // Bailout environment manipulation. |
992 void Push(HValue* value) { environment()->Push(value); } | 992 void Push(HValue* value) { environment()->Push(value); } |
993 HValue* Pop() { return environment()->Pop(); } | 993 HValue* Pop() { return environment()->Pop(); } |
994 | 994 |
995 // Adding instructions. | 995 // Adding instructions. |
996 HInstruction* AddInstruction(HInstruction* instr); | 996 HInstruction* AddInstruction(HInstruction* instr); |
| 997 |
| 998 template<class I> |
| 999 I* Add() { return static_cast<I*>(AddInstruction(new(zone()) I())); } |
| 1000 |
| 1001 template<class I, class P1> |
| 1002 I* Add(P1 p1) { |
| 1003 return static_cast<I*>(AddInstruction(new(zone()) I(p1))); |
| 1004 } |
| 1005 |
| 1006 template<class I, class P1, class P2> |
| 1007 I* Add(P1 p1, P2 p2) { |
| 1008 return static_cast<I*>(AddInstruction(new(zone()) I(p1, p2))); |
| 1009 } |
| 1010 |
| 1011 template<class I, class P1, class P2, class P3> |
| 1012 I* Add(P1 p1, P2 p2, P3 p3) { |
| 1013 return static_cast<I*>(AddInstruction(new(zone()) I(p1, p2, p3))); |
| 1014 } |
| 1015 |
997 void AddSimulate(BailoutId id, | 1016 void AddSimulate(BailoutId id, |
998 RemovableSimulate removable = FIXED_SIMULATE); | 1017 RemovableSimulate removable = FIXED_SIMULATE); |
999 HBoundsCheck* AddBoundsCheck(HValue* index, HValue* length); | |
1000 | 1018 |
1001 HReturn* AddReturn(HValue* value); | 1019 HReturn* AddReturn(HValue* value); |
1002 | 1020 |
1003 void IncrementInNoSideEffectsScope() { | 1021 void IncrementInNoSideEffectsScope() { |
1004 no_side_effects_scope_count_++; | 1022 no_side_effects_scope_count_++; |
1005 } | 1023 } |
1006 | 1024 |
1007 void DecrementInNoSideEffectsScope() { | 1025 void DecrementInNoSideEffectsScope() { |
1008 no_side_effects_scope_count_--; | 1026 no_side_effects_scope_count_--; |
1009 } | 1027 } |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 EmbeddedVector<char, 64> filename_; | 2070 EmbeddedVector<char, 64> filename_; |
2053 HeapStringAllocator string_allocator_; | 2071 HeapStringAllocator string_allocator_; |
2054 StringStream trace_; | 2072 StringStream trace_; |
2055 int indent_; | 2073 int indent_; |
2056 }; | 2074 }; |
2057 | 2075 |
2058 | 2076 |
2059 } } // namespace v8::internal | 2077 } } // namespace v8::internal |
2060 | 2078 |
2061 #endif // V8_HYDROGEN_H_ | 2079 #endif // V8_HYDROGEN_H_ |
OLD | NEW |