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

Unified Diff: test/mjsunit/simd/representation_change.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/prototype.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/simd/representation_change.js
diff --git a/test/mjsunit/compiler/strict-recompile.js b/test/mjsunit/simd/representation_change.js
similarity index 76%
copy from test/mjsunit/compiler/strict-recompile.js
copy to test/mjsunit/simd/representation_change.js
index 96e8bcab78528c3eb34b33e5de20ca7a6cc96fc3..4c4cb429e79c763b52d879c4e2c1df9970ea325b 100644
--- a/test/mjsunit/compiler/strict-recompile.js
+++ b/test/mjsunit/simd/representation_change.js
@@ -25,27 +25,30 @@
// (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
-function foo() {
- try {
- var o = {};
- Object.defineProperty(o, 'x', {value: 12, writable: false});
- o.x = 13;
- } catch(e) {
- return true;
+function testSIMDAbs(i) {
+ var a;
+ if (i < 3) {
+ a = float32x4(1, 1, 1, 1);
+ } else {
+ a = int32x4(2, 2, 2, 2);
}
- return false;
+ return SIMD.float32x4.abs(a);
}
-assertFalse(foo());
-
-function do_eval(str) {
- "use strict";
- return eval(str);
+function tryTestSIMDAbs(i) {
+ var r = 0;
+ try {
+ r = testSIMDAbs(i);
+ } catch (o) {
+ AssertEquals(o, "TypeError: <unknown message this is not a float32x4 value.>");
+ } finally {
+ return r;
+ }
}
-var eval_foo = do_eval('(' + foo + ')');
-for (var i = 0; i < 5; i++) assertTrue(eval_foo());
-%OptimizeFunctionOnNextCall(eval_foo);
-assertTrue(eval_foo());
+tryTestSIMDAbs(1);
+tryTestSIMDAbs(2);
+%OptimizeFunctionOnNextCall(testSIMDAbs);
+tryTestSIMDAbs(3);
« no previous file with comments | « test/mjsunit/simd/prototype.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698