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

Unified Diff: src/compiler/schedule.h

Issue 892513003: [turbofan] Initial support for Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Wuschelstudio build. Created 5 years, 10 months 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 | « src/compiler/raw-machine-assembler.cc ('k') | src/compiler/schedule.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/schedule.h
diff --git a/src/compiler/schedule.h b/src/compiler/schedule.h
index a142bae0dd3f52f9a5f6b138e014b2ba28f21278..aa479851f943107c873ddf6187ddf5af2752b007 100644
--- a/src/compiler/schedule.h
+++ b/src/compiler/schedule.h
@@ -33,6 +33,7 @@ class BasicBlock FINAL : public ZoneObject {
kNone, // Control not initialized yet.
kGoto, // Goto a single successor block.
kBranch, // Branch if true to first successor, otherwise second.
+ kSwitch, // Table dispatch to one of the successor blocks.
kReturn, // Return a value from this method.
kThrow // Throw an exception.
};
@@ -233,6 +234,10 @@ class Schedule FINAL : public ZoneObject {
void AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock,
BasicBlock* fblock);
+ // BasicBlock building: add a switch at the end of {block}.
+ void AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks,
+ size_t succ_count);
+
// BasicBlock building: add a return at the end of {block}.
void AddReturn(BasicBlock* block, Node* input);
@@ -243,6 +248,10 @@ class Schedule FINAL : public ZoneObject {
void InsertBranch(BasicBlock* block, BasicBlock* end, Node* branch,
BasicBlock* tblock, BasicBlock* fblock);
+ // BasicBlock mutation: insert a switch into the end of {block}.
+ void InsertSwitch(BasicBlock* block, BasicBlock* end, Node* sw,
+ BasicBlock** succ_blocks, size_t succ_count);
+
// Exposed publicly for testing only.
void AddSuccessorForTesting(BasicBlock* block, BasicBlock* succ) {
return AddSuccessor(block, succ);
« no previous file with comments | « src/compiler/raw-machine-assembler.cc ('k') | src/compiler/schedule.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698