Home | History | Annotate | Download | only in compiler

Lines Matching refs:node

11 #include "src/compiler/node-matchers.h"
50 for (Node* const phi : *block) {
54 for (Node* const input : phi->inputs()) {
218 bool InstructionSelector::CanCover(Node* user, Node* node) const {
219 return node->OwnedBy(user) &&
220 schedule()->block(node) == schedule()->block(user);
224 int InstructionSelector::GetVirtualRegister(const Node* node) {
225 DCHECK_NOT_NULL(node);
226 size_t const id = node->id();
250 bool InstructionSelector::IsDefined(Node* node) const {
251 DCHECK_NOT_NULL(node);
252 size_t const id = node->id();
258 void InstructionSelector::MarkAsDefined(Node* node) {
259 DCHECK_NOT_NULL(node);
260 size_t const id = node->id();
266 bool InstructionSelector::IsUsed(Node* node) const {
267 DCHECK_NOT_NULL(node);
268 if (!node->op()->HasProperty(Operator::kEliminatable)) return true;
269 size_t const id = node->id();
275 void InstructionSelector::MarkAsUsed(Node* node) {
276 DCHECK_NOT_NULL(node);
277 size_t const id = node->id();
291 Node* node) {
292 sequence()->MarkAsRepresentation(rep, GetVirtualRegister(node));
301 InstructionOperand OperandForDeopt(OperandGenerator* g, Node* input,
331 size_t GetObjectId(Node* node) {
333 if (objects_[i] == node) {
340 size_t InsertObject(Node* node) {
342 objects_.push_back(node);
347 ZoneVector<Node*> objects_;
356 Node* input, MachineType type,
394 Node* state, OperandGenerator* g,
410 Node* parameters = state->InputAt(kFrameStateParametersInput);
411 Node* locals = state->InputAt(kFrameStateLocalsInput);
412 Node* stack = state->InputAt(kFrameStateStackInput);
413 Node* context = state->InputAt(kFrameStateContextInput);
414 Node* function = state->InputAt(kFrameStateFunctionInput);
429 deduplicator, input_node.node,
439 deduplicator, input_node.node,
444 deduplicator, input_node.node,
495 void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
535 Node* output = buffer->output_nodes[i];
548 Node* callee = call->InputAt(0);
588 Node* frame_state =
665 // matching may cover more than one node at a time.
666 for (auto node : base::Reversed(*block)) {
668 if (!IsUsed(node) || IsDefined(node)) continue;
669 // Generate code for this node "top down", but schedule the code "bottom
672 VisitNode(node);
676 SourcePosition source_position = source_positions_->GetSourcePosition(node);
679 node->opcode() == IrOpcode::kCall)) {
701 for (Node* const node : *successor) {
702 CHECK(!IrOpcode::IsPhiOpcode(node->opcode()));
708 Node* input = block->control_input();
763 Node* value = input->InputAt(0);
781 void InstructionSelector::VisitNode(Node* node) {
782 DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes.
783 switch (node->opcode()) {
801 return MarkAsReference(node), VisitIfException(node);
803 return MarkAsReference(node), VisitFinishRegion(node);
805 return MarkAsReference(node), VisitGuard(node);
808 linkage()->GetParameterType(ParameterIndexOf(node->op()));
809 MarkAsRepresentation(type.representation(), node);
810 return VisitParameter(node);
813 return MarkAsReference(node), VisitOsrValue(node);
815 MachineRepresentation rep = PhiRepresentationOf(node->op());
816 MarkAsRepresentation(rep, node);
817 return VisitPhi(node);
820 return VisitProjection(node);
824 return VisitConstant(node);
826 return MarkAsFloat32(node), VisitConstant(node);
828 return MarkAsFloat64(node), VisitConstant(node);
830 return MarkAsReference(node), VisitConstant(node);
832 double value = OpParameter<double>(node);
833 if (!IsSmiDouble(value)) MarkAsReference(node);
834 return VisitConstant(node);
837 return VisitCall(node);
843 LoadRepresentation type = LoadRepresentationOf(node->op());
844 MarkAsRepresentation(type.representation(), node);
845 return VisitLoad(node);
848 return VisitStore(node);
850 return MarkAsWord32(node), VisitWord32And(node);
852 return MarkAsWord32(node), VisitWord32Or(node);
854 return MarkAsWord32(node), VisitWord32Xor(node);
856 return MarkAsWord32(node), VisitWord32Shl(node);
858 return MarkAsWord32(node), VisitWord32Shr(node);
860 return MarkAsWord32(node), VisitWord32Sar(node);
862 return MarkAsWord32(node), VisitWord32Ror(node);
864 return VisitWord32Equal(node);
866 return MarkAsWord32(node), VisitWord32Clz(node);
868 return MarkAsWord32(node), VisitWord32Ctz(node);
870 return MarkAsWord32(node), VisitWord32Popcnt(node);
872 return MarkAsWord32(node), VisitWord64Popcnt(node);
874 return MarkAsWord64(node), VisitWord64And(node);
876 return MarkAsWord64(node), VisitWord64Or(node);
878 node), VisitWord64Xor(node);
880 return MarkAsWord64(node), VisitWord64Shl(node);
882 return MarkAsWord64(node), VisitWord64Shr(node);
884 return MarkAsWord64(node), VisitWord64Sar(node);
886 return MarkAsWord64(node), VisitWord64Ror(node);
888 return MarkAsWord64(node), VisitWord64Clz(node);
890 return MarkAsWord64(node), VisitWord64Ctz(node);
892 return VisitWord64Equal(node);
894 return MarkAsWord32(node), VisitInt32Add(node);
896 return MarkAsWord32(node), VisitInt32AddWithOverflow(node);
898 return MarkAsWord32(node), VisitInt32Sub(node);
900 return VisitInt32SubWithOverflow(node);
902 return MarkAsWord32(node), VisitInt32Mul(node);
904 return VisitInt32MulHigh(node);
906 return MarkAsWord32(node), VisitInt32Div(node);
908 return MarkAsWord32(node), VisitInt32Mod(node);
910 return VisitInt32LessThan(node);
912 return VisitInt32LessThanOrEqual(node);
914 return MarkAsWord32(node), VisitUint32Div(node);
916 return VisitUint32LessThan(node);
918 return VisitUint32LessThanOrEqual(node);
920 return MarkAsWord32(node), VisitUint32Mod(node);
922 return VisitUint32MulHigh(node);
924 return MarkAsWord64(node), VisitInt64Add(node);
926 return MarkAsWord64(node), VisitInt64AddWithOverflow(node);
928 return MarkAsWord64(node), VisitInt64Sub(node);
930 return MarkAsWord64(node), VisitInt64SubWithOverflow(node);
932 return MarkAsWord64(node), VisitInt64Mul(node);
934 return MarkAsWord64(node), VisitInt64Div(node);
936 return MarkAsWord64(node), VisitInt64Mod(node);
938 return VisitInt64LessThan(node);
940 return VisitInt64LessThanOrEqual(node);
942 return MarkAsWord64(node), VisitUint64Div(node);
944 return VisitUint64LessThan(node);
946 return VisitUint64LessThanOrEqual(node);
948 return MarkAsWord64(node), VisitUint64Mod(node);
950 return MarkAsFloat64(node), VisitChangeFloat32ToFloat64(node);
952 return MarkAsFloat64(node), VisitChangeInt32ToFloat64(node);
954 return MarkAsFloat64(node), VisitChangeUint32ToFloat64(node);
956 return MarkAsWord32(node), VisitChangeFloat64ToInt32(node);
958 return MarkAsWord32(node), VisitChangeFloat64ToUint32(node);
960 return MarkAsWord64(node), VisitTryTruncateFloat32ToInt64(node);
962 return MarkAsWord64(node), VisitTryTruncateFloat64ToInt64(node);
964 return MarkAsWord64(node), VisitTryTruncateFloat32ToUint64(node);
966 return MarkAsWord64(node), VisitTryTruncateFloat64ToUint64(node);
968 return MarkAsWord64(node), VisitChangeInt32ToInt64(node);
970 return MarkAsWord64(node), VisitChangeUint32ToUint64(node);
972 return MarkAsFloat32(node), VisitTruncateFloat64ToFloat32(node);
974 return MarkAsWord32(node), VisitTruncateFloat64ToInt32(node);
976 return MarkAsWord32(node), VisitTruncateInt64ToInt32(node);
978 return MarkAsFloat32(node), VisitRoundInt64ToFloat32(node);
980 return MarkAsFloat64(node), VisitRoundInt64ToFloat64(node);
982 return MarkAsWord32(node), VisitBitcastFloat32ToInt32(node);
984 return MarkAsFloat64(node), VisitRoundUint64ToFloat32(node);
986 return MarkAsFloat64(node), VisitRoundUint64ToFloat64(node);
988 return MarkAsWord64(node), VisitBitcastFloat64ToInt64(node);
990 return MarkAsFloat32(node), VisitBitcastInt32ToFloat32(node);
992 return MarkAsFloat64(node), VisitBitcastInt64ToFloat64(node);
994 return MarkAsFloat32(node), VisitFloat32Add(node);
996 return MarkAsFloat32(node), VisitFloat32Sub(node);
998 return MarkAsFloat32(node), VisitFloat32Mul(node);
1000 return MarkAsFloat32(node), VisitFloat32Div(node);
1002 return MarkAsFloat32(node), VisitFloat32Min(node);
1004 return MarkAsFloat32(node), VisitFloat32Max(node);
1006 return MarkAsFloat32(node), VisitFloat32Abs(node);
1008 return MarkAsFloat32(node), VisitFloat32Sqrt(node);
1010 return VisitFloat32Equal(node);
1012 return VisitFloat32LessThan(node);
1014 return VisitFloat32LessThanOrEqual(node);
1016 return MarkAsFloat64(node), VisitFloat64Add(node);
1018 return MarkAsFloat64(node), VisitFloat64Sub(node);
1020 return MarkAsFloat64(node), VisitFloat64Mul(node);
1022 return MarkAsFloat64(node), VisitFloat64Div(node);
1024 return MarkAsFloat64(node), VisitFloat64Mod(node);
1026 return MarkAsFloat64(node), VisitFloat64Min(node);
1028 return MarkAsFloat64(node), VisitFloat64Max(node);
1030 return MarkAsFloat64(node), VisitFloat64Abs(node);
1032 return MarkAsFloat64(node), VisitFloat64Sqrt(node);
1034 return VisitFloat64Equal(node);
1036 return VisitFloat64LessThan(node);
1038 return VisitFloat64LessThanOrEqual(node);
1040 return MarkAsFloat32(node), VisitFloat32RoundDown(node);
1042 return MarkAsFloat64(node), VisitFloat64RoundDown(node);
1044 return MarkAsFloat32(node), VisitFloat32RoundUp(node);
1046 return MarkAsFloat64(node), VisitFloat64RoundUp(node);
1048 return MarkAsFloat32(node), VisitFloat32RoundTruncate(node);
1050 return MarkAsFloat64(node), VisitFloat64RoundTruncate(node);
1052 return MarkAsFloat64(node), VisitFloat64RoundTiesAway(node);
1054 return MarkAsFloat32(node), VisitFloat32RoundTiesEven(node);
1056 return MarkAsFloat64(node), VisitFloat64RoundTiesEven(node);
1058 return MarkAsWord32(node), VisitFloat64ExtractLowWord32(node);
1060 return MarkAsWord32(node), VisitFloat64ExtractHighWord32(node);
1062 return MarkAsFloat64(node), VisitFloat64InsertLowWord32(node);
1064 return MarkAsFloat64(node), VisitFloat64InsertHighWord32(node);
1066 return VisitLoadStackPointer(node);
1068 return VisitLoadFramePointer(node);
1071 CheckedLoadRepresentationOf(node->op()).representation();
1072 MarkAsRepresentation(rep, node);
1073 return VisitCheckedLoad(node);
1076 return VisitCheckedStore(node);
1078 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
1079 node->opcode(), node->op()->mnemonic(), node->id());
1085 void InstructionSelector::VisitLoadStackPointer(Node* node) {
1087 Emit(kArchStackPointer, g.DefineAsRegister(node));
1091 void InstructionSelector::VisitLoadFramePointer(Node* node) {
1093 Emit(kArchFramePointer, g.DefineAsRegister(node));
1136 void InstructionSelector::VisitWord64And(Node* node) { UNIMPLEMENTED(); }
1139 void InstructionSelector::VisitWord64Or(Node* node) { UNIMPLEMENTED(); }
1142 void InstructionSelector::VisitWord64Xor(Node* node) { UNIMPLEMENTED(); }
1145 void InstructionSelector::VisitWord64Shl(Node* node) { UNIMPLEMENTED(); }
1148 void InstructionSelector::VisitWord64Shr(Node* node) { UNIMPLEMENTED(); }
1151 void InstructionSelector::VisitWord64Sar(Node* node) { UNIMPLEMENTED(); }
1154 void InstructionSelector::VisitWord64Ror(Node* node) { UNIMPLEMENTED(); }
1157 void InstructionSelector::VisitWord64Clz(Node* node) { UNIMPLEMENTED(); }
1160 void InstructionSelector::VisitWord64Ctz(Node* node) { UNIMPLEMENTED(); }
1163 void InstructionSelector::VisitWord64Popcnt(Node* node) { UNIMPLEMENTED(); }
1166 void InstructionSelector::VisitWord64Equal(Node* node) { UNIMPLEMENTED(); }
1169 void InstructionSelector::VisitInt64Add(Node* node) { UNIMPLEMENTED(); }
1172 void InstructionSelector::VisitInt64AddWithOverflow(Node* node) {
1177 void InstructionSelector::VisitInt64Sub(Node* node) { UNIMPLEMENTED(); }
1180 void InstructionSelector::VisitInt64SubWithOverflow(Node* node) {
1185 void InstructionSelector::VisitInt64Mul(Node* node) { UNIMPLEMENTED(); }
1188 void InstructionSelector::VisitInt64Div(Node* node) { UNIMPLEMENTED(); }
1191 void InstructionSelector::VisitInt64LessThan(Node* node) { UNIMPLEMENTED(); }
1194 void InstructionSelector::VisitInt64LessThanOrEqual(Node* node) {
1199 void InstructionSelector::VisitUint64Div(Node* node) { UNIMPLEMENTED(); }
1202 void InstructionSelector::VisitInt64Mod(Node* node) { UNIMPLEMENTED(); }
1205 void InstructionSelector::VisitUint64LessThan(Node* node) { UNIMPLEMENTED(); }
1208 void InstructionSelector::VisitUint64LessThanOrEqual(Node* node) {
1213 void InstructionSelector::VisitUint64Mod(Node* node) { UNIMPLEMENTED(); }
1216 void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
1221 void InstructionSelector::VisitChangeUint32ToUint64(Node* node) {
1226 void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
1231 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
1236 void InstructionSelector::VisitTryTruncateFloat32ToUint64(Node* node) {
1241 void InstructionSelector::VisitTryTruncateFloat64ToUint64(Node* node) {
1246 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
1251 void InstructionSelector::VisitRoundInt64ToFloat32(Node* node) {
1256 void InstructionSelector::VisitRoundInt64ToFloat64(Node* node) {
1261 void InstructionSelector::VisitRoundUint64ToFloat32(Node* node) {
1266 void InstructionSelector::VisitRoundUint64ToFloat64(Node* node) {
1271 void InstructionSelector::VisitBitcastFloat64ToInt64(Node* node) {
1276 void InstructionSelector::VisitBitcastInt64ToFloat64(Node* node) {
1283 void InstructionSelector::VisitFinishRegion(Node* node) {
1285 Node* value = node->InputAt(0);
1286 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
1290 void InstructionSelector::VisitGuard(Node* node) {
1292 Node* value = node->InputAt(0);
1293 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
1297 void InstructionSelector::VisitParameter(Node* node) {
1299 int index = ParameterIndexOf(node->op());
1303 node, linkage()->GetParameterLocation(index),
1306 node, linkage()->GetParameterLocation(index),
1313 void InstructionSelector::VisitIfException(Node* node) {
1315 Node* call = node->InputAt(1);
1319 g.DefineAsLocation(node, descriptor->GetReturnLocation(0),
1324 void InstructionSelector::VisitOsrValue(Node* node) {
1326 int index = OpParameter<int>(node);
1327 Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index),
1332 void InstructionSelector::VisitPhi(Node* node) {
1333 const int input_count = node->op()->ValueInputCount();
1335 PhiInstruction(instruction_zone(), GetVirtualRegister(node),
1341 Node* const input = node->InputAt(i);
1348 void InstructionSelector::VisitProjection(Node* node) {
1350 Node* value = node->InputAt(0);
1360 if (ProjectionIndexOf(node->op()) == 0u) {
1361 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value));
1363 DCHECK(ProjectionIndexOf(node->op()) == 1u);
1373 void InstructionSelector::VisitConstant(Node* node) {
1377 Emit(kArchNop, g.DefineAsConstant(node));
1381 void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
1383 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
1388 node->InputAt(static_cast<int>(descriptor->InputCount())));
1399 InitializeCallBuffer(node, &buffer, call_buffer_flags);
1401 EmitPrepareArguments(&(buffer.pushed_nodes), descriptor, node);
1443 void InstructionSelector::VisitTailCall(Node* node) {
1445 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node);
1453 if (linkage()->GetIncomingDescriptor()->CanTailCall(node,
1462 InitializeCallBuffer(node, &buffer, flags, stack_param_delta);
1491 node->InputAt(static_cast<int>(descriptor->InputCount())))
1501 InitializeCallBuffer(node, &buffer, flags);
1503 EmitPrepareArguments(&(buffer.pushed_nodes), descriptor, node);
1538 void InstructionSelector::VisitReturn(Node* ret) {
1555 void InstructionSelector::VisitDeoptimize(DeoptimizeKind kind, Node* value) {
1586 void InstructionSelector::VisitThrow(Node* value) {
1593 Node* state) {
1609 Node* outer_node = state->InputAt(kFrameStateOuterStateInput);