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

Unified Diff: test/mjsunit/constant-fold-control-instructions.js

Issue 196133017: Experimental parser: merge r19949 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 months 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/compiler/division-by-constant.js ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/constant-fold-control-instructions.js
diff --git a/test/mjsunit/constant-fold-control-instructions.js b/test/mjsunit/constant-fold-control-instructions.js
new file mode 100644
index 0000000000000000000000000000000000000000..eb1b0f3c0b70cdc2139c0d59d073b7e1b346342e
--- /dev/null
+++ b/test/mjsunit/constant-fold-control-instructions.js
@@ -0,0 +1,47 @@
+// Copyright 2014 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: --allow-natives-syntax --fold-constants
+
+function test() {
+ assertEquals("string", typeof "");
+ assertEquals("number", typeof 1.1);
+ assertEquals("number", typeof 1);
+ assertEquals("boolean", typeof true);
+ assertEquals("function", typeof function() {});
+ assertEquals("object", typeof null);
+ assertEquals("object", typeof {});
+
+ assertTrue(%_IsObject({}));
+ assertTrue(%_IsObject(null));
+ assertTrue(%_IsObject(/regex/));
+ assertFalse(%_IsObject(0));
+ assertFalse(%_IsObject(""));
+
+ assertTrue(%_IsSmi(1));
+ assertFalse(%_IsSmi(1.1));
+ assertFalse(%_IsSmi({}));
+
+ assertTrue(%_IsRegExp(/regexp/));
+ assertFalse(%_IsRegExp({}));
+
+ assertTrue(%_IsArray([1]));
+ assertFalse(%_IsArray(function() {}));
+
+ assertTrue(%_IsFunction(function() {}));
+ assertFalse(%_IsFunction(null));
+
+ assertTrue(%_IsSpecObject(new Date()));
+ assertFalse(%_IsSpecObject(1));
+
+ assertTrue(%_IsMinusZero(-0.0));
+ assertFalse(%_IsMinusZero(1));
+ assertFalse(%_IsMinusZero(""));
+}
+
+
+test();
+test();
+%OptimizeFunctionOnNextCall(test);
+test();
« no previous file with comments | « test/mjsunit/compiler/division-by-constant.js ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698