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

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

Issue 1027753002: [turbofan] Fix lowering of Math.max for integral inputs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « test/mjsunit/compiler/regress-468162.js ('k') | no next file » | 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/js-builtin-reducer.h" 5 #include "src/compiler/js-builtin-reducer.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/typer.h" 8 #include "src/compiler/typer.h"
9 #include "test/unittests/compiler/graph-unittest.h" 9 #include "test/unittests/compiler/graph-unittest.h"
10 #include "test/unittests/compiler/node-test-utils.h" 10 #include "test/unittests/compiler/node-test-utils.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 Node* p1 = Parameter(t1, 1); 105 Node* p1 = Parameter(t1, 1);
106 Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f)); 106 Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f));
107 Node* call = graph()->NewNode( 107 Node* call = graph()->NewNode(
108 javascript()->CallFunction(4, NO_CALL_FUNCTION_FLAGS), fun, 108 javascript()->CallFunction(4, NO_CALL_FUNCTION_FLAGS), fun,
109 UndefinedConstant(), p0, p1); 109 UndefinedConstant(), p0, p1);
110 Reduction r = Reduce(call); 110 Reduction r = Reduce(call);
111 111
112 if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) { 112 if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) {
113 ASSERT_TRUE(r.Changed()); 113 ASSERT_TRUE(r.Changed());
114 EXPECT_THAT(r.replacement(), 114 EXPECT_THAT(r.replacement(),
115 IsSelect(kMachNone, IsNumberLessThan(p1, p0), p1, p0)); 115 IsSelect(kMachNone, IsNumberLessThan(p1, p0), p0, p1));
116 } else { 116 } else {
117 ASSERT_FALSE(r.Changed()); 117 ASSERT_FALSE(r.Changed());
118 EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode()); 118 EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode());
119 } 119 }
120 } 120 }
121 } 121 }
122 } 122 }
123 123
124 124
125 // ----------------------------------------------------------------------------- 125 // -----------------------------------------------------------------------------
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 Reduction r = Reduce(call); 167 Reduction r = Reduce(call);
168 168
169 ASSERT_TRUE(r.Changed()); 169 ASSERT_TRUE(r.Changed());
170 EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0)); 170 EXPECT_THAT(r.replacement(), IsTruncateFloat64ToFloat32(p0));
171 } 171 }
172 } 172 }
173 173
174 } // namespace compiler 174 } // namespace compiler
175 } // namespace internal 175 } // namespace internal
176 } // namespace v8 176 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/regress-468162.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698