Lines Matching defs:node

11 #include "src/compiler/node-matchers.h"
12 #include "src/compiler/node-properties.h"
13 #include "src/compiler/node.h"
30 AllocationGroup(Node* node, AllocationType allocation, Zone* zone);
31 AllocationGroup(Node* node, AllocationType allocation, Node* size,
78 Reduction MemoryLowering::Reduce(Node* node) {
79 switch (node->opcode()) {
85 return ReduceAllocateRaw(node);
88 return ReduceLoadFromObject(node);
90 return ReduceLoadElement(node);
92 return ReduceLoadField(node);
95 return ReduceStoreToObject(node);
97 return ReduceStoreElement(node);
99 return ReduceStoreField(node);
101 return ReduceStore(node);
129 UNREACHABLE(); // The instance node must have been created before.
136 Node* node, AllocationType allocation_type,
138 DCHECK_EQ(IrOpcode::kAllocateRaw, node->opcode());
149 Node* size = node->InputAt(0);
150 Node* effect = node->InputAt(1);
151 Node* control = node->InputAt(2);
242 // We can fold this Allocate {node} into the allocation {group}
283 // Setup a mutable reservation size node; will be patched as we fold
376 Reduction MemoryLowering::ReduceLoadFromObject(Node* node) {
377 DCHECK(node->opcode() == IrOpcode::kLoadFromObject ||
378 node->opcode() == IrOpcode::kLoadImmutableFromObject);
379 ObjectAccess const& access = ObjectAccessOf(node->op());
385 return ReduceLoadMap(node);
394 NodeProperties::ChangeOp(node, load_op);
395 return Changed(node);
398 Reduction MemoryLowering::ReduceLoadElement(Node* node) {
399 DCHECK_EQ(IrOpcode::kLoadElement, node->opcode());
400 ElementAccess const& access = ElementAccessOf(node->op());
401 Node* index = node->InputAt(1);
402 node->ReplaceInput(1, ComputeIndex(access, index));
405 NodeProperties::ChangeOp(node, machine()->Load(type));
406 return Changed(node);
410 Node* node, ExternalPointerTag external_pointer_tag) {
413 DCHECK(node->opcode() == IrOpcode::kLoad);
416 Node* effect = NodeProperties::GetEffectInput(node);
417 Node* control = NodeProperties::GetControlInput(node);
420 // Clone the load node and put it here.
424 Node* shifted_index = __ AddNode(graph()->CloneNode(node));
450 return node;
454 Reduction MemoryLowering::ReduceLoadMap(Node* node) {
456 NodeProperties::ChangeOp(node, machine()->Load(MachineType::AnyTagged()));
458 Node* effect = NodeProperties::GetEffectInput(node);
459 Node* control = NodeProperties::GetControlInput(node);
462 node = __ AddNode(graph()->CloneNode(node));
463 return Replace(__ UnpackMapWord(node));
465 NodeProperties::ChangeOp(node, machine()->Load(MachineType::TaggedPointer()));
466 return Changed(node);
470 Reduction MemoryLowering::ReduceLoadField(Node* node) {
471 DCHECK_EQ(IrOpcode::kLoadField, node->opcode());
472 FieldAccess const& access = FieldAccessOf(node->op());
474 node->InsertInput(graph_zone(), 1, offset);
484 return ReduceLoadMap(node);
487 NodeProperties::ChangeOp(node, machine()->Load(type));
493 node = DecodeExternalPointer(node, tag);
494 return Replace(node);
498 return Changed(node);
501 Reduction MemoryLowering::ReduceStoreToObject(Node* node,
503 DCHECK(node->opcode() == IrOpcode::kStoreToObject ||
504 node->opcode() == IrOpcode::kInitializeImmutableInObject);
505 ObjectAccess const& access = ObjectAccessOf(node->op());
506 Node* object = node->InputAt(0);
507 Node* value = node->InputAt(2);
510 node, object, value, state, access.write_barrier_kind);
518 NodeProperties::ChangeOp(node, store_op);
519 return Changed(node);
522 Reduction MemoryLowering::ReduceStoreElement(Node* node,
524 DCHECK_EQ(IrOpcode::kStoreElement, node->opcode());
525 ElementAccess const& access = ElementAccessOf(node->op());
526 Node* object = node->InputAt(0);
527 Node* index = node->InputAt(1);
528 Node* value = node->InputAt(2);
529 node->ReplaceInput(1, ComputeIndex(access, index));
531 node, object, value, state, access.write_barrier_kind);
533 node, machine()->Store(StoreRepresentation(
535 return Changed(node);
538 Reduction MemoryLowering::ReduceStoreField(Node* node,
540 DCHECK_EQ(IrOpcode::kStoreField, node->opcode());
541 FieldAccess const& access = FieldAccessOf(node->op());
548 Node* object = node->InputAt(0);
549 Node* value = node->InputAt(1);
551 Node* effect = NodeProperties::GetEffectInput(node);
552 Node* control = NodeProperties::GetControlInput(node);
556 node, object, value, state, access.write_barrier_kind);
558 node->InsertInput(graph_zone(), 1, offset);
564 node->ReplaceInput(2, mapword);
568 node, machine()->Store(StoreRepresentation(machine_type.representation(),
570 return Changed(node);
573 Reduction MemoryLowering::ReduceStore(Node* node,
575 DCHECK_EQ(IrOpcode::kStore, node->opcode());
576 StoreRepresentation representation = StoreRepresentationOf(node->op());
577 Node* object = node->InputAt(0);
578 Node* value = node->InputAt(2);
580 node, object, value, state, representation.write_barrier_kind());
583 node, machine()->Store(StoreRepresentation(
585 return Changed(node);
630 Reduction MemoryLowering::ReduceAllocateRaw(Node* node) {
631 DCHECK_EQ(IrOpcode::kAllocateRaw, node->opcode());
632 const AllocateParameters& allocation = AllocateParametersOf(node->op());
633 return ReduceAllocateRaw(node, allocation.allocation_type(),
638 Node* node, Node* object, Node* value, AllocationState const* state,
651 write_barrier_assert_failed_(node, object, function_debug_name_, zone());
656 MemoryLowering::AllocationGroup::AllocationGroup(Node* node,
662 node_ids_.insert(node->id());
665 MemoryLowering::AllocationGroup::AllocationGroup(Node* node,
671 node_ids_.insert(node->id());
674 void MemoryLowering::AllocationGroup::Add(Node* node) {
675 node_ids_.insert(node->id());
678 bool MemoryLowering::AllocationGroup::Contains(Node* node) const {
681 while (node_ids_.find(node->id()) == node_ids_.end()) {
682 switch (node->opcode()) {
687 node = NodeProperties::GetValueInput(node, 0);