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

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

Issue 1436943005: [turbofan] Add support for %_IsSpecObject intrinsic lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-intrinsic-lowering.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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 effect, CaptureEq(&if_false)), 277 effect, CaptureEq(&if_false)),
278 effect, _), 278 effect, _),
279 IsInt32Constant(JS_REGEXP_TYPE)), 279 IsInt32Constant(JS_REGEXP_TYPE)),
280 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch), 280 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch),
281 IsBranch(IsObjectIsSmi(input), control))), 281 IsBranch(IsObjectIsSmi(input), control))),
282 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 282 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
283 } 283 }
284 284
285 285
286 // ----------------------------------------------------------------------------- 286 // -----------------------------------------------------------------------------
287 // %_IsSpecObject
288
289
290 TEST_F(JSIntrinsicLoweringTest, InlineIsSpecObject) {
291 Node* const input = Parameter(0);
292 Node* const context = Parameter(1);
293 Node* const effect = graph()->start();
294 Node* const control = graph()->start();
295 Reduction const r = Reduce(graph()->NewNode(
296 javascript()->CallRuntime(Runtime::kInlineIsSpecObject, 1), input,
297 context, effect, control));
298 ASSERT_TRUE(r.Changed());
299
300 Node* phi = r.replacement();
301 Capture<Node *> branch, if_false;
302 EXPECT_THAT(
303 phi,
304 IsPhi(
305 static_cast<MachineType>(kTypeBool | kRepTagged), IsFalseConstant(),
306 IsUint32LessThanOrEqual(
307 IsInt32Constant(FIRST_JS_RECEIVER_TYPE),
308 IsLoadField(AccessBuilder::ForMapInstanceType(),
309 IsLoadField(AccessBuilder::ForMap(), input, effect,
310 CaptureEq(&if_false)),
311 effect, _)),
312 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch),
313 IsBranch(IsObjectIsSmi(input), control))),
314 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
315 }
316
317
318 // -----------------------------------------------------------------------------
287 // %_JSValueGetValue 319 // %_JSValueGetValue
288 320
289 321
290 TEST_F(JSIntrinsicLoweringTest, InlineJSValueGetValue) { 322 TEST_F(JSIntrinsicLoweringTest, InlineJSValueGetValue) {
291 Node* const input = Parameter(0); 323 Node* const input = Parameter(0);
292 Node* const context = Parameter(1); 324 Node* const context = Parameter(1);
293 Node* const effect = graph()->start(); 325 Node* const effect = graph()->start();
294 Node* const control = graph()->start(); 326 Node* const control = graph()->start();
295 Reduction const r = Reduce(graph()->NewNode( 327 Reduction const r = Reduce(graph()->NewNode(
296 javascript()->CallRuntime(Runtime::kInlineJSValueGetValue, 1), input, 328 javascript()->CallRuntime(Runtime::kInlineJSValueGetValue, 1), input,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 CaptureEq(&if_false0)))))), 441 CaptureEq(&if_false0)))))),
410 IsMerge( 442 IsMerge(
411 IsIfTrue(AllOf(CaptureEq(&branch0), 443 IsIfTrue(AllOf(CaptureEq(&branch0),
412 IsBranch(IsObjectIsSmi(input), control))), 444 IsBranch(IsObjectIsSmi(input), control))),
413 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); 445 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0))))));
414 } 446 }
415 447
416 } // namespace compiler 448 } // namespace compiler
417 } // namespace internal 449 } // namespace internal
418 } // namespace v8 450 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-intrinsic-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698