OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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-intrinsic-lowering.h" | 5 #include "src/compiler/js-intrinsic-lowering.h" |
6 | 6 |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 case Runtime::kInlineConstructDouble: | 35 case Runtime::kInlineConstructDouble: |
36 return ReduceInlineConstructDouble(node); | 36 return ReduceInlineConstructDouble(node); |
37 case Runtime::kInlineDoubleLo: | 37 case Runtime::kInlineDoubleLo: |
38 return ReduceInlineDoubleLo(node); | 38 return ReduceInlineDoubleLo(node); |
39 case Runtime::kInlineDoubleHi: | 39 case Runtime::kInlineDoubleHi: |
40 return ReduceInlineDoubleHi(node); | 40 return ReduceInlineDoubleHi(node); |
41 case Runtime::kInlineIsRegExp: | 41 case Runtime::kInlineIsRegExp: |
42 return ReduceInlineIsInstanceType(node, JS_REGEXP_TYPE); | 42 return ReduceInlineIsInstanceType(node, JS_REGEXP_TYPE); |
43 case Runtime::kInlineMathFloor: | 43 case Runtime::kInlineMathFloor: |
44 return ReduceInlineMathFloor(node); | 44 return ReduceInlineMathFloor(node); |
| 45 case Runtime::kInlineMathSqrt: |
| 46 return ReduceInlineMathSqrt(node); |
45 case Runtime::kInlineValueOf: | 47 case Runtime::kInlineValueOf: |
46 return ReduceInlineValueOf(node); | 48 return ReduceInlineValueOf(node); |
47 default: | 49 default: |
48 break; | 50 break; |
49 } | 51 } |
50 return NoChange(); | 52 return NoChange(); |
51 } | 53 } |
52 | 54 |
53 | 55 |
54 Reduction JSIntrinsicLowering::ReduceInlineDeoptimizeNow(Node* node) { | 56 Reduction JSIntrinsicLowering::ReduceInlineDeoptimizeNow(Node* node) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return Change(node, common()->Phi(type, 2), vtrue, vfalse, merge); | 165 return Change(node, common()->Phi(type, 2), vtrue, vfalse, merge); |
164 } | 166 } |
165 | 167 |
166 | 168 |
167 Reduction JSIntrinsicLowering::ReduceInlineMathFloor(Node* node) { | 169 Reduction JSIntrinsicLowering::ReduceInlineMathFloor(Node* node) { |
168 if (!machine()->HasFloat64RoundDown()) return NoChange(); | 170 if (!machine()->HasFloat64RoundDown()) return NoChange(); |
169 return Change(node, machine()->Float64RoundDown()); | 171 return Change(node, machine()->Float64RoundDown()); |
170 } | 172 } |
171 | 173 |
172 | 174 |
| 175 Reduction JSIntrinsicLowering::ReduceInlineMathSqrt(Node* node) { |
| 176 return Change(node, machine()->Float64Sqrt()); |
| 177 } |
| 178 |
| 179 |
173 Reduction JSIntrinsicLowering::ReduceInlineValueOf(Node* node) { | 180 Reduction JSIntrinsicLowering::ReduceInlineValueOf(Node* node) { |
174 // if (%_IsSmi(value)) { | 181 // if (%_IsSmi(value)) { |
175 // return value; | 182 // return value; |
176 // } else if (%_GetInstanceType(%_GetMap(value)) == JS_VALUE_TYPE) { | 183 // } else if (%_GetInstanceType(%_GetMap(value)) == JS_VALUE_TYPE) { |
177 // return %_GetValue(value); | 184 // return %_GetValue(value); |
178 // } else { | 185 // } else { |
179 // return value; | 186 // return value; |
180 // } | 187 // } |
181 const Operator* const merge_op = common()->Merge(2); | 188 const Operator* const merge_op = common()->Merge(2); |
182 const Operator* const ephi_op = common()->EffectPhi(2); | 189 const Operator* const ephi_op = common()->EffectPhi(2); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 270 } |
264 | 271 |
265 | 272 |
266 MachineOperatorBuilder* JSIntrinsicLowering::machine() const { | 273 MachineOperatorBuilder* JSIntrinsicLowering::machine() const { |
267 return jsgraph()->machine(); | 274 return jsgraph()->machine(); |
268 } | 275 } |
269 | 276 |
270 } // namespace compiler | 277 } // namespace compiler |
271 } // namespace internal | 278 } // namespace internal |
272 } // namespace v8 | 279 } // namespace v8 |
OLD | NEW |