Index: test/mjsunit/compiler/deopt-materialize-accumulator.js |
diff --git a/test/mjsunit/compiler/escape-analysis-deopt-5.js b/test/mjsunit/compiler/deopt-materialize-accumulator.js |
similarity index 80% |
copy from test/mjsunit/compiler/escape-analysis-deopt-5.js |
copy to test/mjsunit/compiler/deopt-materialize-accumulator.js |
index e70f0b1221bd9ab9b33c72da70db4a38897fe34b..c80e329150383ba24ab0949bbdc470576c4570bb 100644 |
--- a/test/mjsunit/compiler/escape-analysis-deopt-5.js |
+++ b/test/mjsunit/compiler/deopt-materialize-accumulator.js |
@@ -25,17 +25,17 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax --turbo-escape |
+// Flags: --allow-natives-syntax |
+// |
+// Tests that Turbofan correctly materializes values which are in the |
+// interpreters accumulator during deopt. |
-function f() { |
- var x = new Array(2); |
- x[0] = 23.1234; |
- x[1] = 25.1234; |
- %DeoptimizeNow(); |
- return x[0]; |
+var global = 3; |
+function f(a) { |
+ // This will trigger a deopt since global was previously a SMI, with the |
+ // accumulator holding an unboxed double which needs materialized. |
+ global = %_MathSqrt(a); |
} |
- |
-assertEquals(f(), 23.1234); |
-assertEquals(f(), 23.1234); |
%OptimizeFunctionOnNextCall(f); |
-assertEquals(f(), 23.1234); |
+f(0.25); |
+assertEquals(0.5, global); |