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

Side by Side Diff: test/cctest/compiler/test-run-intrinsics.cc

Issue 2592383002: Revert of [regexp] Remove IsRegExp intrinsic (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « src/js/macros.py ('k') | test/cctest/interpreter/test-interpreter-intrinsics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compilation-info.h" 5 #include "src/compilation-info.h"
6 #include "test/cctest/compiler/function-tester.h" 6 #include "test/cctest/compiler/function-tester.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 T.CheckFalse(T.NewObject("([1])")); 73 T.CheckFalse(T.NewObject("([1])"));
74 T.CheckFalse(T.NewObject("({})")); 74 T.CheckFalse(T.NewObject("({})"));
75 T.CheckFalse(T.NewObject("(/x/)")); 75 T.CheckFalse(T.NewObject("(/x/)"));
76 T.CheckFalse(T.undefined()); 76 T.CheckFalse(T.undefined());
77 T.CheckFalse(T.null()); 77 T.CheckFalse(T.null());
78 T.CheckFalse(T.Val("x")); 78 T.CheckFalse(T.Val("x"));
79 T.CheckFalse(T.Val(1)); 79 T.CheckFalse(T.Val(1));
80 } 80 }
81 81
82 82
83 TEST(IsRegExp) {
84 FunctionTester T("(function(a) { return %_IsRegExp(a); })", flags);
85
86 T.CheckFalse(T.NewObject("new Date()"));
87 T.CheckFalse(T.NewObject("(function() {})"));
88 T.CheckFalse(T.NewObject("([1])"));
89 T.CheckFalse(T.NewObject("({})"));
90 T.CheckTrue(T.NewObject("(/x/)"));
91 T.CheckFalse(T.undefined());
92 T.CheckFalse(T.null());
93 T.CheckFalse(T.Val("x"));
94 T.CheckFalse(T.Val(1));
95 }
96
97
83 TEST(IsSmi) { 98 TEST(IsSmi) {
84 FunctionTester T("(function(a) { return %_IsSmi(a); })", flags); 99 FunctionTester T("(function(a) { return %_IsSmi(a); })", flags);
85 100
86 T.CheckFalse(T.NewObject("new Date()")); 101 T.CheckFalse(T.NewObject("new Date()"));
87 T.CheckFalse(T.NewObject("(function() {})")); 102 T.CheckFalse(T.NewObject("(function() {})"));
88 T.CheckFalse(T.NewObject("([1])")); 103 T.CheckFalse(T.NewObject("([1])"));
89 T.CheckFalse(T.NewObject("({})")); 104 T.CheckFalse(T.NewObject("({})"));
90 T.CheckFalse(T.NewObject("(/x/)")); 105 T.CheckFalse(T.NewObject("(/x/)"));
91 T.CheckFalse(T.undefined()); 106 T.CheckFalse(T.undefined());
92 T.CheckTrue(T.Val(1)); 107 T.CheckTrue(T.Val(1));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 FunctionTester T("(function(a,b) { return %_SubString(a,b,b+3); })", flags); 144 FunctionTester T("(function(a,b) { return %_SubString(a,b,b+3); })", flags);
130 145
131 T.CheckCall(T.Val("aaa"), T.Val("aaabbb"), T.Val(0.0)); 146 T.CheckCall(T.Val("aaa"), T.Val("aaabbb"), T.Val(0.0));
132 T.CheckCall(T.Val("abb"), T.Val("aaabbb"), T.Val(2)); 147 T.CheckCall(T.Val("abb"), T.Val("aaabbb"), T.Val(2));
133 T.CheckCall(T.Val("aaa"), T.Val("aaa"), T.Val(0.0)); 148 T.CheckCall(T.Val("aaa"), T.Val("aaa"), T.Val(0.0));
134 } 149 }
135 150
136 } // namespace compiler 151 } // namespace compiler
137 } // namespace internal 152 } // namespace internal
138 } // namespace v8 153 } // namespace v8
OLDNEW
« no previous file with comments | « src/js/macros.py ('k') | test/cctest/interpreter/test-interpreter-intrinsics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698