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 <stack> | 7 #include <stack> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 case Runtime::kInlineIsDate: | 52 case Runtime::kInlineIsDate: |
53 return ReduceIsInstanceType(node, JS_DATE_TYPE); | 53 return ReduceIsInstanceType(node, JS_DATE_TYPE); |
54 case Runtime::kInlineIsTypedArray: | 54 case Runtime::kInlineIsTypedArray: |
55 return ReduceIsInstanceType(node, JS_TYPED_ARRAY_TYPE); | 55 return ReduceIsInstanceType(node, JS_TYPED_ARRAY_TYPE); |
56 case Runtime::kInlineIsRegExp: | 56 case Runtime::kInlineIsRegExp: |
57 return ReduceIsInstanceType(node, JS_REGEXP_TYPE); | 57 return ReduceIsInstanceType(node, JS_REGEXP_TYPE); |
58 case Runtime::kInlineIsJSReceiver: | 58 case Runtime::kInlineIsJSReceiver: |
59 return ReduceIsJSReceiver(node); | 59 return ReduceIsJSReceiver(node); |
60 case Runtime::kInlineIsSmi: | 60 case Runtime::kInlineIsSmi: |
61 return ReduceIsSmi(node); | 61 return ReduceIsSmi(node); |
62 case Runtime::kInlineJSValueGetValue: | |
63 return ReduceJSValueGetValue(node); | |
64 case Runtime::kInlineMathClz32: | 62 case Runtime::kInlineMathClz32: |
65 return ReduceMathClz32(node); | 63 return ReduceMathClz32(node); |
66 case Runtime::kInlineMathFloor: | 64 case Runtime::kInlineMathFloor: |
67 return ReduceMathFloor(node); | 65 return ReduceMathFloor(node); |
68 case Runtime::kInlineMathSqrt: | 66 case Runtime::kInlineMathSqrt: |
69 return ReduceMathSqrt(node); | 67 return ReduceMathSqrt(node); |
70 case Runtime::kInlineValueOf: | 68 case Runtime::kInlineValueOf: |
71 return ReduceValueOf(node); | 69 return ReduceValueOf(node); |
72 case Runtime::kInlineFixedArrayGet: | 70 case Runtime::kInlineFixedArrayGet: |
73 return ReduceFixedArrayGet(node); | 71 return ReduceFixedArrayGet(node); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 Reduction JSIntrinsicLowering::ReduceIsJSReceiver(Node* node) { | 227 Reduction JSIntrinsicLowering::ReduceIsJSReceiver(Node* node) { |
230 return Change(node, simplified()->ObjectIsReceiver()); | 228 return Change(node, simplified()->ObjectIsReceiver()); |
231 } | 229 } |
232 | 230 |
233 | 231 |
234 Reduction JSIntrinsicLowering::ReduceIsSmi(Node* node) { | 232 Reduction JSIntrinsicLowering::ReduceIsSmi(Node* node) { |
235 return Change(node, simplified()->ObjectIsSmi()); | 233 return Change(node, simplified()->ObjectIsSmi()); |
236 } | 234 } |
237 | 235 |
238 | 236 |
239 Reduction JSIntrinsicLowering::ReduceJSValueGetValue(Node* node) { | |
240 Node* value = NodeProperties::GetValueInput(node, 0); | |
241 Node* effect = NodeProperties::GetEffectInput(node); | |
242 Node* control = NodeProperties::GetControlInput(node); | |
243 return Change(node, simplified()->LoadField(AccessBuilder::ForValue()), value, | |
244 effect, control); | |
245 } | |
246 | |
247 | |
248 Reduction JSIntrinsicLowering::ReduceMathClz32(Node* node) { | 237 Reduction JSIntrinsicLowering::ReduceMathClz32(Node* node) { |
249 return Change(node, machine()->Word32Clz()); | 238 return Change(node, machine()->Word32Clz()); |
250 } | 239 } |
251 | 240 |
252 | 241 |
253 Reduction JSIntrinsicLowering::ReduceMathFloor(Node* node) { | 242 Reduction JSIntrinsicLowering::ReduceMathFloor(Node* node) { |
254 if (!machine()->Float64RoundDown().IsSupported()) return NoChange(); | 243 if (!machine()->Float64RoundDown().IsSupported()) return NoChange(); |
255 return Change(node, machine()->Float64RoundDown().op()); | 244 return Change(node, machine()->Float64RoundDown().op()); |
256 } | 245 } |
257 | 246 |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } | 605 } |
617 | 606 |
618 | 607 |
619 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 608 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
620 return jsgraph()->simplified(); | 609 return jsgraph()->simplified(); |
621 } | 610 } |
622 | 611 |
623 } // namespace compiler | 612 } // namespace compiler |
624 } // namespace internal | 613 } // namespace internal |
625 } // namespace v8 | 614 } // namespace v8 |
OLD | NEW |