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

Side by Side Diff: src/compiler/change-lowering-unittest.cc

Issue 545153002: [turbofan] Add MachineType to Phi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/change-lowering.cc ('k') | src/compiler/common-operator.h » ('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/compiler/change-lowering.h" 5 #include "src/compiler/change-lowering.h"
6 #include "src/compiler/compiler-test-utils.h" 6 #include "src/compiler/compiler-test-utils.h"
7 #include "src/compiler/graph-unittest.h" 7 #include "src/compiler/graph-unittest.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/node-properties-inl.h" 9 #include "src/compiler/node-properties-inl.h"
10 #include "src/compiler/simplified-operator.h" 10 #include "src/compiler/simplified-operator.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBitToBool) { 124 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBitToBool) {
125 Node* val = Parameter(0); 125 Node* val = Parameter(0);
126 Node* node = graph()->NewNode(simplified()->ChangeBitToBool(), val); 126 Node* node = graph()->NewNode(simplified()->ChangeBitToBool(), val);
127 Reduction reduction = Reduce(node); 127 Reduction reduction = Reduce(node);
128 ASSERT_TRUE(reduction.Changed()); 128 ASSERT_TRUE(reduction.Changed());
129 129
130 Node* phi = reduction.replacement(); 130 Node* phi = reduction.replacement();
131 Capture<Node*> branch; 131 Capture<Node*> branch;
132 EXPECT_THAT(phi, 132 EXPECT_THAT(phi,
133 IsPhi(IsTrueConstant(), IsFalseConstant(), 133 IsPhi(kMachAnyTagged, IsTrueConstant(), IsFalseConstant(),
134 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch), 134 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch),
135 IsBranch(val, graph()->start()))), 135 IsBranch(val, graph()->start()))),
136 IsIfFalse(CaptureEq(&branch))))); 136 IsIfFalse(CaptureEq(&branch)))));
137 } 137 }
138 138
139 139
140 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBoolToBit) { 140 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBoolToBit) {
141 Node* val = Parameter(0); 141 Node* val = Parameter(0);
142 Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val); 142 Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val);
143 Reduction reduction = Reduce(node); 143 Reduction reduction = Reduce(node);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTagged) { 194 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTagged) {
195 Node* val = Parameter(0); 195 Node* val = Parameter(0);
196 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val); 196 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val);
197 Reduction reduction = Reduce(node); 197 Reduction reduction = Reduce(node);
198 ASSERT_TRUE(reduction.Changed()); 198 ASSERT_TRUE(reduction.Changed());
199 199
200 Node* phi = reduction.replacement(); 200 Node* phi = reduction.replacement();
201 Capture<Node*> add, branch, heap_number, if_true; 201 Capture<Node*> add, branch, heap_number, if_true;
202 EXPECT_THAT( 202 EXPECT_THAT(
203 phi, 203 phi,
204 IsPhi(IsFinish( 204 IsPhi(kMachAnyTagged,
205 IsFinish(
205 AllOf(CaptureEq(&heap_number), 206 AllOf(CaptureEq(&heap_number),
206 IsAllocateHeapNumber(_, CaptureEq(&if_true))), 207 IsAllocateHeapNumber(_, CaptureEq(&if_true))),
207 IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number), 208 IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number),
208 IsInt32Constant(HeapNumberValueOffset()), 209 IsInt32Constant(HeapNumberValueOffset()),
209 IsChangeInt32ToFloat64(val), CaptureEq(&heap_number), 210 IsChangeInt32ToFloat64(val), CaptureEq(&heap_number),
210 CaptureEq(&if_true))), 211 CaptureEq(&if_true))),
211 IsProjection( 212 IsProjection(
212 0, AllOf(CaptureEq(&add), IsInt32AddWithOverflow(val, val))), 213 0, AllOf(CaptureEq(&add), IsInt32AddWithOverflow(val, val))),
213 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 214 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
214 IsIfFalse(AllOf(CaptureEq(&branch), 215 IsIfFalse(AllOf(CaptureEq(&branch),
215 IsBranch(IsProjection(1, CaptureEq(&add)), 216 IsBranch(IsProjection(1, CaptureEq(&add)),
216 graph()->start())))))); 217 graph()->start()))))));
217 } 218 }
218 219
219 220
220 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) { 221 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) {
221 STATIC_ASSERT(kSmiTag == 0); 222 STATIC_ASSERT(kSmiTag == 0);
222 STATIC_ASSERT(kSmiTagSize == 1); 223 STATIC_ASSERT(kSmiTagSize == 1);
223 224
224 Node* val = Parameter(0); 225 Node* val = Parameter(0);
225 Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val); 226 Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val);
226 Reduction reduction = Reduce(node); 227 Reduction reduction = Reduce(node);
227 ASSERT_TRUE(reduction.Changed()); 228 ASSERT_TRUE(reduction.Changed());
228 229
229 Node* phi = reduction.replacement(); 230 Node* phi = reduction.replacement();
230 Capture<Node*> branch, if_true; 231 Capture<Node*> branch, if_true;
231 EXPECT_THAT( 232 EXPECT_THAT(
232 phi, 233 phi,
233 IsPhi( 234 IsPhi(
235 kMachFloat64,
234 IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()), 236 IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
235 IsControlEffect(CaptureEq(&if_true))), 237 IsControlEffect(CaptureEq(&if_true))),
236 IsChangeInt32ToFloat64( 238 IsChangeInt32ToFloat64(
237 IsWord32Sar(val, IsInt32Constant(SmiShiftAmount()))), 239 IsWord32Sar(val, IsInt32Constant(SmiShiftAmount()))),
238 IsMerge( 240 IsMerge(
239 AllOf(CaptureEq(&if_true), 241 AllOf(CaptureEq(&if_true),
240 IsIfTrue(AllOf( 242 IsIfTrue(AllOf(
241 CaptureEq(&branch), 243 CaptureEq(&branch),
242 IsBranch(IsWord32And(val, IsInt32Constant(kSmiTagMask)), 244 IsBranch(IsWord32And(val, IsInt32Constant(kSmiTagMask)),
243 graph()->start())))), 245 graph()->start())))),
244 IsIfFalse(CaptureEq(&branch))))); 246 IsIfFalse(CaptureEq(&branch)))));
245 } 247 }
246 248
247 249
248 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToInt32) { 250 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToInt32) {
249 STATIC_ASSERT(kSmiTag == 0); 251 STATIC_ASSERT(kSmiTag == 0);
250 STATIC_ASSERT(kSmiTagSize == 1); 252 STATIC_ASSERT(kSmiTagSize == 1);
251 253
252 Node* val = Parameter(0); 254 Node* val = Parameter(0);
253 Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), val); 255 Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), val);
254 Reduction reduction = Reduce(node); 256 Reduction reduction = Reduce(node);
255 ASSERT_TRUE(reduction.Changed()); 257 ASSERT_TRUE(reduction.Changed());
256 258
257 Node* phi = reduction.replacement(); 259 Node* phi = reduction.replacement();
258 Capture<Node*> branch, if_true; 260 Capture<Node*> branch, if_true;
259 EXPECT_THAT( 261 EXPECT_THAT(
260 phi, 262 phi,
261 IsPhi(IsChangeFloat64ToInt32(IsLoad( 263 IsPhi(kMachInt32,
264 IsChangeFloat64ToInt32(IsLoad(
262 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()), 265 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
263 IsControlEffect(CaptureEq(&if_true)))), 266 IsControlEffect(CaptureEq(&if_true)))),
264 IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())), 267 IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
265 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 268 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
266 IsIfFalse(AllOf( 269 IsIfFalse(AllOf(
267 CaptureEq(&branch), 270 CaptureEq(&branch),
268 IsBranch(IsWord32And(val, IsInt32Constant(kSmiTagMask)), 271 IsBranch(IsWord32And(val, IsInt32Constant(kSmiTagMask)),
269 graph()->start())))))); 272 graph()->start()))))));
270 } 273 }
271 274
272 275
273 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToUint32) { 276 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToUint32) {
274 STATIC_ASSERT(kSmiTag == 0); 277 STATIC_ASSERT(kSmiTag == 0);
275 STATIC_ASSERT(kSmiTagSize == 1); 278 STATIC_ASSERT(kSmiTagSize == 1);
276 279
277 Node* val = Parameter(0); 280 Node* val = Parameter(0);
278 Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), val); 281 Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), val);
279 Reduction reduction = Reduce(node); 282 Reduction reduction = Reduce(node);
280 ASSERT_TRUE(reduction.Changed()); 283 ASSERT_TRUE(reduction.Changed());
281 284
282 Node* phi = reduction.replacement(); 285 Node* phi = reduction.replacement();
283 Capture<Node*> branch, if_true; 286 Capture<Node*> branch, if_true;
284 EXPECT_THAT( 287 EXPECT_THAT(
285 phi, 288 phi,
286 IsPhi(IsChangeFloat64ToUint32(IsLoad( 289 IsPhi(kMachUint32,
290 IsChangeFloat64ToUint32(IsLoad(
287 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()), 291 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
288 IsControlEffect(CaptureEq(&if_true)))), 292 IsControlEffect(CaptureEq(&if_true)))),
289 IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())), 293 IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
290 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 294 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
291 IsIfFalse(AllOf( 295 IsIfFalse(AllOf(
292 CaptureEq(&branch), 296 CaptureEq(&branch),
293 IsBranch(IsWord32And(val, IsInt32Constant(kSmiTagMask)), 297 IsBranch(IsWord32And(val, IsInt32Constant(kSmiTagMask)),
294 graph()->start())))))); 298 graph()->start()))))));
295 } 299 }
296 300
297 301
298 TARGET_TEST_F(ChangeLowering32Test, ChangeUint32ToTagged) { 302 TARGET_TEST_F(ChangeLowering32Test, ChangeUint32ToTagged) {
299 STATIC_ASSERT(kSmiTag == 0); 303 STATIC_ASSERT(kSmiTag == 0);
300 STATIC_ASSERT(kSmiTagSize == 1); 304 STATIC_ASSERT(kSmiTagSize == 1);
301 305
302 Node* val = Parameter(0); 306 Node* val = Parameter(0);
303 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), val); 307 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), val);
304 Reduction reduction = Reduce(node); 308 Reduction reduction = Reduce(node);
305 ASSERT_TRUE(reduction.Changed()); 309 ASSERT_TRUE(reduction.Changed());
306 310
307 Node* phi = reduction.replacement(); 311 Node* phi = reduction.replacement();
308 Capture<Node*> branch, heap_number, if_false; 312 Capture<Node*> branch, heap_number, if_false;
309 EXPECT_THAT( 313 EXPECT_THAT(
310 phi, 314 phi,
311 IsPhi( 315 IsPhi(
312 IsWord32Shl(val, IsInt32Constant(SmiShiftAmount())), 316 kMachAnyTagged, IsWord32Shl(val, IsInt32Constant(SmiShiftAmount())),
313 IsFinish( 317 IsFinish(
314 AllOf(CaptureEq(&heap_number), 318 AllOf(CaptureEq(&heap_number),
315 IsAllocateHeapNumber(_, CaptureEq(&if_false))), 319 IsAllocateHeapNumber(_, CaptureEq(&if_false))),
316 IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number), 320 IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number),
317 IsInt32Constant(HeapNumberValueOffset()), 321 IsInt32Constant(HeapNumberValueOffset()),
318 IsChangeUint32ToFloat64(val), CaptureEq(&heap_number), 322 IsChangeUint32ToFloat64(val), CaptureEq(&heap_number),
319 CaptureEq(&if_false))), 323 CaptureEq(&if_false))),
320 IsMerge( 324 IsMerge(
321 IsIfTrue(AllOf(CaptureEq(&branch), 325 IsIfTrue(AllOf(CaptureEq(&branch),
322 IsBranch(IsUint32LessThanOrEqual( 326 IsBranch(IsUint32LessThanOrEqual(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 Node* val = Parameter(0); 362 Node* val = Parameter(0);
359 Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val); 363 Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val);
360 Reduction reduction = Reduce(node); 364 Reduction reduction = Reduce(node);
361 ASSERT_TRUE(reduction.Changed()); 365 ASSERT_TRUE(reduction.Changed());
362 366
363 Node* phi = reduction.replacement(); 367 Node* phi = reduction.replacement();
364 Capture<Node*> branch, if_true; 368 Capture<Node*> branch, if_true;
365 EXPECT_THAT( 369 EXPECT_THAT(
366 phi, 370 phi,
367 IsPhi( 371 IsPhi(
372 kMachFloat64,
368 IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()), 373 IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
369 IsControlEffect(CaptureEq(&if_true))), 374 IsControlEffect(CaptureEq(&if_true))),
370 IsChangeInt32ToFloat64(IsTruncateInt64ToInt32( 375 IsChangeInt32ToFloat64(IsTruncateInt64ToInt32(
371 IsWord64Sar(val, IsInt32Constant(SmiShiftAmount())))), 376 IsWord64Sar(val, IsInt32Constant(SmiShiftAmount())))),
372 IsMerge( 377 IsMerge(
373 AllOf(CaptureEq(&if_true), 378 AllOf(CaptureEq(&if_true),
374 IsIfTrue(AllOf( 379 IsIfTrue(AllOf(
375 CaptureEq(&branch), 380 CaptureEq(&branch),
376 IsBranch(IsWord64And(val, IsInt32Constant(kSmiTagMask)), 381 IsBranch(IsWord64And(val, IsInt32Constant(kSmiTagMask)),
377 graph()->start())))), 382 graph()->start())))),
378 IsIfFalse(CaptureEq(&branch))))); 383 IsIfFalse(CaptureEq(&branch)))));
379 } 384 }
380 385
381 386
382 TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToInt32) { 387 TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToInt32) {
383 STATIC_ASSERT(kSmiTag == 0); 388 STATIC_ASSERT(kSmiTag == 0);
384 STATIC_ASSERT(kSmiTagSize == 1); 389 STATIC_ASSERT(kSmiTagSize == 1);
385 390
386 Node* val = Parameter(0); 391 Node* val = Parameter(0);
387 Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), val); 392 Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), val);
388 Reduction reduction = Reduce(node); 393 Reduction reduction = Reduce(node);
389 ASSERT_TRUE(reduction.Changed()); 394 ASSERT_TRUE(reduction.Changed());
390 395
391 Node* phi = reduction.replacement(); 396 Node* phi = reduction.replacement();
392 Capture<Node*> branch, if_true; 397 Capture<Node*> branch, if_true;
393 EXPECT_THAT( 398 EXPECT_THAT(
394 phi, 399 phi,
395 IsPhi(IsChangeFloat64ToInt32(IsLoad( 400 IsPhi(kMachInt32,
401 IsChangeFloat64ToInt32(IsLoad(
396 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()), 402 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
397 IsControlEffect(CaptureEq(&if_true)))), 403 IsControlEffect(CaptureEq(&if_true)))),
398 IsTruncateInt64ToInt32( 404 IsTruncateInt64ToInt32(
399 IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))), 405 IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))),
400 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 406 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
401 IsIfFalse(AllOf( 407 IsIfFalse(AllOf(
402 CaptureEq(&branch), 408 CaptureEq(&branch),
403 IsBranch(IsWord64And(val, IsInt32Constant(kSmiTagMask)), 409 IsBranch(IsWord64And(val, IsInt32Constant(kSmiTagMask)),
404 graph()->start())))))); 410 graph()->start()))))));
405 } 411 }
406 412
407 413
408 TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToUint32) { 414 TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToUint32) {
409 STATIC_ASSERT(kSmiTag == 0); 415 STATIC_ASSERT(kSmiTag == 0);
410 STATIC_ASSERT(kSmiTagSize == 1); 416 STATIC_ASSERT(kSmiTagSize == 1);
411 417
412 Node* val = Parameter(0); 418 Node* val = Parameter(0);
413 Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), val); 419 Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), val);
414 Reduction reduction = Reduce(node); 420 Reduction reduction = Reduce(node);
415 ASSERT_TRUE(reduction.Changed()); 421 ASSERT_TRUE(reduction.Changed());
416 422
417 Node* phi = reduction.replacement(); 423 Node* phi = reduction.replacement();
418 Capture<Node*> branch, if_true; 424 Capture<Node*> branch, if_true;
419 EXPECT_THAT( 425 EXPECT_THAT(
420 phi, 426 phi,
421 IsPhi(IsChangeFloat64ToUint32(IsLoad( 427 IsPhi(kMachUint32,
428 IsChangeFloat64ToUint32(IsLoad(
422 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()), 429 kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
423 IsControlEffect(CaptureEq(&if_true)))), 430 IsControlEffect(CaptureEq(&if_true)))),
424 IsTruncateInt64ToInt32( 431 IsTruncateInt64ToInt32(
425 IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))), 432 IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))),
426 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 433 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
427 IsIfFalse(AllOf( 434 IsIfFalse(AllOf(
428 CaptureEq(&branch), 435 CaptureEq(&branch),
429 IsBranch(IsWord64And(val, IsInt32Constant(kSmiTagMask)), 436 IsBranch(IsWord64And(val, IsInt32Constant(kSmiTagMask)),
430 graph()->start())))))); 437 graph()->start()))))));
431 } 438 }
432 439
433 440
434 TARGET_TEST_F(ChangeLowering64Test, ChangeUint32ToTagged) { 441 TARGET_TEST_F(ChangeLowering64Test, ChangeUint32ToTagged) {
435 STATIC_ASSERT(kSmiTag == 0); 442 STATIC_ASSERT(kSmiTag == 0);
436 STATIC_ASSERT(kSmiTagSize == 1); 443 STATIC_ASSERT(kSmiTagSize == 1);
437 444
438 Node* val = Parameter(0); 445 Node* val = Parameter(0);
439 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), val); 446 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), val);
440 Reduction reduction = Reduce(node); 447 Reduction reduction = Reduce(node);
441 ASSERT_TRUE(reduction.Changed()); 448 ASSERT_TRUE(reduction.Changed());
442 449
443 Node* phi = reduction.replacement(); 450 Node* phi = reduction.replacement();
444 Capture<Node*> branch, heap_number, if_false; 451 Capture<Node*> branch, heap_number, if_false;
445 EXPECT_THAT( 452 EXPECT_THAT(
446 phi, 453 phi,
447 IsPhi( 454 IsPhi(
448 IsWord64Shl(IsChangeUint32ToUint64(val), 455 kMachAnyTagged, IsWord64Shl(IsChangeUint32ToUint64(val),
449 IsInt32Constant(SmiShiftAmount())), 456 IsInt32Constant(SmiShiftAmount())),
450 IsFinish( 457 IsFinish(
451 AllOf(CaptureEq(&heap_number), 458 AllOf(CaptureEq(&heap_number),
452 IsAllocateHeapNumber(_, CaptureEq(&if_false))), 459 IsAllocateHeapNumber(_, CaptureEq(&if_false))),
453 IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number), 460 IsStore(kMachFloat64, kNoWriteBarrier, CaptureEq(&heap_number),
454 IsInt32Constant(HeapNumberValueOffset()), 461 IsInt32Constant(HeapNumberValueOffset()),
455 IsChangeUint32ToFloat64(val), CaptureEq(&heap_number), 462 IsChangeUint32ToFloat64(val), CaptureEq(&heap_number),
456 CaptureEq(&if_false))), 463 CaptureEq(&if_false))),
457 IsMerge( 464 IsMerge(
458 IsIfTrue(AllOf(CaptureEq(&branch), 465 IsIfTrue(AllOf(CaptureEq(&branch),
459 IsBranch(IsUint32LessThanOrEqual( 466 IsBranch(IsUint32LessThanOrEqual(
460 val, IsInt32Constant(SmiMaxValue())), 467 val, IsInt32Constant(SmiMaxValue())),
461 graph()->start()))), 468 graph()->start()))),
462 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 469 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
463 } 470 }
464 471
465 } // namespace compiler 472 } // namespace compiler
466 } // namespace internal 473 } // namespace internal
467 } // namespace v8 474 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/change-lowering.cc ('k') | src/compiler/common-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698