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

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

Issue 877643002: Reland of "Steps towards unification of number bitset and range types." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Avoid (some of the) uninhabited type normalization based on representation. Created 5 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
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-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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 204 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
205 IsIfFalse(AllOf(CaptureEq(&branch), 205 IsIfFalse(AllOf(CaptureEq(&branch),
206 IsBranch(IsProjection(1, CaptureEq(&add)), 206 IsBranch(IsProjection(1, CaptureEq(&add)),
207 graph()->start())))))); 207 graph()->start()))))));
208 } 208 }
209 209
210 210
211 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTaggedSmall) { 211 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTaggedSmall) {
212 Node* val = Parameter(0); 212 Node* val = Parameter(0);
213 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val); 213 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val);
214 NodeProperties::SetBounds(val, Bounds(Type::None(), Type::SignedSmall())); 214 NodeProperties::SetBounds(val, Bounds(Type::None(), Type::Signed31()));
215 Reduction reduction = Reduce(node); 215 Reduction reduction = Reduce(node);
216 ASSERT_TRUE(reduction.Changed()); 216 ASSERT_TRUE(reduction.Changed());
217 217
218 Node* change = reduction.replacement(); 218 Node* change = reduction.replacement();
219 Capture<Node*> add, branch, heap_number, if_true; 219 Capture<Node*> add, branch, heap_number, if_true;
220 EXPECT_THAT(change, IsWord32Shl(val, IsInt32Constant(SmiShiftAmount()))); 220 EXPECT_THAT(change, IsWord32Shl(val, IsInt32Constant(SmiShiftAmount())));
221 } 221 }
222 222
223 223
224 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) { 224 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 IsIfTrue(AllOf(CaptureEq(&branch), 454 IsIfTrue(AllOf(CaptureEq(&branch),
455 IsBranch(IsUint32LessThanOrEqual( 455 IsBranch(IsUint32LessThanOrEqual(
456 val, IsInt32Constant(SmiMaxValue())), 456 val, IsInt32Constant(SmiMaxValue())),
457 graph()->start()))), 457 graph()->start()))),
458 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 458 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
459 } 459 }
460 460
461 } // namespace compiler 461 } // namespace compiler
462 } // namespace internal 462 } // namespace internal
463 } // namespace v8 463 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698