| 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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/address-map.h" | 9 #include "src/address-map.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2970 Node* const one = jsgraph()->Float64Constant(1.0); | 2970 Node* const one = jsgraph()->Float64Constant(1.0); |
| 2971 | 2971 |
| 2972 Node* const input = node->InputAt(0); | 2972 Node* const input = node->InputAt(0); |
| 2973 | 2973 |
| 2974 return graph()->NewNode( | 2974 return graph()->NewNode( |
| 2975 common()->Select(MachineRepresentation::kFloat64), | 2975 common()->Select(MachineRepresentation::kFloat64), |
| 2976 graph()->NewNode(machine()->Float64LessThan(), input, zero), minus_one, | 2976 graph()->NewNode(machine()->Float64LessThan(), input, zero), minus_one, |
| 2977 graph()->NewNode( | 2977 graph()->NewNode( |
| 2978 common()->Select(MachineRepresentation::kFloat64), | 2978 common()->Select(MachineRepresentation::kFloat64), |
| 2979 graph()->NewNode(machine()->Float64LessThan(), zero, input), one, | 2979 graph()->NewNode(machine()->Float64LessThan(), zero, input), one, |
| 2980 zero)); | 2980 input)); |
| 2981 } | 2981 } |
| 2982 | 2982 |
| 2983 Node* SimplifiedLowering::Int32Abs(Node* const node) { | 2983 Node* SimplifiedLowering::Int32Abs(Node* const node) { |
| 2984 Node* const input = node->InputAt(0); | 2984 Node* const input = node->InputAt(0); |
| 2985 | 2985 |
| 2986 // Generate case for absolute integer value. | 2986 // Generate case for absolute integer value. |
| 2987 // | 2987 // |
| 2988 // let sign = input >> 31 in | 2988 // let sign = input >> 31 in |
| 2989 // (input ^ sign) - sign | 2989 // (input ^ sign) - sign |
| 2990 | 2990 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3323 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3323 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
| 3324 Operator::kNoProperties); | 3324 Operator::kNoProperties); |
| 3325 to_number_operator_.set(common()->Call(desc)); | 3325 to_number_operator_.set(common()->Call(desc)); |
| 3326 } | 3326 } |
| 3327 return to_number_operator_.get(); | 3327 return to_number_operator_.get(); |
| 3328 } | 3328 } |
| 3329 | 3329 |
| 3330 } // namespace compiler | 3330 } // namespace compiler |
| 3331 } // namespace internal | 3331 } // namespace internal |
| 3332 } // namespace v8 | 3332 } // namespace v8 |
| OLD | NEW |