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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 private: | 47 private: |
48 JSOperatorBuilder javascript_; | 48 JSOperatorBuilder javascript_; |
49 }; | 49 }; |
50 | 50 |
51 | 51 |
52 namespace { | 52 namespace { |
53 | 53 |
54 // TODO(mstarzinger): Find a common place and unify with test-js-typed-lowering. | 54 // TODO(mstarzinger): Find a common place and unify with test-js-typed-lowering. |
55 Type* const kNumberTypes[] = { | 55 Type* const kNumberTypes[] = { |
56 Type::UnsignedSmall(), Type::Negative32(), Type::Unsigned31(), | 56 Type::UnsignedSmall(), Type::NegativeSigned32(), |
57 Type::SignedSmall(), Type::Signed32(), Type::Unsigned32(), | 57 Type::NonNegativeSigned32(), Type::SignedSmall(), |
58 Type::Integral32(), Type::MinusZero(), Type::NaN(), | 58 Type::Signed32(), Type::Unsigned32(), |
59 Type::OrderedNumber(), Type::PlainNumber(), Type::Number()}; | 59 Type::Integral32(), Type::MinusZero(), |
| 60 Type::NaN(), Type::OrderedNumber(), |
| 61 Type::PlainNumber(), Type::Number()}; |
60 | 62 |
61 } // namespace | 63 } // namespace |
62 | 64 |
63 | 65 |
64 // ----------------------------------------------------------------------------- | 66 // ----------------------------------------------------------------------------- |
65 // Math.abs | 67 // Math.abs |
66 | 68 |
67 | 69 |
68 TEST_F(JSBuiltinReducerTest, MathAbs) { | 70 TEST_F(JSBuiltinReducerTest, MathAbs) { |
69 Handle<JSFunction> f = MathFunction("abs"); | 71 Handle<JSFunction> f = MathFunction("abs"); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), | 294 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), |
293 fun, UndefinedConstant(), p0); | 295 fun, UndefinedConstant(), p0); |
294 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); | 296 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); |
295 | 297 |
296 ASSERT_FALSE(r.Changed()); | 298 ASSERT_FALSE(r.Changed()); |
297 } | 299 } |
298 } | 300 } |
299 } // namespace compiler | 301 } // namespace compiler |
300 } // namespace internal | 302 } // namespace internal |
301 } // namespace v8 | 303 } // namespace v8 |
OLD | NEW |