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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 case Runtime::kInlineToNumber: | 82 case Runtime::kInlineToNumber: |
83 return ReduceToNumber(node); | 83 return ReduceToNumber(node); |
84 case Runtime::kInlineToObject: | 84 case Runtime::kInlineToObject: |
85 return ReduceToObject(node); | 85 return ReduceToObject(node); |
86 case Runtime::kInlineToPrimitive: | 86 case Runtime::kInlineToPrimitive: |
87 return ReduceToPrimitive(node); | 87 return ReduceToPrimitive(node); |
88 case Runtime::kInlineToString: | 88 case Runtime::kInlineToString: |
89 return ReduceToString(node); | 89 return ReduceToString(node); |
90 case Runtime::kInlineCall: | 90 case Runtime::kInlineCall: |
91 return ReduceCall(node); | 91 return ReduceCall(node); |
92 case Runtime::kInlineNewObject: | |
93 return ReduceNewObject(node); | |
92 case Runtime::kInlineGetSuperConstructor: | 94 case Runtime::kInlineGetSuperConstructor: |
93 return ReduceGetSuperConstructor(node); | 95 return ReduceGetSuperConstructor(node); |
94 case Runtime::kInlineGetOrdinaryHasInstance: | 96 case Runtime::kInlineGetOrdinaryHasInstance: |
95 return ReduceGetOrdinaryHasInstance(node); | 97 return ReduceGetOrdinaryHasInstance(node); |
96 default: | 98 default: |
97 break; | 99 break; |
98 } | 100 } |
99 return NoChange(); | 101 return NoChange(); |
100 } | 102 } |
101 | 103 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 | 472 |
471 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { | 473 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { |
472 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); | 474 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); |
473 NodeProperties::ChangeOp(node, | 475 NodeProperties::ChangeOp(node, |
474 javascript()->CallFunction(arity, VectorSlotPair(), | 476 javascript()->CallFunction(arity, VectorSlotPair(), |
475 ConvertReceiverMode::kAny, | 477 ConvertReceiverMode::kAny, |
476 TailCallMode::kDisallow)); | 478 TailCallMode::kDisallow)); |
477 return Changed(node); | 479 return Changed(node); |
478 } | 480 } |
479 | 481 |
482 Reduction JSIntrinsicLowering::ReduceNewObject(Node* node) { | |
483 return Change(node, CodeFactory::FastNewObject(isolate()), 0); | |
Benedikt Meurer
2016/03/31 17:49:29
%_NewObject should be lowered to JSCreate, which d
| |
484 } | |
480 | 485 |
481 Reduction JSIntrinsicLowering::ReduceGetSuperConstructor(Node* node) { | 486 Reduction JSIntrinsicLowering::ReduceGetSuperConstructor(Node* node) { |
482 Node* active_function = NodeProperties::GetValueInput(node, 0); | 487 Node* active_function = NodeProperties::GetValueInput(node, 0); |
483 Node* effect = NodeProperties::GetEffectInput(node); | 488 Node* effect = NodeProperties::GetEffectInput(node); |
484 Node* control = NodeProperties::GetControlInput(node); | 489 Node* control = NodeProperties::GetControlInput(node); |
485 Node* active_function_map = effect = | 490 Node* active_function_map = effect = |
486 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 491 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
487 active_function, effect, control); | 492 active_function, effect, control); |
488 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), | 493 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), |
489 active_function_map, effect, control); | 494 active_function_map, effect, control); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
574 } | 579 } |
575 | 580 |
576 | 581 |
577 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 582 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
578 return jsgraph()->simplified(); | 583 return jsgraph()->simplified(); |
579 } | 584 } |
580 | 585 |
581 } // namespace compiler | 586 } // namespace compiler |
582 } // namespace internal | 587 } // namespace internal |
583 } // namespace v8 | 588 } // namespace v8 |
OLD | NEW |