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

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

Issue 795713003: Steps towards unification of number bitset and range types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix BitsetType::Max for OtherNumber with missing representation Created 6 years 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/node-properties-inl.h" 8 #include "src/compiler/node-properties-inl.h"
9 #include "src/compiler/simplified-operator.h" 9 #include "src/compiler/simplified-operator.h"
10 #include "test/unittests/compiler/compiler-test-utils.h" 10 #include "test/unittests/compiler/compiler-test-utils.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))), 209 IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
210 IsIfFalse(AllOf(CaptureEq(&branch), 210 IsIfFalse(AllOf(CaptureEq(&branch),
211 IsBranch(IsProjection(1, CaptureEq(&add)), 211 IsBranch(IsProjection(1, CaptureEq(&add)),
212 graph()->start())))))); 212 graph()->start()))))));
213 } 213 }
214 214
215 215
216 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTaggedSmall) { 216 TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTaggedSmall) {
217 Node* val = Parameter(0); 217 Node* val = Parameter(0);
218 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val); 218 Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val);
219 NodeProperties::SetBounds(val, Bounds(Type::None(), Type::SignedSmall())); 219 NodeProperties::SetBounds(val, Bounds(Type::None(), Type::Signed31()));
220 Reduction reduction = Reduce(node); 220 Reduction reduction = Reduce(node);
221 ASSERT_TRUE(reduction.Changed()); 221 ASSERT_TRUE(reduction.Changed());
222 222
223 Node* change = reduction.replacement(); 223 Node* change = reduction.replacement();
224 Capture<Node*> add, branch, heap_number, if_true; 224 Capture<Node*> add, branch, heap_number, if_true;
225 EXPECT_THAT(change, IsWord32Shl(val, IsInt32Constant(SmiShiftAmount()))); 225 EXPECT_THAT(change, IsWord32Shl(val, IsInt32Constant(SmiShiftAmount())));
226 } 226 }
227 227
228 228
229 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) { 229 TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 IsIfTrue(AllOf(CaptureEq(&branch), 461 IsIfTrue(AllOf(CaptureEq(&branch),
462 IsBranch(IsUint32LessThanOrEqual( 462 IsBranch(IsUint32LessThanOrEqual(
463 val, IsInt32Constant(SmiMaxValue())), 463 val, IsInt32Constant(SmiMaxValue())),
464 graph()->start()))), 464 graph()->start()))),
465 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); 465 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch))))));
466 } 466 }
467 467
468 } // namespace compiler 468 } // namespace compiler
469 } // namespace internal 469 } // namespace internal
470 } // namespace v8 470 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698