MIPS: Fix failures on Octane 2.0 zlib benchmark.
authorpalfia@homejinni.com <palfia@homejinni.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 29 Nov 2013 23:46:10 +0000 (23:46 +0000)
committerpalfia@homejinni.com <palfia@homejinni.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 29 Nov 2013 23:46:10 +0000 (23:46 +0000)
The bug was introduced in af9504e.

The zlib benchmark triggers long branch mode on MIPS, in which
at register is clobbered after every branch.

TEST=benchmarks/octane/zlib
BUG=
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/95203005

Patch from Dusan Milosavljevic <Dusan.Milosavljevic@rt-rk.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18168 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/mips/full-codegen-mips.cc

index 35fbad0..a56fbb1 100644 (file)
@@ -631,11 +631,13 @@ void FullCodeGenerator::StackValueContext::Plug(
   Label done;
   __ bind(materialize_true);
   __ LoadRoot(at, Heap::kTrueValueRootIndex);
+  // Push the value as the following branch can clobber at in long branch mode.
+  __ push(at);
   __ Branch(&done);
   __ bind(materialize_false);
   __ LoadRoot(at, Heap::kFalseValueRootIndex);
-  __ bind(&done);
   __ push(at);
+  __ bind(&done);
 }