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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 case Runtime::kInlineIsTypedArray: | 50 case Runtime::kInlineIsTypedArray: |
51 return ReduceIsInstanceType(node, JS_TYPED_ARRAY_TYPE); | 51 return ReduceIsInstanceType(node, JS_TYPED_ARRAY_TYPE); |
52 case Runtime::kInlineIsRegExp: | 52 case Runtime::kInlineIsRegExp: |
53 return ReduceIsInstanceType(node, JS_REGEXP_TYPE); | 53 return ReduceIsInstanceType(node, JS_REGEXP_TYPE); |
54 case Runtime::kInlineIsJSReceiver: | 54 case Runtime::kInlineIsJSReceiver: |
55 return ReduceIsJSReceiver(node); | 55 return ReduceIsJSReceiver(node); |
56 case Runtime::kInlineIsSmi: | 56 case Runtime::kInlineIsSmi: |
57 return ReduceIsSmi(node); | 57 return ReduceIsSmi(node); |
58 case Runtime::kInlineMathClz32: | 58 case Runtime::kInlineMathClz32: |
59 return ReduceMathClz32(node); | 59 return ReduceMathClz32(node); |
60 case Runtime::kInlineMathFloor: | |
61 return ReduceMathFloor(node); | |
62 case Runtime::kInlineValueOf: | 60 case Runtime::kInlineValueOf: |
63 return ReduceValueOf(node); | 61 return ReduceValueOf(node); |
64 case Runtime::kInlineFixedArrayGet: | 62 case Runtime::kInlineFixedArrayGet: |
65 return ReduceFixedArrayGet(node); | 63 return ReduceFixedArrayGet(node); |
66 case Runtime::kInlineFixedArraySet: | 64 case Runtime::kInlineFixedArraySet: |
67 return ReduceFixedArraySet(node); | 65 return ReduceFixedArraySet(node); |
68 case Runtime::kInlineRegExpConstructResult: | 66 case Runtime::kInlineRegExpConstructResult: |
69 return ReduceRegExpConstructResult(node); | 67 return ReduceRegExpConstructResult(node); |
70 case Runtime::kInlineRegExpExec: | 68 case Runtime::kInlineRegExpExec: |
71 return ReduceRegExpExec(node); | 69 return ReduceRegExpExec(node); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 Reduction JSIntrinsicLowering::ReduceIsSmi(Node* node) { | 207 Reduction JSIntrinsicLowering::ReduceIsSmi(Node* node) { |
210 return Change(node, simplified()->ObjectIsSmi()); | 208 return Change(node, simplified()->ObjectIsSmi()); |
211 } | 209 } |
212 | 210 |
213 | 211 |
214 Reduction JSIntrinsicLowering::ReduceMathClz32(Node* node) { | 212 Reduction JSIntrinsicLowering::ReduceMathClz32(Node* node) { |
215 return Change(node, machine()->Word32Clz()); | 213 return Change(node, machine()->Word32Clz()); |
216 } | 214 } |
217 | 215 |
218 | 216 |
219 Reduction JSIntrinsicLowering::ReduceMathFloor(Node* node) { | |
220 if (!machine()->Float64RoundDown().IsSupported()) return NoChange(); | |
221 return Change(node, machine()->Float64RoundDown().op()); | |
222 } | |
223 | |
224 | |
225 Reduction JSIntrinsicLowering::ReduceValueOf(Node* node) { | 217 Reduction JSIntrinsicLowering::ReduceValueOf(Node* node) { |
226 // if (%_IsSmi(value)) { | 218 // if (%_IsSmi(value)) { |
227 // return value; | 219 // return value; |
228 // } else if (%_GetInstanceType(%_GetMap(value)) == JS_VALUE_TYPE) { | 220 // } else if (%_GetInstanceType(%_GetMap(value)) == JS_VALUE_TYPE) { |
229 // return %_GetValue(value); | 221 // return %_GetValue(value); |
230 // } else { | 222 // } else { |
231 // return value; | 223 // return value; |
232 // } | 224 // } |
233 const Operator* const merge_op = common()->Merge(2); | 225 const Operator* const merge_op = common()->Merge(2); |
234 const Operator* const ephi_op = common()->EffectPhi(2); | 226 const Operator* const ephi_op = common()->EffectPhi(2); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 } | 574 } |
583 | 575 |
584 | 576 |
585 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 577 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
586 return jsgraph()->simplified(); | 578 return jsgraph()->simplified(); |
587 } | 579 } |
588 | 580 |
589 } // namespace compiler | 581 } // namespace compiler |
590 } // namespace internal | 582 } // namespace internal |
591 } // namespace v8 | 583 } // namespace v8 |
OLD | NEW |