| OLD | NEW |
| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 Node* p1 = Parameter(t1, 1); | 157 Node* p1 = Parameter(t1, 1); |
| 158 Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f)); | 158 Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f)); |
| 159 Node* call = graph()->NewNode( | 159 Node* call = graph()->NewNode( |
| 160 javascript()->CallFunction(4, NO_CALL_FUNCTION_FLAGS), fun, | 160 javascript()->CallFunction(4, NO_CALL_FUNCTION_FLAGS), fun, |
| 161 UndefinedConstant(), p0, p1); | 161 UndefinedConstant(), p0, p1); |
| 162 Reduction r = Reduce(call); | 162 Reduction r = Reduce(call); |
| 163 | 163 |
| 164 if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) { | 164 if (t0->Is(Type::Integral32()) && t1->Is(Type::Integral32())) { |
| 165 ASSERT_TRUE(r.Changed()); | 165 ASSERT_TRUE(r.Changed()); |
| 166 EXPECT_THAT(r.replacement(), | 166 EXPECT_THAT(r.replacement(), |
| 167 IsSelect(kMachNone, IsNumberLessThan(p1, p0), p1, p0)); | 167 IsSelect(kMachNone, IsNumberLessThan(p1, p0), p0, p1)); |
| 168 } else { | 168 } else { |
| 169 ASSERT_FALSE(r.Changed()); | 169 ASSERT_FALSE(r.Changed()); |
| 170 EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode()); | 170 EXPECT_EQ(IrOpcode::kJSCallFunction, call->opcode()); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 | 176 |
| 177 // ----------------------------------------------------------------------------- | 177 // ----------------------------------------------------------------------------- |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), | 292 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), |
| 293 fun, UndefinedConstant(), p0); | 293 fun, UndefinedConstant(), p0); |
| 294 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); | 294 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); |
| 295 | 295 |
| 296 ASSERT_FALSE(r.Changed()); | 296 ASSERT_FALSE(r.Changed()); |
| 297 } | 297 } |
| 298 } | 298 } |
| 299 } // namespace compiler | 299 } // namespace compiler |
| 300 } // namespace internal | 300 } // namespace internal |
| 301 } // namespace v8 | 301 } // namespace v8 |
| OLD | NEW |