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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 return compare; | 1298 return compare; |
1299 } | 1299 } |
1300 | 1300 |
1301 template<class Condition, class P2, class P3> | 1301 template<class Condition, class P2, class P3> |
1302 Condition* If(HValue* p1, P2 p2, P3 p3) { | 1302 Condition* If(HValue* p1, P2 p2, P3 p3) { |
1303 Condition* compare = builder()->New<Condition>(p1, p2, p3); | 1303 Condition* compare = builder()->New<Condition>(p1, p2, p3); |
1304 AddCompare(compare); | 1304 AddCompare(compare); |
1305 return compare; | 1305 return compare; |
1306 } | 1306 } |
1307 | 1307 |
| 1308 template<class Condition> |
| 1309 Condition* IfNot(HValue* p) { |
| 1310 Condition* compare = If<Condition>(p); |
| 1311 HBasicBlock* block0 = compare->SuccessorAt(0); |
| 1312 HBasicBlock* block1 = compare->SuccessorAt(1); |
| 1313 compare->SetSuccessorAt(0, block1); |
| 1314 compare->SetSuccessorAt(1, block0); |
| 1315 return compare; |
| 1316 } |
| 1317 |
1308 template<class Condition, class P2> | 1318 template<class Condition, class P2> |
1309 Condition* IfNot(HValue* p1, P2 p2) { | 1319 Condition* IfNot(HValue* p1, P2 p2) { |
1310 Condition* compare = builder()->New<Condition>(p1, p2); | 1320 Condition* compare = If<Condition>(p1, p2); |
1311 AddCompare(compare); | |
1312 HBasicBlock* block0 = compare->SuccessorAt(0); | 1321 HBasicBlock* block0 = compare->SuccessorAt(0); |
1313 HBasicBlock* block1 = compare->SuccessorAt(1); | 1322 HBasicBlock* block1 = compare->SuccessorAt(1); |
1314 compare->SetSuccessorAt(0, block1); | 1323 compare->SetSuccessorAt(0, block1); |
1315 compare->SetSuccessorAt(1, block0); | 1324 compare->SetSuccessorAt(1, block0); |
1316 return compare; | 1325 return compare; |
1317 } | 1326 } |
1318 | 1327 |
1319 template<class Condition, class P2, class P3> | 1328 template<class Condition, class P2, class P3> |
1320 Condition* IfNot(HValue* p1, P2 p2, P3 p3) { | 1329 Condition* IfNot(HValue* p1, P2 p2, P3 p3) { |
1321 Condition* compare = builder()->New<Condition>(p1, p2, p3); | 1330 Condition* compare = If<Condition>(p1, p2, p3); |
1322 AddCompare(compare); | |
1323 HBasicBlock* block0 = compare->SuccessorAt(0); | 1331 HBasicBlock* block0 = compare->SuccessorAt(0); |
1324 HBasicBlock* block1 = compare->SuccessorAt(1); | 1332 HBasicBlock* block1 = compare->SuccessorAt(1); |
1325 compare->SetSuccessorAt(0, block1); | 1333 compare->SetSuccessorAt(0, block1); |
1326 compare->SetSuccessorAt(1, block0); | 1334 compare->SetSuccessorAt(1, block0); |
1327 return compare; | 1335 return compare; |
1328 } | 1336 } |
1329 | 1337 |
1330 template<class Condition> | 1338 template<class Condition> |
1331 Condition* OrIf(HValue *p) { | 1339 Condition* OrIf(HValue *p) { |
1332 Or(); | 1340 Or(); |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2370 } | 2378 } |
2371 | 2379 |
2372 private: | 2380 private: |
2373 HGraphBuilder* builder_; | 2381 HGraphBuilder* builder_; |
2374 }; | 2382 }; |
2375 | 2383 |
2376 | 2384 |
2377 } } // namespace v8::internal | 2385 } } // namespace v8::internal |
2378 | 2386 |
2379 #endif // V8_HYDROGEN_H_ | 2387 #endif // V8_HYDROGEN_H_ |
OLD | NEW |