47 if (!target)
return std::nullopt;
51 if (
broker ==
nullptr)
return std::nullopt;
57 if (code.object()->is_builtin()) {
58 return code.object()->builtin_id();
68 if (!builtin_id.has_value())
return false;
69 if (*builtin_id != Builtin::kCEntry_Return1_ArgvOnStack_NoBuiltinExit) {
74 auto is_this_builtin = [&](
int input_index) {
77 real_callee !=
nullptr &&
79 real_callee->external_reference() ==
88 return is_this_builtin(2) || is_this_builtin(3);
100void ValidateOpInputRep(
102 std::initializer_list<RegisterRepresentation> expected_reps,
103 const Operation* checked_op, std::optional<size_t> projection_index) {
104 const Operation& input_op = graph.Get(input);
108 if (projection_index) {
109 if (*projection_index < input_reps.
size()) {
110 input_rep = input_reps[*projection_index];
112 std::cerr <<
"Turboshaft operation ";
114 std::cerr << *checked_op <<
" ";
116 std::cerr <<
"has input #" << input <<
":" << input_op
117 <<
" with wrong arity.\n";
119 <<
", but expected at least " << (*projection_index + 1)
123 }
else if (input_reps.
size() == 1) {
124 input_rep = input_reps[0];
126 std::cerr <<
"Turboshaft operation ";
128 std::cerr << *checked_op <<
" ";
130 std::cerr <<
"has input #" << input <<
":" << input_op
131 <<
" with wrong arity.\n";
132 std::cerr <<
"Expected a single output but found " << input_reps.
size()
136 for (RegisterRepresentation expected_rep : expected_reps) {
138 expected_rep, graph.IsCreatedFromTurbofan())) {
142 std::cerr <<
"Turboshaft operation ";
144 std::cerr << *checked_op <<
" ";
146 std::cerr <<
"has input #" << input <<
":" << input_op
147 <<
" with wrong representation.\n";
148 std::cerr <<
"Expected " << (expected_reps.size() > 1 ?
"one of " :
"")
150 << input_rep <<
".\n";
151 std::cout <<
"Input: " << graph.Get(input) <<
"\n";
155void ValidateOpInputRep(
const Graph& graph,
OpIndex input,
156 RegisterRepresentation expected_rep,
158 std::optional<size_t> projection_index) {
159 return ValidateOpInputRep(graph, input, {expected_rep}, checked_op,
165#define OPCODE_NAME(Name) #Name,
183 return os << static_cast<uint16_t>(index);
188#define PRINT_KIND(Name) \
189 case GenericBinopOp::Kind::k##Name: \
198#define PRINT_KIND(Name) \
199 case GenericUnopOp::Kind::k##Name: \
209 return os <<
"Signed";
211 return os <<
"Unsigned";
218 return os <<
"ReverseBytes";
220 return os <<
"CountLeadingZeros";
222 return os <<
"CountTrailingZeros";
224 return os <<
"PopCount";
226 return os <<
"SignExtend8";
228 return os <<
"SignExtend16";
244 return os <<
"Negate";
246 return os <<
"SilenceNaN";
248 return os <<
"RoundUp";
250 return os <<
"RoundDown";
252 return os <<
"RoundToZero";
254 return os <<
"RoundTiesEven";
260 return os <<
"Log10";
262 return os <<
"Log1p";
270 return os <<
"Expm1";
284 return os <<
"Asinh";
286 return os <<
"Acosh";
294 return os <<
"Atanh";
304 return SupportedOperations::float32_round_down();
306 return SupportedOperations::float32_round_up();
308 return SupportedOperations::float32_round_to_zero();
310 return SupportedOperations::float32_round_ties_even();
317 return SupportedOperations::float64_round_down();
319 return SupportedOperations::float64_round_up();
321 return SupportedOperations::float64_round_to_zero();
323 return SupportedOperations::float64_round_ties_even();
340 ? SupportedOperations::word32_ctz()
341 : SupportedOperations::word64_ctz();
344 ? SupportedOperations::word32_popcnt()
345 : SupportedOperations::word64_popcnt();
351 case ShiftOp::Kind::kShiftRightArithmeticShiftOutZeros:
352 return os <<
"ShiftRightArithmeticShiftOutZeros";
353 case ShiftOp::Kind::kShiftRightArithmetic:
354 return os <<
"ShiftRightArithmetic";
355 case ShiftOp::Kind::kShiftRightLogical:
356 return os <<
"ShiftRightLogical";
357 case ShiftOp::Kind::kShiftLeft:
358 return os <<
"ShiftLeft";
359 case ShiftOp::Kind::kRotateRight:
360 return os <<
"RotateRight";
361 case ShiftOp::Kind::kRotateLeft:
362 return os <<
"RotateLeft";
369 return os <<
"Equal";
371 return os <<
"SignedLessThan";
373 return os <<
"SignedLessThanOrEqual";
375 return os <<
"UnsignedLessThan";
377 return os <<
"UnsignedLessThanOrEqual";
384 return os <<
"FloatConversion";
386 return os <<
"JSFloatTruncate";
388 return os <<
"JSFloat16ChangeWithBitcast";
390 return os <<
"JSFloat16TruncateWithBitcast";
392 return os <<
"SignedFloatTruncateOverflowToMin";
394 return os <<
"UnsignedFloatTruncateOverflowToMin";
396 return os <<
"SignedToFloat";
398 return os <<
"UnsignedToFloat";
400 return os <<
"ExtractHighHalf";
402 return os <<
"ExtractLowHalf";
404 return os <<
"ZeroExtend";
406 return os <<
"SignExtend";
408 return os <<
"Truncate";
410 return os <<
"Bitcast";
417 return os <<
"Uint32ToInt32";
419 return os <<
"Int64ToInt32";
421 return os <<
"Uint64ToInt32";
423 return os <<
"Uint64ToInt64";
425 return os <<
"Float64ToInt32";
427 return os <<
"Float64ToUint32";
429 return os <<
"Float64ToAdditiveSafeInteger";
431 return os <<
"Float64ToInt64";
433 return os <<
"Float64NotHole";
440 return os <<
"SignedFloatTruncateOverflowUndefined";
442 return os <<
"UnsignedFloatTruncateOverflowUndefined";
451 return os <<
"HeapObject";
453 return os <<
"TagAndSmiBits";
460 switch (assumption) {
462 return os <<
"NoAssumption";
464 return os <<
"NoOverflow";
466 return os <<
"Reversible";
473 return os <<
"Branch";
475 return os <<
"CMove";
481 case AtomicRMWOp::BinOp::kAdd:
483 case AtomicRMWOp::BinOp::kSub:
485 case AtomicRMWOp::BinOp::kAnd:
487 case AtomicRMWOp::BinOp::kOr:
489 case AtomicRMWOp::BinOp::kXor:
491 case AtomicRMWOp::BinOp::kExchange:
492 return os <<
"exchange";
493 case AtomicRMWOp::BinOp::kCompareExchange:
494 return os <<
"compare-exchange";
511 return os <<
"exchange";
513 return os <<
"compare-exchange";
517 return os <<
"store";
524 return os <<
"stack check offset";
526 return os <<
"frame pointer";
528 return os <<
"parent frame pointer";
533 const std::string& op_index_prefix)
const {
535#define SWITCH_CASE(Name) \
536 case Opcode::k##Name: \
537 Cast<Name##Op>().PrintInputs(os, op_index_prefix); \
546#define SWITCH_CASE(Name) \
547 case Opcode::k##Name: \
548 Cast<Name##Op>().PrintOptions(os); \
565 os <<
"smi: " <<
smi();
578 }
else if (
float64().is_nan()) {
585 os <<
" (0x" << std::hex << base::bit_cast<uint32_t>(
storage.
float32)
602 os <<
"relocatable wasm call: 0x"
606 os <<
"relocatable wasm stub call: 0x"
610 os <<
"relocatable wasm canonical signature ID: "
614 os <<
"relocatable wasm indirect call target: "
639 const std::string& op_index_prefix)
const {
640 os <<
" *(" << op_index_prefix <<
base().
id();
646 if (
index().valid()) {
666 const std::string& op_index_prefix)
const {
667 os <<
" *(" << op_index_prefix <<
base().
id() <<
" + " << op_index_prefix
669 if (
bin_op == BinOp::kCompareExchange) {
670 os <<
"expected: " << op_index_prefix <<
expected();
671 os <<
", new: " << op_index_prefix <<
value();
673 os << op_index_prefix <<
value().
id();
684 const std::string& op_index_prefix)
const {
685 os <<
" *(" << op_index_prefix <<
base().
id();
686 if (
index().valid()) {
687 os <<
" + " << op_index_prefix <<
index().value().id();
690 os <<
" + offset=" <<
offset;
692 os <<
").atomic_word32_pair_" <<
kind <<
'(';
694 os <<
"expected: {lo: " << op_index_prefix <<
value_low()
695 <<
", hi: " << op_index_prefix <<
value_high();
696 os <<
"}, value: {lo: " << op_index_prefix <<
value_low()
697 <<
", hi: " << op_index_prefix <<
value_high() <<
'}';
699 os <<
"lo: " << op_index_prefix <<
value_low()
700 <<
", hi: " << op_index_prefix <<
value_high();
706 os <<
"[opkind: " <<
kind <<
']';
714 const std::string& op_index_prefix)
const {
715 os <<
" *(" << op_index_prefix <<
base().
id();
721 if (
index().valid()) {
725 os <<
") = " << op_index_prefix <<
value().
id() <<
' ';
755 os << (inlined ?
"inlined" :
"not inlined");
757 os << data->frame_state_info;
758 os <<
", state values:";
760 while (it.has_more()) {
762 switch (it.current_instr()) {
763 case FrameStateData::Instr::kInput: {
766 it.ConsumeInput(&type, &input);
767 os <<
'#' << input.id() <<
'(' << type <<
')';
770 case FrameStateData::Instr::kUnusedRegister:
771 it.ConsumeUnusedRegister();
774 case FrameStateData::Instr::kDematerializedObject: {
776 uint32_t field_count;
777 it.ConsumeDematerializedObject(&
id, &field_count);
778 os <<
'$' <<
id <<
"(field count: " << field_count <<
')';
781 case FrameStateData::Instr::kDematerializedObjectReference: {
783 it.ConsumeDematerializedObjectReference(&
id);
787 case FrameStateData::Instr::kDematerializedStringConcat: {
789 it.ConsumeDematerializedStringConcat(&
id);
790 os <<
"£" <<
id <<
"DematerializedStringConcat";
793 case FrameStateData::Instr::kDematerializedStringConcatReference: {
795 it.ConsumeDematerializedStringConcatReference(&
id);
799 case FrameStateData::Instr::kArgumentsElements: {
801 it.ConsumeArgumentsElements(&type);
802 os <<
"ArgumentsElements(" << type <<
')';
805 case FrameStateData::Instr::kArgumentsLength: {
806 it.ConsumeArgumentsLength();
807 os <<
"ArgumentsLength";
810 case FrameStateData::Instr::kRestLength: {
811 it.ConsumeRestLength();
825 while (it.has_more()) {
826 switch (it.current_instr()) {
827 case FrameStateData::Instr::kInput: {
830 it.ConsumeInput(&type, &input);
833 type.representation());
839 ValidateOpInputRep(graph, input, rep);
843 case FrameStateData::Instr::kUnusedRegister:
844 it.ConsumeUnusedRegister();
846 case FrameStateData::Instr::kDematerializedObject: {
848 uint32_t field_count;
849 it.ConsumeDematerializedObject(&
id, &field_count);
852 case FrameStateData::Instr::kDematerializedObjectReference: {
854 it.ConsumeDematerializedObjectReference(&
id);
857 case FrameStateData::Instr::kDematerializedStringConcat: {
859 it.ConsumeDematerializedStringConcat(&
id);
862 case FrameStateData::Instr::kDematerializedStringConcatReference: {
864 it.ConsumeDematerializedStringConcatReference(&
id);
867 case FrameStateData::Instr::kArgumentsElements: {
869 it.ConsumeArgumentsElements(&type);
872 case FrameStateData::Instr::kArgumentsLength: {
873 it.ConsumeArgumentsLength();
876 case FrameStateData::Instr::kRestLength: {
877 it.ConsumeRestLength();
885 static_assert(std::tuple_size_v<
decltype(
options())> == 2);
893 case Opcode::kCall: {
898 case Opcode::kFastApiCall: {
903#define STATIC_OUTPUT_CASE(Name) \
904 case Opcode::k##Name: { \
905 const Name##Op& op = graph.Get(throwing_operation()).Cast<Name##Op>(); \
906 DCHECK_EQ(op.kOutReps, outputs_rep()); \
910#undef STATIC_OUTPUT_CASE
916 OpIndex this_index = graph.Index(*
this);
921 DCHECK_EQ(catch_op.didnt_throw_block->begin(), this_index);
941 os <<
"SignedMulOverflownBits, ";
944 os <<
"UnsignedMulOverflownBits, ";
950 os <<
"UnsignedDiv, ";
956 os <<
"UnsignedMod, ";
959 os <<
"BitwiseAnd, ";
965 os <<
"BitwiseXor, ";
1023 os <<
"ShiftRightSigned";
1026 os <<
"ShiftRightUnsigned";
1036 os <<
"signed add, ";
1039 os <<
"signed mul, ";
1042 os <<
"signed sub, ";
1045 os <<
"signed div, ";
1048 os <<
"signed mod, ";
1051 os <<
"unsigned div, ";
1054 os <<
"unsigned mod, ";
1065 os <<
"signed add, ";
1068 os <<
"signed sub, ";
1071 os <<
"signed mul, ";
1080 return os <<
"<invalid OpIndex>";
1082 return os << idx.
id();
1087 return os <<
"<invalid block>";
1089 return os <<
'B' << b.
id();
1093 return os << b->
index();
1097 auto produce_consume = [](
bool produces,
bool consumes) {
1098 if (!produces && !consumes) {
1100 }
else if (produces && !consumes) {
1102 }
else if (!produces && consumes) {
1104 }
else if (produces && consumes) {
1135 os <<
"case " << c.value <<
": " << c.destination <<
", ";
1142 std::unordered_set<int> cases_set;
1144 DCHECK(!cases_set.contains(cas.value));
1145 cases_set.insert(cas.value);
1152 return os <<
"ArrayBufferView";
1154 return os <<
"BigInt";
1156 return os <<
"BigInt64";
1158 return os <<
"Callable";
1160 return os <<
"Constructor";
1162 return os <<
"DetectableCallable";
1164 return os <<
"InternalizedString";
1166 return os <<
"NonCallable";
1168 return os <<
"Number";
1170 return os <<
"NumberFitsInt32";
1172 return os <<
"NumberOrBigInt";
1174 return os <<
"Receiver";
1176 return os <<
"ReceiverOrNullOrUndefined";
1180 return os <<
"String";
1182 return os <<
"StringOrStringWrapper";
1184 return os <<
"Symbol";
1186 return os <<
"Undetectable";
1192 switch (input_assumptions) {
1194 return os <<
"None";
1196 return os <<
"HeapObject";
1198 return os <<
"BigInt";
1205 return os <<
"Float64Hole";
1207 return os <<
"Finite";
1209 return os <<
"Integer";
1211 return os <<
"SafeInteger";
1213 return os <<
"kInt32";
1215 return os <<
"kSmi";
1217 return os <<
"MinusZero";
1226 return os <<
"Object";
1228 return os <<
"Boolean";
1230 return os <<
"Number";
1232 return os <<
"NumberOrOddball";
1234 return os <<
"PlainPrimitive";
1236 return os <<
"String";
1246 return os <<
"BigInt";
1248 return os <<
"Boolean";
1250 return os <<
"HeapNumber";
1253 return os <<
"HeapNumberOrUndefined";
1255 return os <<
"Number";
1259 return os <<
"String";
1266 switch (input_interpretation) {
1268 return os <<
"Signed";
1270 return os <<
"Unsigned";
1272 return os <<
"CharCode";
1274 return os <<
"CodePoint";
1289 input_interpretation) {
1290 switch (input_interpretation) {
1292 return os <<
"Signed";
1294 return os <<
"Unsigned";
1302 return os <<
"Int32";
1304 return os <<
"Int64";
1306 return os <<
"Uint32";
1310 return os <<
"Float64";
1317 switch (input_assumptions) {
1319 return os <<
"Boolean";
1323 return os <<
"NumberOrOddball";
1325 return os <<
"PlainPrimitive";
1334 return os <<
"Int32";
1337 return os <<
"AdditiveSafeInteger";
1339 return os <<
"Int64";
1341 return os <<
"Float64";
1343 return os <<
"ArrayIndex";
1353 return os <<
"AdditiveSafeInteger";
1355 return os <<
"Number";
1358 return os <<
"NumberOrBoolean";
1361 return os <<
"NumberOrOddball";
1364 return os <<
"NumberOrString";
1374 return os <<
"Int32";
1376 return os <<
"Int64";
1385 switch (input_assumptions) {
1387 return os <<
"BigInt";
1389 return os <<
"NumberOrOddball";
1391 return os <<
"HeapObject";
1393 return os <<
"Object";
1402 return os <<
"Int32";
1409 return os <<
"Double";
1411 return os <<
"Object";
1437 return os <<
"BitwiseAnd";
1439 return os <<
"BitwiseOr";
1441 return os <<
"BitwiseXor";
1443 return os <<
"ShiftLeft";
1445 return os <<
"ShiftRightArithmetic";
1452 return os <<
"Equal";
1454 return os <<
"LessThan";
1456 return os <<
"LessThanOrEqual";
1463 return os <<
"Negate";
1470 return os <<
"CharCode";
1472 return os <<
"CodePoint";
1476#ifdef V8_INTL_SUPPORT
1477std::ostream&
operator<<(std::ostream& os, StringToCaseIntlOp::Kind
kind) {
1479 case StringToCaseIntlOp::Kind::kLower:
1480 return os <<
"Lower";
1481 case StringToCaseIntlOp::Kind::kUpper:
1482 return os <<
"Upper";
1490 return os <<
"Equal";
1492 return os <<
"LessThan";
1494 return os <<
"LessThanOrEqual";
1501 return os <<
"Arguments";
1503 return os <<
"Rest";
1511 return os <<
"Element";
1513 return os <<
"NumberElement";
1515 return os <<
"OddballElement";
1517 return os <<
"NonNumberElement";
1519 return os <<
"SignedSmallElement";
1525 for (
size_t i = 0;
i < maps.
size(); ++
i) {
1526 if (
i != 0) os <<
",";
1541 os <<
", " << flags <<
", " << feedback <<
"]";
1553 return os <<
"SameValue";
1555 return os <<
"SameValueNumbersOnly";
1562 return os <<
"FindOrderedHashMapEntry";
1564 return os <<
"FindOrderedHashMapEntryForInt32Key";
1566 return os <<
"FindOrderedHashSetEntry";
1573 return os <<
"function-entry";
1575 return os <<
"builtin-entry";
1577 return os <<
"loop";
1581#if V8_ENABLE_WEBASSEMBLY
1597 switch (type.kind()) {
1609 case wasm::kRefNull:
1622template <
size_t size>
1623void PrintSimdValue(std::ostream& os,
const uint8_t (&value)[size]) {
1624 os <<
"0x" << std::hex << std::setfill(
'0');
1625#ifdef V8_TARGET_BIG_ENDIAN
1626 for (
int i = 0; i < static_cast<int>(size);
i++) {
1628 for (
int i =
static_cast<int>(size) - 1;
i >= 0;
i--) {
1630 os << std::setw(2) << static_cast<int>(value[
i]);
1632 os << std::dec << std::setfill(
' ');
1636void Simd128ConstantOp::PrintOptions(std::ostream& os)
const {
1637 PrintSimdValue(os, value);
1640std::ostream&
operator<<(std::ostream& os, Simd128BinopOp::Kind
kind) {
1642#define PRINT_KIND(kind) \
1643 case Simd128BinopOp::Kind::k##kind: \
1650std::ostream&
operator<<(std::ostream& os, Simd128UnaryOp::Kind
kind) {
1652#define PRINT_KIND(kind) \
1653 case Simd128UnaryOp::Kind::k##kind: \
1660std::ostream&
operator<<(std::ostream& os, Simd128ReduceOp::Kind
kind) {
1662#define PRINT_KIND(kind) \
1663 case Simd128ReduceOp::Kind::k##kind: \
1665 FOREACH_SIMD_128_REDUCE_OPTIONAL_OPCODE(
PRINT_KIND)
1670std::ostream&
operator<<(std::ostream& os, Simd128ShiftOp::Kind
kind) {
1672#define PRINT_KIND(kind) \
1673 case Simd128ShiftOp::Kind::k##kind: \
1680std::ostream&
operator<<(std::ostream& os, Simd128TestOp::Kind
kind) {
1682#define PRINT_KIND(kind) \
1683 case Simd128TestOp::Kind::k##kind: \
1690std::ostream&
operator<<(std::ostream& os, Simd128SplatOp::Kind
kind) {
1692#define PRINT_KIND(kind) \
1693 case Simd128SplatOp::Kind::k##kind: \
1700std::ostream&
operator<<(std::ostream& os, Simd128TernaryOp::Kind
kind) {
1702#define PRINT_KIND(kind) \
1703 case Simd128TernaryOp::Kind::k##kind: \
1710void Simd128ExtractLaneOp::PrintOptions(std::ostream& os)
const {
1741 os <<
", " <<
static_cast<int32_t>(lane) <<
']';
1744void Simd128ReplaceLaneOp::PrintOptions(std::ostream& os)
const {
1769 os <<
", " <<
static_cast<int32_t>(lane) <<
']';
1772void Simd128LaneMemoryOp::PrintOptions(std::ostream& os)
const {
1773 os <<
'[' << (mode == Mode::kLoad ?
"Load" :
"Store") <<
", ";
1774 if (
kind.maybe_unaligned) os <<
"unaligned, ";
1775 if (
kind.with_trap_handler) os <<
"protected, ";
1776 switch (lane_kind) {
1790 os <<
"bit, lane: " <<
static_cast<int>(lane);
1795void Simd128LoadTransformOp::PrintOptions(std::ostream& os)
const {
1797 if (load_kind.maybe_unaligned) os <<
"unaligned, ";
1798 if (load_kind.with_trap_handler) os <<
"protected, ";
1800 switch (transform_kind) {
1801#define PRINT_KIND(kind) \
1802 case TransformKind::k##kind: \
1805 FOREACH_SIMD_128_LOAD_TRANSFORM_OPCODE(
PRINT_KIND)
1809 os <<
", offset: " <<
offset <<
']';
1812void Simd128ShuffleOp::PrintOptions(std::ostream& os)
const {
1828 PrintSimdValue(os, shuffle);
1832#if V8_ENABLE_WASM_DEINTERLEAVED_MEM_OPS
1833void Simd128LoadPairDeinterleaveOp::PrintOptions(std::ostream& os)
const {
1835 if (load_kind.maybe_unaligned) os <<
"unaligned, ";
1836 if (load_kind.with_trap_handler) os <<
"protected, ";
1856#if V8_ENABLE_WASM_SIMD256_REVEC
1857void Simd256ConstantOp::PrintOptions(std::ostream& os)
const {
1858 PrintSimdValue(os, value);
1861void Simd256Extract128LaneOp::PrintOptions(std::ostream& os)
const {
1862 os << '[' << static_cast<int>(lane) <<
']';
1865void Simd256LoadTransformOp::PrintOptions(std::ostream& os)
const {
1867 if (load_kind.maybe_unaligned) os <<
"unaligned, ";
1868 if (load_kind.with_trap_handler) os <<
"protected, ";
1870 switch (transform_kind) {
1871#define PRINT_KIND(kind) \
1872 case TransformKind::k##kind: \
1875 FOREACH_SIMD_256_LOAD_TRANSFORM_OPCODE(
PRINT_KIND)
1879 os <<
", offset: " <<
offset <<
']';
1882std::ostream&
operator<<(std::ostream& os, Simd256UnaryOp::Kind
kind) {
1884#define PRINT_KIND(kind) \
1885 case Simd256UnaryOp::Kind::k##kind: \
1892std::ostream&
operator<<(std::ostream& os, Simd256TernaryOp::Kind
kind) {
1894#define PRINT_KIND(kind) \
1895 case Simd256TernaryOp::Kind::k##kind: \
1902std::ostream&
operator<<(std::ostream& os, Simd256BinopOp::Kind
kind) {
1904#define PRINT_KIND(kind) \
1905 case Simd256BinopOp::Kind::k##kind: \
1912std::ostream&
operator<<(std::ostream& os, Simd256ShiftOp::Kind
kind) {
1914#define PRINT_KIND(kind) \
1915 case Simd256ShiftOp::Kind::k##kind: \
1922std::ostream&
operator<<(std::ostream& os, Simd256SplatOp::Kind
kind) {
1924#define PRINT_KIND(kind) \
1925 case Simd256SplatOp::Kind::k##kind: \
1932#ifdef V8_TARGET_ARCH_X64
1933void Simd256ShufdOp::PrintOptions(std::ostream& os)
const {
1934 os << '[' << std::bitset<8>(control) <<
']';
1937void Simd256ShufpsOp::PrintOptions(std::ostream& os)
const {
1938 os << '[' << std::bitset<8>(control) <<
']';
1941std::ostream&
operator<<(std::ostream& os, Simd256UnpackOp::Kind
kind) {
1943#define PRINT_KIND(kind) \
1944 case Simd256UnpackOp::Kind::k##kind: \
1953void WasmAllocateArrayOp::PrintOptions(std::ostream& os)
const {
1954 os <<
'[' << array_type->element_type() <<
']';
1957void ArrayGetOp::PrintOptions(std::ostream& os)
const {
1958 os <<
'[' << (
is_signed ?
"signed " :
"")
1959 << (array_type->mutability() ?
"" :
"immutable ")
1960 << array_type->element_type() <<
']';
1966 std::stringstream ss;
1982#define SET_SUPPORTED(name, machine_name) \
1983 instance_.name##_ = supported & MachineOperatorBuilder::Flag::k##machine_name;
1990 const Graph& graph) {
2010 V<Any>::Cast(graph.PreviousIndex(graph.Index(*
this))));
2026 auto [descriptor_value, effects] =
options();
2037 auto [didnt_throw_block_value, catch_block_value] =
options();
2038 return HashWithOptions(index_for_bound_block(didnt_throw_block_value),
2039 index_for_bound_block(catch_block_value));
2049 auto [destination_value, is_backedge_value] =
options();
2061 auto [if_true_value, if_false_value, hint_value] =
options();
2063 index_for_bound_block(if_false_value), hint_value);
2073 auto [cases_value, default_case_value, default_hint_value] =
options();
2075 size_t hash =
HashWithOptions(index_for_bound_block(default_case_value),
2076 default_hint_value);
2077 for (
const auto& c : cases_value) {
2079 index_for_bound_block(c.destination), c.hint);
2108 const Graph& graph) {
2110 const Operation& terminator = block->LastOperation(graph);
2111 switch (terminator.
opcode) {
2112 case Opcode::kCheckException: {
2119 case Opcode::kBranch: {
2125 case Opcode::kSwitch: {
2130 auto it = std::find_if(swtch.
cases.begin(), swtch.
cases.end(),
2132 return c.destination == successor;
2137 case Opcode::kDeoptimize:
2138 case Opcode::kTailCall:
2139 case Opcode::kUnreachable:
2140 case Opcode::kReturn:
2143#define NON_TERMINATOR_CASE(op) case Opcode::k##op:
2146#undef NON_TERMINATOR_CASE
2153 if (value.saturated_use_count.IsOne())
return true;
2155 value.saturated_use_count.Get();
2158#if V8_ENABLE_WEBASSEMBLY
2161 return load->kind.with_trap_handler;
2163 return load_t->load_kind.with_trap_handler;
2164#ifdef V8_ENABLE_WASM_DEINTERLEAVED_MEM_OPS
2166 return load_t->load_kind.with_trap_handler;
constexpr size_t size() const
static ExternalReference Create(const SCTableReference &table_ref)
uint64_t get_bits() const
double get_scalar() const
constexpr MachineRepresentation representation() const
static constexpr MachineType AnyCompressed()
static constexpr MachineType CompressedPointer()
static MachineOperatorBuilder::AlignmentRequirements AlignmentRequirements()
static MachineOperatorBuilder::Flags SupportedMachineOperatorFlags()
bool IsUnalignedLoadSupported(MachineRepresentation rep) const
bool IsUnalignedStoreSupported(MachineRepresentation rep) const
base::SmallVector< Block *, 8 > Predecessors() const
static constexpr FloatRepresentation Float32()
constexpr Enum value() const
static constexpr FloatRepresentation Float64()
static constexpr MaybeRegisterRepresentation Float64()
static constexpr MaybeRegisterRepresentation Compressed()
static constexpr MaybeRegisterRepresentation Word64()
static constexpr MaybeRegisterRepresentation Float32()
static constexpr MaybeRegisterRepresentation Tagged()
static constexpr MaybeRegisterRepresentation Word32()
static constexpr MaybeRegisterRepresentation Simd128()
static constexpr MemoryRepresentation AnyTagged()
static constexpr MemoryRepresentation TaggedPointer()
MachineType ToMachineType() const
constexpr uint32_t id() const
constexpr bool valid() const
constexpr OpIndex value() const
static constexpr RegisterRepresentation Compressed()
static constexpr RegisterRepresentation FromMachineRepresentation(MachineRepresentation rep)
static constexpr RegisterRepresentation Simd128()
static constexpr RegisterRepresentation Word32()
static constexpr RegisterRepresentation Float64()
static constexpr RegisterRepresentation Float32()
constexpr bool AllowImplicitRepresentationChangeTo(RegisterRepresentation dst_rep, bool graph_created_from_turbofan) const
static constexpr RegisterRepresentation Word64()
static constexpr RegisterRepresentation Tagged()
static bool IsUnalignedStoreSupported(MemoryRepresentation repr)
static SupportedOperations instance_
static base::LazyMutex mutex_
static bool IsUnalignedLoadSupported(MemoryRepresentation repr)
static constexpr WordRepresentation Word32()
#define LAZY_MUTEX_INITIALIZER
bool contains(const C &container, const T &element)
std::ostream & operator<<(std::ostream &os, PaddingSpace padding)
V8_INLINE const Operation & Get(const Graph &graph, OpIndex index)
constexpr bool MayThrow(Opcode opcode)
V8_INLINE size_t fast_hash_combine()
const char * OpcodeName(Opcode opcode)
std::optional< Builtin > TryGetBuiltinId(const ConstantOp *target, JSHeapBroker *broker)
Zone * get_zone(Graph *graph)
constexpr std::underlying_type_t< Opcode > OpcodeIndex(Opcode x)
constexpr uint16_t kNumberOfOpcodes
void PrintMapSet(std::ostream &os, const ZoneRefSet< Map > &maps)
base::SmallVector< Block *, 4 > SuccessorBlocks(const Block &block, const Graph &graph)
bool IsUnlikelySuccessor(const Block *block, const Block *successor, const Graph &graph)
Runtime::FunctionId GetBuiltinForStackCheckKind(StackCheckKind kind)
Node::Uses::const_iterator begin(const Node::Uses &uses)
ref_traits< T >::ref_type MakeRef(JSHeapBroker *broker, Tagged< T > object)
std::ostream & operator<<(std::ostream &os, AtomicMemoryOrder order)
const char * GetAbortReason(AbortReason reason)
auto PrintCollection(const T &collection) -> PrintIteratorRange< typename std::common_type< decltype(std::begin(collection)), decltype(std::end(collection))>::type >
bool is_signed(Condition cond)
#define SET_SUPPORTED(name, machine_name)
#define SWITCH_CASE(Name)
#define OPCODE_NAME(Name)
#define NON_TERMINATOR_CASE(op)
#define GENERIC_BINOP_LIST(V)
#define SUPPORTED_OPERATIONS_LIST(V)
#define TURBOSHAFT_OPERATION_LIST(V)
#define TURBOSHAFT_THROWING_STATIC_OUTPUTS_OPERATIONS_LIST(V)
#define TURBOSHAFT_OPERATION_LIST_NOT_BLOCK_TERMINATOR(V)
#define GENERIC_UNOP_LIST(V)
#define DCHECK_NOT_NULL(val)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
void PrintOptions(std::ostream &os) const
void PrintOptions(std::ostream &os) const
V< WordPtr > index() const
OptionalOpIndex expected() const
V< WordPtr > base() const
void PrintInputs(std::ostream &os, const std::string &op_index_prefix) const
MemoryRepresentation memory_rep
RegisterRepresentation in_out_rep
void PrintOptions(std::ostream &os) const
V< WordPtr > base() const
void PrintOptions(std::ostream &os) const
OptionalV< Word32 > value_high() const
OptionalV< Word32 > value_low() const
OptionalV< WordPtr > index() const
void PrintInputs(std::ostream &os, const std::string &op_index_prefix) const
size_t hash_value(HashingStrategy strategy=HashingStrategy::kDefault) const
const TSCallDescriptor * descriptor
size_t hash_value(HashingStrategy strategy=HashingStrategy::kDefault) const
V< CallTarget > callee() const
void PrintOptions(std::ostream &os) const
V8_EXPORT_PRIVATE bool IsStackCheck(const Graph &graph, JSHeapBroker *broker, StackCheckKind kind) const
@ kSignedFloatTruncateOverflowToMin
@ kJSFloat16ChangeWithBitcast
@ kJSFloat16TruncateWithBitcast
@ kUnsignedFloatTruncateOverflowToMin
@ kFloat64ToAdditiveSafeInteger
size_t hash_value(HashingStrategy strategy=HashingStrategy::kDefault) const
Block * didnt_throw_block
V8_EXPORT_PRIVATE void Validate(const Graph &graph) const
V< Any > throwing_operation() const
void PrintOptions(std::ostream &os) const
void PrintOptions(std::ostream &os) const
@ kUnsignedLessThanOrEqual
i::Float64 number() const
i::Float64 float64() const
i::Float32 float32() const
int32_t tagged_index() const
@ kRelocatableWasmCanonicalSignatureId
@ kRelocatableWasmIndirectCallTarget
@ kRelocatableWasmStubCall
IndirectHandle< i::HeapObject > handle() const
i::Tagged< Smi > smi() const
void PrintOptions(std::ostream &os) const
union v8::internal::compiler::turboshaft::ConstantOp::Storage storage
ExternalReference external_reference() const
void PrintOptions(std::ostream &os) const
ExternalPointerTagRange tag_range
const DeoptimizeParameters * parameters
void PrintOptions(std::ostream &os) const
V8_EXPORT_PRIVATE void Validate(const Graph &graph) const
OpIndex throwing_operation() const
base::Vector< const RegisterRepresentation > outputs_rep() const
bool after_raw_heap_access
bool before_raw_heap_access
bool load_off_heap_memory
bool store_off_heap_memory
@ kFindOrderedHashMapEntryForInt32Key
@ kFindOrderedHashMapEntry
@ kFindOrderedHashSetEntry
void PrintOptions(std::ostream &os) const
static V8_EXPORT_PRIVATE bool IsSupported(Kind kind, FloatRepresentation rep)
OpIndex parent_frame_state() const
V8_EXPORT_PRIVATE void PrintOptions(std::ostream &os) const
base::Vector< const OpIndex > state_values() const
V8_EXPORT_PRIVATE void Validate(const Graph &graph) const
size_t hash_value(HashingStrategy strategy=HashingStrategy::kDefault) const
MachineType machine_type() const
void PrintOptions(std::ostream &os) const
MemoryRepresentation loaded_rep
RegisterRepresentation result_rep
OptionalOpIndex index() const
void PrintInputs(std::ostream &os, const std::string &op_index_prefix) const
uint8_t element_size_log2
void PrintOptions(std::ostream &os) const
AtomicMemoryOrder memory_order
@ kReceiverOrNullOrUndefined
EffectDimensions consumes
EffectDimensions produces
const char * op_index_prefix
V8_INLINE OpIndex & input(size_t i)
size_t hash_value(HashingStrategy strategy=HashingStrategy::kDefault) const
size_t HashWithOptions(const Args &... args) const
static const Opcode opcode
void PrintOptions(std::ostream &os) const
std::string ToString() const
bool IsProtectedLoad() const
void PrintInputs(std::ostream &os, const std::string &op_index_prefix) const
bool IsOnlyUserOf(const Operation &value, const Graph &graph) const
const uint16_t input_count
base::Vector< const OpIndex > inputs() const
const underlying_operation_t< Op > * TryCast() const
underlying_operation_t< Op > & Cast()
base::Vector< const RegisterRepresentation > outputs_rep() const
void PrintOptions(std::ostream &os) const
void PrintOptions(std::ostream &os) const
void PrintOptions(std::ostream &os) const
OptionalOpIndex index() const
MemoryRepresentation stored_rep
WriteBarrierKind write_barrier
void PrintInputs(std::ostream &os, const std::string &op_index_prefix) const
bool maybe_initializing_or_transitioning
uint8_t element_size_log2
void PrintOptions(std::ostream &os) const
V8_EXPORT_PRIVATE void Validate(const Graph &graph) const
size_t hash_value(HashingStrategy strategy=HashingStrategy::kDefault) const
base::Vector< Case > cases
const TSCallDescriptor * descriptor
void PrintOptions(std::ostream &os) const
@ kSignedFloatTruncateOverflowUndefined
@ kUnsignedFloatTruncateOverflowUndefined
void PrintOptions(std::ostream &os) const
CheckForMinusZeroMode mode
void PrintOptions(std::ostream &os) const
@ kUnsignedMulOverflownBits
@ kSignedMulOverflownBits
void PrintOptions(std::ostream &os) const
static V8_EXPORT_PRIVATE bool IsSupported(Kind kind, WordRepresentation rep)