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

Unified Diff: src/hydrogen-sce.cc

Issue 148503002: A64: Synchronize with r15545. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/hydrogen-sce.h ('k') | src/hydrogen-uint32-analysis.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-sce.cc
diff --git a/src/a64/frames-a64.cc b/src/hydrogen-sce.cc
similarity index 62%
copy from src/a64/frames-a64.cc
copy to src/hydrogen-sce.cc
index b1764e0c5fc4b2d8dc4567931990170da2dccaa0..a6995f647afc00437783f057110c7654a28265c3 100644
--- a/src/a64/frames-a64.cc
+++ b/src/hydrogen-sce.cc
@@ -25,27 +25,38 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include "hydrogen-sce.h"
#include "v8.h"
-#if defined(V8_TARGET_ARCH_A64)
-
-#include "assembler.h"
-#include "assembler-a64.h"
-#include "assembler-a64-inl.h"
-#include "frames.h"
-
namespace v8 {
namespace internal {
-
-Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
-Register JavaScriptFrame::context_register() { return cp; }
-
-
-Register StubFailureTrampolineFrame::fp_register() { return v8::internal::fp; }
-Register StubFailureTrampolineFrame::context_register() { return cp; }
-
+void HStackCheckEliminationPhase::Run() {
+ // For each loop block walk the dominator tree from the backwards branch to
+ // the loop header. If a call instruction is encountered the backwards branch
+ // is dominated by a call and the stack check in the backwards branch can be
+ // removed.
+ for (int i = 0; i < graph()->blocks()->length(); i++) {
+ HBasicBlock* block = graph()->blocks()->at(i);
+ if (block->IsLoopHeader()) {
+ HBasicBlock* back_edge = block->loop_information()->GetLastBackEdge();
+ HBasicBlock* dominator = back_edge;
+ while (true) {
+ for (HInstructionIterator it(dominator); !it.Done(); it.Advance()) {
+ if (it.Current()->IsCall()) {
+ block->loop_information()->stack_check()->Eliminate();
+ break;
+ }
+ }
+
+ // Done when the loop header is processed.
+ if (dominator == block) break;
+
+ // Move up the dominator tree.
+ dominator = dominator->dominator();
+ }
+ }
+ }
+}
} } // namespace v8::internal
-
-#endif // V8_TARGET_ARCH_A64
« no previous file with comments | « src/hydrogen-sce.h ('k') | src/hydrogen-uint32-analysis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698