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

Unified Diff: src/hydrogen.h

Issue 6532088: Partial refactoring of subgraphs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 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 | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »
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 8a5e8df7cd9c624ac17e293291f8d0c58a7a56d0..e6e3a020c08c7841540003f5b54672e4724cd624 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -200,13 +200,12 @@ class HSubgraph: public ZoneObject {
}
HGraph* graph() const { return graph_; }
- HEnvironment* environment() const {
- ASSERT(HasExit());
- return exit_block_->last_environment();
+ HBasicBlock* entry_block() const { return entry_block_; }
+ HBasicBlock* exit_block() const { return exit_block_; }
+ void set_exit_block(HBasicBlock* block) {
+ exit_block_ = block;
}
- bool HasExit() const { return exit_block_ != NULL; }
-
void PreProcessOsrEntry(IterationStatement* statement);
void AppendJoin(HSubgraph* then_graph, HSubgraph* else_graph, AstNode* node);
@@ -237,17 +236,6 @@ class HSubgraph: public ZoneObject {
entry_block_ = block;
exit_block_ = block;
}
- HBasicBlock* entry_block() const { return entry_block_; }
- HBasicBlock* exit_block() const { return exit_block_; }
- void set_exit_block(HBasicBlock* block) {
- exit_block_ = block;
- }
-
- void ConnectExitTo(HBasicBlock* other, bool include_stack_check = false) {
- if (HasExit()) {
- exit_block()->Goto(other, include_stack_check);
- }
- }
protected:
HGraph* graph_; // The graph this is a subgraph of.
@@ -657,8 +645,13 @@ class HGraphBuilder: public AstVisitor {
BreakAndContinueScope* break_scope() const { return break_scope_; }
void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; }
- HEnvironment* environment() const { return subgraph()->environment(); }
- HBasicBlock* CurrentBlock() const { return subgraph()->exit_block(); }
+ HBasicBlock* current_block() const { return subgraph()->exit_block(); }
+ void set_current_block(HBasicBlock* block) {
+ subgraph()->set_exit_block(block);
+ }
+ HEnvironment* environment() const {
+ return current_block()->last_environment();
+ }
// Adding instructions.
HInstruction* AddInstruction(HInstruction* instr);
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698