Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: src/hydrogen.h

Issue 66983002: Add ability to do "else-if" clauses in IfBuilder (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 // if_finally.Then(); 1456 // if_finally.Then();
1457 // // continues after then code of if_whatever or if_something. 1457 // // continues after then code of if_whatever or if_something.
1458 // ... 1458 // ...
1459 // if_finally.Else(); 1459 // if_finally.Else();
1460 // // continues after else code of if_whatever or if_something. 1460 // // continues after else code of if_whatever or if_something.
1461 // ... 1461 // ...
1462 // if_finally.End(); 1462 // if_finally.End();
1463 void JoinContinuation(HIfContinuation* continuation); 1463 void JoinContinuation(HIfContinuation* continuation);
1464 1464
1465 void Then(); 1465 void Then();
1466 void ThenDeopt(const char* reason) {
Michael Starzinger 2013/11/12 09:50:00 nit: Let's move that down to line 1474 into the bl
danno 2013/11/14 14:46:40 Done.
1467 Then();
1468 Deopt(reason);
1469 }
1466 void Else(); 1470 void Else();
1467 void End(); 1471 void End();
1468 1472
1469 void Deopt(const char* reason); 1473 void Deopt(const char* reason);
1470 void ElseDeopt(const char* reason) { 1474 void ElseDeopt(const char* reason) {
1471 Else(); 1475 Else();
1472 Deopt(reason); 1476 Deopt(reason);
1473 } 1477 }
1474 1478
1475 void Return(HValue* value); 1479 void Return(HValue* value);
1476 1480
1477 private: 1481 private:
1478 HControlInstruction* AddCompare(HControlInstruction* compare); 1482 HControlInstruction* AddCompare(HControlInstruction* compare);
1479 1483
1480 HGraphBuilder* builder() const { return builder_; } 1484 HGraphBuilder* builder() const { return builder_; }
1481 1485
1486 void AddMergeAtJoinBlock(bool deopt) {
1487 if (!pending_merge_block_) return;
1488 HBasicBlock* block = builder_->current_block();
1489 ASSERT(block == NULL || !block->IsFinished());
1490 MergeAtJoinBlock* record =
1491 new(builder_->zone()) MergeAtJoinBlock(block, deopt,
1492 merge_at_join_blocks_);
1493 merge_at_join_blocks_ = record;
1494 if (block != NULL) {
1495 if (deopt) {
1496 normal_merge_at_join_block_count_++;
1497 } else {
1498 deopt_merge_at_join_block_count_++;
1499 }
1500 }
1501 builder_->set_current_block(NULL);
1502 pending_merge_block_ = false;
1503 }
1504
1505 void Finish();
1506 void Finish(HBasicBlock** then_continuation,
1507 HBasicBlock** else_continuation);
1508
1509 class MergeAtJoinBlock : public ZoneObject {
1510 public:
1511 MergeAtJoinBlock(HBasicBlock* block,
1512 bool deopt,
1513 MergeAtJoinBlock* next)
1514 : block_(block),
1515 deopt_(deopt),
1516 next_(next) {}
1517 HBasicBlock* block_;
1518 bool deopt_;
1519 MergeAtJoinBlock* next_;
1520 };
1521
1482 HGraphBuilder* builder_; 1522 HGraphBuilder* builder_;
1483 bool finished_ : 1; 1523 bool finished_ : 1;
1484 bool deopt_then_ : 1;
1485 bool deopt_else_ : 1;
1486 bool did_then_ : 1; 1524 bool did_then_ : 1;
1487 bool did_else_ : 1; 1525 bool did_else_ : 1;
1526 bool did_else_if_ : 1;
1488 bool did_and_ : 1; 1527 bool did_and_ : 1;
1489 bool did_or_ : 1; 1528 bool did_or_ : 1;
1490 bool captured_ : 1; 1529 bool captured_ : 1;
1491 bool needs_compare_ : 1; 1530 bool needs_compare_ : 1;
1531 bool pending_merge_block_ : 1;
1492 HBasicBlock* first_true_block_; 1532 HBasicBlock* first_true_block_;
1493 HBasicBlock* last_true_block_;
1494 HBasicBlock* first_false_block_; 1533 HBasicBlock* first_false_block_;
1495 HBasicBlock* split_edge_merge_block_; 1534 HBasicBlock* split_edge_merge_block_;
1496 HBasicBlock* merge_block_; 1535 MergeAtJoinBlock* merge_at_join_blocks_;
1536 int normal_merge_at_join_block_count_;
1537 int deopt_merge_at_join_block_count_;
1497 }; 1538 };
1498 1539
1499 class LoopBuilder V8_FINAL { 1540 class LoopBuilder V8_FINAL {
1500 public: 1541 public:
1501 enum Direction { 1542 enum Direction {
1502 kPreIncrement, 1543 kPreIncrement,
1503 kPostIncrement, 1544 kPostIncrement,
1504 kPreDecrement, 1545 kPreDecrement,
1505 kPostDecrement 1546 kPostDecrement
1506 }; 1547 };
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
2496 } 2537 }
2497 2538
2498 private: 2539 private:
2499 HGraphBuilder* builder_; 2540 HGraphBuilder* builder_;
2500 }; 2541 };
2501 2542
2502 2543
2503 } } // namespace v8::internal 2544 } } // namespace v8::internal
2504 2545
2505 #endif // V8_HYDROGEN_H_ 2546 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698