Home | History | Annotate | Download | only in compiler

Lines Matching refs:Node

15 #include "src/compiler/node-properties.h"
16 #include "src/compiler/node.h"
33 AllocationBuilder(JSGraph* jsgraph, Node* effect, Node* control)
55 void Store(const FieldAccess& access, Node* value) {
61 void Store(ElementAccess const& access, Node* index, Node* value) {
84 void FinishAndChange(Node* node) {
85 NodeProperties::SetType(allocation_, NodeProperties::GetType(node));
86 node->ReplaceInput(0, allocation_);
87 node->ReplaceInput(1, effect_);
88 node->TrimInputCount(2);
89 NodeProperties::ChangeOp(node, common()->FinishRegion());
92 Node* Finish() {
104 Node* allocation_;
105 Node* effect_;
106 Node* control_;
110 Node* GetArgumentsFrameState(Node* frame_state) {
111 Node* const outer_state = NodeProperties::GetFrameStateInput(frame_state);
206 Reduction JSCreateLowering::Reduce(Node* node) {
207 switch (node->opcode()) {
209 return ReduceJSCreate(node);
211 return ReduceJSCreateArguments(node);
213 return ReduceJSCreateArray(node);
215 return ReduceJSCreateIterResultObject(node);
217 return ReduceJSCreateKeyValueArray(node);
220 return ReduceJSCreateLiteral(node);
222 return ReduceJSCreateFunctionContext(node);
224 return ReduceJSCreateWithContext(node);
226 return ReduceJSCreateCatchContext(node);
228 return ReduceJSCreateBlockContext(node);
235 Reduction JSCreateLowering::ReduceJSCreate(Node* node) {
236 DCHECK_EQ(IrOpcode::kJSCreate, node->opcode());
237 Node* const target = NodeProperties::GetValueInput(node, 0);
239 Node* const new_target = NodeProperties::GetValueInput(node, 1);
241 Node* const effect = NodeProperties::GetEffectInput(node);
242 Node* const control = NodeProperties::GetControlInput(node);
281 RelaxControls(node);
282 a.FinishAndChange(node);
283 return Changed(node);
289 Reduction JSCreateLowering::ReduceJSCreateArguments(Node* node) {
290 DCHECK_EQ(IrOpcode::kJSCreateArguments, node->opcode());
291 CreateArgumentsType type = CreateArgumentsTypeOf(node->op());
292 Node* const frame_state = NodeProperties::GetFrameStateInput(node);
293 Node* const outer_state = frame_state->InputAt(kFrameStateOuterStateInput);
294 Node* const control = graph()->start();
311 Node* const callee = NodeProperties::GetValueInput(node, 0);
312 Node* effect = NodeProperties::GetEffectInput(node);
314 Node* const elements = effect = graph()->NewNode(
316 Node* const length = effect = graph()->NewNode(
320 Node* const arguments_map = jsgraph()->HeapConstant(
324 Node* properties = jsgraph()->EmptyFixedArrayConstant();
332 RelaxControls(node);
333 a.FinishAndChange(node);
336 Operator::Properties properties = node->op()->properties();
341 Node* stub_code = jsgraph()->HeapConstant(callable.code());
342 node->InsertInput(graph()->zone(), 0, stub_code);
343 node->RemoveInput(3); // Remove the frame state.
344 NodeProperties::ChangeOp(node, new_op);
346 return Changed(node);
353 Node* effect = NodeProperties::GetEffectInput(node);
355 Node* const elements = effect = graph()->NewNode(
359 Node* const length = effect = graph()->NewNode(
363 Node* const arguments_map = jsgraph()->HeapConstant(
367 Node* properties = jsgraph()->EmptyFixedArrayConstant();
374 node);
375 a.FinishAndChange(node);
378 Operator::Properties properties = node->op()->properties();
383 Node* stub_code = jsgraph()->HeapConstant(callable.code());
384 node->InsertInput(graph()->zone(), 0, stub_code);
385 NodeProperties::ChangeOp(node, new_op);
387 return Changed(node);
392 Node* effect = NodeProperties::GetEffectInput(node);
394 Node* const elements = effect = graph()->NewNode(
398 Node* const length = effect = graph()->NewNode(
402 Node* const jsarray_map = jsgraph()->HeapConstant(handle(
406 Node* properties = jsgraph()->EmptyFixedArrayConstant();
413 RelaxControls(node);
414 a.FinishAndChange(node);
417 Operator::Properties properties = node->op()->properties();
422 Node* stub_code = jsgraph()->HeapConstant(callable.code());
423 node->InsertInput(graph()->zone(), 0, stub_code);
424 NodeProperties::ChangeOp(node, new_op);
426 return Changed(node);
436 Node* const callee = NodeProperties::GetValueInput(node, 0);
437 Node* const context = NodeProperties::GetContextInput(node);
438 Node* effect = NodeProperties::GetEffectInput(node);
444 Node* const args_state = GetArgumentsFrameState(frame_state);
448 Node* const elements = AllocateAliasedArguments(
452 Node* const arguments_map = jsgraph()->HeapConstant(handle(
458 Node* properties = jsgraph()->EmptyFixedArrayConstant();
467 RelaxControls(node);
468 a.FinishAndChange(node);
469 return Changed(node);
473 Node* effect = NodeProperties::GetEffectInput(node);
477 Node* const args_state = GetArgumentsFrameState(frame_state);
480 Node* const elements = AllocateArguments(effect, control, args_state);
483 Node* const arguments_map = jsgraph()->HeapConstant(
487 Node* properties = jsgraph()->EmptyFixedArrayConstant();
495 RelaxControls(node);
496 a.FinishAndChange(node);
497 return Changed(node);
504 Node* effect = NodeProperties::GetEffectInput(node);
508 Node* const args_state = GetArgumentsFrameState(frame_state);
511 Node* const elements =
515 Node* const jsarray_map = jsgraph()->HeapConstant(handle(
519 Node* properties = jsgraph()->EmptyFixedArrayConstant();
531 RelaxControls(node);
532 a.FinishAndChange(node);
533 return Changed(node);
540 Reduction JSCreateLowering::ReduceNewArray(Node* node, Node* length,
543 DCHECK_EQ(IrOpcode::kJSCreateArray, node->opcode());
544 Node* effect = NodeProperties::GetEffectInput(node);
545 Node* control = NodeProperties::GetControlInput(node);
561 Node* js_array_map = jsgraph()->HeapConstant(
565 Node* elements;
572 Node* properties = jsgraph()->EmptyFixedArrayConstant();
581 RelaxControls(node);
582 a.FinishAndChange(node);
583 return Changed(node);
587 Node* node, Handle<AllocationSite> site) {
588 CreateArrayParameters const& p = CreateArrayParametersOf(node->op());
603 node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode()));
604 node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site));
605 node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(0));
606 node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
607 NodeProperties::ChangeOp(node, common()->Call(desc));
608 return Changed(node);
621 node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode()));
622 node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site));
623 node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(1));
624 node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
625 NodeProperties::ChangeOp(node, common()->Call(desc));
626 return Changed(node);
629 Node* effect = NodeProperties::GetEffectInput(node);
630 Node* control = NodeProperties::GetControlInput(node);
631 Node* length = NodeProperties::GetValueInput(node, 2);
632 Node* equal = graph()->NewNode(simplified()->ReferenceEqual(), length,
635 Node* branch =
637 Node* call_holey;
638 Node* call_packed;
639 Node* if_success_packed;
640 Node* if_success_holey;
641 Node* context = NodeProperties::GetContextInput(node);
642 Node* frame_state = NodeProperties::GetFrameStateInput(node);
643 Node* if_equal = graph()->NewNode(common()->IfTrue(), branch);
651 Node* inputs[] = {jsgraph()->HeapConstant(stub.GetCode()),
652 node->InputAt(1),
666 Node* if_not_equal = graph()->NewNode(common()->IfFalse(), branch);
675 Node* inputs[] = {jsgraph()->HeapConstant(stub.GetCode()),
676 node->InputAt(1),
690 Node* merge = graph()->NewNode(common()->Merge(2), if_success_holey,
692 Node* effect_phi = graph()->NewNode(common()->EffectPhi(2), call_holey,
694 Node* phi =
698 ReplaceWithValue(node, phi, effect_phi, merge);
699 return Changed(node);
707 node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode()));
708 node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site));
709 node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(arity));
710 node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
711 NodeProperties::ChangeOp(node, common()->Call(desc));
712 return Changed(node);
715 Reduction JSCreateLowering::ReduceJSCreateArray(Node* node) {
716 DCHECK_EQ(IrOpcode::kJSCreateArray, node->opcode());
717 CreateArrayParameters const& p = CreateArrayParametersOf(node->op());
718 Node* target = NodeProperties::GetValueInput(node, 0);
719 Node* new_target = NodeProperties::GetValueInput(node, 1);
722 if (NodeProperties::IsExceptionalCall(node)) return NoChange();
727 // Check if we have a feedback {site} on the {node}.
736 Node* length = jsgraph()->ZeroConstant();
738 return ReduceNewArray(node, length, capacity, site);
740 Node* length = NodeProperties::GetValueInput(node, 2);
746 return ReduceNewArray(node, length, capacity, site);
751 return ReduceNewArrayToStubCall(node, site);
754 Reduction JSCreateLowering::ReduceJSCreateIterResultObject(Node* node) {
755 DCHECK_EQ(IrOpcode::kJSCreateIterResultObject, node->opcode());
756 Node* value = NodeProperties::GetValueInput(node, 0);
757 Node* done = NodeProperties::GetValueInput(node, 1);
758 Node* effect = NodeProperties::GetEffectInput(node);
760 Node* iterator_result_map = jsgraph()->HeapConstant(
774 a.FinishAndChange(node);
775 return Changed(node);
778 Reduction JSCreateLowering::ReduceJSCreateKeyValueArray(Node* node) {
779 DCHECK_EQ(IrOpcode::kJSCreateKeyValueArray, node->opcode());
780 Node* key = NodeProperties::GetValueInput(node, 0);
781 Node* value = NodeProperties::GetValueInput(node, 1);
782 Node* effect = NodeProperties::GetEffectInput(node);
784 Node* array_map = jsgraph()->HeapConstant(
786 Node* properties = jsgraph()->EmptyFixedArrayConstant();
787 Node* length = jsgraph()->Constant(2);
795 Node* elements = aa.Finish();
804 a.FinishAndChange(node);
805 return Changed(node);
808 Reduction JSCreateLowering::ReduceJSCreateLiteral(Node* node) {
809 DCHECK(node->opcode() == IrOpcode::kJSCreateLiteralArray ||
810 node->opcode() == IrOpcode::kJSCreateLiteralObject);
811 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
812 Node* effect = NodeProperties::GetEffectInput(node);
813 Node* control = NodeProperties::GetControlInput(node);
816 if (GetSpecializationFeedbackVector(node).ToHandle(&feedback_vector)) {
827 Node* value = effect =
830 ReplaceWithValue(node, value, effect, control);
839 Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) {
840 DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode());
842 CreateFunctionContextParametersOf(node->op());
845 Node* const closure = NodeProperties::GetValueInput(node, 0);
850 Node* effect = NodeProperties::GetEffectInput(node);
851 Node* control = NodeProperties::GetControlInput(node);
852 Node* context = NodeProperties::GetContextInput(node);
853 Node* extension = jsgraph()->TheHoleConstant();
877 RelaxControls(node);
878 a.FinishAndChange(node);
879 return Changed(node);
885 Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) {
886 DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode());
887 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node);
888 Node* object = NodeProperties::GetValueInput(node, 0);
889 Node* closure = NodeProperties::GetValueInput(node, 1);
890 Node* effect = NodeProperties::GetEffectInput(node);
891 Node* control = NodeProperties::GetControlInput(node);
892 Node* context = NodeProperties::GetContextInput(node);
899 Node* extension = aa.Finish();
909 RelaxControls(node);
910 a.FinishAndChange(node);
911 return Changed(node);
914 Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) {
915 DCHECK_EQ(IrOpcode::kJSCreateCatchContext, node->opcode());
917 CreateCatchContextParametersOf(node->op());
918 Node* exception = NodeProperties::GetValueInput(node, 0);
919 Node* closure = NodeProperties::GetValueInput(node, 1);
920 Node* effect = NodeProperties::GetEffectInput(node);
921 Node* control = NodeProperties::GetControlInput(node);
922 Node* context = NodeProperties::GetContextInput(node);
931 Node* extension = aa.Finish();
944 RelaxControls(node);
945 a.FinishAndChange(node);
946 return Changed(node);
949 Reduction JSCreateLowering::ReduceJSCreateBlockContext(Node* node) {
950 DCHECK_EQ(IrOpcode::kJSCreateBlockContext, node->opcode());
951 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node);
953 Node* const closure = NodeProperties::GetValueInput(node, 0);
958 Node* effect = NodeProperties::GetEffectInput(node);
959 Node* control = NodeProperties::GetControlInput(node);
960 Node* context = NodeProperties::GetContextInput(node);
961 Node* extension = jsgraph()->Constant(scope_info);
974 RelaxControls(node);
975 a.FinishAndChange(node);
976 return Changed(node);
984 Node* JSCreateLowering::AllocateArguments(Node* effect, Node* control,
985 Node* frame_state) {
991 Node* const parameters = frame_state->InputAt(kFrameStateParametersInput);
999 DCHECK_NOT_NULL((*parameters_it).node);
1000 a.Store(AccessBuilder::ForFixedArraySlot(i), (*parameters_it).node);
1007 Node* JSCreateLowering::AllocateRestArguments(Node* effect, Node* control,
1008 Node* frame_state,
1016 Node* const parameters = frame_state->InputAt(kFrameStateParametersInput);
1029 DCHECK_NOT_NULL((*parameters_it).node);
1030 a.Store(AccessBuilder::ForFixedArraySlot(i), (*parameters_it).node);
1038 Node* JSCreateLowering::AllocateAliasedArguments(
1039 Node* effect, Node* control, Node* frame_state, Node* context,
1057 Node* const parameters = frame_state->InputAt(kFrameStateParametersInput);
1070 DCHECK_NOT_NULL((*parameters_it).node);
1071 aa.Store(AccessBuilder::ForFixedArraySlot(i), (*parameters_it).node);
1073 Node* arguments = aa.Finish();
1087 Node* JSCreateLowering::AllocateElements(Node* effect, Node* control,
1100 Node* value;
1116 Node* index = jsgraph()->Constant(i);
1122 Node* JSCreateLowering::AllocateFastLiteral(
1123 Node* effect, Node* control, Handle<JSObject> boilerplate,
1139 Node* properties = jsgraph()->EmptyFixedArrayConstant();
1142 Node* elements = AllocateFastLiteralElements(effect, control, boilerplate,
1148 ZoneVector<std::pair<FieldAccess, Node*>> inobject_fields(zone());
1163 Node* value;
1206 Node* value = jsgraph()->HeapConstant(factory()->one_pointer_filler_map());
1229 Node* JSCreateLowering::AllocateFastLiteralElements(
1230 Node* effect, Node* control, Handle<JSObject> boilerplate,
1254 ZoneVector<Node*> elements_values(elements_length, zone());
1258 Node* the_hole_value = nullptr;
1310 Node* node) {
1311 Node* const closure = NodeProperties::GetValueInput(node, 0);