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

Unified Diff: test/unittests/compiler/js-builtin-reducer-unittest.cc

Issue 2170343002: [turbofan] Change Float64Max/Float64Min to JavaScript semantics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips/mips64 ports. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: test/unittests/compiler/js-builtin-reducer-unittest.cc
diff --git a/test/unittests/compiler/js-builtin-reducer-unittest.cc b/test/unittests/compiler/js-builtin-reducer-unittest.cc
index 4170111cdb404184f49dcdb32e035fcfc1bb5afb..0b0269e96eab9b899b411b25868a562c6e8e7dbc 100644
--- a/test/unittests/compiler/js-builtin-reducer-unittest.cc
+++ b/test/unittests/compiler/js-builtin-reducer-unittest.cc
@@ -889,36 +889,15 @@ TEST_F(JSBuiltinReducerTest, MathMaxWithPlainPrimitive) {
Node* context = UndefinedConstant();
Node* frame_state = graph()->start();
Node* p0 = Parameter(Type::PlainPrimitive(), 0);
- Node* call = graph()->NewNode(javascript()->CallFunction(3), function,
- UndefinedConstant(), p0, context, frame_state,
- effect, control);
+ Node* p1 = Parameter(Type::PlainPrimitive(), 1);
+ Node* call = graph()->NewNode(javascript()->CallFunction(4), function,
+ UndefinedConstant(), p0, p1, context,
+ frame_state, effect, control);
Reduction r = Reduce(call);
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsPlainPrimitiveToNumber(p0));
-}
-
-TEST_F(JSBuiltinReducerTest, MathMaxWithIntegral32) {
- Node* function = MathFunction("max");
-
- Node* effect = graph()->start();
- Node* control = graph()->start();
- Node* context = UndefinedConstant();
- Node* frame_state = graph()->start();
- TRACED_FOREACH(Type*, t0, kIntegral32Types) {
- TRACED_FOREACH(Type*, t1, kIntegral32Types) {
- Node* p0 = Parameter(t0, 0);
- Node* p1 = Parameter(t1, 1);
- Node* call = graph()->NewNode(javascript()->CallFunction(4), function,
- UndefinedConstant(), p0, p1, context,
- frame_state, effect, control);
- Reduction r = Reduce(call);
-
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsSelect(MachineRepresentation::kNone,
- IsNumberLessThan(p1, p0), p0, p1));
- }
- }
+ EXPECT_THAT(r.replacement(), IsNumberMax(IsPlainPrimitiveToNumber(p0),
+ IsPlainPrimitiveToNumber(p1)));
}
// -----------------------------------------------------------------------------
@@ -967,36 +946,15 @@ TEST_F(JSBuiltinReducerTest, MathMinWithPlainPrimitive) {
Node* context = UndefinedConstant();
Node* frame_state = graph()->start();
Node* p0 = Parameter(Type::PlainPrimitive(), 0);
- Node* call = graph()->NewNode(javascript()->CallFunction(3), function,
- UndefinedConstant(), p0, context, frame_state,
- effect, control);
+ Node* p1 = Parameter(Type::PlainPrimitive(), 1);
+ Node* call = graph()->NewNode(javascript()->CallFunction(4), function,
+ UndefinedConstant(), p0, p1, context,
+ frame_state, effect, control);
Reduction r = Reduce(call);
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsPlainPrimitiveToNumber(p0));
-}
-
-TEST_F(JSBuiltinReducerTest, MathMinWithIntegral32) {
- Node* function = MathFunction("min");
-
- Node* effect = graph()->start();
- Node* control = graph()->start();
- Node* context = UndefinedConstant();
- Node* frame_state = graph()->start();
- TRACED_FOREACH(Type*, t0, kIntegral32Types) {
- TRACED_FOREACH(Type*, t1, kIntegral32Types) {
- Node* p0 = Parameter(t0, 0);
- Node* p1 = Parameter(t1, 1);
- Node* call = graph()->NewNode(javascript()->CallFunction(4), function,
- UndefinedConstant(), p0, p1, context,
- frame_state, effect, control);
- Reduction r = Reduce(call);
-
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsSelect(MachineRepresentation::kNone,
- IsNumberLessThan(p1, p0), p1, p0));
- }
- }
+ EXPECT_THAT(r.replacement(), IsNumberMin(IsPlainPrimitiveToNumber(p0),
+ IsPlainPrimitiveToNumber(p1)));
}
// -----------------------------------------------------------------------------
« no previous file with comments | « test/unittests/compiler/common-operator-reducer-unittest.cc ('k') | test/unittests/compiler/machine-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698