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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index 8f4878d93e9c065bad1b36579099cd64d08fa8c9..89274a5991fefe92bef6b600f6f85e4ec61a4832 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1463,6 +1463,10 @@ class HGraphBuilder {
void JoinContinuation(HIfContinuation* continuation);
void Then();
+ 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.
+ Then();
+ Deopt(reason);
+ }
void Else();
void End();
@@ -1479,21 +1483,58 @@ class HGraphBuilder {
HGraphBuilder* builder() const { return builder_; }
+ void AddMergeAtJoinBlock(bool deopt) {
+ if (!pending_merge_block_) return;
+ HBasicBlock* block = builder_->current_block();
+ ASSERT(block == NULL || !block->IsFinished());
+ MergeAtJoinBlock* record =
+ new(builder_->zone()) MergeAtJoinBlock(block, deopt,
+ merge_at_join_blocks_);
+ merge_at_join_blocks_ = record;
+ if (block != NULL) {
+ if (deopt) {
+ normal_merge_at_join_block_count_++;
+ } else {
+ deopt_merge_at_join_block_count_++;
+ }
+ }
+ builder_->set_current_block(NULL);
+ pending_merge_block_ = false;
+ }
+
+ void Finish();
+ void Finish(HBasicBlock** then_continuation,
+ HBasicBlock** else_continuation);
+
+ class MergeAtJoinBlock : public ZoneObject {
+ public:
+ MergeAtJoinBlock(HBasicBlock* block,
+ bool deopt,
+ MergeAtJoinBlock* next)
+ : block_(block),
+ deopt_(deopt),
+ next_(next) {}
+ HBasicBlock* block_;
+ bool deopt_;
+ MergeAtJoinBlock* next_;
+ };
+
HGraphBuilder* builder_;
bool finished_ : 1;
- bool deopt_then_ : 1;
- bool deopt_else_ : 1;
bool did_then_ : 1;
bool did_else_ : 1;
+ bool did_else_if_ : 1;
bool did_and_ : 1;
bool did_or_ : 1;
bool captured_ : 1;
bool needs_compare_ : 1;
+ bool pending_merge_block_ : 1;
HBasicBlock* first_true_block_;
- HBasicBlock* last_true_block_;
HBasicBlock* first_false_block_;
HBasicBlock* split_edge_merge_block_;
- HBasicBlock* merge_block_;
+ MergeAtJoinBlock* merge_at_join_blocks_;
+ int normal_merge_at_join_block_count_;
+ int deopt_merge_at_join_block_count_;
};
class LoopBuilder V8_FINAL {
« 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