v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
simplified-lowering-verifier.cc
Go to the documentation of this file.
1// Copyright 2022 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
11
12namespace v8 {
13namespace internal {
14namespace compiler {
15
18 if (type.IsNone()) return true;
19 // TODO(nicohartmann@): Add more cases here.
20 if (type.Is(Type::BigInt())) {
21 if (mt.representation() == MachineRepresentation::kWord64) {
22 return type.Is(Type::SignedBigInt64()) ||
23 type.Is(Type::UnsignedBigInt64());
24 }
25 return mt.representation() == MachineRepresentation::kTaggedPointer ||
26 mt.representation() == MachineRepresentation::kTagged;
27 }
28 switch (mt.representation()) {
30 CHECK(mt.semantic() == MachineSemantic::kBool ||
31 mt.semantic() == MachineSemantic::kAny);
32 return type.Is(Type::Boolean()) || type.Is(Type::Range(0, 1, graph_zone));
33 default:
34 return true;
35 }
36}
37
40 Type node_type = NodeProperties::GetType(node);
41 if (!type.Is(node_type)) {
42 std::ostringstream type_str;
43 type.PrintTo(type_str);
44 std::ostringstream node_type_str;
45 node_type.PrintTo(node_type_str);
46
47 FATAL(
48 "SimplifiedLoweringVerifierError: verified type %s of node #%d:%s "
49 "does not match with type %s assigned during lowering",
50 type_str.str().c_str(), node->id(), node->op()->mnemonic(),
51 node_type_str.str().c_str());
52 }
53}
54
56 const Truncation& trunc) {
57 DCHECK(!type.IsInvalid());
58
59 if (NodeProperties::IsTyped(node)) {
60 CheckType(node, type);
61 } else {
62 // We store the type inferred by the verification pass. We do not update
63 // the node's type directly, because following phases might encounter
64 // unsound types as long as the verification is not complete.
65 SetType(node, type);
66 }
67 SetTruncation(node, GeneralizeTruncation(trunc, type));
68}
69
71 Node* node, const std::vector<Type>& types) {
72 std::ostringstream types_str;
73 for (size_t i = 0; i < types.size(); ++i) {
74 if (i != 0) types_str << ", ";
75 types[i].PrintTo(types_str);
76 }
77 std::ostringstream graph_str;
78 node->Print(graph_str, 2);
79 FATAL(
80 "SimplifiedLoweringVerifierError: invalid combination of input types %s "
81 " for node #%d:%s.\n\nGraph is: %s",
82 types_str.str().c_str(), node->id(), node->op()->mnemonic(),
83 graph_str.str().c_str());
84}
85
86bool IsModuloTruncation(const Truncation& truncation) {
87 return truncation.IsUsedAsWord32() ||
88 (Is64() && truncation.IsUsedAsWord64()) ||
90}
91
93 const Truncation& truncation, const Type& type) const {
94 IdentifyZeros identify_zeros = truncation.identify_zeros();
95 if (!type.Maybe(Type::MinusZero())) {
96 identify_zeros = IdentifyZeros::kDistinguishZeros;
97 }
98
99 switch (truncation.kind()) {
101 return Truncation::Any(identify_zeros);
102 }
104 if (type.Is(Type::Boolean())) return Truncation::Any();
105 return Truncation(Truncation::TruncationKind::kBool, identify_zeros);
106 }
108 if (type.Is(Type::Signed32OrMinusZero()) ||
109 type.Is(Type::Unsigned32OrMinusZero())) {
110 return Truncation::Any(identify_zeros);
111 }
112 return Truncation(Truncation::TruncationKind::kWord32, identify_zeros);
113 }
115 if (type.Is(Type::BigInt())) {
117 if (type.Is(Type::SignedBigInt64()) ||
118 type.Is(Type::UnsignedBigInt64())) {
120 }
121 } else if (type.Is(TypeCache::Get()->kSafeIntegerOrMinusZero)) {
122 return Truncation::Any(identify_zeros);
123 }
124 return Truncation(Truncation::TruncationKind::kWord64, identify_zeros);
125 }
126
127 default:
128 // TODO(nicohartmann): Support remaining truncations.
129 UNREACHABLE();
130 }
131}
132
134 const Truncation& t2) {
136 if (Truncation::LessGeneral(t1.kind(), t2.kind())) {
137 kind = t1.kind();
138 } else {
140 kind = t2.kind();
141 }
144 ? t1.identify_zeros()
145 : t2.identify_zeros();
146 return Truncation(kind, identify_zeros);
147}
148
150 OperationTyper& op_typer) {
151 switch (node->opcode()) {
152 case IrOpcode::kStart:
153 case IrOpcode::kIfTrue:
154 case IrOpcode::kIfFalse:
155 case IrOpcode::kMerge:
156 case IrOpcode::kEnd:
157 case IrOpcode::kEffectPhi:
158 case IrOpcode::kCheckpoint:
159 case IrOpcode::kFrameState:
160 case IrOpcode::kJSStackCheck:
161 break;
162 case IrOpcode::kInt32Constant: {
163 // NOTE: Constants require special handling as they are shared between
164 // machine graphs and non-machine graphs lowered during SL. The former
165 // might have assigned Type::Machine() to the constant, but to be able
166 // to provide a different type for uses of constants that don't come
167 // from machine graphs, the machine-uses of Int32Constants have been
168 // put behind additional SLVerifierHints to provide the required
169 // Type::Machine() to them, such that we can treat constants here as
170 // having JS types to satisfy their non-machine uses.
171 int32_t value = OpParameter<int32_t>(node->op());
172 Type type = Type::Constant(value, graph_zone());
173 SetType(node, type);
175 break;
176 }
177 case IrOpcode::kInt64Constant:
178 case IrOpcode::kFloat64Constant: {
179 // Constants might be untyped, because they are cached in the graph and
180 // used in different contexts such that no single type can be assigned.
181 // Their type is provided by an introduced TypeGuard where necessary.
182 break;
183 }
184 case IrOpcode::kHeapConstant:
185 break;
186 case IrOpcode::kCheckedFloat64ToInt32: {
187 Type input_type = InputType(node, 0);
188 DCHECK(input_type.Is(Type::Number()));
189
190 const auto& p = CheckMinusZeroParametersOf(node->op());
192 // Remove -0 from input_type.
193 input_type =
194 Type::Intersect(input_type, Type::Signed32(), graph_zone());
195 } else {
196 input_type = Type::Intersect(input_type, Type::Signed32OrMinusZero(),
197 graph_zone());
198 }
199 CheckAndSet(node, input_type, Truncation::Word32());
200 break;
201 }
202 case IrOpcode::kCheckedTaggedToTaggedSigned: {
203 Type input_type = InputType(node, 0);
204 Type output_type =
206 Truncation output_trunc = InputTruncation(node, 0);
207 CheckAndSet(node, output_type, output_trunc);
208 break;
209 }
210 case IrOpcode::kCheckedTaggedToTaggedPointer:
211 CheckAndSet(node, InputType(node, 0), InputTruncation(node, 0));
212 break;
213 case IrOpcode::kTruncateTaggedToBit: {
214 Type input_type = InputType(node, 0);
215 Truncation input_trunc = InputTruncation(node, 0);
216 // Cannot have other truncation here, because identified values lead to
217 // different results when converted to bit.
218 CHECK(input_trunc == Truncation::Bool() ||
219 input_trunc == Truncation::Any());
220 Type output_type = op_typer.ToBoolean(input_type);
221 CheckAndSet(node, output_type, Truncation::Bool());
222 break;
223 }
224 case IrOpcode::kInt32Add: {
225 Type left_type = InputType(node, 0);
226 Type right_type = InputType(node, 1);
227 Type output_type;
228 if (left_type.IsNone() && right_type.IsNone()) {
229 output_type = Type::None();
230 } else if (left_type.Is(Type::Machine()) &&
231 right_type.Is(Type::Machine())) {
232 output_type = Type::Machine();
233 } else if (left_type.Is(Type::NumberOrOddball()) &&
234 right_type.Is(Type::NumberOrOddball())) {
235 left_type = op_typer.ToNumber(left_type);
236 right_type = op_typer.ToNumber(right_type);
237 output_type = op_typer.NumberAdd(left_type, right_type);
238 } else {
239 ReportInvalidTypeCombination(node, {left_type, right_type});
240 }
241 Truncation output_trunc =
244 CHECK(IsModuloTruncation(output_trunc));
245 CheckAndSet(node, output_type, output_trunc);
246 break;
247 }
248 case IrOpcode::kInt32Sub: {
249 Type left_type = InputType(node, 0);
250 Type right_type = InputType(node, 1);
251 Type output_type;
252 if (left_type.IsNone() && right_type.IsNone()) {
253 output_type = Type::None();
254 } else if (left_type.Is(Type::Machine()) &&
255 right_type.Is(Type::Machine())) {
256 output_type = Type::Machine();
257 } else if (left_type.Is(Type::NumberOrOddball()) &&
258 right_type.Is(Type::NumberOrOddball())) {
259 left_type = op_typer.ToNumber(left_type);
260 right_type = op_typer.ToNumber(right_type);
261 output_type = op_typer.NumberSubtract(left_type, right_type);
262 } else {
263 ReportInvalidTypeCombination(node, {left_type, right_type});
264 }
265 Truncation output_trunc =
268 CHECK(IsModuloTruncation(output_trunc));
269 CheckAndSet(node, output_type, output_trunc);
270 break;
271 }
272 case IrOpcode::kChangeInt31ToTaggedSigned:
273 case IrOpcode::kChangeInt32ToTagged:
274 case IrOpcode::kChangeFloat32ToFloat64:
275 case IrOpcode::kChangeInt32ToInt64:
276 case IrOpcode::kChangeUint32ToUint64:
277 case IrOpcode::kChangeUint64ToTagged: {
278 // These change operators do not truncate any values and can simply
279 // forward input type and truncation.
280 CheckAndSet(node, InputType(node, 0), InputTruncation(node, 0));
281 break;
282 }
283 case IrOpcode::kChangeFloat64ToInt64: {
284 Truncation output_trunc =
286 CheckAndSet(node, InputType(node, 0), output_trunc);
287 break;
288 }
289 case IrOpcode::kInt64Add: {
290 Type left_type = InputType(node, 0);
291 Type right_type = InputType(node, 1);
292 Type output_type;
293 if (left_type.IsNone() && right_type.IsNone()) {
294 // None x None -> None
295 output_type = Type::None();
296 } else if (left_type.Is(Type::Machine()) &&
297 right_type.Is(Type::Machine())) {
298 // Machine x Machine -> Machine
299 output_type = Type::Machine();
300 } else if (left_type.Is(Type::BigInt()) &&
301 right_type.Is(Type::BigInt())) {
302 // BigInt x BigInt -> BigInt
303 output_type = op_typer.BigIntAdd(left_type, right_type);
304 } else if (left_type.Is(Type::NumberOrOddball()) &&
305 right_type.Is(Type::NumberOrOddball())) {
306 // Number x Number -> Number
307 left_type = op_typer.ToNumber(left_type);
308 right_type = op_typer.ToNumber(right_type);
309 output_type = op_typer.NumberAdd(left_type, right_type);
310 } else {
311 // Invalid type combination.
312 ReportInvalidTypeCombination(node, {left_type, right_type});
313 }
314 Truncation output_trunc =
317 CHECK(IsModuloTruncation(output_trunc));
318 CheckAndSet(node, output_type, output_trunc);
319 break;
320 }
321 case IrOpcode::kInt64Sub: {
322 Type left_type = InputType(node, 0);
323 Type right_type = InputType(node, 1);
324 Type output_type;
325 if (left_type.IsNone() && right_type.IsNone()) {
326 // None x None -> None
327 output_type = Type::None();
328 } else if (left_type.Is(Type::Machine()) &&
329 right_type.Is(Type::Machine())) {
330 // Machine x Machine -> Machine
331 output_type = Type::Machine();
332 } else if (left_type.Is(Type::BigInt()) &&
333 right_type.Is(Type::BigInt())) {
334 // BigInt x BigInt -> BigInt
335 output_type = op_typer.BigIntSubtract(left_type, right_type);
336 } else if (left_type.Is(Type::NumberOrOddball()) &&
337 right_type.Is(Type::NumberOrOddball())) {
338 // Number x Number -> Number
339 left_type = op_typer.ToNumber(left_type);
340 right_type = op_typer.ToNumber(right_type);
341 output_type = op_typer.NumberSubtract(left_type, right_type);
342 } else {
343 // Invalid type combination.
344 ReportInvalidTypeCombination(node, {left_type, right_type});
345 }
346 Truncation output_trunc =
349 CHECK(IsModuloTruncation(output_trunc));
350 CheckAndSet(node, output_type, output_trunc);
351 break;
352 }
353 case IrOpcode::kDeadValue: {
355 break;
356 }
357 case IrOpcode::kTypeGuard: {
358 Type output_type = op_typer.TypeTypeGuard(node->op(), InputType(node, 0));
359 // TypeGuard has no effect on trunction, but the restricted type may help
360 // generalize it.
361 CheckAndSet(node, output_type, InputTruncation(node, 0));
362 break;
363 }
364 case IrOpcode::kTruncateBigIntToWord64: {
365 Type input_type = InputType(node, 0);
366 CHECK(input_type.Is(Type::BigInt()));
367 CHECK(Truncation::Word64().IsLessGeneralThan(InputTruncation(node, 0)));
368 CheckAndSet(node, input_type, Truncation::Word64());
369 break;
370 }
371 case IrOpcode::kChangeTaggedSignedToInt64: {
372 Type input_type = InputType(node, 0);
373 CHECK(input_type.Is(Type::Number()));
374 Truncation output_trunc =
376 CheckAndSet(node, input_type, output_trunc);
377 break;
378 }
379 case IrOpcode::kCheckBigInt: {
380 Type input_type = InputType(node, 0);
381 input_type = Type::Intersect(input_type, Type::BigInt(), graph_zone());
382 CheckAndSet(node, input_type, InputTruncation(node, 0));
383 break;
384 }
385 case IrOpcode::kCheckedBigIntToBigInt64: {
386 Type input_type = InputType(node, 0);
387 CHECK(input_type.Is(Type::BigInt()));
388 input_type =
389 Type::Intersect(input_type, Type::SignedBigInt64(), graph_zone());
390 CheckAndSet(node, input_type, InputTruncation(node, 0));
391 break;
392 }
393 case IrOpcode::kReturn: {
394 const int return_value_count = ValueInputCountOfReturn(node->op());
395 for (int i = 0; i < return_value_count; ++i) {
396 Type input_type = InputType(node, 1 + i);
397 Truncation input_trunc = InputTruncation(node, 1 + i);
398 input_trunc = GeneralizeTruncation(input_trunc, input_type);
399 // No values must be lost due to truncation.
400 CHECK_EQ(input_trunc, Truncation::Any());
401 }
402 break;
403 }
404 case IrOpcode::kSLVerifierHint: {
405 Type output_type = InputType(node, 0);
406 Truncation output_trunc = InputTruncation(node, 0);
407 const auto& p = SLVerifierHintParametersOf(node->op());
408
409 if (const Operator* semantics = p.semantics()) {
410 switch (semantics->opcode()) {
411 case IrOpcode::kPlainPrimitiveToNumber:
412 output_type = op_typer.ToNumber(output_type);
413 break;
414 default:
415 UNREACHABLE();
416 }
417 }
418
419 if (p.override_output_type()) {
420 output_type = *p.override_output_type();
421 }
422
423 SetType(node, output_type);
424 SetTruncation(node, GeneralizeTruncation(output_trunc, output_type));
425 break;
426 }
427 case IrOpcode::kBranch: {
428 CHECK_EQ(BranchParametersOf(node->op()).semantics(),
430 Type input_type = InputType(node, 0);
431 CHECK(input_type.Is(Type::Boolean()) || input_type.Is(Type::Machine()));
432 break;
433 }
434 case IrOpcode::kTypedStateValues: {
435 const ZoneVector<MachineType>* machine_types = MachineTypesOf(node->op());
436 for (int i = 0; i < static_cast<int>(machine_types->size()); ++i) {
437 // Inputs must not be truncated.
439 CHECK(IsNonTruncatingMachineTypeFor(machine_types->at(i),
440 InputType(node, i), graph_zone()));
441 }
442 break;
443 }
444 case IrOpcode::kParameter: {
447 break;
448 }
449 case IrOpcode::kEnterMachineGraph:
450 case IrOpcode::kExitMachineGraph: {
451 // Eliminated during lowering.
452 UNREACHABLE();
453 }
454
455#define CASE(code, ...) case IrOpcode::k##code:
456 // Control operators
457 CASE(Loop)
458 CASE(Switch)
459 CASE(IfSuccess)
460 CASE(IfException)
461 CASE(IfValue)
462 CASE(IfDefault)
463 CASE(Deoptimize)
464 CASE(DeoptimizeIf)
465 CASE(DeoptimizeUnless)
466 CASE(TrapIf)
467 CASE(TrapUnless)
468 CASE(Assert)
469 CASE(TailCall)
471 CASE(Throw)
472 CASE(TraceInstruction)
473 // Constant operators
474 CASE(TaggedIndexConstant)
475 CASE(Float32Constant)
476 CASE(ExternalConstant)
479 CASE(CompressedHeapConstant)
480 CASE(TrustedHeapConstant)
481 CASE(RelocatableInt32Constant)
482 CASE(RelocatableInt64Constant)
483 // Inner operators
484 CASE(Select)
485 CASE(Phi)
486 CASE(InductionVariablePhi)
487 CASE(BeginRegion)
488 CASE(FinishRegion)
489 CASE(StateValues)
490 CASE(ArgumentsElementsState)
491 CASE(ArgumentsLengthState)
492 CASE(ObjectState)
493 CASE(ObjectId)
494 CASE(TypedObjectState)
495 CASE(Call)
496 CASE(OsrValue)
497 CASE(LoopExit)
498 CASE(LoopExitValue)
499 CASE(LoopExitEffect)
500 CASE(Projection)
501 CASE(Retain)
502 CASE(MapGuard)
503 CASE(Unreachable)
504 CASE(Dead)
505 CASE(Plug)
506 CASE(StaticAssert)
507 // Simplified change operators
508 CASE(ChangeTaggedSignedToInt32)
509 CASE(ChangeTaggedToInt32)
510 CASE(ChangeTaggedToInt64)
511 CASE(ChangeTaggedToUint32)
512 CASE(ChangeTaggedToFloat64)
513 CASE(ChangeTaggedToTaggedSigned)
514 CASE(ChangeInt64ToTagged)
515 CASE(ChangeUint32ToTagged)
516 CASE(ChangeFloat64ToTagged)
517 CASE(ChangeFloat64ToTaggedPointer)
518 CASE(ChangeTaggedToBit)
519 CASE(ChangeBitToTagged)
520 CASE(ChangeInt64ToBigInt)
521 CASE(ChangeUint64ToBigInt)
522 CASE(TruncateTaggedToWord32)
523 CASE(TruncateTaggedToFloat64)
524 CASE(TruncateTaggedPointerToBit)
525 // Simplified checked operators
526 CASE(CheckedInt32Add)
527 CASE(CheckedInt32Sub)
528 CASE(CheckedInt32Div)
529 CASE(CheckedInt32Mod)
530 CASE(CheckedUint32Div)
531 CASE(CheckedUint32Mod)
532 CASE(CheckedInt32Mul)
533 CASE(CheckedAdditiveSafeIntegerAdd)
534 CASE(CheckedAdditiveSafeIntegerSub)
535 CASE(CheckedInt64Add)
536 CASE(CheckedInt64Sub)
537 CASE(CheckedInt64Mul)
538 CASE(CheckedInt64Div)
539 CASE(CheckedInt64Mod)
540 CASE(CheckedInt32ToTaggedSigned)
541 CASE(CheckedInt64ToInt32)
542 CASE(CheckedInt64ToTaggedSigned)
543 CASE(CheckedUint32Bounds)
544 CASE(CheckedUint32ToInt32)
545 CASE(CheckedUint32ToTaggedSigned)
546 CASE(CheckedUint64Bounds)
547 CASE(CheckedUint64ToInt32)
548 CASE(CheckedUint64ToInt64)
549 CASE(CheckedUint64ToTaggedSigned)
550 CASE(CheckedFloat64ToAdditiveSafeInteger)
551 CASE(CheckedFloat64ToInt64)
552 CASE(CheckedTaggedSignedToInt32)
553 CASE(CheckedTaggedToInt32)
554 CASE(CheckedTaggedToArrayIndex)
555 CASE(CheckedTruncateTaggedToWord32)
556 CASE(CheckedTaggedToFloat64)
557 CASE(CheckedTaggedToAdditiveSafeInteger)
558 CASE(CheckedTaggedToInt64)
564 // Simplified unary bigint operators
565 CASE(BigIntNegate)
572 // Binary 32bit machine operators
573 CASE(Word32And)
574 CASE(Word32Or)
575 CASE(Word32Xor)
576 CASE(Word32Shl)
577 CASE(Word32Shr)
578 CASE(Word32Sar)
579 CASE(Word32Rol)
580 CASE(Word32Ror)
581 CASE(Int32AddWithOverflow)
582 CASE(Int32SubWithOverflow)
583 CASE(Int32Mul)
584 CASE(Int32MulWithOverflow)
585 CASE(Int32MulHigh)
586 CASE(Int32Div)
587 CASE(Int32Mod)
588 CASE(Uint32Div)
589 CASE(Uint32Mod)
590 CASE(Uint32MulHigh)
591 // Binary 64bit machine operators
592 CASE(Word64And)
593 CASE(Word64Or)
594 CASE(Word64Xor)
595 CASE(Word64Shl)
596 CASE(Word64Shr)
597 CASE(Word64Sar)
598 CASE(Word64Rol)
599 CASE(Word64Ror)
600 CASE(Word64RolLowerable)
601 CASE(Word64RorLowerable)
602 CASE(Int64AddWithOverflow)
603 CASE(Int64SubWithOverflow)
604 CASE(Int64Mul)
605 CASE(Int64MulHigh)
606 CASE(Uint64MulHigh)
607 CASE(Int64MulWithOverflow)
608 CASE(Int64Div)
609 CASE(Int64Mod)
610 CASE(Uint64Div)
611 CASE(Uint64Mod)
617 CASE(AbortCSADcheck)
618 CASE(DebugBreak)
619 CASE(Comment)
620 CASE(Load)
621 CASE(LoadImmutable)
622 CASE(Store)
623 CASE(StorePair)
624 CASE(StoreIndirectPointer)
625 CASE(StackSlot)
626 CASE(Word32Popcnt)
627 CASE(Word64Popcnt)
628 CASE(Word64Clz)
629 CASE(Word64Ctz)
630 CASE(Word64ClzLowerable)
631 CASE(Word64CtzLowerable)
632 CASE(Word64ReverseBits)
633 CASE(Word64ReverseBytes)
634 CASE(Simd128ReverseBytes)
635 CASE(Int64AbsWithOverflow)
636 CASE(BitcastTaggedToWord)
637 CASE(BitcastTaggedToWordForTagAndSmiBits)
638 CASE(BitcastWordToTagged)
639 CASE(BitcastWordToTaggedSigned)
640 CASE(TruncateFloat64ToWord32)
641 CASE(ChangeFloat64ToInt32)
642 CASE(ChangeFloat64ToUint32)
643 CASE(ChangeFloat64ToUint64)
644 CASE(Float64SilenceNaN)
645 CASE(TruncateFloat64ToInt64)
646 CASE(TruncateFloat64ToUint32)
647 CASE(TruncateFloat32ToInt32)
648 CASE(TruncateFloat32ToUint32)
649 CASE(TryTruncateFloat32ToInt64)
650 CASE(TryTruncateFloat64ToInt64)
651 CASE(TryTruncateFloat32ToUint64)
652 CASE(TryTruncateFloat64ToUint64)
653 CASE(TryTruncateFloat64ToInt32)
654 CASE(TryTruncateFloat64ToUint32)
655 CASE(ChangeInt32ToFloat64)
656 CASE(BitcastWord32ToWord64)
657 CASE(ChangeInt64ToFloat64)
658 CASE(ChangeUint32ToFloat64)
659 CASE(ChangeFloat16RawBitsToFloat64)
660 CASE(TruncateFloat64ToFloat32)
661 CASE(TruncateFloat64ToFloat16RawBits)
662 CASE(TruncateInt64ToInt32)
663 CASE(RoundFloat64ToInt32)
664 CASE(RoundInt32ToFloat32)
665 CASE(RoundInt64ToFloat32)
666 CASE(RoundInt64ToFloat64)
667 CASE(RoundUint32ToFloat32)
668 CASE(RoundUint64ToFloat32)
669 CASE(RoundUint64ToFloat64)
670 CASE(BitcastFloat32ToInt32)
671 CASE(BitcastFloat64ToInt64)
672 CASE(BitcastInt32ToFloat32)
673 CASE(BitcastInt64ToFloat64)
674 CASE(Float64ExtractLowWord32)
675 CASE(Float64ExtractHighWord32)
676 CASE(Float64InsertLowWord32)
677 CASE(Float64InsertHighWord32)
678 CASE(Word32Select)
679 CASE(Word64Select)
680 CASE(Float32Select)
681 CASE(Float64Select)
682 CASE(LoadStackCheckOffset)
683 CASE(LoadFramePointer)
684 IF_WASM(CASE, LoadStackPointer)
685 IF_WASM(CASE, SetStackPointer)
686 CASE(LoadParentFramePointer)
687 CASE(LoadRootRegister)
688 CASE(UnalignedLoad)
689 CASE(UnalignedStore)
690 CASE(Int32PairAdd)
691 CASE(Int32PairSub)
692 CASE(Int32PairMul)
693 CASE(Word32PairShl)
694 CASE(Word32PairShr)
695 CASE(Word32PairSar)
696 CASE(ProtectedLoad)
697 CASE(ProtectedStore)
698 CASE(LoadTrapOnNull)
699 CASE(StoreTrapOnNull)
700 CASE(MemoryBarrier)
701 CASE(SignExtendWord8ToInt32)
702 CASE(SignExtendWord16ToInt32)
703 CASE(SignExtendWord8ToInt64)
704 CASE(SignExtendWord16ToInt64)
705 CASE(SignExtendWord32ToInt64)
706 CASE(StackPointerGreaterThan)
713 CASE(JSAsyncFunctionEnter)
714 CASE(JSAsyncFunctionReject)
715 CASE(JSAsyncFunctionResolve)
716 CASE(JSCallRuntime)
717 CASE(JSForInEnumerate)
718 CASE(JSForInNext)
719 CASE(JSForInPrepare)
720 CASE(JSGetIterator)
721 CASE(JSLoadMessage)
722 CASE(JSStoreMessage)
723 CASE(JSLoadModule)
724 CASE(JSStoreModule)
725 CASE(JSGetImportMeta)
726 CASE(JSGeneratorStore)
727 CASE(JSGeneratorRestoreContinuation)
728 CASE(JSGeneratorRestoreContext)
729 CASE(JSGeneratorRestoreRegister)
730 CASE(JSGeneratorRestoreInputOrDebugPos)
731 CASE(JSFulfillPromise)
732 CASE(JSPerformPromiseThen)
733 CASE(JSPromiseResolve)
734 CASE(JSRejectPromise)
735 CASE(JSResolvePromise)
736 CASE(JSObjectIsArray)
737 CASE(JSRegExpTest)
738 CASE(JSDebugger) {
739 // TODO(nicohartmann@): These operators might need to be supported.
740 break;
741 }
745 // SIMD operators should not be in the graph, yet.
746 UNREACHABLE();
747 }
748#undef CASE
749 }
750}
751
752} // namespace compiler
753} // namespace internal
754} // namespace v8
#define Assert(condition)
Builtins::Kind kind
Definition builtins.cc:40
static Type GetType(const Node *node)
static bool IsTyped(const Node *node)
Type TypeTypeGuard(const Operator *sigma_op, Type input)
Truncation GeneralizeTruncation(const Truncation &truncation, const Type &type) const
void ReportInvalidTypeCombination(Node *node, const std::vector< Type > &types)
Truncation InputTruncation(Node *node, int input_index) const
void SetTruncation(Node *node, const Truncation &truncation)
Truncation JoinTruncation(const Truncation &t1, const Truncation &t2)
void CheckAndSet(Node *node, const Type &type, const Truncation &trunc)
static Truncation Any(IdentifyZeros identify_zeros=kDistinguishZeros)
Definition use-info.h:46
TruncationKind kind() const
Definition use-info.h:107
static bool LessGeneral(TruncationKind rep1, TruncationKind rep2)
static bool LessGeneralIdentifyZeros(IdentifyZeros u1, IdentifyZeros u2)
bool IsLessGeneralThan(Truncation other) const
Definition use-info.h:87
IdentifyZeros identify_zeros() const
Definition use-info.h:92
static Truncation Word32()
Definition use-info.h:35
static Truncation Word64()
Definition use-info.h:38
static TypeCache const * Get()
void PrintTo(std::ostream &os) const
static Type Constant(JSHeapBroker *broker, Handle< i::Object > value, Zone *zone)
static Type Intersect(Type type1, Type type2, Zone *zone)
bool Is(Type that) const
static Type Range(double min, double max, Zone *zone)
MachineType mt
Zone * graph_zone
const BranchParameters & BranchParametersOf(const Operator *const op)
ZoneVector< MachineType > const * MachineTypesOf(Operator const *op)
static const Operator * PointerConstant(CommonOperatorBuilder *common, const void *ptr)
bool IsNonTruncatingMachineTypeFor(const MachineType &mt, const Type &type, Zone *graph_zone)
int ValueInputCountOfReturn(Operator const *const op)
NumberConstant(std::numeric_limits< double >::quiet_NaN())) DEFINE_GETTER(EmptyStateValues
const CheckMinusZeroParameters & CheckMinusZeroParametersOf(const Operator *op)
const SLVerifierHintParameters & SLVerifierHintParametersOf(const Operator *op)
T const & OpParameter(const Operator *op)
Definition operator.h:214
bool IsModuloTruncation(const Truncation &truncation)
void Terminate(Isolate *isolate)
Definition bigint.cc:1187
constexpr bool Is64()
i::Address Load(i::Address address)
Definition unwinder.cc:19
#define SIMPLIFIED_OTHER_OP_LIST(V)
Definition opcodes.h:449
#define MACHINE_SIMD256_OP_LIST(V)
Definition opcodes.h:1159
#define JS_CONTEXT_OP_LIST(V)
Definition opcodes.h:201
#define MACHINE_FLOAT32_UNOP_LIST(V)
Definition opcodes.h:687
#define JS_SIMPLE_UNOP_LIST(V)
Definition opcodes.h:152
#define SIMPLIFIED_BIGINT_BINOP_LIST(V)
Definition opcodes.h:367
#define SIMPLIFIED_NUMBER_UNOP_LIST(V)
Definition opcodes.h:397
#define MACHINE_FLOAT32_BINOP_LIST(V)
Definition opcodes.h:696
#define JS_OBJECT_OP_LIST(V)
Definition opcodes.h:183
#define SIMPLIFIED_SPECULATIVE_BIGINT_UNOP_LIST(V)
Definition opcodes.h:573
#define SIMPLIFIED_SPECULATIVE_NUMBER_UNOP_LIST(V)
Definition opcodes.h:439
#define SIMPLIFIED_COMPARE_BINOP_LIST(V)
Definition opcodes.h:328
#define JS_SIMPLE_BINOP_LIST(V)
Definition opcodes.h:124
#define MACHINE_FLOAT64_BINOP_LIST(V)
Definition opcodes.h:733
#define MACHINE_COMPARE_BINOP_LIST(V)
Definition opcodes.h:623
#define MACHINE_UNOP_32_LIST(V)
Definition opcodes.h:616
#define MACHINE_ATOMIC_OP_LIST(V)
Definition opcodes.h:744
#define MACHINE_SIMD128_OP_LIST(V)
Definition opcodes.h:879
#define SIMPLIFIED_SPECULATIVE_BIGINT_BINOP_LIST(V)
Definition opcodes.h:561
#define SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V)
Definition opcodes.h:379
#define SIMPLIFIED_WASM_OP_LIST(V)
Definition opcodes.h:579
#define SIMPLIFIED_NUMBER_BINOP_LIST(V)
Definition opcodes.h:349
#define JS_CONSTRUCT_OP_LIST(V)
Definition opcodes.h:219
#define JS_CALL_OP_LIST(V)
Definition opcodes.h:212
#define MACHINE_FLOAT64_UNOP_LIST(V)
Definition opcodes.h:704
#define FATAL(...)
Definition logging.h:47
#define CHECK(condition)
Definition logging.h:124
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_EQ(v1, v2)
Definition logging.h:485
#define IF_WASM(V,...)
Definition macros.h:472