Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: test/mjsunit/simd/captured_object.js

Issue 90643003: Experimental implementation: Exposing SIMD instructions into JavaScript Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/simd/argument_object.js ('k') | test/mjsunit/simd/deopt.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « test/mjsunit/simd/argument_object.js ('k') | test/mjsunit/simd/deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698