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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 case Runtime::kInlineToNumber: | 69 case Runtime::kInlineToNumber: |
70 return ReduceToNumber(node); | 70 return ReduceToNumber(node); |
71 case Runtime::kInlineToObject: | 71 case Runtime::kInlineToObject: |
72 return ReduceToObject(node); | 72 return ReduceToObject(node); |
73 case Runtime::kInlineToString: | 73 case Runtime::kInlineToString: |
74 return ReduceToString(node); | 74 return ReduceToString(node); |
75 case Runtime::kInlineCall: | 75 case Runtime::kInlineCall: |
76 return ReduceCall(node); | 76 return ReduceCall(node); |
77 case Runtime::kInlineGetSuperConstructor: | 77 case Runtime::kInlineGetSuperConstructor: |
78 return ReduceGetSuperConstructor(node); | 78 return ReduceGetSuperConstructor(node); |
| 79 case Runtime::kInlineMaxSmi: |
| 80 return ReduceMaxSmi(node); |
| 81 case Runtime::kInlineTypedArrayMaxSizeInHeap: |
| 82 return ReduceTypedArrayMaxSizeInHeap(node); |
79 case Runtime::kInlineJSCollectionGetTable: | 83 case Runtime::kInlineJSCollectionGetTable: |
80 return ReduceJSCollectionGetTable(node); | 84 return ReduceJSCollectionGetTable(node); |
81 case Runtime::kInlineStringGetRawHashField: | 85 case Runtime::kInlineStringGetRawHashField: |
82 return ReduceStringGetRawHashField(node); | 86 return ReduceStringGetRawHashField(node); |
83 case Runtime::kInlineTheHole: | 87 case Runtime::kInlineTheHole: |
84 return ReduceTheHole(node); | 88 return ReduceTheHole(node); |
85 case Runtime::kInlineClassOf: | 89 case Runtime::kInlineClassOf: |
86 return ReduceClassOf(node); | 90 return ReduceClassOf(node); |
87 default: | 91 default: |
88 break; | 92 break; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 Node* active_function = NodeProperties::GetValueInput(node, 0); | 314 Node* active_function = NodeProperties::GetValueInput(node, 0); |
311 Node* effect = NodeProperties::GetEffectInput(node); | 315 Node* effect = NodeProperties::GetEffectInput(node); |
312 Node* control = NodeProperties::GetControlInput(node); | 316 Node* control = NodeProperties::GetControlInput(node); |
313 Node* active_function_map = effect = | 317 Node* active_function_map = effect = |
314 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 318 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
315 active_function, effect, control); | 319 active_function, effect, control); |
316 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), | 320 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), |
317 active_function_map, effect, control); | 321 active_function_map, effect, control); |
318 } | 322 } |
319 | 323 |
| 324 Reduction JSIntrinsicLowering::ReduceMaxSmi(Node* node) { |
| 325 Node* value = jsgraph()->Constant(Smi::kMaxValue); |
| 326 ReplaceWithValue(node, value); |
| 327 return Replace(value); |
| 328 } |
| 329 |
| 330 Reduction JSIntrinsicLowering::ReduceTypedArrayMaxSizeInHeap(Node* node) { |
| 331 Node* value = jsgraph()->Constant(FLAG_typed_array_max_size_in_heap); |
| 332 ReplaceWithValue(node, value); |
| 333 return Replace(value); |
| 334 } |
| 335 |
320 Reduction JSIntrinsicLowering::ReduceJSCollectionGetTable(Node* node) { | 336 Reduction JSIntrinsicLowering::ReduceJSCollectionGetTable(Node* node) { |
321 Node* collection = NodeProperties::GetValueInput(node, 0); | 337 Node* collection = NodeProperties::GetValueInput(node, 0); |
322 Node* effect = NodeProperties::GetEffectInput(node); | 338 Node* effect = NodeProperties::GetEffectInput(node); |
323 Node* control = NodeProperties::GetControlInput(node); | 339 Node* control = NodeProperties::GetControlInput(node); |
324 return Change(node, | 340 return Change(node, |
325 simplified()->LoadField(AccessBuilder::ForJSCollectionTable()), | 341 simplified()->LoadField(AccessBuilder::ForJSCollectionTable()), |
326 collection, effect, control); | 342 collection, effect, control); |
327 } | 343 } |
328 | 344 |
329 Reduction JSIntrinsicLowering::ReduceStringGetRawHashField(Node* node) { | 345 Reduction JSIntrinsicLowering::ReduceStringGetRawHashField(Node* node) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 return jsgraph_->javascript(); | 426 return jsgraph_->javascript(); |
411 } | 427 } |
412 | 428 |
413 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 429 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
414 return jsgraph()->simplified(); | 430 return jsgraph()->simplified(); |
415 } | 431 } |
416 | 432 |
417 } // namespace compiler | 433 } // namespace compiler |
418 } // namespace internal | 434 } // namespace internal |
419 } // namespace v8 | 435 } // namespace v8 |
OLD | NEW |