Index: test/mjsunit/simd/captured_object.js |
diff --git a/test/mjsunit/regress/regress-1650.js b/test/mjsunit/simd/captured_object.js |
similarity index 59% |
copy from test/mjsunit/regress/regress-1650.js |
copy to test/mjsunit/simd/captured_object.js |
index fb6a17814d1d1c282e004436fc7d2347249cb9cb..6a4793cc8b7c513bc846cc8759f6a43d4015ce7c 100644 |
--- a/test/mjsunit/regress/regress-1650.js |
+++ b/test/mjsunit/simd/captured_object.js |
@@ -25,36 +25,54 @@ |
// (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 |
+// Flags: --simd_object --allow-natives-syntax --use-escape-analysis |
-function g(f) { return f.call.apply(f.bind, arguments); } |
+function testCapturedObjectwithFloat32x4Field() { |
+ var deopt = { deopt:false }; |
+ function constructor() { |
+ this.x = 1.1; |
+ this.y = float32x4(1,2,3,4); |
+ } |
+ function field(x) { |
+ var o = new constructor(); |
+ o.x = x; |
+ deopt.deopt; |
+ assertEquals(x, o.x); |
+ assertEquals(o.y.x, 1); |
+ assertEquals(o.y.y, 2); |
+ assertEquals(o.y.z, 3); |
+ assertEquals(o.y.w, 4); |
+ } |
+ field(1); field(2); |
+ %OptimizeFunctionOnNextCall(field); |
+ field(3); field(4); |
+ delete deopt.deopt; |
+ field(5); field(6); |
+} |
-var x = new Object; |
+testCapturedObjectwithFloat32x4Field(); |
-function t() { } |
+function testCapturedObjectwithInt32x4Field() { |
+ var deopt = { deopt:false }; |
+ function constructor() { |
+ this.x = 1.1; |
+ this.y = int32x4(1,2,3,4); |
+ } |
+ function field(x) { |
+ var o = new constructor(); |
+ o.x = x; |
+ deopt.deopt; |
+ assertEquals(x, o.x); |
+ assertEquals(o.y.x, 1); |
+ assertEquals(o.y.y, 2); |
+ assertEquals(o.y.z, 3); |
+ assertEquals(o.y.w, 4); |
+ } |
+ field(1); field(2); |
+ %OptimizeFunctionOnNextCall(field); |
+ field(3); field(4); |
+ delete deopt.deopt; |
+ field(5); field(6); |
+} |
-g(t, x); |
-g(t, x); |
-g(t, x); |
-%OptimizeFunctionOnNextCall(g); |
- |
-function Fake() {} |
- |
-var fakeCallInvoked = false; |
- |
-Fake.prototype.call = function () { |
- assertSame(Fake.prototype.bind, this); |
- assertEquals(2, arguments.length); |
- assertSame(fake, arguments[0]); |
- assertSame(x, arguments[1]); |
- fakeCallInvoked = true; |
-}; |
- |
-Fake.prototype.bind = function () { |
-}; |
- |
-var fake = new Fake; |
- |
-g(fake, x); |
- |
-assertTrue(fakeCallInvoked); |
+testCapturedObjectwithInt32x4Field(); |