OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 values_[index] = value; | 888 values_[index] = value; |
889 } | 889 } |
890 | 890 |
891 private: | 891 private: |
892 ZoneList<HValue*> values_; | 892 ZoneList<HValue*> values_; |
893 }; | 893 }; |
894 | 894 |
895 | 895 |
896 class HGoto: public HTemplateControlInstruction<1, 0> { | 896 class HGoto: public HTemplateControlInstruction<1, 0> { |
897 public: | 897 public: |
898 explicit HGoto(HBasicBlock* target) | 898 explicit HGoto(HBasicBlock* target) { |
899 : include_stack_check_(false) { | |
900 SetSuccessorAt(0, target); | 899 SetSuccessorAt(0, target); |
901 } | 900 } |
902 | 901 |
903 void set_include_stack_check(bool include_stack_check) { | |
904 include_stack_check_ = include_stack_check; | |
905 } | |
906 bool include_stack_check() const { return include_stack_check_; } | |
907 | |
908 virtual Representation RequiredInputRepresentation(int index) const { | 902 virtual Representation RequiredInputRepresentation(int index) const { |
909 return Representation::None(); | 903 return Representation::None(); |
910 } | 904 } |
911 | 905 |
912 DECLARE_CONCRETE_INSTRUCTION(Goto) | 906 DECLARE_CONCRETE_INSTRUCTION(Goto) |
913 | |
914 private: | |
915 bool include_stack_check_; | |
916 }; | 907 }; |
917 | 908 |
918 | 909 |
919 class HUnaryControlInstruction: public HTemplateControlInstruction<2, 1> { | 910 class HUnaryControlInstruction: public HTemplateControlInstruction<2, 1> { |
920 public: | 911 public: |
921 HUnaryControlInstruction(HValue* value, | 912 HUnaryControlInstruction(HValue* value, |
922 HBasicBlock* true_target, | 913 HBasicBlock* true_target, |
923 HBasicBlock* false_target) { | 914 HBasicBlock* false_target) { |
924 SetOperandAt(0, value); | 915 SetOperandAt(0, value); |
925 SetSuccessorAt(0, true_target); | 916 SetSuccessorAt(0, true_target); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 } | 1241 } |
1251 int ast_id_; | 1242 int ast_id_; |
1252 int pop_count_; | 1243 int pop_count_; |
1253 ZoneList<HValue*> values_; | 1244 ZoneList<HValue*> values_; |
1254 ZoneList<int> assigned_indexes_; | 1245 ZoneList<int> assigned_indexes_; |
1255 }; | 1246 }; |
1256 | 1247 |
1257 | 1248 |
1258 class HStackCheck: public HTemplateInstruction<0> { | 1249 class HStackCheck: public HTemplateInstruction<0> { |
1259 public: | 1250 public: |
1260 HStackCheck() { } | 1251 enum Type { |
| 1252 kFunctionEntry, |
| 1253 kBackwardsBranch |
| 1254 }; |
| 1255 |
| 1256 explicit HStackCheck(Type type) : type_(type) { } |
1261 | 1257 |
1262 virtual Representation RequiredInputRepresentation(int index) const { | 1258 virtual Representation RequiredInputRepresentation(int index) const { |
1263 return Representation::None(); | 1259 return Representation::None(); |
1264 } | 1260 } |
1265 | 1261 |
| 1262 void Eliminate() { |
| 1263 // The stack check eliminator might try to eliminate the same stack |
| 1264 // check instruction multiple times. |
| 1265 if (IsLinked()) { |
| 1266 DeleteFromGraph(); |
| 1267 } |
| 1268 } |
| 1269 |
| 1270 bool is_function_entry() { return type_ == kFunctionEntry; } |
| 1271 bool is_backwards_branch() { return type_ == kBackwardsBranch; } |
| 1272 |
1266 DECLARE_CONCRETE_INSTRUCTION(StackCheck) | 1273 DECLARE_CONCRETE_INSTRUCTION(StackCheck) |
| 1274 |
| 1275 private: |
| 1276 Type type_; |
1267 }; | 1277 }; |
1268 | 1278 |
1269 | 1279 |
1270 class HEnterInlined: public HTemplateInstruction<0> { | 1280 class HEnterInlined: public HTemplateInstruction<0> { |
1271 public: | 1281 public: |
1272 HEnterInlined(Handle<JSFunction> closure, | 1282 HEnterInlined(Handle<JSFunction> closure, |
1273 FunctionLiteral* function, | 1283 FunctionLiteral* function, |
1274 CallKind call_kind) | 1284 CallKind call_kind) |
1275 : closure_(closure), | 1285 : closure_(closure), |
1276 function_(function), | 1286 function_(function), |
(...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4104 | 4114 |
4105 DECLARE_CONCRETE_INSTRUCTION(In) | 4115 DECLARE_CONCRETE_INSTRUCTION(In) |
4106 }; | 4116 }; |
4107 | 4117 |
4108 #undef DECLARE_INSTRUCTION | 4118 #undef DECLARE_INSTRUCTION |
4109 #undef DECLARE_CONCRETE_INSTRUCTION | 4119 #undef DECLARE_CONCRETE_INSTRUCTION |
4110 | 4120 |
4111 } } // namespace v8::internal | 4121 } } // namespace v8::internal |
4112 | 4122 |
4113 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4123 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |