Enable inlining of functions containing loops.

Review URL: http://codereview.chromium.org/6813107

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7586 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4618b186
...@@ -367,36 +367,11 @@ bool Slot::IsInlineable() const { ...@@ -367,36 +367,11 @@ bool Slot::IsInlineable() const {
} }
bool ForStatement::IsInlineable() const {
return false;
}
bool WhileStatement::IsInlineable() const {
return false;
}
bool DoWhileStatement::IsInlineable() const {
return false;
}
bool ForInStatement::IsInlineable() const { bool ForInStatement::IsInlineable() const {
return false; return false;
} }
bool ContinueStatement::IsInlineable() const {
return false;
}
bool BreakStatement::IsInlineable() const {
return false;
}
bool WithEnterStatement::IsInlineable() const { bool WithEnterStatement::IsInlineable() const {
return false; return false;
} }
...@@ -471,6 +446,36 @@ bool ValidLeftHandSideSentinel::IsInlineable() const { ...@@ -471,6 +446,36 @@ bool ValidLeftHandSideSentinel::IsInlineable() const {
} }
bool ForStatement::IsInlineable() const {
return (init() == NULL || init()->IsInlineable())
&& (cond() == NULL || cond()->IsInlineable())
&& (next() == NULL || next()->IsInlineable())
&& body()->IsInlineable();
}
bool WhileStatement::IsInlineable() const {
return cond()->IsInlineable()
&& body()->IsInlineable();
}
bool DoWhileStatement::IsInlineable() const {
return cond()->IsInlineable()
&& body()->IsInlineable();
}
bool ContinueStatement::IsInlineable() const {
return true;
}
bool BreakStatement::IsInlineable() const {
return true;
}
bool EmptyStatement::IsInlineable() const { bool EmptyStatement::IsInlineable() const {
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment