Revert "Revert "Upgrade to 5.0.71.48"" DO NOT MERGE
This reverts commit f2e3994fa5148cc3d9946666f0b0596290192b0e,
and updates the x64 makefile properly so it doesn't break that
build.
FPIIM-449
Change-Id: Ib83e35bfbae6af627451c926a9650ec57c045605
(cherry picked from commit 109988c7ccb6f3fd1a58574fa3dfb88beaef6632)
diff --git a/test/mjsunit/wasm/stack.js b/test/mjsunit/wasm/stack.js
new file mode 100644
index 0000000..d4b72c0
--- /dev/null
+++ b/test/mjsunit/wasm/stack.js
@@ -0,0 +1,69 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --expose-wasm
+
+load("test/mjsunit/wasm/wasm-constants.js");
+
+function testStack(func, check) {
+ var kBodySize = 2;
+ var kNameFunOffset = 22 + kBodySize + 1;
+ var kNameMainOffset = kNameFunOffset + 4;
+
+ var ffi = new Object();
+ ffi.fun = func;
+
+ var data = bytes(
+ // signatures
+ kDeclSignatures, 1, // --
+ 0, kAstStmt, // () -> void
+ // -- foreign function
+ kDeclFunctions, 2, // --
+ kDeclFunctionName | kDeclFunctionImport, // --
+ 0, 0, // --
+ kNameFunOffset, 0, 0, 0, // name offset
+ // -- main function
+ kDeclFunctionName | kDeclFunctionExport, // --
+ 0, 0, // --
+ kNameMainOffset, 0, 0, 0, // name offset
+ kBodySize, 0,
+ // main body
+ kExprCallFunction, 0, // --
+ // names
+ kDeclEnd, // --
+ 'f', 'u', 'n', 0, // --
+ 'm', 'a', 'i', 'n', 0 // --
+ );
+
+ var module = _WASMEXP_.instantiateModule(data, ffi);
+
+ assertEquals("function", typeof module.main);
+
+ module.main();
+ check();
+}
+
+// The stack trace contains file path, only keep "stack.js".
+function stripPath(s) {
+ return s.replace(/[^ (]*stack\.js/g, "stack.js");
+}
+
+var stack;
+function STACK() {
+ var e = new Error();
+ stack = e.stack;
+}
+
+function check_STACK() {
+ assertEquals(expected, stripPath(stack));
+}
+
+var expected = "Error\n" +
+ // The line numbers below will change as this test gains / loses lines..
+ " at STACK (stack.js:54:11)\n" + // --
+ " at testStack (stack.js:43:10)\n" +
+ // TODO(jfb) Add WebAssembly stack here.
+ " at stack.js:69:1";
+
+testStack(STACK, check_STACK);