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

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

Issue 1399423002: [turbofan] Introduce node regions for protection from scheduling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move RelaxControls Created 5 years, 2 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/compiler/verifier.cc ('k') | test/unittests/compiler/common-operator-unittest.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/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler/change-lowering.h" 6 #include "src/compiler/change-lowering.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/simplified-operator.h" 10 #include "src/compiler/simplified-operator.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 122
123 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeFloat64ToTagged) { 123 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeFloat64ToTagged) {
124 Node* value = Parameter(Type::Number()); 124 Node* value = Parameter(Type::Number());
125 Reduction r = 125 Reduction r =
126 Reduce(graph()->NewNode(simplified()->ChangeFloat64ToTagged(), value)); 126 Reduce(graph()->NewNode(simplified()->ChangeFloat64ToTagged(), value));
127 ASSERT_TRUE(r.Changed()); 127 ASSERT_TRUE(r.Changed());
128 Capture<Node*> heap_number; 128 Capture<Node*> heap_number;
129 EXPECT_THAT( 129 EXPECT_THAT(
130 r.replacement(), 130 r.replacement(),
131 IsFinish( 131 IsFinishRegion(
132 AllOf(CaptureEq(&heap_number), 132 AllOf(CaptureEq(&heap_number),
133 IsAllocateHeapNumber(IsValueEffect(value), graph()->start())), 133 IsAllocateHeapNumber(IsBeginRegion(graph()->start()),
134 graph()->start())),
134 IsStore(StoreRepresentation(kMachFloat64, kNoWriteBarrier), 135 IsStore(StoreRepresentation(kMachFloat64, kNoWriteBarrier),
135 CaptureEq(&heap_number), 136 CaptureEq(&heap_number),
136 IsIntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag), 137 IsIntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag),
137 value, CaptureEq(&heap_number), graph()->start()))); 138 value, CaptureEq(&heap_number), graph()->start())));
138 } 139 }
139 140
140 141
141 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeInt32ToTaggedWithSignedSmall) { 142 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeInt32ToTaggedWithSignedSmall) {
142 Node* value = Parameter(Type::SignedSmall()); 143 Node* value = Parameter(Type::SignedSmall());
143 Reduction r = 144 Reduction r =
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 212
212 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTagged) { 213 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTagged) {
213 Node* value = Parameter(Type::Integral32()); 214 Node* value = Parameter(Type::Integral32());
214 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), value); 215 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), value);
215 Reduction r = Reduce(node); 216 Reduction r = Reduce(node);
216 ASSERT_TRUE(r.Changed()); 217 ASSERT_TRUE(r.Changed());
217 Capture<Node*> add, branch, heap_number, if_true; 218 Capture<Node*> add, branch, heap_number, if_true;
218 EXPECT_THAT( 219 EXPECT_THAT(
219 r.replacement(), 220 r.replacement(),
220 IsPhi(kMachAnyTagged, 221 IsPhi(kMachAnyTagged,
221 IsFinish(AllOf(CaptureEq(&heap_number), 222 IsFinishRegion(
222 IsAllocateHeapNumber(_, CaptureEq(&if_true))), 223 AllOf(CaptureEq(&heap_number),
223 IsStore(StoreRepresentation(kMachFloat64, kNoWriteBarrier), 224 IsAllocateHeapNumber(_, CaptureEq(&if_true))),
224 CaptureEq(&heap_number), 225 IsStore(
225 IsIntPtrConstant(HeapNumber::kValueOffset - 226 StoreRepresentation(kMachFloat64, kNoWriteBarrier),
226 kHeapObjectTag), 227 CaptureEq(&heap_number),
227 IsChangeInt32ToFloat64(value), 228 IsIntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag),
228 CaptureEq(&heap_number), CaptureEq(&if_true))), 229 IsChangeInt32ToFloat64(value), CaptureEq(&heap_number),
230 CaptureEq(&if_true))),
229 IsProjection(0, AllOf(CaptureEq(&add), 231 IsProjection(0, AllOf(CaptureEq(&add),
230 IsInt32AddWithOverflow(value, value))), 232 IsInt32AddWithOverflow(value, value))),
231 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 233 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
232 IsIfFalse(AllOf(CaptureEq(&branch), 234 IsIfFalse(AllOf(CaptureEq(&branch),
233 IsBranch(IsProjection(1, CaptureEq(&add)), 235 IsBranch(IsProjection(1, CaptureEq(&add)),
234 graph()->start())))))); 236 graph()->start()))))));
235 } 237 }
236 238
237 239
238 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) { 240 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 Node* value = Parameter(Type::Number()); 314 Node* value = Parameter(Type::Number());
313 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), value); 315 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), value);
314 Reduction r = Reduce(node); 316 Reduction r = Reduce(node);
315 ASSERT_TRUE(r.Changed()); 317 ASSERT_TRUE(r.Changed());
316 Capture<Node*> branch, heap_number, if_false; 318 Capture<Node*> branch, heap_number, if_false;
317 EXPECT_THAT( 319 EXPECT_THAT(
318 r.replacement(), 320 r.replacement(),
319 IsPhi( 321 IsPhi(
320 kMachAnyTagged, 322 kMachAnyTagged,
321 IsWord32Shl(value, IsInt32Constant(kSmiTagSize + kSmiShiftSize)), 323 IsWord32Shl(value, IsInt32Constant(kSmiTagSize + kSmiShiftSize)),
322 IsFinish(AllOf(CaptureEq(&heap_number), 324 IsFinishRegion(
323 IsAllocateHeapNumber(_, CaptureEq(&if_false))), 325 AllOf(CaptureEq(&heap_number),
324 IsStore(StoreRepresentation(kMachFloat64, kNoWriteBarrier), 326 IsAllocateHeapNumber(_, CaptureEq(&if_false))),
325 CaptureEq(&heap_number), 327 IsStore(
326 IsInt32Constant(HeapNumber::kValueOffset - 328 StoreRepresentation(kMachFloat64, kNoWriteBarrier),
327 kHeapObjectTag), 329 CaptureEq(&heap_number),
328 IsChangeUint32ToFloat64(value), 330 IsInt32Constant(HeapNumber::kValueOffset - kHeapObjectTag),
329 CaptureEq(&heap_number), CaptureEq(&if_false))), 331 IsChangeUint32ToFloat64(value), CaptureEq(&heap_number),
332 CaptureEq(&if_false))),
330 IsMerge(IsIfTrue(AllOf( 333 IsMerge(IsIfTrue(AllOf(
331 CaptureEq(&branch), 334 CaptureEq(&branch),
332 IsBranch(IsUint32LessThanOrEqual( 335 IsBranch(IsUint32LessThanOrEqual(
333 value, IsInt32Constant(Smi::kMaxValue)), 336 value, IsInt32Constant(Smi::kMaxValue)),
334 graph()->start()))), 337 graph()->start()))),
335 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 338 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
336 } 339 }
337 340
338 341
339 // ----------------------------------------------------------------------------- 342 // -----------------------------------------------------------------------------
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), value); 439 Node* node = graph()->NewNode(simplified()->ChangeUint32ToTagged(), value);
437 Reduction r = Reduce(node); 440 Reduction r = Reduce(node);
438 ASSERT_TRUE(r.Changed()); 441 ASSERT_TRUE(r.Changed());
439 Capture<Node*> branch, heap_number, if_false; 442 Capture<Node*> branch, heap_number, if_false;
440 EXPECT_THAT( 443 EXPECT_THAT(
441 r.replacement(), 444 r.replacement(),
442 IsPhi( 445 IsPhi(
443 kMachAnyTagged, 446 kMachAnyTagged,
444 IsWord64Shl(IsChangeUint32ToUint64(value), 447 IsWord64Shl(IsChangeUint32ToUint64(value),
445 IsInt64Constant(kSmiTagSize + kSmiShiftSize)), 448 IsInt64Constant(kSmiTagSize + kSmiShiftSize)),
446 IsFinish(AllOf(CaptureEq(&heap_number), 449 IsFinishRegion(
447 IsAllocateHeapNumber(_, CaptureEq(&if_false))), 450 AllOf(CaptureEq(&heap_number),
448 IsStore(StoreRepresentation(kMachFloat64, kNoWriteBarrier), 451 IsAllocateHeapNumber(_, CaptureEq(&if_false))),
449 CaptureEq(&heap_number), 452 IsStore(
450 IsInt64Constant(HeapNumber::kValueOffset - 453 StoreRepresentation(kMachFloat64, kNoWriteBarrier),
451 kHeapObjectTag), 454 CaptureEq(&heap_number),
452 IsChangeUint32ToFloat64(value), 455 IsInt64Constant(HeapNumber::kValueOffset - kHeapObjectTag),
453 CaptureEq(&heap_number), CaptureEq(&if_false))), 456 IsChangeUint32ToFloat64(value), CaptureEq(&heap_number),
457 CaptureEq(&if_false))),
454 IsMerge(IsIfTrue(AllOf( 458 IsMerge(IsIfTrue(AllOf(
455 CaptureEq(&branch), 459 CaptureEq(&branch),
456 IsBranch(IsUint32LessThanOrEqual( 460 IsBranch(IsUint32LessThanOrEqual(
457 value, IsInt32Constant(Smi::kMaxValue)), 461 value, IsInt32Constant(Smi::kMaxValue)),
458 graph()->start()))), 462 graph()->start()))),
459 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 463 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
460 } 464 }
461 465
462 } // namespace compiler 466 } // namespace compiler
463 } // namespace internal 467 } // namespace internal
464 } // namespace v8 468 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | test/unittests/compiler/common-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698