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

Side by Side Diff: test/unittests/compiler/js-intrinsic-lowering-unittest.cc

Issue 1183213002: Inline code generation for %_IsTypedArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: don't remove mips64 EmitIsArray Created 5 years, 6 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/x87/full-codegen-x87.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/diamond.h" 6 #include "src/compiler/diamond.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-intrinsic-lowering.h" 8 #include "src/compiler/js-intrinsic-lowering.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "test/unittests/compiler/graph-unittest.h" 10 #include "test/unittests/compiler/graph-unittest.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 effect, CaptureEq(&if_false)), 167 effect, CaptureEq(&if_false)),
168 effect, _), 168 effect, _),
169 IsInt32Constant(JS_ARRAY_TYPE)), 169 IsInt32Constant(JS_ARRAY_TYPE)),
170 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch), 170 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch),
171 IsBranch(IsObjectIsSmi(input), control))), 171 IsBranch(IsObjectIsSmi(input), control))),
172 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 172 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
173 } 173 }
174 174
175 175
176 // ----------------------------------------------------------------------------- 176 // -----------------------------------------------------------------------------
177 // %_IsTypedArray
178
179
180 TEST_F(JSIntrinsicLoweringTest, InlineIsTypedArray) {
181 Node* const input = Parameter(0);
182 Node* const context = Parameter(1);
183 Node* const effect = graph()->start();
184 Node* const control = graph()->start();
185 Reduction const r = Reduce(graph()->NewNode(
186 javascript()->CallRuntime(Runtime::kInlineIsTypedArray, 1), input,
187 context, effect, control));
188 ASSERT_TRUE(r.Changed());
189
190 Node* phi = r.replacement();
191 Capture<Node*> branch, if_false;
192 EXPECT_THAT(
193 phi,
194 IsPhi(
195 static_cast<MachineType>(kTypeBool | kRepTagged), IsFalseConstant(),
196 IsWord32Equal(IsLoadField(AccessBuilder::ForMapInstanceType(),
197 IsLoadField(AccessBuilder::ForMap(), input,
198 effect, CaptureEq(&if_false)),
199 effect, _),
200 IsInt32Constant(JS_TYPED_ARRAY_TYPE)),
201 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch),
202 IsBranch(IsObjectIsSmi(input), control))),
203 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
204 }
205
206
207 // -----------------------------------------------------------------------------
177 // %_IsFunction 208 // %_IsFunction
178 209
179 210
180 TEST_F(JSIntrinsicLoweringTest, InlineIsFunction) { 211 TEST_F(JSIntrinsicLoweringTest, InlineIsFunction) {
181 Node* const input = Parameter(0); 212 Node* const input = Parameter(0);
182 Node* const context = Parameter(1); 213 Node* const context = Parameter(1);
183 Node* const effect = graph()->start(); 214 Node* const effect = graph()->start();
184 Node* const control = graph()->start(); 215 Node* const control = graph()->start();
185 Reduction const r = Reduce( 216 Reduction const r = Reduce(
186 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineIsFunction, 1), 217 graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineIsFunction, 1),
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 CaptureEq(&if_false0)))))), 441 CaptureEq(&if_false0)))))),
411 IsMerge( 442 IsMerge(
412 IsIfTrue(AllOf(CaptureEq(&branch0), 443 IsIfTrue(AllOf(CaptureEq(&branch0),
413 IsBranch(IsObjectIsSmi(input), control))), 444 IsBranch(IsObjectIsSmi(input), control))),
414 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); 445 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0))))));
415 } 446 }
416 447
417 } // namespace compiler 448 } // namespace compiler
418 } // namespace internal 449 } // namespace internal
419 } // namespace v8 450 } // namespace v8
OLDNEW
« no previous file with comments | « src/x87/full-codegen-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698