Index: test/mjsunit/regress/regress-clobbered-fp-regs.js |
diff --git a/test/mjsunit/regress/regress-1387.js b/test/mjsunit/regress/regress-clobbered-fp-regs.js |
similarity index 73% |
copy from test/mjsunit/regress/regress-1387.js |
copy to test/mjsunit/regress/regress-clobbered-fp-regs.js |
index d171d381ad27f2ac101105dbe0419211adf10b46..7795ae9a304f5cee33c55d1225903d4c18495ba6 100644 |
--- a/test/mjsunit/regress/regress-1387.js |
+++ b/test/mjsunit/regress/regress-clobbered-fp-regs.js |
@@ -24,15 +24,31 @@ |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// (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 |
-// Tests that we always return the same type error function when trying to |
-// access strict mode caller and callee. |
- |
-function foo() { |
- 'use strict'; |
- return arguments; |
+function store(a, x, y) { |
+ var f1 = 0.1 * y; |
+ var f2 = 0.2 * y; |
+ var f3 = 0.3 * y; |
+ var f4 = 0.4 * y; |
+ var f5 = 0.5 * y; |
+ var f6 = 0.6 * y; |
+ var f7 = 0.7 * y; |
+ var f8 = 0.8 * y; |
+ a[0] = x; |
+ var sum = (f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8); |
+ assertEquals(1, y); |
+ var expected = 3.6; |
+ if (Math.abs(expected - sum) > 0.01) { |
+ assertEquals(expected, sum); |
+ } |
} |
-var get1 = Object.getOwnPropertyDescriptor(foo(), "caller").get; |
-var get2 = Object.getOwnPropertyDescriptor(foo(), "callee").get; |
-assertEquals(get1, get2); |
+// Generate TransitionElementsKindStub. |
+store([1], 1, 1); |
+store([1], 1.1, 1); |
+store([1], 1.1, 1); |
+%OptimizeFunctionOnNextCall(store); |
+// This will trap on allocation site in TransitionElementsKindStub. |
+store([1], 1, 1) |