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::NegativeSigned32(), | 56 Type::UnsignedSmall(), Type::Negative32(), Type::Unsigned31(), |
57 Type::NonNegativeSigned32(), Type::SignedSmall(), | 57 Type::SignedSmall(), Type::Signed32(), Type::Unsigned32(), |
58 Type::Signed32(), Type::Unsigned32(), | 58 Type::Integral32(), Type::MinusZero(), Type::NaN(), |
59 Type::Integral32(), Type::MinusZero(), | 59 Type::OrderedNumber(), Type::PlainNumber(), Type::Number()}; |
60 Type::NaN(), Type::OrderedNumber(), | |
61 Type::PlainNumber(), Type::Number()}; | |
62 | 60 |
63 } // namespace | 61 } // namespace |
64 | 62 |
65 | 63 |
66 // ----------------------------------------------------------------------------- | 64 // ----------------------------------------------------------------------------- |
67 // Math.abs | 65 // Math.abs |
68 | 66 |
69 | 67 |
70 TEST_F(JSBuiltinReducerTest, MathAbs) { | 68 TEST_F(JSBuiltinReducerTest, MathAbs) { |
71 Handle<JSFunction> f = MathFunction("abs"); | 69 Handle<JSFunction> f = MathFunction("abs"); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), | 292 graph()->NewNode(javascript()->CallFunction(3, NO_CALL_FUNCTION_FLAGS), |
295 fun, UndefinedConstant(), p0); | 293 fun, UndefinedConstant(), p0); |
296 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); | 294 Reduction r = Reduce(call, MachineOperatorBuilder::Flag::kNoFlags); |
297 | 295 |
298 ASSERT_FALSE(r.Changed()); | 296 ASSERT_FALSE(r.Changed()); |
299 } | 297 } |
300 } | 298 } |
301 } // namespace compiler | 299 } // namespace compiler |
302 } // namespace internal | 300 } // namespace internal |
303 } // namespace v8 | 301 } // namespace v8 |
OLD | NEW |