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::OtherSignedSmall(), Type::OtherUnsigned31(), | 61 Type::UnsignedSmall(), Type::NegativeSigned32(), |
62 Type::OtherUnsigned32(), Type::OtherSigned32(), Type::SignedSmall(), | 62 Type::NonNegativeSigned32(), Type::SignedSmall(), |
63 Type::Signed32(), Type::Unsigned32(), Type::Integral32(), | 63 Type::Signed32(), Type::Unsigned32(), |
64 Type::MinusZero(), Type::NaN(), Type::OtherNumber(), | 64 Type::Integral32(), Type::MinusZero(), |
65 Type::OrderedNumber(), Type::Number()}; | 65 Type::NaN(), Type::OrderedNumber(), |
| 66 Type::PlainNumber(), Type::Number()}; |
66 | 67 |
67 } // namespace | 68 } // namespace |
68 | 69 |
69 | 70 |
70 // ----------------------------------------------------------------------------- | 71 // ----------------------------------------------------------------------------- |
71 // Math.abs | 72 // Math.abs |
72 | 73 |
73 | 74 |
74 TEST_F(JSBuiltinReducerTest, MathAbs) { | 75 TEST_F(JSBuiltinReducerTest, MathAbs) { |
75 Handle<JSFunction> f = MathFunction("abs"); | 76 Handle<JSFunction> f = MathFunction("abs"); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), | 297 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), |
297 fun, UndefinedConstant(), p0); | 298 fun, UndefinedConstant(), p0); |
298 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); | 299 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); |
299 | 300 |
300 ASSERT_FALSE(r.Changed()); | 301 ASSERT_FALSE(r.Changed()); |
301 } | 302 } |
302 } | 303 } |
303 } // namespace compiler | 304 } // namespace compiler |
304 } // namespace internal | 305 } // namespace internal |
305 } // namespace v8 | 306 } // namespace v8 |
OLD | NEW |