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

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

Issue 2591923003: [regexp] Remove IsRegExp intrinsic (Closed)
Patch Set: Rebase Created 3 years, 11 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 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
98 TEST(IsSmi) { 83 TEST(IsSmi) {
99 FunctionTester T("(function(a) { return %_IsSmi(a); })", flags); 84 FunctionTester T("(function(a) { return %_IsSmi(a); })", flags);
100 85
101 T.CheckFalse(T.NewObject("new Date()")); 86 T.CheckFalse(T.NewObject("new Date()"));
102 T.CheckFalse(T.NewObject("(function() {})")); 87 T.CheckFalse(T.NewObject("(function() {})"));
103 T.CheckFalse(T.NewObject("([1])")); 88 T.CheckFalse(T.NewObject("([1])"));
104 T.CheckFalse(T.NewObject("({})")); 89 T.CheckFalse(T.NewObject("({})"));
105 T.CheckFalse(T.NewObject("(/x/)")); 90 T.CheckFalse(T.NewObject("(/x/)"));
106 T.CheckFalse(T.undefined()); 91 T.CheckFalse(T.undefined());
107 T.CheckTrue(T.Val(1)); 92 T.CheckTrue(T.Val(1));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 FunctionTester T("(function(a,b) { return %_SubString(a,b,b+3); })", flags); 129 FunctionTester T("(function(a,b) { return %_SubString(a,b,b+3); })", flags);
145 130
146 T.CheckCall(T.Val("aaa"), T.Val("aaabbb"), T.Val(0.0)); 131 T.CheckCall(T.Val("aaa"), T.Val("aaabbb"), T.Val(0.0));
147 T.CheckCall(T.Val("abb"), T.Val("aaabbb"), T.Val(2)); 132 T.CheckCall(T.Val("abb"), T.Val("aaabbb"), T.Val(2));
148 T.CheckCall(T.Val("aaa"), T.Val("aaa"), T.Val(0.0)); 133 T.CheckCall(T.Val("aaa"), T.Val("aaa"), T.Val(0.0));
149 } 134 }
150 135
151 } // namespace compiler 136 } // namespace compiler
152 } // namespace internal 137 } // namespace internal
153 } // namespace v8 138 } // 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