| 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-inl.h" | 7 #include "src/compiler/node-properties-inl.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 JSOperatorBuilder javascript_; | 53 JSOperatorBuilder javascript_; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 | 56 |
| 57 namespace { | 57 namespace { |
| 58 | 58 |
| 59 // TODO(mstarzinger): Find a common place and unify with test-js-typed-lowering. | 59 // TODO(mstarzinger): Find a common place and unify with test-js-typed-lowering. |
| 60 Type* const kNumberTypes[] = { | 60 Type* const kNumberTypes[] = { |
| 61 Type::UnsignedSmall(), Type::NegativeSigned32(), | 61 Type::UnsignedSmall(), Type::OtherSignedSmall(), Type::OtherUnsigned31(), |
| 62 Type::NonNegativeSigned32(), Type::SignedSmall(), | 62 Type::OtherUnsigned32(), Type::OtherSigned32(), Type::SignedSmall(), |
| 63 Type::Signed32(), Type::Unsigned32(), | 63 Type::Signed32(), Type::Unsigned32(), Type::Integral32(), |
| 64 Type::Integral32(), Type::MinusZero(), | 64 Type::MinusZero(), Type::NaN(), Type::OtherNumber(), |
| 65 Type::NaN(), Type::OrderedNumber(), | 65 Type::OrderedNumber(), Type::Number()}; |
| 66 Type::PlainNumber(), Type::Number()}; | |
| 67 | 66 |
| 68 } // namespace | 67 } // namespace |
| 69 | 68 |
| 70 | 69 |
| 71 // ----------------------------------------------------------------------------- | 70 // ----------------------------------------------------------------------------- |
| 72 // Math.abs | 71 // Math.abs |
| 73 | 72 |
| 74 | 73 |
| 75 TEST_F(JSBuiltinReducerTest, MathAbs) { | 74 TEST_F(JSBuiltinReducerTest, MathAbs) { |
| 76 Handle<JSFunction> f = MathFunction("abs"); | 75 Handle<JSFunction> f = MathFunction("abs"); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), | 296 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), |
| 298 fun, UndefinedConstant(), p0); | 297 fun, UndefinedConstant(), p0); |
| 299 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); | 298 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); |
| 300 | 299 |
| 301 ASSERT_FALSE(r.Changed()); | 300 ASSERT_FALSE(r.Changed()); |
| 302 } | 301 } |
| 303 } | 302 } |
| 304 } // namespace compiler | 303 } // namespace compiler |
| 305 } // namespace internal | 304 } // namespace internal |
| 306 } // namespace v8 | 305 } // namespace v8 |
| OLD | NEW |