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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 case Runtime::kInlineToObject: | 90 case Runtime::kInlineToObject: |
91 return ReduceToObject(node); | 91 return ReduceToObject(node); |
92 case Runtime::kInlineToPrimitive: | 92 case Runtime::kInlineToPrimitive: |
93 return ReduceToPrimitive(node); | 93 return ReduceToPrimitive(node); |
94 case Runtime::kInlineToString: | 94 case Runtime::kInlineToString: |
95 return ReduceToString(node); | 95 return ReduceToString(node); |
96 case Runtime::kInlineCall: | 96 case Runtime::kInlineCall: |
97 return ReduceCall(node); | 97 return ReduceCall(node); |
98 case Runtime::kInlineGetSuperConstructor: | 98 case Runtime::kInlineGetSuperConstructor: |
99 return ReduceGetSuperConstructor(node); | 99 return ReduceGetSuperConstructor(node); |
| 100 case Runtime::kInlineGetOrdinaryHasInstance: |
| 101 return ReduceGetOrdinaryHasInstance(node); |
100 default: | 102 default: |
101 break; | 103 break; |
102 } | 104 } |
103 return NoChange(); | 105 return NoChange(); |
104 } | 106 } |
105 | 107 |
106 | 108 |
107 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { | 109 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { |
108 Node* const value = NodeProperties::GetValueInput(node, 0); | 110 Node* const value = NodeProperties::GetValueInput(node, 0); |
109 Node* const done = NodeProperties::GetValueInput(node, 1); | 111 Node* const done = NodeProperties::GetValueInput(node, 1); |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 Node* active_function = NodeProperties::GetValueInput(node, 0); | 511 Node* active_function = NodeProperties::GetValueInput(node, 0); |
510 Node* effect = NodeProperties::GetEffectInput(node); | 512 Node* effect = NodeProperties::GetEffectInput(node); |
511 Node* control = NodeProperties::GetControlInput(node); | 513 Node* control = NodeProperties::GetControlInput(node); |
512 Node* active_function_map = effect = | 514 Node* active_function_map = effect = |
513 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 515 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
514 active_function, effect, control); | 516 active_function, effect, control); |
515 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), | 517 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), |
516 active_function_map, effect, control); | 518 active_function_map, effect, control); |
517 } | 519 } |
518 | 520 |
| 521 Reduction JSIntrinsicLowering::ReduceGetOrdinaryHasInstance(Node* node) { |
| 522 Node* effect = NodeProperties::GetEffectInput(node); |
| 523 Node* context = NodeProperties::GetContextInput(node); |
| 524 Node* native_context = effect = graph()->NewNode( |
| 525 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true), |
| 526 context, context, effect); |
| 527 return Change(node, javascript()->LoadContext( |
| 528 0, Context::ORDINARY_HAS_INSTANCE_INDEX, true), |
| 529 native_context, context, effect); |
| 530 } |
519 | 531 |
520 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, | 532 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, |
521 Node* b) { | 533 Node* b) { |
522 RelaxControls(node); | 534 RelaxControls(node); |
523 node->ReplaceInput(0, a); | 535 node->ReplaceInput(0, a); |
524 node->ReplaceInput(1, b); | 536 node->ReplaceInput(1, b); |
525 node->TrimInputCount(2); | 537 node->TrimInputCount(2); |
526 NodeProperties::ChangeOp(node, op); | 538 NodeProperties::ChangeOp(node, op); |
527 return Changed(node); | 539 return Changed(node); |
528 } | 540 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 } | 603 } |
592 | 604 |
593 | 605 |
594 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 606 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
595 return jsgraph()->simplified(); | 607 return jsgraph()->simplified(); |
596 } | 608 } |
597 | 609 |
598 } // namespace compiler | 610 } // namespace compiler |
599 } // namespace internal | 611 } // namespace internal |
600 } // namespace v8 | 612 } // namespace v8 |
OLD | NEW |