5#ifndef V8_COMPILER_TURBOSHAFT_ASSEMBLER_H_
6#define V8_COMPILER_TURBOSHAFT_ASSEMBLER_H_
63#ifdef V8_ENABLE_WEBASSEMBLY
75template <
class AssemblerT>
103template <
typename It,
typename A>
105 { iterator.Begin(assembler) } -> std::same_as<typename It::iterator_type>;
107 iterator.IsEnd(assembler,
typename It::iterator_type{})
108 } -> std::same_as<OptionalV<Word32>>;
110 iterator.Advance(assembler,
typename It::iterator_type{})
111 } -> std::same_as<typename It::iterator_type>;
113 iterator.Dereference(assembler,
typename It::iterator_type{})
114 } -> std::same_as<typename It::value_type>;
138 template <
typename A>
140 return assembler.resolve(
begin_);
143 template <
typename A>
145 if constexpr (std::is_same_v<T, Word32>) {
146 return assembler.Uint32LessThanOrEqual(assembler.resolve(
end_),
149 static_assert(std::is_same_v<T, Word64>);
150 return assembler.Uint64LessThanOrEqual(assembler.resolve(
end_),
155 template <
typename A>
157 if constexpr (std::is_same_v<T, Word32>) {
158 return assembler.Word32Add(current_iterator, assembler.resolve(
stride_));
160 static_assert(std::is_same_v<T, Word64>);
161 return assembler.Word64Add(current_iterator, assembler.resolve(
stride_));
165 template <
typename A>
167 return current_iterator;
236 template <
typename A>
275template <
typename... Iterables>
278 using value_type = std::tuple<
typename Iterables::value_type...>;
283 template <
typename A>
286 iterables_, [&assembler](
auto& it) {
return it.Begin(assembler); });
289 template <
typename A>
295 [&assembler](
auto& it,
auto current) {
296 return it.IsEnd(assembler, current);
304 assembler.Word32BitwiseOr(acc.
value(), next.
value()));
308 template <
typename A>
311 [&assembler](
auto& it,
auto current) {
312 return it.Advance(assembler, current);
316 template <
typename A>
319 [&assembler](
auto& it,
auto current) {
320 return it.Dereference(assembler, current);
329template <
typename... Iterables>
330Zip(Iterables... iterables) ->
Zip<Iterables...>;
339 template <
typename T>
343 requires(std::is_same_v<T, OpIndex>)
355template <
typename A,
typename ConstOrValues>
356auto ResolveAll(
A& assembler,
const ConstOrValues& const_or_values) {
358 [&](
auto&...
args) {
return std::tuple{assembler.resolve(
args)...}; },
377 return std::get<0>(std::forward<std::tuple<T>>(tpl));
379template <
typename T1,
typename T2,
typename... Rest>
385template <
bool loop,
typename... Ts>
388 static constexpr size_t size =
sizeof...(Ts);
403 template <
typename A>
405 if (assembler.generating_unreachable_operations())
return;
407 Block* current_block = assembler.current_block();
413 template <
typename A>
416 if (assembler.generating_unreachable_operations())
return;
418 Block* current_block = assembler.current_block();
426 template <
typename A>
429 if (assembler.generating_unreachable_operations())
return;
431 Block* current_block = assembler.current_block();
439 template <
typename A>
443 return std::tuple_cat(std::tuple{
false},
values_t{});
463 :
data_(std::move(other.data_)),
469 if (data.block->IsBound()) {
477 template <
size_t... indices>
480 std::index_sequence<indices...>) {
482 std::initializer_list<size_t> sizes{
483 std::get<indices>(data.recorded_values).size()...};
489 sizes,
static_cast<size_t>(data.block->PredecessorCount() - 1)));
490 DCHECK_EQ(data.block->PredecessorCount() - 1, data.predecessors.size());
492 (std::get<indices>(data.recorded_values)
493 .push_back(std::get<indices>(values)),
495 data.predecessors.push_back(source);
498 template <
typename A>
501 std::make_index_sequence<size>());
504 template <
typename A,
size_t... indices>
506 std::index_sequence<indices...>) {
507 size_t predecessor_count = data.block->PredecessorCount();
508 DCHECK_EQ(data.predecessors.size(), predecessor_count);
510 if constexpr (size == 0)
return values_t{};
515 if (predecessor_count == 1) {
516 return values_t{std::get<indices>(data.recorded_values)[0]...};
529template <
typename... Ts>
537 template <
typename Reducer>
543template <
typename... Ts>
553 template <
typename Reducer>
555 :
super(reducer->Asm().NewBlock()),
559 :
super(std::move(other)),
565 template <
typename A>
567 if (assembler.generating_unreachable_operations())
return;
572 Block* current_block = assembler.current_block();
583 template <
typename A>
586 if (assembler.generating_unreachable_operations())
return;
591 Block* current_block = assembler.current_block();
604 template <
typename A>
607 if (assembler.generating_unreachable_operations())
return;
612 Block* current_block = assembler.current_block();
625 template <
typename A>
631 template <
typename A>
635 return std::tuple_cat(std::tuple{
false},
values_t{});
641 return std::tuple_cat(std::tuple{
true}, pending_loop_phis);
644 template <
typename A>
651 if (std::get<0>(bind_result)) {
653 DCHECK_EQ(assembler.current_block(), this->super::block());
665 template <
typename A>
668 std::make_index_sequence<super::size>());
671 template <
typename A,
size_t... indices>
673 std::index_sequence<indices...>) {
674 size_t predecessor_count = data.block->PredecessorCount();
675 USE(predecessor_count);
676 DCHECK_EQ(data.predecessors.size(), predecessor_count);
682 std::get<indices>(data.recorded_values)[0])...};
686 template <
typename A>
695 template <
size_t I,
typename A>
700 assembler.output_graph()
705 assembler.output_graph().template Replace<PhiOp>(
708 {pending_loop_phi.
first(), std::get<I>(values)}),
709 pending_loop_phi.
rep);
725template <
typename... Ts>
736template <
typename Next>
747 template <
typename Next>
766template <
class Assembler>
773template <
typename Reducers>
782template <
typename ReducerList>
807template <
typename Next>
813#define TURBOSHAFT_REDUCER_GENERIC_BOILERPLATE(Name) \
814 using ReducerList = typename Next::ReducerList; \
815 using assembler_t = compiler::turboshaft::Assembler<ReducerList>; \
816 assembler_t& Asm() { return *static_cast<assembler_t*>(this); } \
818 using ScopedVar = compiler::turboshaft::ScopedVar<T, assembler_t>; \
819 using CatchScope = compiler::turboshaft::CatchScopeImpl<assembler_t>; \
820 static constexpr auto& ReducerName() { return #Name; }
823#define TURBOSHAFT_REDUCER_BOILERPLATE(Name) \
824 TURBOSHAFT_REDUCER_GENERIC_BOILERPLATE(Name) \
825 using node_t = typename Next::node_t; \
826 using block_t = typename Next::block_t;
828template <
class T,
class Assembler>
833 template <
typename Reducer>
836 template <
typename Reducer>
858 template <
typename U>
861 implicitly_constructible_from<T>::value {
864 template <
typename U>
867 implicitly_constructible_from<T>::value {
870 template <
typename U>
873 v_traits<
U>::template implicitly_constructible_from<T>::value)
884template <
typename T,
typename Assembler>
896 using Base::operator=;
910#define LABEL_BLOCK(label) \
911 for (; false; UNREACHABLE()) \
924class EmitProjectionReducer
925 :
public UniformReducerAdapter<EmitProjectionReducer, Next> {
935 return Next::ReduceCatchBlockBegin();
938 template <
Opcode opcode,
typename Continuation,
typename... Args>
940 OpIndex new_idx = Continuation{
this}.Reduce(
args...);
941 const Operation& op = Asm().output_graph().Get(new_idx);
953 if (op.outputs_rep().size() > 1) {
955 auto reps = op.outputs_rep();
956 for (
int i = 0; i < static_cast<int>(reps.size());
i++) {
957 projections.
push_back(Asm().Projection(idx,
i, reps[
i]));
980 template <class Op, class... Args>
982 static_assert((std::is_base_of<Operation, Op>::value));
983 static_assert(!(std::is_same<Op, Operation>::value));
985 OpIndex result = Asm().output_graph().next_operation_index();
986 Op& op = Asm().output_graph().template Add<Op>(
args...);
987 Asm().output_graph().operation_origins()[
result] =
988 Asm().current_operation_origin();
990 if (
v8_flags.turboshaft_trace_intermediate_reductions) {
991 std::cout << std::setw(Asm().intermediate_tracing_depth()) <<
' ' <<
"["
992 << ReducerName() <<
"]: emitted " << op <<
"\n";
994 op_to_block_[
result] = Asm().current_block();
997 if (op.IsBlockTerminator()) Asm().FinalizeBlock();
1004 &Asm().output_graph()};
1006 bool ValidInputs(
OpIndex op_idx) {
1007 const Operation& op = Asm().output_graph().Get(op_idx);
1009 auto pred_blocks = Asm().current_block()->Predecessors();
1010 for (
size_t i = 0;
i < phi->input_count; ++
i) {
1011 Block* input_block = op_to_block_[phi->input(
i)];
1012 Block* pred_block = pred_blocks[
i];
1014 std::cerr <<
"Input #" << phi->input(
i).id()
1015 <<
" does not dominate predecessor B"
1016 << pred_block->
index().
id() <<
".\n";
1017 std::cerr << op_idx.
id() <<
": " << op <<
"\n";
1023 Block* input_block = op_to_block_[input];
1024 if (input_block->GetCommonDominator(Asm().current_block()) !=
1026 std::cerr <<
"Input #" << input.id()
1027 <<
" does not dominate its use.\n";
1028 std::cerr << op_idx.
id() <<
": " << op <<
"\n";
1039template <
typename T>
1041 static_assert(!std::is_same_v<std::remove_reference_t<T>,
OpIndex>);
1042 return std::forward<T>(value);
1047template <
typename T>
1055template <
typename T>
1063template <
class Next>
1068#define EMIT_OP(Name) \
1069 OpIndex ReduceInputGraph##Name(OpIndex ig_index, const Name##Op& op) { \
1070 return this->Asm().AssembleOutputGraph##Name(op); \
1072 template <class... Args> \
1073 OpIndex Reduce##Name(Args... args) { \
1074 return this->Asm().template Emit<Name##Op>(detail::MakeShadowy(args)...); \
1084template <
class Next>
1085class GenericReducerBase :
public ReducerBaseForwarder<Next> {
1105 Asm().output_graph().RemoveLast();
1109 Block* output_graph_loop) {
1117 auto& pending_phi = Asm()
1128 pending_phi.first() != Asm().MapToNewGraph(input_phi.
input(0)),
1129 output_graph_loop->has_peeled_iteration());
1131 Asm().output_graph().template Replace<PhiOp>(
1134 {pending_phi.first(), Asm().MapToNewGraph(input_phi.
input(1))}),
1140 DCHECK(Asm().current_block()->IsMerge() &&
1141 inputs.size() == Asm().current_block()->Predecessors().
size());
1142 return Base::ReducePhi(inputs, rep);
1146 DCHECK(Asm().current_block()->IsLoop());
1147 return Base::ReducePendingLoopPhi(first, rep);
1157 Block* saved_current_block = Asm().current_block();
1159 Asm().AddPredecessor(saved_current_block,
destination,
false);
1170 Block* saved_current_block = Asm().current_block();
1172 Base::ReduceBranch(
condition, if_true, if_false, hint);
1173 Asm().AddPredecessor(saved_current_block, if_true,
true);
1174 Asm().AddPredecessor(saved_current_block, if_false,
true);
1179 Block* current_block = Asm().current_block();
1187 return Base::ReduceCatchBlockBegin();
1196 V<Object> catch_begin = predecessor->begin();
1210 std::unordered_set<Block*> seen;
1212 for (
auto switch_case : cases) {
1213 DCHECK_EQ(seen.count(switch_case.destination), 0);
1214 seen.insert(switch_case.destination);
1217 Block* saved_current_block = Asm().current_block();
1219 Base::ReduceSwitch(input, cases,
default_case, default_hint);
1221 Asm().AddPredecessor(saved_current_block, c.destination,
true);
1223 Asm().AddPredecessor(saved_current_block,
default_case,
true);
1232 Base::ReduceCall(callee, frame_state, arguments, descriptor, effects);
1233 bool has_catch_block =
false;
1239 effects = effects.RequiredWhenUnused();
1242 return ReduceDidntThrow(raw_call, has_catch_block, &descriptor->out_reps,
1251 OpIndex raw_call = Base::ReduceFastApiCall(
1252 frame_state, data_argument, context, arguments, parameters, out_reps);
1254 return ReduceDidntThrow(raw_call, has_catch_block,
1263#define REDUCE_THROWING_OP(Name) \
1264 template <typename... Args> \
1265 V<Any> Reduce##Name(Args... args) { \
1266 OpIndex raw_op_index = Base::Reduce##Name(args...); \
1267 bool has_catch_block = CatchIfInCatchScope(raw_op_index); \
1268 const Name##Op& raw_op = \
1269 Asm().output_graph().Get(raw_op_index).template Cast<Name##Op>(); \
1270 return ReduceDidntThrow(raw_op_index, has_catch_block, &raw_op.kOutReps, \
1271 raw_op.Effects()); \
1274#undef REDUCE_THROWING_OP
1280 using Base::ReduceDidntThrow;
1282 Block* catch_block) {
1286 Block* saved_current_block = Asm().current_block();
1288 Base::ReduceCheckException(throwing_operation, successor, catch_block);
1289 Asm().AddPredecessor(saved_current_block, successor,
true);
1290 Asm().AddPredecessor(saved_current_block, catch_block,
true);
1295 if (Asm().current_catch_block()) {
1296 Block* successor = Asm().NewBlock();
1297 ReduceCheckException(throwing_operation, successor,
1298 Asm().current_catch_block());
1299 Asm().BindReachable(successor);
1308template <
typename LoopLabel,
typename Iterable,
typename Iterator,
1309 typename ValueTuple,
size_t... Indices>
1312 Iterator current_iterator, ValueTuple current_values,
1313 std::index_sequence<Indices...>) {
1314 return std::make_tuple(bound, std::forward<Iterable>(iterable),
1315 std::forward<LoopLabel>(loop_header),
1316 std::move(loop_exit), current_iterator,
1317 std::get<Indices>(current_values)...);
1320template <
typename LoopLabel,
typename Iterable,
typename Iterator,
1323 Label<> loop_exit, Iterator current_iterator,
1324 Value current_value) {
1325 return std::make_tuple(bound, std::forward<Iterable>(iterable),
1326 std::forward<LoopLabel>(loop_header),
1327 std::move(loop_exit), current_iterator, current_value);
1330template <
typename LoopLabel,
typename Iterable,
typename Iterator,
1333 Label<> loop_exit, Iterator current_iterator,
1334 std::tuple<Values...> current_values) {
1335 static_assert(std::tuple_size_v<Iterator> ==
sizeof...(Values));
1337 std::forward<LoopLabel>(loop_header),
1338 std::move(loop_exit), std::move(current_iterator),
1339 std::move(current_values),
1340 std::make_index_sequence<
sizeof...(Values)>{});
1345template <
typename Assembler>
1354 template <
typename L>
1358 static_assert(!L::is_loop);
1362 template <
typename L>
1366 static_assert(L::is_loop);
1370 template <
typename L>
1372 static_assert(L::is_loop);
1376 template <ForeachIterable<assembler_t> It>
1387 It temp_copy = iterable;
1391 DCHECK_EQ(next_index,
Asm().output_graph().next_operation_index());
1397 typename It::iterator_type
begin = iterable.Begin(
Asm());
1401 auto bound_and_current_iterator = loop_header.BindLoop(
Asm());
1410 typename It::value_type current_value =
1411 iterable.Dereference(
Asm(), current_iterator);
1414 bound, std::move(iterable), std::move(loop_header),
1415 std::move(loop_exit), current_iterator, current_value);
1418 template <ForeachIterable<assembler_t> It>
1421 Label<>& exit_label,
typename It::iterator_type current_iterator) {
1422 typename It::iterator_type next_iterator =
1423 iterable.Advance(
Asm(), current_iterator);
1430 std::function<
V<Word32>()> cond_builder) {
1440 return std::make_tuple(bound, std::move(loop_header), std::move(loop_exit));
1443 template <
typename L1,
typename L2>
1445 static_assert(L1::is_loop);
1446 static_assert(!L2::is_loop);
1452 template <
typename L>
1454 const typename L::const_or_values_t& values) {
1456 label.Goto(
Asm(), resolved_values);
1459 template <
typename L>
1461 const typename L::const_or_values_t& values) {
1467 template <
typename L>
1470 const typename L::const_or_values_t& values) {
1487 return Asm().
Bind(then_block);
1496 return Asm().
Bind(then_block);
1500 block_t* else_block = state->else_block;
1501 state->else_block =
nullptr;
1502 return Asm().
Bind(else_block);
1506 if (
Asm().current_block() ==
nullptr)
return;
1511 if (state->else_block) {
1512 if (
Asm().Bind(state->else_block)) {
1520template <
typename Assembler>
1526 template <
typename... Args>
1537 return ReduceIfReachableWord32SignHint(input,
sign);
1551 return ReduceIfReachableGenericBinop(left, right,
frame_state, context,
1552 kind, lazy_deopt_on_throw);
1554#define DECL_GENERIC_BINOP(Name) \
1555 V<Object> Generic##Name( \
1556 V<Object> left, V<Object> right, V<turboshaft::FrameState> frame_state, \
1557 V<Context> context, LazyDeoptOnThrow lazy_deopt_on_throw) { \
1558 return GenericBinop(left, right, frame_state, context, \
1559 GenericBinopOp::Kind::k##Name, lazy_deopt_on_throw); \
1562#undef DECL_GENERIC_BINOP
1567 return ReduceIfReachableGenericUnop(input,
frame_state, context,
kind,
1568 lazy_deopt_on_throw);
1570#define DECL_GENERIC_UNOP(Name) \
1571 V<Object> Generic##Name( \
1572 V<Object> input, V<turboshaft::FrameState> frame_state, \
1573 V<Context> context, LazyDeoptOnThrow lazy_deopt_on_throw) { \
1574 return GenericUnop(input, frame_state, context, \
1575 GenericUnopOp::Kind::k##Name, lazy_deopt_on_throw); \
1578#undef DECL_GENERIC_UNOP
1584 return ReduceIfReachableToNumberOrNumeric(input,
frame_state, context,
kind,
1585 lazy_deopt_on_throw);
1591 lazy_deopt_on_throw);
1598 lazy_deopt_on_throw);
1601#define DECL_MULTI_REP_BINOP(name, operation, rep_type, kind) \
1602 OpIndex name(OpIndex left, OpIndex right, rep_type rep) { \
1603 return ReduceIfReachable##operation(left, right, \
1604 operation##Op::Kind::k##kind, rep); \
1607#define DECL_MULTI_REP_BINOP_V(name, operation, kind, tag) \
1608 V<tag> name(V<tag> left, V<tag> right, v_traits<tag>::rep_type rep) { \
1609 return ReduceIfReachable##operation(left, right, \
1610 operation##Op::Kind::k##kind, rep); \
1613#define DECL_SINGLE_REP_BINOP_V(name, operation, kind, tag) \
1614 V<tag> name(ConstOrV<tag> left, ConstOrV<tag> right) { \
1615 return ReduceIfReachable##operation(resolve(left), resolve(right), \
1616 operation##Op::Kind::k##kind, \
1674 return Word32BitwiseXor(input,
static_cast<uint32_t
>(-1));
1679 return ReduceIfReachableWordBinop(left, right,
kind,
rep);
1684 return ReduceIfReachableOverflowCheckedBinop(left, right,
kind,
rep);
1687#define DECL_MULTI_REP_CHECK_BINOP_V(name, operation, kind, tag) \
1688 V<turboshaft::Tuple<tag, Word32>> name(V<tag> left, V<tag> right, \
1689 v_traits<tag>::rep_type rep) { \
1690 return ReduceIfReachable##operation(left, right, \
1691 operation##Op::Kind::k##kind, rep); \
1693#define DECL_SINGLE_REP_CHECK_BINOP_V(name, operation, kind, tag) \
1694 V<turboshaft::Tuple<tag, Word32>> name(ConstOrV<tag> left, \
1695 ConstOrV<tag> right) { \
1696 return ReduceIfReachable##operation(resolve(left), resolve(right), \
1697 operation##Op::Kind::k##kind, \
1718#undef DECL_MULTI_REP_CHECK_BINOP_V
1719#undef DECL_SINGLE_REP_CHECK_BINOP_V
1745 return ReduceIfReachableShift(left, right,
kind,
rep);
1748#define DECL_SINGLE_REP_SHIFT_V(name, kind, tag) \
1749 V<tag> name(ConstOrV<tag> left, ConstOrV<Word32> right) { \
1750 return ReduceIfReachableShift(resolve(left), resolve(right), \
1751 ShiftOp::Kind::k##kind, V<tag>::rep); \
1816#define DECL_SINGLE_REP_EQUAL_V(name, tag) \
1817 V<Word32> name(ConstOrV<tag> left, ConstOrV<tag> right) { \
1818 return ReduceIfReachableComparison(resolve(left), resolve(right), \
1819 ComparisonOp::Kind::kEqual, \
1827#undef DECL_SINGLE_REP_EQUAL_V
1829#define DECL_SINGLE_REP_COMPARISON_V(name, kind, tag) \
1830 V<Word32> name(ConstOrV<tag> left, ConstOrV<tag> right) { \
1831 return ReduceIfReachableComparison(resolve(left), resolve(right), \
1832 ComparisonOp::Kind::k##kind, \
1874#undef DECL_SINGLE_REP_COMPARISON_V
1878 return ReduceIfReachableComparison(left, right,
kind,
rep);
1881#undef DECL_SINGLE_REP_BINOP_V
1882#undef DECL_MULTI_REP_BINOP
1886 return ReduceIfReachableFloatUnary(input,
kind,
rep);
1889 return ReduceIfReachableFloatUnary(input,
kind,
1893#define DECL_MULTI_REP_UNARY(name, operation, rep_type, kind) \
1894 OpIndex name(OpIndex input, rep_type rep) { \
1895 return ReduceIfReachable##operation(input, operation##Op::Kind::k##kind, \
1898#define DECL_MULTI_REP_UNARY_V(name, operation, rep_type, kind, tag) \
1899 V<tag> name(V<tag> input, rep_type rep) { \
1900 return ReduceIfReachable##operation(input, operation##Op::Kind::k##kind, \
1903#define DECL_SINGLE_REP_UNARY_V(name, operation, kind, tag) \
1904 V<tag> name(ConstOrV<tag> input) { \
1905 return ReduceIfReachable##operation( \
1906 resolve(input), operation##Op::Kind::k##kind, V<tag>::rep); \
1991 return ReduceIfReachableOverflowCheckedUnary(input,
kind,
rep);
2001#undef DECL_SINGLE_REP_UNARY_V
2002#undef DECL_MULTI_REP_UNARY
2003#undef DECL_MULTI_REP_UNARY_V
2011 return ReduceIfReachableWordBinopDeoptOnOverflow(left, right,
frame_state,
2014#define DECL_SINGLE_REP_BINOP_DEOPT_OVERFLOW(operation, rep_type) \
2015 OpIndex rep_type##operation##DeoptOnOverflow( \
2016 ConstOrV<rep_type> left, ConstOrV<rep_type> right, \
2017 V<turboshaft::FrameState> frame_state, FeedbackSource feedback, \
2018 CheckForMinusZeroMode mode = \
2019 CheckForMinusZeroMode::kDontCheckForMinusZero) { \
2020 return WordBinopDeoptOnOverflow( \
2021 resolve(left), resolve(right), frame_state, \
2022 WordBinopDeoptOnOverflowOp::Kind::k##operation, \
2023 WordRepresentation::rep_type(), feedback, mode); \
2043#undef DECL_SINGLE_REP_BINOP_DEOPT_OVERFLOW
2047 return ReduceIfReachableBitcastWord32PairToFloat64(
resolve(high_word32),
2053 return ReduceIfReachableTaggedBitcast(input, from, to,
kind);
2056#define DECL_TAGGED_BITCAST(FromT, ToT, kind) \
2057 V<ToT> Bitcast##FromT##To##ToT(V<FromT> input) { \
2058 return TaggedBitcast(input, V<FromT>::rep, V<ToT>::rep, \
2059 TaggedBitcastOp::Kind::kind); \
2067#undef DECL_TAGGED_BITCAST
2086 return ReduceIfReachableObjectIs(input,
kind, input_assumptions);
2088#define DECL_OBJECT_IS(kind) \
2089 V<Word32> ObjectIs##kind(V<Object> object) { \
2090 return ObjectIs(object, ObjectIsOp::Kind::k##kind, \
2091 ObjectIsOp::InputAssumptions::kNone); \
2112#undef DECL_OBJECT_IS
2115 return ReduceIfReachableFloat64Is(input,
kind);
2130 return ReduceIfReachableObjectIsNumericValue(input,
kind, input_rep);
2134 return ReduceIfReachableConvert(input, from, to);
2158 return ReduceIfReachableConvertUntaggedToJSPrimitive(
2159 input,
kind, input_rep, input_interpretation, minus_zero_mode);
2161#define CONVERT_PRIMITIVE_TO_OBJECT(name, kind, input_rep, \
2162 input_interpretation) \
2163 V<kind> name(V<input_rep> input) { \
2164 return V<kind>::Cast(ConvertUntaggedToJSPrimitive( \
2165 input, ConvertUntaggedToJSPrimitiveOp::JSPrimitiveKind::k##kind, \
2166 RegisterRepresentation::input_rep(), \
2167 ConvertUntaggedToJSPrimitiveOp::InputInterpretation:: \
2168 k##input_interpretation, \
2169 CheckForMinusZeroMode::kDontCheckForMinusZero)); \
2176#undef CONVERT_PRIMITIVE_TO_OBJECT
2191 input_interpretation,
2193 return ReduceIfReachableConvertUntaggedToJSPrimitiveOrDeopt(
2201 return ReduceIfReachableConvertJSPrimitiveToUntagged(primitive,
kind,
2210 return ReduceIfReachableConvertJSPrimitiveToUntaggedOrDeopt(
2211 object,
frame_state, from_kind, to_kind, minus_zero_mode, feedback);
2226 return ReduceIfReachableTruncateJSPrimitiveToUntagged(
object,
kind,
2242 return ReduceIfReachableTruncateJSPrimitiveToUntaggedOrDeopt(
2250 return ReduceIfReachableConvertJSPrimitiveToObject(value,
native_context,
2251 global_proxy, mode);
2271 switch (
rep.value()) {
2293 if (std::isnan(value)) {
2306 if (std::isnan(value)) {
2316 switch (
rep.value()) {
2329 if (std::isnan(value)) {
2338 uint64_t{
static_cast<uint32_t
>(
value)});
2342 template <
typename T>
2349 template <
typename T>
2355 template <
typename T>
2373 DCHECK(IsTrustedObject(*value));
2385 return ReduceIfReachableConstant(
2389 static_cast<uint64_t
>(value));
2398 return ReduceIfReachableConstant(
2400 static_cast<uint64_t
>(canonical_id));
2404 return ReduceIfReachableConstant(
2416 bool builtin_exit_frame =
false) {
2419 builtin_exit_frame));
2422 DCHECK(result_size >= 1 && result_size <= 3);
2424 const int index = builtin_exit_frame ? 0 : result_size;
2427 isolate, result_size, argv_mode, builtin_exit_frame);
2432#define DECL_CHANGE_V(name, kind, assumption, from, to) \
2433 V<to> name(ConstOrV<from> input) { \
2434 return ReduceIfReachableChange(resolve(input), ChangeOp::Kind::kind, \
2435 ChangeOp::Assumption::assumption, \
2436 V<from>::rep, V<to>::rep); \
2438#define DECL_TRY_CHANGE_V(name, kind, from, to) \
2439 V<turboshaft::Tuple<to, Word32>> name(V<from> input) { \
2440 return ReduceIfReachableTryChange(input, TryChangeOp::Kind::kind, \
2441 V<from>::rep, V<to>::rep); \
2489 return ChangeUint32ToUint64(value);
2492 if constexpr (
Is64()) {
2493 return TruncateWord64ToWord32(input);
2500 if constexpr (
Is64()) {
2501 return ChangeInt32ToInt64(input);
2508 if constexpr (
Is64()) {
2509 return ChangeUint32ToUint64(input);
2517 if constexpr (
Is64()) {
2521 return ChangeInt32ToInt64(input);
2526 if constexpr (
Is64()) {
2530 return ChangeUint32ToUint64(input);
2539 return WordPtrEqual(
2544#define DECL_SIGNED_FLOAT_TRUNCATE(FloatBits, ResultBits) \
2546 TruncateFloat##FloatBits##ToInt##ResultBits##OverflowUndefined, \
2547 kSignedFloatTruncateOverflowToMin, kNoOverflow, Float##FloatBits, \
2549 DECL_TRY_CHANGE_V(TryTruncateFloat##FloatBits##ToInt##ResultBits, \
2550 kSignedFloatTruncateOverflowUndefined, Float##FloatBits, \
2557#undef DECL_SIGNED_FLOAT_TRUNCATE
2565#define DECL_UNSIGNED_FLOAT_TRUNCATE(FloatBits, ResultBits) \
2567 TruncateFloat##FloatBits##ToUint##ResultBits##OverflowUndefined, \
2568 kUnsignedFloatTruncateOverflowToMin, kNoOverflow, Float##FloatBits, \
2570 DECL_CHANGE_V(TruncateFloat##FloatBits##ToUint##ResultBits##OverflowToMin, \
2571 kUnsignedFloatTruncateOverflowToMin, kNoAssumption, \
2572 Float##FloatBits, Word##ResultBits) \
2573 DECL_TRY_CHANGE_V(TryTruncateFloat##FloatBits##ToUint##ResultBits, \
2574 kUnsignedFloatTruncateOverflowUndefined, Float##FloatBits, \
2581#undef DECL_UNSIGNED_FLOAT_TRUNCATE
2596#undef DECL_TRY_CHANGE_V
2604 minus_zero_mode, feedback);
2613 minus_zero_mode, feedback));
2621 minus_zero_mode, feedback));
2629 minus_zero_mode, feedback));
2637 minus_zero_mode, feedback));
2647 return BitcastWord32ToSmi(shifted);
2649 return BitcastWordPtrToSmi(
2657 return Word32ShiftRightArithmeticShiftOutZeros(BitcastSmiToWord32(input),
2661 BitcastSmiToWordPtr(input), kSmiShiftBits));
2669 DCHECK_NE(bin_op, AtomicRMWOp::BinOp::kCompareExchange);
2671 bin_op, in_out_rep, memory_rep,
2672 memory_access_kind);
2680 return ReduceIfReachableAtomicRMW(
2681 base, index, new_value, expected, AtomicRMWOp::BinOp::kCompareExchange,
2682 result_rep, input_rep, memory_access_kind);
2691 return ReduceIfReachableAtomicWord32Pair(
base, index, value_low, value_high,
2692 expected_low, expected_high,
2723 return ReduceIfReachableMemoryBarrier(memory_order);
2729 uint8_t element_size_log2 = 0) {
2730 return ReduceIfReachableLoad(
base, index,
kind, loaded_rep, result_rep,
2731 offset, element_size_log2);
2736 uint8_t element_size_log2 = 0) {
2755 rep.SizeInBytesLog2());
2768 offset, index.valid() ? element_size_log2 : 0);
2782#if V8_ENABLE_SANDBOX
2793 IsolateData::trusted_pointer_table_offset() +
2819#ifdef V8_ENABLE_SANDBOX
2871 int32_t
offset = 0, uint8_t element_size_log2 = 0,
2872 bool maybe_initializing_or_transitioning =
false,
2874 ReduceIfReachableStore(
base, index, value,
kind, stored_rep, write_barrier,
2875 offset, element_size_log2,
2876 maybe_initializing_or_transitioning,
2877 maybe_indirect_pointer_tag);
2882 int32_t
offset = 0,
bool maybe_initializing_or_transitioning =
false,
2885 offset, 0, maybe_initializing_or_transitioning,
2886 maybe_indirect_pointer_tag);
2889 template <
typename T>
2893 return Store(
object.
object(), value,
2895 stored_rep, write_barrier,
offset,
true);
2909 template <
typename Rep = Any>
2912 return LoadFieldImpl<Rep>(
object, access);
2915 template <
typename Rep = Any>
2918 return LoadFieldImpl<Rep>(raw_base, access);
2921 template <
typename Obj,
typename Class,
typename T>
2924 implicitly_constructible_from<Obj>::value {
2925 return LoadFieldImpl<T>(
object, field);
2928 template <
typename Rep>
2933#ifdef V8_MAP_PACKING
2939#ifdef V8_ENABLE_SANDBOX
2940 bool is_sandboxed_external =
2941 access.type.Is(compiler::Type::ExternalPointer());
2942 if (is_sandboxed_external) {
2949 if (access.is_immutable) {
2953#ifdef V8_ENABLE_SANDBOX
2954 if (is_sandboxed_external) {
2957 if (access.is_bounded_size_access) {
2958 DCHECK(!is_sandboxed_external);
2984 heap_number, AccessBuilderTS::ForHeapNumberValue());
2989 heap_number, AccessBuilderTS::ForHeapInt32Value());
2992 template <
typename Type = Object>
3000 template <
typename Base>
3003 access.maybe_initializing_or_transitioning_store);
3006 template <
typename Object,
typename Class,
typename T>
3016 template <
typename T>
3022 template <
typename Base>
3024 bool maybe_initializing_or_transitioning) {
3028 static_assert(std::is_same_v<Base, WordPtr>);
3032 DCHECK(!access.type.Is(compiler::Type::ExternalPointer()) ||
3035 DCHECK(!access.type.Is(compiler::Type::SandboxedPointer()));
3037#ifdef V8_ENABLE_SANDBOX
3038 if (access.is_bounded_size_access) {
3048#ifdef V8_MAP_PACKING
3054 Store(
object, value,
kind,
rep, access.write_barrier_kind, access.offset,
3055 maybe_initializing_or_transitioning);
3082 template <
typename Class,
typename T>
3085 return LoadElement<T>(
object, access, index, access.is_array_buffer_load);
3090 template <
typename T = Any,
typename Base>
3097 template <
typename T = Any,
typename Base>
3102 template <
typename Base>
3105 return WordPtrAdd(BitcastHeapObjectToWordPtr(
object),
3106 access.header_size - access.tag());
3109 template <
typename Base>
3112 return StoreElement(
object, access, index, value,
true);
3114 template <
typename Base>
3117 return StoreElement(
object, access, index, value,
false);
3120 template <
typename Class,
typename T>
3123 StoreElement(
object, access, index, value, access.is_array_buffer_load);
3126 template <
typename Class,
typename T>
3131 access.is_array_buffer_load);
3136 template <
typename Base>
3144 template <
typename Base>
3156 return __ Word32BitwiseAnd(bitfield, JSArrayBuffer::WasDetachedBit::kMask);
3159 template <
typename T = HeapObject>
3167 template <
typename T>
3171 return uninitialized.ReleaseObject();
3185 return ReduceIfReachableDecodeExternalPointer(
handle, tag);
3188#if V8_ENABLE_WEBASSEMBLY
3189 void WasmStackCheck(WasmStackCheckOp::Kind
kind) {
3190 ReduceIfReachableWasmStackCheck(
kind);
3212 return ReduceIfReachableStackPointerGreaterThan(limit,
kind);
3216 return ReduceIfReachableFrameConstant(
3223 return ReduceIfReachableFrameConstant(
3228 return ReduceIfReachableStackSlot(size, alignment, is_tagged);
3232#ifdef V8_ENABLE_DIRECT_HANDLE
3239 StackSlot(
sizeof(uintptr_t),
alignof(uintptr_t),
true);
3248 template <
typename T = Any,
typename U = T>
3253 return ReduceIfReachableSelect(
resolve(cond), vtrue, vfalse,
rep, hint,
3266#define DEF_SELECT(Rep) \
3267 V<Rep> Rep##Select(ConstOrV<Word32> cond, ConstOrV<Rep> vtrue, \
3268 ConstOrV<Rep> vfalse) { \
3269 return Select<Rep>(resolve(cond), resolve(vtrue), resolve(vfalse), \
3270 RegisterRepresentation::Rep(), BranchHint::kNone, \
3271 SelectOp::Implementation::kCMove); \
3280 template <
typename T,
typename U>
3285 V<std::common_type_t<T, U>>
::rep, hint,
3291 ReduceIfReachableSwitch(input, cases,
default_case, default_hint);
3296 const char* debug_name =
nullptr) {
3304 if (!cached_param.
valid()) {
3307 cached_param = ReduceIfReachableParameter(index,
rep, debug_name);
3312 return cached_param;
3314 template <
typename T>
3320 bool spill_caller_frame_slots =
false) {
3321 ReduceIfReachableReturn(pop_count, return_values, spill_caller_frame_slots);
3327 template <
typename R = AnyOrNone>
3332 return ReduceIfReachableCall(callee,
frame_state, arguments, descriptor,
3335 template <
typename R = AnyOrNone>
3343 template <
typename Descriptor>
3346 V<Context> context,
const typename Descriptor::arguments_t&
args,
3348 requires(Descriptor::kNeedsFrameState && Descriptor::kNeedsContext)
3352 return result_t::Invalid();
3356 auto arguments = std::apply(
3357 [context](
auto&&... as) {
3359 OpIndex, std::tuple_size_v<typename Descriptor::arguments_t> + 1>{
3360 std::forward<decltype(as)>(as)..., context};
3367 lazy_deopt_on_throw),
3368 Descriptor::kEffects));
3371 template <
typename Descriptor>
3374 const typename Descriptor::arguments_t&
args)
3375 requires(!Descriptor::kNeedsFrameState && Descriptor::kNeedsContext)
3379 return result_t::Invalid();
3382 auto arguments = std::apply(
3383 [context](
auto&&... as) {
3385 OpIndex, std::tuple_size_v<typename Descriptor::arguments_t> + 1>{
3386 std::forward<decltype(as)>(as)..., context};
3390 isolate, Descriptor::kFunction,
3394 Descriptor::kEffects));
3396 template <
typename Descriptor>
3399 const typename Descriptor::arguments_t&
args,
3401 requires(Descriptor::kNeedsFrameState && !Descriptor::kNeedsContext)
3405 return result_t::Invalid();
3408 auto arguments = std::apply(
3411 std::forward<decltype(as)>(as)...};
3418 lazy_deopt_on_throw),
3419 Descriptor::kEffects));
3421 template <
typename Descriptor>
3423 Isolate* isolate,
const typename Descriptor::arguments_t&
args)
3424 requires(!Descriptor::kNeedsFrameState && !Descriptor::kNeedsContext)
3428 return result_t::Invalid();
3430 auto arguments = std::apply(
3433 OpIndex, std::tuple_size_v<typename Descriptor::arguments_t>>{
3434 std::forward<decltype(as)>(as)...};
3438 isolate, Descriptor::kFunction,
3442 Descriptor::kEffects));
3445#if V8_ENABLE_WEBASSEMBLY
3447 template <
typename Descriptor>
3449 WasmCallBuiltinThroughJumptable(
const typename Descriptor::arguments_t&
args)
3450 requires(!Descriptor::kNeedsContext)
3452 static_assert(!Descriptor::kNeedsFrameState);
3455 return result_t::Invalid();
3457 auto arguments = std::apply(
3460 OpIndex, std::tuple_size_v<typename Descriptor::arguments_t>>{
3461 std::forward<decltype(as)>(as)...};
3464 V<WordPtr> call_target =
3466 return result_t::Cast(
3469 Descriptor::Create(StubCallMode::kCallWasmRuntimeStub,
3471 Descriptor::kEffects));
3474 template <
typename Descriptor>
3476 WasmCallBuiltinThroughJumptable(
V<Context> context,
3477 const typename Descriptor::arguments_t&
args)
3478 requires Descriptor::kNeedsContext
3480 static_assert(!Descriptor::kNeedsFrameState);
3483 return result_t::Invalid();
3486 auto arguments = std::apply(
3487 [context](
auto&&... as) {
3488 return base::SmallVector<
3489 OpIndex, std::tuple_size_v<typename Descriptor::arguments_t> + 1>{
3490 std::forward<decltype(as)>(as)..., context};
3493 V<WordPtr> call_target =
3495 return result_t::Cast(
3498 Descriptor::Create(StubCallMode::kCallWasmRuntimeStub,
3500 Descriptor::kEffects));
3514#define DECL_GENERIC_BINOP_BUILTIN_CALL(Name) \
3515 V<Object> CallBuiltin_##Name( \
3516 Isolate* isolate, V<turboshaft::FrameState> frame_state, \
3517 V<Context> context, V<Object> lhs, V<Object> rhs, \
3518 LazyDeoptOnThrow lazy_deopt_on_throw) { \
3519 return CallBuiltin<typename BuiltinCallDescriptor::Name>( \
3520 isolate, frame_state, context, {lhs, rhs}, lazy_deopt_on_throw); \
3523#undef DECL_GENERIC_BINOP_BUILTIN_CALL
3525#define DECL_GENERIC_UNOP_BUILTIN_CALL(Name) \
3526 V<Object> CallBuiltin_##Name(Isolate* isolate, \
3527 V<turboshaft::FrameState> frame_state, \
3528 V<Context> context, V<Object> input, \
3529 LazyDeoptOnThrow lazy_deopt_on_throw) { \
3530 return CallBuiltin<typename BuiltinCallDescriptor::Name>( \
3531 isolate, frame_state, context, {input}, lazy_deopt_on_throw); \
3534#undef DECL_GENERIC_UNOP_BUILTIN_CALL
3541 isolate,
frame_state, context, {input}, lazy_deopt_on_throw);
3548 isolate,
frame_state, context, {input}, lazy_deopt_on_throw);
3556 isolate, context, {object, allocated_type, node_id});
3567 isolate, context, {value});
3572 isolate, context, {value});
3578 isolate, context, {table,
key});
3584 isolate, context, {set,
key});
3589 isolate, {object, size});
3600 V<Smi> arguments_count) {
3603 isolate, {frame, formal_parameter_count, arguments_count});
3607 V<Smi> arguments_count) {
3610 isolate, {frame, formal_parameter_count, arguments_count});
3614 V<Smi> arguments_count) {
3617 isolate, {frame, formal_parameter_count, arguments_count});
3628 isolate,
frame_state, context, {input}, lazy_deopt_on_throw);
3638 isolate, {left, right});
3643 isolate, {left, right});
3649 isolate, context, {left, right});
3654 isolate, {left,
right, length});
3659 isolate, {left, right});
3664 isolate, {left, right});
3675 isolate, {
string, index});
3677#ifdef V8_INTL_SUPPORT
3682 isolate, context, {
string});
3701 isolate, context, {
object});
3710 lazy_deopt_on_throw);
3719 lazy_deopt_on_throw);
3726 isolate,
frame_state, context, {shared_function_info, feedback_cell});
3755 int num_args_no_spread,
V<Object> spread,
3761 arguments.push_back(spread);
3762 arguments.insert(arguments.end(), args_no_spread.begin(),
3763 args_no_spread.end());
3765 arguments.push_back(context);
3769 num_args_no_spread,
base::VectorOf(arguments), lazy_deopt_on_throw);
3778 constexpr int kNumberOfStackArguments = 1;
3785 lazy_deopt_on_throw);
3792 DCHECK(builtin == Builtin::kCallFunctionForwardVarargs ||
3793 builtin == Builtin::kCallForwardVarargs);
3798 arguments.insert(arguments.end(),
args.begin(),
args.end());
3799 arguments.push_back(context);
3806 template <
typename Descriptor>
3810 const typename Descriptor::arguments_t&
args)
3811 requires Descriptor::kNeedsFrameState
3819 isolate, Descriptor::kFunction,
3821 lazy_deopt_on_throw),
3824 template <
typename Descriptor>
3827 const typename Descriptor::arguments_t&
args)
3828 requires(!Descriptor::kNeedsFrameState)
3835 isolate, Descriptor::kFunction,
3841 template <
typename Ret,
typename Args>
3847 constexpr size_t kMaxNumArgs = 6;
3848 const size_t argc = std::tuple_size_v<Args>;
3849 static_assert(kMaxNumArgs >= argc);
3852 auto inputs = std::apply(
3854 return vector_t{std::forward<decltype(as)>(as)...};
3860 inputs.push_back(context);
3862 if constexpr (std::is_same_v<Ret, void>) {
3878 any_of(::Operation::kBitwiseNot, ::Operation::kNegate,
3879 ::Operation::kIncrement, ::Operation::kDecrement));
3885 isolate, context, {});
3911 isolate, context, {
string, index});
3913#ifdef V8_INTL_SUPPORT
3918 isolate, context, {
string});
3926 isolate,
frame_state, context, lazy_deopt_on_throw, {symbol});
3939 isolate, context, {object, target_map});
3944 isolate, context, {heap_object});
3948 return CallRuntime<
typename RuntimeCallDescriptor::
3949 TryMigrateInstanceAndMarkMapAsMigrationTarget>(
3972 isolate,
frame_state, context, lazy_deopt_on_throw,
3973 {constructor, function});
3979 isolate,
frame_state, context, lazy_deopt_on_throw, {});
3986 isolate,
frame_state, context, lazy_deopt_on_throw, {});
3994 isolate,
frame_state, context, lazy_deopt_on_throw, {value});
4000 isolate,
frame_state, context, lazy_deopt_on_throw, {});
4007 isolate, context, {shared_function_info, feedback_cell});
4014 isolate, context, {shared_function_info, feedback_cell});
4021 isolate,
frame_state, context, lazy_deopt_on_throw,
4022 {object, prototype});
4027 ReduceIfReachableTailCall(callee, arguments, descriptor);
4033 return ReduceIfReachableFrameState(inputs, inlined, data);
4068 ReduceIfReachableDeoptimize(
frame_state, parameters);
4081#if V8_ENABLE_WEBASSEMBLY
4106 ReduceIfReachableStaticAssert(
condition, source);
4110 return ReduceIfReachablePhi(inputs,
rep);
4116 template <
typename T>
4122 OpIndex* inputs_begin = inputs.data();
4127 return ReduceIfReachablePendingLoopPhi(first,
rep);
4129 template <
typename T>
4135 return ReduceIfReachableTuple(indices);
4140 template <
typename... Ts>
4142 std::initializer_list<V<Any>> inputs{
V<Any>::Cast(indices)...};
4153 return ReduceIfReachableProjection(tuple, index,
rep);
4155 template <uint16_t Index,
typename... Ts>
4159 "Representation for Projection cannot be inferred. Use "
4160 "overload with explicit Representation argument.");
4163 template <uint16_t Index,
typename... Ts>
4171 Type expected_type,
bool successful) {
4173 return ReduceIfReachableCheckTurboshaftTypeOf(input,
rep, expected_type,
4199 if (message !=
nullptr) {
4206 std::vector<FileAndLine> file_and_line;
4207 if (file !=
nullptr) {
4208 file_and_line.push_back({
file, line});
4216 const std::vector<FileAndLine>& files_and_lines,
4218 std::stringstream stream;
4219 if (message) stream << message;
4220 for (
auto it = files_and_lines.rbegin(); it != files_and_lines.rend();
4222 if (it->first !=
nullptr) {
4223 stream <<
" [" << it->first <<
":" << it->second <<
"]";
4244 ReduceIfReachableAbortCSADcheck(message);
4340 ReduceIfReachableBranch(
condition, if_true, if_false, hint);
4400 return ReduceIfReachableNewConsString(length, first,
second);
4404 return ReduceIfReachableNewArray(length,
kind, allocation_type);
4414 return ReduceIfReachableDoubleArrayMinMax(array,
kind);
4424 return ReduceIfReachableLoadFieldByIndex(
object, index);
4431 const char* file,
int line) {
4435 static constexpr size_t kMaxAssertCommentLength = 256;
4438 kMaxAssertCommentLength);
4440 condition_string, file, line);
4454 ReduceIfReachableDebugPrint(input,
rep);
4466 void Comment(
const char* message) { ReduceIfReachableComment(message); }
4468 size_t length = message.length() + 1;
4471 MemCopy(zone_buffer, message.c_str(), length);
4475 template <
typename... Args>
4477 if (!
v8_flags.code_comments)
return;
4478 std::ostringstream
s;
4479 USE(s << message.message, (s << std::forward<Args>(
args))...);
4480 if (message.loc.FileName()) {
4481 s <<
" - " << message.loc.ToString();
4491#define BIGINT_BINOP(kind) \
4492 V<BigInt> BigInt##kind(V<BigInt> left, V<BigInt> right, \
4493 V<turboshaft::FrameState> frame_state) { \
4494 return BigIntBinop(left, right, frame_state, \
4495 BigIntBinopOp::Kind::k##kind); \
4511 return ReduceIfReachableBigIntComparison(left, right,
kind);
4513#define BIGINT_COMPARE(kind) \
4514 V<Boolean> BigInt##kind(V<BigInt> left, V<BigInt> right) { \
4515 return BigIntComparison(left, right, BigIntComparisonOp::Kind::k##kind); \
4520#undef BIGINT_COMPARE
4523 return ReduceIfReachableBigIntUnary(input,
kind);
4532 return ReduceIfReachableWord32PairBinop(left_low, left_high, right_low,
4538 return ReduceIfReachableStringAt(
string,
position,
kind);
4547#ifdef V8_INTL_SUPPORT
4549 return ReduceIfReachableStringToCaseIntl(
string,
kind);
4552 return StringToCaseIntl(
string, StringToCaseIntlOp::Kind::kLower);
4555 return StringToCaseIntl(
string, StringToCaseIntlOp::Kind::kUpper);
4560 return ReduceIfReachableStringLength(
string);
4565 return ReduceIfReachableTypedArrayLength(typed_array, elements_kind);
4569 return ReduceIfReachableStringIndexOf(
string, search,
position);
4573 return ReduceIfReachableStringFromCodePointAt(
string, index);
4577 return ReduceIfReachableStringSubstring(
string,
start,
end);
4581 return ReduceIfReachableStringConcat(length, left, right);
4586 return ReduceIfReachableStringComparison(left, right,
kind);
4606 formal_parameter_count);
4611 int formal_parameter_count) {
4613 return ReduceIfReachableNewArgumentsElements(arguments_count, type,
4614 formal_parameter_count);
4619 return ReduceIfReachableLoadTypedElement(buffer,
base, external, index,
4626 return ReduceIfReachableLoadDataViewElement(
object, storage, index,
4627 is_little_endian, element_type);
4631 return ReduceIfReachableLoadStackArgument(
base, index);
4637 ReduceIfReachableStoreTypedElement(buffer,
base, external, index, value,
4645 ReduceIfReachableStoreDataViewElement(
4646 object, storage, index, value,
resolve(is_little_endian), element_type);
4653 ReduceIfReachableTransitionAndStoreArrayElement(array, index, value,
kind,
4654 fast_map, double_map);
4660 array, index, value,
4666 return ReduceIfReachableCompareMaps(heap_object, map, maps);
4673 ReduceIfReachableCheckMaps(heap_object,
frame_state, map, maps, flags,
4678 ReduceIfReachableAssumeMap(heap_object, maps);
4684 return ReduceIfReachableCheckedClosure(input,
frame_state, feedback_cell);
4689 ReduceIfReachableCheckEqualsInternalizedString(expected, value,
4706 return ReduceIfReachableLoadMessage(
offset);
4710 ReduceIfReachableStoreMessage(
offset,
object);
4715 return ReduceIfReachableSameValue(left, right, mode);
4719 return ReduceIfReachableFloat64SameValue(
resolve(left),
resolve(right));
4727 return ReduceIfReachableFastApiCall(
frame_state, data_argument, context,
4728 arguments, parameters, out_reps);
4732 ReduceIfReachableRuntimeAbort(reason);
4736 return ReduceIfReachableEnsureWritableFastElements(
object, elements);
4744 return ReduceIfReachableMaybeGrowFastElements(
4745 object, elements, index, elements_length,
frame_state, mode, feedback);
4750 ReduceIfReachableTransitionElementsKind(
object, transition);
4755 ReduceIfReachableTransitionElementsKindOrCheckMap(
object, map,
frame_state,
4761 return ReduceIfReachableFindOrderedHashEntry(data_structure,
key,
kind);
4801#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name) \
4803 decltype(std::declval<ReadOnlyRoots>().rootAccessorName())>::type> \
4804 name##Constant() { \
4805 const TurboshaftPipelineKind kind = __ data() -> pipeline_kind(); \
4806 if (V8_UNLIKELY(kind == TurboshaftPipelineKind::kCSA || \
4807 kind == TurboshaftPipelineKind::kTSABuiltin)) { \
4808 DCHECK(RootsTable::IsImmortalImmovable(RootIndex::k##rootIndexName)); \
4809 return V<RemoveTagged< \
4810 decltype(std::declval<ReadOnlyRoots>().rootAccessorName())>::type>:: \
4811 Cast(__ LoadRoot(RootIndex::k##rootIndexName)); \
4813 Isolate* isolate = __ data() -> isolate(); \
4814 DCHECK_NOT_NULL(isolate); \
4815 Factory* factory = isolate->factory(); \
4816 DCHECK_NOT_NULL(factory); \
4817 return __ HeapConstant(factory->rootAccessorName()); \
4821#undef HEAP_CONSTANT_ACCESSOR
4823#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name) \
4824 V<RemoveTagged<decltype(std::declval<Heap>().rootAccessorName())>::type> \
4825 name##Constant() { \
4826 const TurboshaftPipelineKind kind = __ data() -> pipeline_kind(); \
4827 if (V8_UNLIKELY(kind == TurboshaftPipelineKind::kCSA || \
4828 kind == TurboshaftPipelineKind::kTSABuiltin)) { \
4829 DCHECK(RootsTable::IsImmortalImmovable(RootIndex::k##rootIndexName)); \
4831 RemoveTagged<decltype(std::declval<Heap>().rootAccessorName())>:: \
4832 type>::Cast(__ LoadRoot(RootIndex::k##rootIndexName)); \
4834 Isolate* isolate = __ data() -> isolate(); \
4835 DCHECK_NOT_NULL(isolate); \
4836 Factory* factory = isolate->factory(); \
4837 DCHECK_NOT_NULL(factory); \
4838 return __ HeapConstant(factory->rootAccessorName()); \
4842#undef HEAP_CONSTANT_ACCESSOR
4844#define HEAP_CONSTANT_TEST(rootIndexName, rootAccessorName, name) \
4845 V<Word32> Is##name(V<Object> value) { \
4846 return TaggedEqual(value, name##Constant()); \
4848 V<Word32> IsNot##name(V<Object> value) { \
4849 return TaggedNotEqual(value, name##Constant()); \
4852#undef HEAP_CONSTANT_TEST
4854#ifdef V8_ENABLE_WEBASSEMBLY
4856 const wasm::WasmGlobal* global) {
4857 return ReduceIfReachableGlobalGet(trusted_instance_data, global);
4861 V<Any> value,
const wasm::WasmGlobal* global) {
4862 return ReduceIfReachableGlobalSet(trusted_instance_data, value, global);
4866 return ReduceIfReachableRootConstant(index);
4870 return ReduceIfReachableIsRootConstant(input, index);
4874 return ReduceIfReachableNull(type);
4878 return ReduceIfReachableIsNull(input, type);
4883 return ReduceIfReachableAssertNotNull(
object, type, trap_id);
4887 return ReduceIfReachableRttCanon(rtts, type_index);
4891 WasmTypeCheckConfig config) {
4892 return ReduceIfReachableWasmTypeCheck(
object, rtt, config);
4896 WasmTypeCheckConfig config) {
4897 return ReduceIfReachableWasmTypeCast(
object, rtt, config);
4901 return ReduceIfReachableAnyConvertExtern(input);
4905 return ReduceIfReachableExternConvertAny(input);
4908 template <
typename T>
4909 V<T> AnnotateWasmType(
V<T> value,
const wasm::ValueType type) {
4910 return ReduceIfReachableWasmTypeAnnotation(value, type);
4914 wasm::ModuleTypeIndex type_index,
int field_index,
4916 return ReduceIfReachableStructGet(
object, type, type_index, field_index,
4921 const wasm::StructType* type, wasm::ModuleTypeIndex type_index,
4923 ReduceIfReachableStructSet(
object, value, type, type_index, field_index,
4928 const wasm::ArrayType* array_type,
bool is_signed) {
4929 return ReduceIfReachableArrayGet(array, index, array_type,
is_signed);
4933 wasm::ValueType element_type) {
4934 ReduceIfReachableArraySet(array, index, value, element_type);
4938 return ReduceIfReachableArrayLength(array, null_check);
4942 const wasm::ArrayType* array_type) {
4943 return ReduceIfReachableWasmAllocateArray(rtt,
resolve(length), array_type);
4947 const wasm::StructType* struct_type) {
4948 return ReduceIfReachableWasmAllocateStruct(rtt, struct_type);
4952 return ReduceIfReachableWasmRefFunc(wasm_instance, function_index);
4956 return ReduceIfReachableStringAsWtf16(
string);
4961 return ReduceIfReachableStringPrepareForGetCodeUnit(
string);
4965 return ReduceIfReachableSimd128Constant(value);
4969 Simd128BinopOp::Kind
kind) {
4970 return ReduceIfReachableSimd128Binop(left, right,
kind);
4974 return ReduceIfReachableSimd128Unary(input,
kind);
4978 return Simd128Unary(input, Simd128UnaryOp::Kind::kSimd128ReverseBytes);
4982 Simd128ShiftOp::Kind
kind) {
4983 return ReduceIfReachableSimd128Shift(input, shift,
kind);
4987 return ReduceIfReachableSimd128Test(input,
kind);
4991 return ReduceIfReachableSimd128Splat(input,
kind);
4996 return ReduceIfReachableSimd128Ternary(first,
second, third,
kind);
5001 return ReduceIfReachableSimd128ExtractLane(input,
kind, lane);
5005 return ReduceIfReachableSimd128Reduce(input,
kind);
5009 Simd128ReplaceLaneOp::Kind
kind, uint8_t lane) {
5010 return ReduceIfReachableSimd128ReplaceLane(into, new_lane,
kind, lane);
5013 OpIndex Simd128LaneMemory(V<WordPtr> base, V<WordPtr> index, V<WordPtr> value,
5014 Simd128LaneMemoryOp::Mode mode,
5015 Simd128LaneMemoryOp::Kind
kind,
5016 Simd128LaneMemoryOp::LaneKind lane_kind,
5017 uint8_t lane,
int offset) {
5018 return ReduceIfReachableSimd128LaneMemory(base, index, value, mode,
kind,
5019 lane_kind, lane,
offset);
5023 V<WordPtr> base, V<WordPtr> index,
5024 Simd128LoadTransformOp::LoadKind load_kind,
5025 Simd128LoadTransformOp::TransformKind transform_kind,
int offset) {
5026 return ReduceIfReachableSimd128LoadTransform(base, index, load_kind,
5031 Simd128ShuffleOp::Kind
kind,
5033 return ReduceIfReachableSimd128Shuffle(left, right,
kind, shuffle);
5036#if V8_ENABLE_WASM_DEINTERLEAVED_MEM_OPS
5038 V<WordPtr> base, V<WordPtr> index, LoadOp::Kind load_kind,
5039 Simd128LoadPairDeinterleaveOp::Kind
kind) {
5040 return ReduceIfReachableSimd128LoadPairDeinterleave(base, index, load_kind,
5046#if V8_ENABLE_WASM_SIMD256_REVEC
5048 return ReduceIfReachableSimd256Constant(value);
5052 return ReduceIfReachableSimd256Extract128Lane(source, lane);
5056 V<WordPtr> base, V<WordPtr> index,
5057 Simd256LoadTransformOp::LoadKind load_kind,
5058 Simd256LoadTransformOp::TransformKind transform_kind,
int offset) {
5059 return ReduceIfReachableSimd256LoadTransform(base, index, load_kind,
5064 return ReduceIfReachableSimd256Unary(input,
kind);
5068 DCHECK_GE(
kind, Simd256UnaryOp::Kind::kFirstSignExtensionOp);
5069 DCHECK_LE(
kind, Simd256UnaryOp::Kind::kLastSignExtensionOp);
5070 return ReduceIfReachableSimd256Unary(input,
kind);
5074 Simd256BinopOp::Kind
kind) {
5075 return ReduceIfReachableSimd256Binop(left, right,
kind);
5079 Simd256BinopOp::Kind
kind) {
5080 DCHECK_GE(
kind, Simd256BinopOp::Kind::kFirstSignExtensionOp);
5081 DCHECK_LE(
kind, Simd256BinopOp::Kind::kLastSignExtensionOp);
5082 return ReduceIfReachableSimd256Binop(left, right,
kind);
5086 Simd256ShiftOp::Kind
kind) {
5087 return ReduceIfReachableSimd256Shift(input, shift,
kind);
5092 return ReduceIfReachableSimd256Ternary(first,
second, third,
kind);
5096 return ReduceIfReachableSimd256Splat(input,
kind);
5100 return ReduceIfReachableSimdPack128To256(left, right);
5103#ifdef V8_TARGET_ARCH_X64
5105 return ReduceIfReachableSimd256Shufd(input, control);
5109 const uint8_t control) {
5110 return ReduceIfReachableSimd256Shufps(left, right, control);
5114 Simd256UnpackOp::Kind
kind) {
5115 return ReduceIfReachableSimd256Unpack(left, right,
kind);
5125 OpIndex LoadStackPointer() {
return ReduceIfReachableLoadStackPointer(); }
5127 void SetStackPointer(V<WordPtr> value) {
5128 ReduceIfReachableSetStackPointer(value);
5132#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
5133 V<Object> GetContinuationPreservedEmbedderData() {
5134 return ReduceIfReachableGetContinuationPreservedEmbedderData();
5137 void SetContinuationPreservedEmbedderData(
V<Object> data) {
5138 ReduceIfReachableSetContinuationPreservedEmbedderData(data);
5142 template <
typename Rep>
5161#define REDUCE_OP(Op) \
5162 template <class... Args> \
5163 V8_INLINE OpIndex ReduceIfReachable##Op(Args... args) { \
5164 if (V8_UNLIKELY(Asm().generating_unreachable_operations())) { \
5165 DCHECK(Asm().conceptually_in_a_block()); \
5166 return OpIndex::Invalid(); \
5168 OpIndex result = Asm().Reduce##Op(args...); \
5169 if constexpr (!IsBlockTerminator(Opcode::k##Op)) { \
5170 if (Asm().current_block() == nullptr) { \
5173 Asm().set_conceptually_in_a_block(true); \
5179#define REDUCE_OP(Op) \
5180 template <class... Args> \
5181 V8_INLINE OpIndex ReduceIfReachable##Op(Args... args) { \
5182 if (V8_UNLIKELY(Asm().generating_unreachable_operations())) { \
5183 return OpIndex::Invalid(); \
5196 return Asm().Reduce##Op(args...); \
5204 template <
typename T = Any,
typename Base>
5210 static_assert(std::is_same_v<Base, WordPtr>);
5214 if (is_array_buffer)
kind =
kind.NotLoadEliminable();
5217 return Load(
object, index,
kind,
rep, access.header_size,
5218 rep.SizeInBytesLog2());
5223 template <
typename Base>
5226 bool is_array_buffer) {
5230 static_assert(std::is_same_v<Base, WordPtr>);
5234 if (is_array_buffer)
kind =
kind.NotLoadEliminable();
5238 access.header_size,
rep.SizeInBytesLog2());
5249 Block* other = to_bind == if_true ? if_false : if_true;
5253 bool to_bind_reachable = to_bind_last_pred != to_bind->
LastPredecessor();
5256 static_cast<int>(other_reachable) | ((to_bind_reachable) << 1));
5257 bool bind_status =
Asm().
Bind(to_bind);
5258 DCHECK_EQ(bind_status, to_bind_reachable);
5290template <
class Reducers>
5320#if defined(__clang__) || !defined(V8_CC_GNU)
5325 set_conceptually_in_a_block(
true);
5328 if (block->IsLoop() && block->single_loop_predecessor()) {
5336 this->
template Emit<GotoOp>(block,
false);
5350 bool bound =
Bind(block);
5368 void set_conceptually_in_a_block(
bool value) {
5392 int& intermediate_tracing_depth() {
return intermediate_tracing_depth_; }
5405 return tuple_op->input(index);
5407 return Stack::ReduceProjection(tuple, index,
rep);
5412 DCHECK_IMPLIES(branch, source->EndsWithBranchingOp(this->output_graph()));
5459 Block* single_predecessor =
5484 set_conceptually_in_a_block(
false);
5496 GotoOp& old_predecessor_goto =
5507 old_predecessor_goto.
destination = single_loop_predecessor;
5516 return single_loop_predecessor;
5520 GotoOp& new_predecessor_goto =
5523 new_predecessor_goto.
destination = single_predecessor;
5530 DCHECK(source->EndsWithBranchingOp(this->output_graph()));
5547 case Opcode::kBranch: {
5550 branch.
if_true = intermediate_block;
5556 branch.
if_false = intermediate_block;
5560 case Opcode::kCheckException: {
5570 catch_exception_op.
catch_block = intermediate_block;
5573 intermediate_block->
SetOrigin(source->OriginForBlockEnd());
5575 this->
Goto(destination);
5580 case Opcode::kSwitch: {
5583 for (
auto& case_block : switch_op.
cases) {
5585 case_block.destination = intermediate_block;
5606 intermediate_block->
SetOrigin(source->OriginForBlockEnd());
5612 this->
Goto(destination);
5676 int intermediate_tracing_depth_ = 0;
5679 template <
class Next>
5681 template <
class AssemblerT>
5685template <
class AssemblerT>
5691 assembler_.current_catch_block_ = catch_block;
5693 this->catch_block = catch_block;
5711 Block* catch_block =
nullptr;
5714 template <
class Reducers>
5718template <
template <
class>
class... Reducers>
#define REDUCE(operation)
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
static constexpr SourceLocation Current()
constexpr T * data() const
static V8_EXPORT_PRIVATE Callable CallableFor(Isolate *isolate, Builtin builtin)
int GetStackParameterCount() const
Handle< Code > code() const
CallInterfaceDescriptor descriptor() const
static Handle< Code > CEntry(Isolate *isolate, int result_size=1, ArgvMode argv_mode=ArgvMode::kStack, bool builtin_exit_frame=false, bool switch_to_central_stack=false)
static const int kNoContext
static ExternalReference Create(const SCTableReference &table_ref)
static const int kTrustedPointerTableBasePointerOffset
static constexpr int root_slot_offset(RootIndex root_index)
constexpr bool IsMapWord() const
static constexpr MachineType TaggedPointer()
static constexpr int OffsetOfElementAt(int index)
static constexpr bool IsImmortalImmovable(RootIndex root_index)
static V8_EXPORT_PRIVATE const Function * FunctionForId(FunctionId id)
static constexpr Tagged< Smi > FromEnum(E value)
static constexpr Tagged< Smi > zero()
static constexpr int OffsetOfElementAt(int index)
static ThreadId Current()
static FieldAccess ForJSArrayBufferViewBuffer()
static FieldAccess ForMap(WriteBarrierKind write_barrier=kMapWriteBarrier)
static FieldAccess ForHeapNumberValue()
static FieldAccess ForJSArrayBufferBitField()
static FieldAccess ForMapInstanceType()
bool NeedsFrameState() const
static CallDescriptor * GetStubCallDescriptor(Zone *zone, const CallInterfaceDescriptor &descriptor, int stack_parameter_count, CallDescriptor::Flags flags, Operator::Properties properties=Operator::kNoProperties, StubCallMode stub_mode=StubCallMode::kCallCodeObject)
const Operation & Get(OpIndex op_idx) const
Zone * graph_zone() const
Graph & output_graph() const
void AddPredecessor(Block *source, Block *destination, bool branch)
Graph & modifiable_input_graph() const
typename Stack::node_t node_t
Block * CreateSinglePredecessorForLoop(Block *loop_header)
Block * current_catch_block() const
void set_current_catch_block(Block *block)
void SetCurrentOrigin(OpIndex operation_origin)
typename ReducerStack< Reducers >::type Stack
PipelineData * data() const
V< AnyOrNone > current_operation_origin() const
void AddLoopPredecessor(Block *single_predecessor, Block *new_predecessor)
void SplitEdge(Block *source, Block *destination)
V8_INLINE void BindReachable(Block *block)
Assembler(PipelineData *data, Graph &input_graph, Graph &output_graph, Zone *phase_zone)
const Graph & input_graph() const
void FinalizeLoop(Block *loop_header)
bool generating_unreachable_operations() const
V8_INLINE bool Bind(Block *block)
Block * current_catch_block_
V< Any > ReduceProjection(V< Any > tuple, uint16_t index, RegisterRepresentation rep)
V< AnyOrNone > current_operation_origin_
Block * current_block() const
bool conceptually_in_a_block_
void ResetAllPredecessors()
void ResetLastPredecessor()
base::SmallVector< Block *, 8 > Predecessors() const
bool Contains(OpIndex op_idx) const
bool IsBranchTarget() const
const Operation & LastOperation(const Graph &graph) const
void SetOrigin(const Block *origin)
const Block * OriginForLoopHeader() const
Block * single_loop_predecessor() const
int PredecessorCount() const
void SetSingleLoopPredecessor(Block *single_loop_predecessor)
Block * LastPredecessor() const
void AddPredecessor(Block *predecessor)
Block * previous_catch_block_
CatchScopeImpl & operator=(const CatchScopeImpl &)=delete
CatchScopeImpl(const CatchScopeImpl &)=delete
CatchScopeImpl & operator=(CatchScopeImpl &&)=delete
CatchScopeImpl(CatchScopeImpl &&)=delete
CatchScopeImpl(AssemblerT &assembler, Block *catch_block)
ConditionWithHint(V< Word32 > condition, BranchHint hint=BranchHint::kNone)
V< Word32 > condition() const
ConditionWithHint(T condition, BranchHint hint=BranchHint::kNone)
constant_type constant_value() const
OpIndex ReduceOperation(Args... args)
V< Any > WrapInTupleIfNeeded(const Op &op, V< Any > idx)
V< Object > ReduceCatchBlockBegin()
static constexpr FloatRepresentation Float32()
static constexpr FloatRepresentation Float64()
void ControlFlowHelper_GotoIf(ConditionWithHint condition, L &label, const typename L::const_or_values_t &values)
bool ControlFlowHelper_BindIf(ConditionWithHint condition, ControlFlowHelper_IfState *state)
void ControlFlowHelper_Goto(L &label, const typename L::const_or_values_t &values)
bool ControlFlowHelper_BindIfNot(ConditionWithHint condition, ControlFlowHelper_IfState *state)
auto ControlFlowHelper_BindLoop(L &label) -> base::prepend_tuple_type< bool, typename L::values_t >
void ControlFlowHelper_EndIf(ControlFlowHelper_IfState *state)
void ControlFlowHelper_FinishIfBlock(ControlFlowHelper_IfState *state)
void ControlFlowHelper_EndLoop(L &label)
void ControlFlowHelper_EndForeachLoop(It iterable, LoopLabelFor< typename It::iterator_type > &header_label, Label<> &exit_label, typename It::iterator_type current_iterator)
void ControlFlowHelper_EndWhileLoop(L1 &header_label, L2 &exit_label)
bool ControlFlowHelper_BindElse(ControlFlowHelper_IfState *state)
auto ControlFlowHelper_Bind(L &label) -> base::prepend_tuple_type< bool, typename L::values_t >
std::tuple< bool, LoopLabel<>, Label<> > ControlFlowHelper_While(std::function< V< Word32 >()> cond_builder)
void ControlFlowHelper_GotoIfNot(ConditionWithHint condition, L &label, const typename L::const_or_values_t &values)
auto ControlFlowHelper_Foreach(It iterable)
V< Object > REDUCE CatchBlockBegin()
void RemoveLast(OpIndex index_of_last_operation)
V< None > REDUCE Branch(V< Word32 > condition, Block *if_true, Block *if_false, BranchHint hint)
OpIndex REDUCE FastApiCall(V< FrameState > frame_state, V< Object > data_argument, V< Context > context, base::Vector< const OpIndex > arguments, const FastApiCallParameters *parameters, base::Vector< const RegisterRepresentation > out_reps)
V< None > REDUCE CheckException(V< Any > throwing_operation, Block *successor, Block *catch_block)
bool CatchIfInCatchScope(OpIndex throwing_operation)
OpIndex REDUCE Phi(base::Vector< const OpIndex > inputs, RegisterRepresentation rep)
void FixLoopPhi(const PhiOp &input_phi, OpIndex output_index, Block *output_graph_loop)
OpIndex REDUCE PendingLoopPhi(OpIndex first, RegisterRepresentation rep)
V< None > REDUCE Switch(V< Word32 > input, base::Vector< SwitchOp::Case > cases, Block *default_case, BranchHint default_hint)
V< None > REDUCE Goto(Block *destination, bool is_backedge)
bool CanAutoInlineBlocksWithSinglePredecessor() const
Zone * graph_zone() const
V8_INLINE Block * NewLoopHeader(const Block *origin=nullptr)
V8_INLINE Block * NewBlock(const Block *origin=nullptr)
void TurnLoopIntoMerge(Block *loop)
V8_INLINE const Operation & Get(OpIndex i) const
void Finalize(Block *block)
OpIndex next_operation_index() const
IndexRange(ConstOrV< T > count)
LabelBase(LabelBase &&other) V8_NOEXCEPT
static constexpr size_t size
void GotoIfNot(A &assembler, OpIndex condition, BranchHint hint, const values_t &values)
values_t MaterializePhis(A &assembler)
std::tuple< base::SmallVector< V< Ts >, 2 >... > recorded_values_t
base::prepend_tuple_type< bool, values_t > Bind(A &assembler)
static constexpr bool is_loop
void Goto(A &assembler, const values_t &values)
static void RecordValues(Block *source, BlockData &data, const values_t &values)
bool has_incoming_jump() const
LabelBase(const LabelBase &)=delete
std::tuple< maybe_const_or_v_t< Ts >... > const_or_values_t
static values_t MaterializePhisImpl(A &assembler, BlockData &data, std::index_sequence< indices... >)
LabelBase & operator=(const LabelBase &)=delete
static void RecordValuesImpl(BlockData &data, Block *source, const values_t &values, std::index_sequence< indices... >)
std::tuple< V< Ts >... > values_t
void GotoIf(A &assembler, OpIndex condition, BranchHint hint, const values_t &values)
Label(Label &&other) V8_NOEXCEPT
Label(const Label &)=delete
LabelBase< false, Ts... > super
Label & operator=(const Label &)=delete
void GotoIf(A &assembler, OpIndex condition, BranchHint hint, const values_t &values)
base::prepend_tuple_type< bool, values_t > Bind(A &assembler)
LoopLabel & operator=(const LoopLabel &)=delete
typename super::BlockData BlockData
void EndLoop(A &assembler)
void FixLoopPhis(A &assembler, const typename super::values_t &values)
static values_t MaterializeLoopPhisImpl(A &assembler, BlockData &data, std::index_sequence< indices... >)
LoopLabel(const LoopLabel &)=delete
LoopLabel(Reducer *reducer)
void Goto(A &assembler, const values_t &values)
static values_t MaterializeLoopPhis(A &assembler, BlockData &data)
base::prepend_tuple_type< bool, values_t > BindLoop(A &assembler)
std::optional< values_t > pending_loop_phis_
LabelBase< true, Ts... > super
Block * loop_header() const
void FixLoopPhi(A &assembler, const typename super::values_t &values)
BlockData loop_header_data_
void GotoIfNot(A &assembler, OpIndex condition, BranchHint hint, const values_t &values)
typename super::values_t values_t
LoopLabel(LoopLabel &&other) V8_NOEXCEPT
RegisterRepresentation ToRegisterRepresentation() const
static MemoryRepresentation FromMachineType(MachineType type)
static constexpr MemoryRepresentation AnyTagged()
static constexpr MemoryRepresentation Uint32()
static constexpr MemoryRepresentation ProtectedPointer()
static constexpr MemoryRepresentation TaggedPointer()
static constexpr MemoryRepresentation UintPtr()
static constexpr MemoryRepresentation Float64()
static constexpr OpIndex Invalid()
constexpr uint32_t id() const
constexpr bool valid() const
constexpr bool has_value() const
constexpr V< T > value() const
static OptionalV Nullopt()
ZoneWithName< kCompilationZoneName > & compilation_zone()
Isolate * isolate() const
Derived * GetCommonDominator(RandomAccessStackDominatorNode< Derived > *other) const
iterator_type Advance(A &assembler, iterator_type current_iterator) const
OptionalV< Word32 > IsEnd(A &assembler, iterator_type current_iterator) const
Range(ConstOrV< T > begin, ConstOrV< T > end, ConstOrV< T > stride=1)
value_type Dereference(A &assembler, iterator_type current_iterator) const
iterator_type Begin(A &assembler) const
static constexpr RegisterRepresentation Float64()
static constexpr RegisterRepresentation WordPtr()
static constexpr RegisterRepresentation Tagged()
OptionalV< Word32 > IsEnd(A &, iterator_type) const
Sequence(ConstOrV< T > begin, ConstOrV< T > stride=1)
static constexpr bool kIsBottomOfStack
OpIndex Emit(Args... args)
void DebugPrint(OpIndex input, RegisterRepresentation rep)
OpIndex LoadOffHeap(OpIndex address, MemoryRepresentation rep)
V< Smi > ArgumentsLength()
V< Object > CallBuiltin_GrowFastSmiOrObjectElements(Isolate *isolate, V< Object > object, V< Smi > size)
V< JSReceiver > CallBuiltin_ToObject(Isolate *isolate, V< Context > context, V< JSPrimitive > object)
V< Float64 > Float64Unary(V< Float64 > input, FloatUnaryOp::Kind kind)
void StoreFixedArrayElement(V< FixedArray > array, int index, V< Object > value, compiler::WriteBarrierKind write_barrier)
V< WordPtr > LoadExternalPointerFromObject(V< Object > object, int offset, ExternalPointerTag tag)
void TailCall(V< CallTarget > callee, base::Vector< const OpIndex > arguments, const TSCallDescriptor *descriptor)
void Branch(V< Word32 > condition, Block *if_true, Block *if_false, BranchHint hint=BranchHint::kNone)
V< Word32 > Float64IsNaN(V< Float64 > input)
V< FixedArray > NewArgumentsElements(V< Smi > arguments_count, CreateArgumentsType type, int formal_parameter_count)
V< Word32 > StringAt(V< String > string, V< WordPtr > position, StringAtOp::Kind kind)
void CheckMaps(V< HeapObject > heap_object, V< turboshaft::FrameState > frame_state, OptionalV< Map > map, const ZoneRefSet< Map > &maps, CheckMapsFlags flags, const FeedbackSource &feedback)
V< Word32 > CheckedSmiUntag(V< Object > object, V< turboshaft::FrameState > frame_state, const FeedbackSource &feedback)
void InitializeField(Uninitialized< T > &object, const FieldAccess &access, V< Any > value)
V< Smi > SmiZeroConstant()
OpIndex TaggedBitcast(OpIndex input, RegisterRepresentation from, RegisterRepresentation to, TaggedBitcastOp::Kind kind)
Float32 Float64 Float64 Float32 kUnsignedToFloat
OpIndex AtomicRMW(V< WordPtr > base, V< WordPtr > index, OpIndex value, AtomicRMWOp::BinOp bin_op, RegisterRepresentation in_out_rep, MemoryRepresentation memory_rep, MemoryAccessKind memory_access_kind)
OpIndex AtomicWord32Pair(V< WordPtr > base, OptionalV< WordPtr > index, OptionalV< Word32 > value_low, OptionalV< Word32 > value_high, OptionalV< Word32 > expected_low, OptionalV< Word32 > expected_high, AtomicWord32PairOp::Kind op_kind, int32_t offset)
V< Object > CallBuiltin_CallForwardVarargs(Isolate *isolate, Zone *graph_zone, Builtin builtin, V< turboshaft::FrameState > frame_state, V< Context > context, V< JSFunction > function, int num_args, int start_index, base::Vector< V< Object > > args, LazyDeoptOnThrow lazy_deopt_on_throw)
void JSLoopStackCheck(V< Context > context, V< turboshaft::FrameState > frame_state)
V< Boolean > CallBuiltin_SameValueNumbersOnly(Isolate *isolate, V< Object > left, V< Object > right)
V< WordPtr > IntPtrConstant(intptr_t value)
detail::index_type_for_t< typename Descriptor::results_t > CallBuiltin(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, const typename Descriptor::arguments_t &args, LazyDeoptOnThrow lazy_deopt_on_throw=LazyDeoptOnThrow::kNo)
OpIndex LoadOffHeap(OpIndex address, OptionalOpIndex index, int32_t offset, MemoryRepresentation rep)
V< Smi > FindOrderedHashMapEntry(V< Object > table, V< Smi > key)
V< Object > MaybeGrowFastElements(V< Object > object, V< Object > elements, V< Word32 > index, V< Word32 > elements_length, V< turboshaft::FrameState > frame_state, GrowFastElementsMode mode, const FeedbackSource &feedback)
void StoreFieldImpl(V< Base > object, const FieldAccess &access, V< Any > value, bool maybe_initializing_or_transitioning)
V< Number > DoubleArrayMax(V< JSArray > array)
V< Object > ToNumber(V< Object > input, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw)
V< Word64 > ChangeUintPtrToUint64(V< WordPtr > input)
V< Float > FloatUnary(V< Float > input, FloatUnaryOp::Kind kind, FloatRepresentation rep)
Word32 Word Word64 Word32 V< Word32 > right
V< Number > CallRuntime_DateCurrentTime(Isolate *isolate, V< Context > context)
V< Context > NoContextConstant()
void Store(OpIndex base, OpIndex value, StoreOp::Kind kind, MemoryRepresentation stored_rep, WriteBarrierKind write_barrier, int32_t offset=0, bool maybe_initializing_or_transitioning=false, IndirectPointerTag maybe_indirect_pointer_tag=kIndirectPointerNullTag)
V< Object > CallRuntime_TransitionElementsKind(Isolate *isolate, V< Context > context, V< HeapObject > object, V< Map > target_map)
V< Object > LoadProtectedFixedArrayElement(V< ProtectedFixedArray > array, V< WordPtr > index)
V< Boolean > StringLessThan(V< String > left, V< String > right)
void DebugPrint(V< Object > input)
OpIndex ExternalConstant(ExternalReference value)
V< Object > CallRuntime_TryMigrateInstanceAndMarkMapAsMigrationTarget(Isolate *isolate, V< Context > context, V< HeapObject > heap_object)
Word32 Word64 Word32 V< Untagged > ChangeOrDeopt(V< Untagged > input, V< turboshaft::FrameState > frame_state, ChangeOrDeoptOp::Kind kind, CheckForMinusZeroMode minus_zero_mode, const FeedbackSource &feedback)
void CallRuntime_ThrowConstructorReturnedNonObject(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw)
void DebugPrint(V< WordPtr > input)
OpIndex Select(ConstOrV< Word32 > cond, OpIndex vtrue, OpIndex vfalse, RegisterRepresentation rep, BranchHint hint, SelectOp::Implementation implem)
void CodeComment(MessageWithSourceLocation message, Args &&... args)
OpIndex AtomicWord32PairLoad(V< WordPtr > base, OptionalV< WordPtr > index, int32_t offset)
V< turboshaft::Tuple< Word, Word32 > > OverflowCheckedBinop(V< Word > left, V< Word > right, OverflowCheckedBinopOp::Kind kind, WordRepresentation rep)
V< Object > EnsureWritableFastElements(V< Object > object, V< Object > elements)
Descriptor::result_t CallRuntime(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw, const typename Descriptor::arguments_t &args)
bool in_object_initialization_
Word32 V< Word > V< turboshaft::FrameState > WordBinopDeoptOnOverflowOp::Kind WordRepresentation FeedbackSource feedback
V< Object > CallRuntime_TerminateExecution(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context)
V< Number > ConvertFloat64ToNumber(V< Float64 > input, CheckForMinusZeroMode minus_zero_mode)
V< T > HeapConstantMaybeHole(Handle< T > value)
V< String > StringSubstring(V< String > string, V< Word32 > start, V< Word32 > end)
OpIndex MemoryBarrier(AtomicMemoryOrder memory_order)
void DeoptimizeIfNot(V< Word32 > condition, V< turboshaft::FrameState > frame_state, const DeoptimizeParameters *parameters)
V< std::common_type_t< T, U > > Conditional(ConstOrV< Word32 > cond, V< T > vtrue, V< U > vfalse, BranchHint hint=BranchHint::kNone)
auto Projection(V< turboshaft::Tuple< Ts... > > tuple, RegisterRepresentation rep)
V< Map > LoadMapField(V< Object > object)
void CallRuntime_ThrowInvalidStringLength(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw)
V< WordPtr > ChangeUint32ToUintPtr(V< Word32 > input)
void StoreElement(V< Base > object, const ElementAccess &access, ConstOrV< WordPtr > index, V< Any > value, bool is_array_buffer)
V< Rep > LoadField(V< WordPtr > raw_base, const compiler::FieldAccess &access)
detail::index_type_for_t< typename Descriptor::results_t > CallBuiltin(Isolate *isolate, const typename Descriptor::arguments_t &args)
V< WordPtr > UintPtrConstant(uintptr_t value)
V< Boolean > CallBuiltin_SameValue(Isolate *isolate, V< Object > left, V< Object > right)
void DeoptimizeIf(V< Word32 > condition, V< turboshaft::FrameState > frame_state, const DeoptimizeParameters *parameters)
void AssertImpl(V< Word32 > condition, const char *condition_string, const char *file, int line)
void JSStackCheck(V< Context > context, OptionalV< turboshaft::FrameState > frame_state, JSStackCheckOp::Kind kind)
V< Any > LoadFieldByIndex(V< Object > object, V< Word32 > index)
V< Object > CallBuiltin_GrowFastDoubleElements(Isolate *isolate, V< Object > object, V< Smi > size)
V< String > CallBuiltin_Typeof(Isolate *isolate, V< Object > object)
V< Code > BuiltinCode(Builtin builtin, Isolate *isolate)
Float32 Float64 Float64 Float32 Float32 Float64 Float64 Float64 Float32
V< Word32 > ObjectIsNumericValue(V< Object > input, NumericKind kind, FloatRepresentation input_rep)
V< Word > ShiftRightArithmetic(V< Word > left, uint32_t right, WordRepresentation rep)
DECL_CHANGE_V(ReversibleFloat64ToInt32, kSignedFloatTruncateOverflowToMin, kReversible, Float64, Word32) DECL_CHANGE_V(ReversibleFloat64ToUint32
V< Object > LoadRoot(RootIndex root_index)
Float32 Float64 kSignedToFloat
V< Object > CatchBlockBegin()
V< String > StringConcat(V< Smi > length, V< String > left, V< String > right)
kUnsignedFloatTruncateOverflowToMin
OpIndex Load(OpIndex base, LoadOp::Kind kind, MemoryRepresentation loaded_rep, int32_t offset=0)
V< T > HeapConstantNoHole(Handle< T > value)
V< WordPtr > GetElementStartPointer(V< Base > object, const ElementAccess &access)
V< Word32 > Word32SignHintUnsigned(V< Word32 > input)
V< FixedArray > CallBuiltin_NewRestArgumentsElements(Isolate *isolate, V< WordPtr > frame, V< WordPtr > formal_parameter_count, V< Smi > arguments_count)
void Comment(const char *message)
V< Context > CallBuiltin_FastNewFunctionContextFunction(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< ScopeInfo > scope_info, ConstOrV< Word32 > slot_count, LazyDeoptOnThrow lazy_deopt_on_throw)
V< Word32 > CompareMaps(V< HeapObject > heap_object, OptionalV< Map > map, const ZoneRefSet< Map > &maps)
V< Word32 > resolve(const ConstOrV< Word32 > &v)
void StaticAssert(V< Word32 > condition, const char *source)
V< String > CallBuiltin_StringAdd_CheckNone(Isolate *isolate, V< Context > context, V< String > left, V< String > right)
V< String > CallBuiltin_StringSubstring(Isolate *isolate, V< String > string, V< WordPtr > start, V< WordPtr > end)
void CallRuntime_ThrowSuperAlreadyCalledError(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw)
V< T > LoadElement(V< Class > object, const ElementAccessTS< Class, T > &access, V< WordPtr > index)
V< Object > LoadProtectedPointerField(V< Object > base, OptionalV< WordPtr > index, LoadOp::Kind kind=LoadOp::Kind::TaggedBase(), int offset=0, int element_size_log2=kTaggedSizeLog2)
V< Boolean > StringComparison(V< String > left, V< String > right, StringComparisonOp::Kind kind)
void CallRuntime_DebugPrint(Isolate *isolate, V< Object > object)
V< Object > CallBuiltin_CallWithArrayLike(Isolate *isolate, Zone *graph_zone, V< turboshaft::FrameState > frame_state, V< Context > context, V< Object > receiver, V< Object > function, V< Object > arguments_list, LazyDeoptOnThrow lazy_deopt_on_throw)
V< Word32 > TaggedEqual(V< Object > left, V< Object > right)
void InitializeField(Uninitialized< Object > &object, const FieldAccessTS< Class, T > &access, maybe_const_or_v_t< T > value)
OpIndex DecodeExternalPointer(OpIndex handle, ExternalPointerTag tag)
void Return(OpIndex result)
V< Object > LoadMessage(V< WordPtr > offset)
V< turboshaft::FrameState > FrameState(base::Vector< const OpIndex > inputs, bool inlined, const FrameStateData *data)
OpIndex TrustedHeapConstant(Handle< HeapObject > value)
V< Any > CallBuiltinImpl(Isolate *isolate, Builtin builtin, OptionalV< turboshaft::FrameState > frame_state, base::Vector< const OpIndex > arguments, const TSCallDescriptor *desc, OpEffects effects)
void Store(OpIndex base, OptionalOpIndex index, OpIndex value, StoreOp::Kind kind, MemoryRepresentation stored_rep, WriteBarrierKind write_barrier, int32_t offset=0, uint8_t element_size_log2=0, bool maybe_initializing_or_transitioning=false, IndirectPointerTag maybe_indirect_pointer_tag=kIndirectPointerNullTag)
V< T > Phi(const base::Vector< V< T > > &inputs)
V< String > ConvertNumberToString(V< Number > input)
V< Code > CEntryStubConstant(Isolate *isolate, int result_size, ArgvMode argv_mode=ArgvMode::kStack, bool builtin_exit_frame=false)
void DebugPrint(V< Float64 > input)
V< Float64 > LoadHeapNumberValue(V< HeapNumber > heap_number)
OpIndex AtomicWord32PairCompareExchange(V< WordPtr > base, OptionalV< WordPtr > index, V< Word32 > value_low, V< Word32 > value_high, V< Word32 > expected_low, V< Word32 > expected_high, int32_t offset=0)
void InitializeArrayBufferElement(Uninitialized< Base > &object, const ElementAccess &access, V< WordPtr > index, V< Any > value)
Float Float Float32 Float CountLeadingZeros
V< WordPtr > BitcastTaggedToWordPtr(V< Object > input)
V< T > PendingLoopPhi(V< T > first)
DECL_MULTI_REP_UNARY_V(IntAbsCheckOverflow, OverflowCheckedUnary, WordRepresentation, Abs, Word) DECL_SINGLE_REP_UNARY_V(Int32AbsCheckOverflow
Ret CallRuntimeImpl(Isolate *isolate, Runtime::FunctionId function, const TSCallDescriptor *desc, V< turboshaft::FrameState > frame_state, V< Context > context, const Args &args)
void Dcheck(V< Word32 > condition, const char *message, const char *file, int line, const SourceLocation &loc=SourceLocation::Current())
const OperationMatcher & matcher() const
MaybeHandle< Code > cached_centry_stub_constants_[4]
V< WordPtr > RelocatableWasmBuiltinCallTarget(Builtin builtin)
V< Word64 > resolve(const ConstOrV< Word64 > &v)
void TransitionAndStoreArrayElement(V< JSArray > array, V< WordPtr > index, V< Any > value, TransitionAndStoreArrayElementOp::Kind kind, MaybeHandle< Map > fast_map, MaybeHandle< Map > double_map)
Float Float RoundTiesEven
V< String > StringFromCodePointAt(V< String > string, V< WordPtr > index)
V< T > Parameter(int index, const char *debug_name=nullptr)
OpIndex AtomicWord32PairBinop(V< WordPtr > base, OptionalV< WordPtr > index, V< Word32 > value_low, V< Word32 > value_high, AtomicRMWOp::BinOp bin_op, int32_t offset=0)
base::SmallVector< OpIndex, 16 > cached_parameters_
V< BigInt > BigIntUnary(V< BigInt > input, BigIntUnaryOp::Kind kind)
V< Word32 > IsSmi(V< Object > object)
V< Word32 > RootEqual(V< Object > input, RootIndex root, Isolate *isolate)
Word32 Word64 kExtractHighHalf
V< Word32 > HasInstanceType(V< Object > object, InstanceType instance_type)
void CallRuntime_ThrowAccessedUninitializedVariable(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw, V< Object > object)
detail::index_type_for_t< typename Descriptor::results_t > CallBuiltin(Isolate *isolate, V< turboshaft::FrameState > frame_state, const typename Descriptor::arguments_t &args, LazyDeoptOnThrow lazy_deopt_on_throw=LazyDeoptOnThrow::kNo)
Float32 Float64 Float64 Float32 Float32 kReversible
V< Word32 > TruncateWordPtrToWord32(ConstOrV< WordPtr > input)
V< Any > Tuple(base::Vector< const V< Any > > indices)
V< T > HeapConstant(Handle< T > value)
OpIndex Phi(std::initializer_list< OpIndex > inputs, RegisterRepresentation rep)
V< Word32 > RelocatableWasmCanonicalSignatureId(uint32_t canonical_id)
void StoreOffHeap(OpIndex address, OptionalOpIndex index, OpIndex value, MemoryRepresentation rep, int32_t offset)
V< FixedArray > CallBuiltin_NewStrictArgumentsElements(Isolate *isolate, V< WordPtr > frame, V< WordPtr > formal_parameter_count, V< Smi > arguments_count)
V< Object > ToNumberOrNumeric(V< Object > input, V< turboshaft::FrameState > frame_state, V< Context > context, Object::Conversion kind, LazyDeoptOnThrow lazy_deopt_on_throw)
V< Float64 > ChangeFloat16RawBitsToFloat64(V< Word32 > input)
V< Word32 > Float64SameValue(ConstOrV< Float64 > left, ConstOrV< Float64 > right)
V< Rep > resolve(const V< Rep > &v)
auto Projection(V< turboshaft::Tuple< Ts... > > tuple)
void Deoptimize(V< turboshaft::FrameState > frame_state, const DeoptimizeParameters *parameters)
V< JSFunction > CallRuntime_NewClosure(Isolate *isolate, V< Context > context, V< SharedFunctionInfo > shared_function_info, V< FeedbackCell > feedback_cell)
V< JSPrimitive > ConvertUntaggedToJSPrimitiveOrDeopt(V< Untagged > input, V< turboshaft::FrameState > frame_state, ConvertUntaggedToJSPrimitiveOrDeoptOp::JSPrimitiveKind kind, RegisterRepresentation input_rep, ConvertUntaggedToJSPrimitiveOrDeoptOp::InputInterpretation input_interpretation, const FeedbackSource &feedback)
OpIndex AtomicCompareExchange(V< WordPtr > base, V< WordPtr > index, OpIndex expected, OpIndex new_value, RegisterRepresentation result_rep, MemoryRepresentation input_rep, MemoryAccessKind memory_access_kind)
V< Boolean > CallBuiltin_ToBoolean(Isolate *isolate, V< Object > object)
V< T > LoadNonArrayBufferElement(V< Base > object, const ElementAccess &access, V< WordPtr > index)
DECL_MULTI_REP_BINOP(ShiftRightArithmeticShiftOutZeros, Shift, WordRepresentation, ShiftRightArithmeticShiftOutZeros) DECL_SINGLE_REP_SHIFT_V(Word32ShiftRightArithmeticShiftOutZeros
DECL_CHANGE_V(TruncateFloat64ToInt64OverflowToMin, kSignedFloatTruncateOverflowToMin, kNoAssumption, Float64, Word64) DECL_CHANGE_V(TruncateFloat32ToInt32OverflowToMin
V< Boolean > CallBuiltin_StringLessThanOrEqual(Isolate *isolate, V< String > left, V< String > right)
OpIndex CompressedHeapConstant(Handle< HeapObject > value)
V< Smi > SmiConstant(i::Tagged< Smi > value)
void StoreDataViewElement(V< Object > object, V< WordPtr > storage, V< WordPtr > index, OpIndex value, ConstOrV< Word32 > is_little_endian, ExternalArrayType element_type)
V< Object > LoadFixedArrayElement(V< FixedArray > array, int index)
V< Float64 > LoadFixedDoubleArrayElement(V< FixedDoubleArray > array, int index)
V< Boolean > ConvertToBoolean(V< Object > input)
OpIndex Load(OpIndex base, OptionalOpIndex index, LoadOp::Kind kind, MemoryRepresentation loaded_rep, RegisterRepresentation result_rep, int32_t offset=0, uint8_t element_size_log2=0)
V< Word32 > Word32SignHint(V< Word32 > input, Word32SignHintOp::Sign sign)
V< Object > LoadTrustedPointerField(V< HeapObject > base, LoadOp::Kind kind, IndirectPointerTag tag, int offset=0)
V< String > CallRuntime_SymbolDescriptiveString(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< Symbol > symbol, LazyDeoptOnThrow lazy_deopt_on_throw)
Float32 Float64 Float64 Float32 Float32 Float64 Float64 Float64 Float64 kTruncate
void DeoptimizeIf(V< Word32 > condition, V< turboshaft::FrameState > frame_state, DeoptimizeReason reason, const FeedbackSource &feedback)
V< Float32 > Float32Constant(float value)
void AssumeMap(V< HeapObject > heap_object, const ZoneRefSet< Map > &maps)
V< Word32 > LoadInstanceTypeField(V< Map > map)
Word32 UnsignedMulOverflownBits
V< Object > CallRuntime_HandleNoHeapWritesInterrupts(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context)
OpIndex FastApiCall(V< turboshaft::FrameState > frame_state, V< Object > data_argument, V< Context > context, base::Vector< const OpIndex > arguments, const FastApiCallParameters *parameters, base::Vector< const RegisterRepresentation > out_reps)
Word32 Word Word64 Word32 V< Word32 > ShiftOp::Kind WordRepresentation rep
V< Word32 > LoadHeapInt32Value(V< HeapNumber > heap_number)
V< Smi > StackCheckOffset()
V< Smi > StringIndexOf(V< String > string, V< String > search, V< Smi > position)
V< WordPtr > ParentFramePointer()
V< Word32 > StringCharCodeAt(V< String > string, V< WordPtr > position)
OpIndex Parameter(int index, RegisterRepresentation rep, const char *debug_name=nullptr)
V< Smi > FindOrderedHashSetEntry(V< Object > table, V< Smi > key)
void CallBuiltin_DebugPrintWordPtr(Isolate *isolate, V< Context > context, V< WordPtr > value)
void Switch(V< Word32 > input, base::Vector< SwitchOp::Case > cases, Block *default_case, BranchHint default_hint=BranchHint::kNone)
V< Object > OsrValue(int index)
V< JSFunction > CallRuntime_NewClosure_Tenured(Isolate *isolate, V< Context > context, V< SharedFunctionInfo > shared_function_info, V< FeedbackCell > feedback_cell)
V< Number > ConvertPlainPrimitiveToNumber(V< PlainPrimitive > input)
void StoreTypedElement(OpIndex buffer, V< Object > base, V< WordPtr > external, V< WordPtr > index, OpIndex value, ExternalArrayType array_type)
void TransitionElementsKindOrCheckMap(V< HeapObject > object, V< Map > map, V< turboshaft::FrameState > frame_state, const ElementsTransitionWithMultipleSources &transition)
TurboshaftAssemblerOpInterface(Args... args)
void CheckEqualsInternalizedString(V< Object > expected, V< Object > value, V< turboshaft::FrameState > frame_state)
V< Rep > LoadField(V< Object > object, const compiler::FieldAccess &access)
OpIndex CheckTurboshaftTypeOf(OpIndex input, RegisterRepresentation rep, Type expected_type, bool successful)
Float Float Float32 Float WordUnary
Float Float Float32 Float Word Word64 CountTrailingZeros
void Deoptimize(V< turboshaft::FrameState > frame_state, DeoptimizeReason reason, const FeedbackSource &feedback)
V< std::common_type_t< T, U > > Select(ConstOrV< Word32 > cond, V< T > vtrue, V< U > vfalse, RegisterRepresentation rep, BranchHint hint, SelectOp::Implementation implem)
Word32 Word Word64 V< Word32 > Word32BitwiseNot(ConstOrV< Word32 > input)
void StoreOffHeap(OpIndex address, OpIndex value, MemoryRepresentation rep, int32_t offset=0)
V< Number > CallBuiltin_ToNumber(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< Object > input, LazyDeoptOnThrow lazy_deopt_on_throw)
V< FixedArray > CallBuiltin_NewSloppyArgumentsElements(Isolate *isolate, V< WordPtr > frame, V< WordPtr > formal_parameter_count, V< Smi > arguments_count)
V< Float64 > LoadFixedDoubleArrayElement(V< FixedDoubleArray > array, V< WordPtr > index)
V< Object > CallBuiltin_CallWithSpread(Isolate *isolate, Zone *graph_zone, V< turboshaft::FrameState > frame_state, V< Context > context, V< Object > function, int num_args_no_spread, V< Object > spread, base::Vector< V< Object > > args_no_spread, LazyDeoptOnThrow lazy_deopt_on_throw)
V< Boolean > CallRuntime_HasInPrototypeChain(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw, V< Object > object, V< HeapObject > prototype)
V< Word > TruncateJSPrimitiveToUntaggedOrDeopt(V< JSPrimitive > object, V< turboshaft::FrameState > frame_state, TruncateJSPrimitiveToUntaggedOrDeoptOp::UntaggedKind kind, TruncateJSPrimitiveToUntaggedOrDeoptOp::InputRequirement input_requirement, const FeedbackSource &feedback)
OpIndex LoadDataViewElement(V< Object > object, V< WordPtr > storage, V< WordPtr > index, V< Word32 > is_little_endian, ExternalArrayType element_type)
void CallRuntime_ThrowSuperNotCalled(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw)
DECL_MULTI_REP_CHECK_BINOP_V(IntAddCheckOverflow, OverflowCheckedBinop, SignedAdd, Word) DECL_SINGLE_REP_CHECK_BINOP_V(Int32AddCheckOverflow
OpIndex FloatConstant(double value, FloatRepresentation rep)
V< Number > CallBuiltin_StringToNumber(Isolate *isolate, V< String > input)
V< Word32 > UntagSmi(V< Smi > input)
V< Boolean > SameValue(V< Object > left, V< Object > right, SameValueOp::Mode mode)
Word32 V< Word > V< turboshaft::FrameState > frame_state
V< Any > Tuple(std::initializer_list< V< Any > > indices)
V< Object > CheckedClosure(V< Object > input, V< turboshaft::FrameState > frame_state, Handle< FeedbackCell > feedback_cell)
V< Object > LoadTrustedPointerField(V< HeapObject > base, OptionalV< Word32 > index, LoadOp::Kind kind, IndirectPointerTag tag, int offset=0)
V< T > LoadField(V< Obj > object, const FieldAccessTS< Class, T > &field) implicitly_constructible_from< Obj >
Float Float Float32 Float Word Word64 Word32 PopCount
Word32 WordPtr ShiftRightArithmetic
V< Float32 > Float32Constant(i::Float32 value)
V< Boolean > CallBuiltin_StringLessThan(Isolate *isolate, V< String > left, V< String > right)
V< Any > Projection(V< Any > tuple, uint16_t index, RegisterRepresentation rep)
V< WordPtr > WordPtrConstant(uintptr_t value)
void Return(V< Word32 > pop_count, base::Vector< const OpIndex > return_values, bool spill_caller_frame_slots=false)
V< Word64 > ChangeFloat64ToInt64OrDeopt(V< Float64 > input, V< turboshaft::FrameState > frame_state, CheckForMinusZeroMode minus_zero_mode, const FeedbackSource &feedback)
V< BigInt > BigIntBinop(V< BigInt > left, V< BigInt > right, V< turboshaft::FrameState > frame_state, BigIntBinopOp::Kind kind)
OpIndex NumberConstant(double value)
V< turboshaft::Tuple< Ts... > > Tuple(V< Ts >... indices)
V< Object > GenericBinop(V< Object > left, V< Object > right, V< turboshaft::FrameState > frame_state, V< Context > context, GenericBinopOp::Kind kind, LazyDeoptOnThrow lazy_deopt_on_throw)
OpIndex NumberConstant(i::Float64 value)
void StoreField(V< Base > object, const FieldAccess &access, V< Any > value)
V< WordPtr > FindOrderedHashMapEntryForInt32Key(V< Object > table, V< Word32 > key)
void Initialize(Uninitialized< T > &object, OpIndex value, MemoryRepresentation stored_rep, WriteBarrierKind write_barrier, int32_t offset=0)
V< String > CallBuiltin_ToString(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< Object > input, LazyDeoptOnThrow lazy_deopt_on_throw)
V< Word64 > ChangeIntPtrToInt64(V< WordPtr > input)
V< Object > CallRuntime_StackGuardWithGap(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< Smi > gap)
V< Float64 > Float64Constant(i::Float64 value)
V< T > FinishInitialization(Uninitialized< T > &&uninitialized)
V< ConsString > NewConsString(V< Word32 > length, V< String > first, V< String > second)
Word32 Word Word64 SignedMul
V< T > LoadArrayBufferElement(V< Base > object, const ElementAccess &access, V< WordPtr > index)
Word32 Word Word64 Word32 V< Word32 > ShiftOp::Kind kind
V< Word64 > Word64Constant(int64_t value)
V< Untagged > ConvertJSPrimitiveToUntaggedOrDeopt(V< Object > object, V< turboshaft::FrameState > frame_state, ConvertJSPrimitiveToUntaggedOrDeoptOp::JSPrimitiveKind from_kind, ConvertJSPrimitiveToUntaggedOrDeoptOp::UntaggedKind to_kind, CheckForMinusZeroMode minus_zero_mode, const FeedbackSource &feedback)
V< JSFunction > CallBuiltin_FastNewClosure(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< SharedFunctionInfo > shared_function_info, V< FeedbackCell > feedback_cell)
V< Object > CallRuntime_StringCharCodeAt(Isolate *isolate, V< Context > context, V< String > string, V< Number > index)
V< WordPtr > FramePointer()
ConditionalGotoStatus BranchAndBind(V< Word32 > condition, Block *if_true, Block *if_false, BranchHint hint, Block *to_bind)
OperationMatcher matcher_
ConditionalGotoStatus GotoIfNot(ConditionWithHint condition, Block *if_false)
ShiftRightArithmeticShiftOutZeros
V< Word32 > Float64IsHole(V< Float64 > input)
V< Object > GenericUnop(V< Object > input, V< turboshaft::FrameState > frame_state, V< Context > context, GenericUnopOp::Kind kind, LazyDeoptOnThrow lazy_deopt_on_throw)
void Branch(ConditionWithHint condition, Block *if_true, Block *if_false)
ConditionalGotoStatus GotoIfNot(V< Word32 > condition, Block *if_false, BranchHint hint=BranchHint::kNone)
void TransitionElementsKind(V< HeapObject > object, const ElementsTransition &transition)
Float Float Float32 Float Word Word64 Word32 Word SignExtend16
void InitializeNonArrayBufferElement(Uninitialized< Base > &object, const ElementAccess &access, V< WordPtr > index, V< Any > value)
V< Word > ShiftLeft(V< Word > left, uint32_t right, WordRepresentation rep)
V< WordPtr > StackSlot(int size, int alignment, bool is_tagged=false)
V< Smi > CallBuiltin_FindOrderedHashSetEntry(Isolate *isolate, V< Context > context, V< Object > set, V< Smi > key)
V< Float32 > resolve(const ConstOrV< Float32 > &v)
void StoreArrayBufferElement(V< Base > object, const ElementAccess &access, V< WordPtr > index, V< Any > value)
Float32 Float64 Float64 Float32 Float32 Float64 Float64 Float64 Float64 Word32 V< Word > ZeroExtendWord32ToRep(V< Word32 > value, WordRepresentation rep)
V< BigInt > CallRuntime_BigIntUnaryOp(Isolate *isolate, V< Context > context, V< BigInt > input, ::Operation operation)
V< Word > TruncateJSPrimitiveToUntagged(V< JSPrimitive > object, TruncateJSPrimitiveToUntaggedOp::UntaggedKind kind, TruncateJSPrimitiveToUntaggedOp::InputAssumptions input_assumptions)
V< String > CallBuiltin_NumberToString(Isolate *isolate, V< Number > input)
V< HeapObject > HeapConstantHole(Handle< HeapObject > value)
V< Word32 > StringCodePointAt(V< String > string, V< WordPtr > position)
V< Object > CallBuiltinWithVarStackArgs(Isolate *isolate, Zone *graph_zone, Builtin builtin, V< turboshaft::FrameState > frame_state, int num_stack_args, base::Vector< OpIndex > arguments, LazyDeoptOnThrow lazy_deopt_on_throw)
V< R > Call(V< CallTarget > callee, std::initializer_list< OpIndex > arguments, const TSCallDescriptor *descriptor, OpEffects effects=OpEffects().CanCallAnything())
void CallBuiltin_CheckTurbofanType(Isolate *isolate, V< Context > context, V< Object > object, V< TurbofanType > allocated_type, V< Smi > node_id)
DCHECK_LT(right, rep.bit_width())
V< String > CallBuiltin_StringFromCodePointAt(Isolate *isolate, V< String > string, V< WordPtr > index)
V< HeapNumber > AllocateHeapNumberWithValue(V< Float64 > value, Factory *factory)
V< Word32 > ArrayBufferIsDetached(V< JSArrayBufferView > object)
V< FixedDoubleArray > NewDoubleArray(V< WordPtr > length, AllocationType allocation_type)
OpIndex Phi(base::Vector< const OpIndex > inputs, RegisterRepresentation rep)
void InitializeElement(Uninitialized< Class > &object, const ElementAccessTS< Class, T > &access, ConstOrV< WordPtr > index, V< T > value)
void StoreFixedArrayElement(V< FixedArray > array, V< WordPtr > index, V< Object > value, compiler::WriteBarrierKind write_barrier)
V< turboshaft::Tuple< Any, Any > > Tuple(OpIndex left, OpIndex right)
V< WordPtr > BitcastTaggedToWordPtrForTagAndSmiBits(V< Object > input)
void CallBuiltin_DebugPrintFloat64(Isolate *isolate, V< Context > context, V< Float64 > value)
ConditionalGotoStatus GotoIf(V< Word32 > condition, Block *if_true, BranchHint hint=BranchHint::kNone)
V< Word32 > ChangeFloat64ToUint32OrDeopt(V< Float64 > input, V< turboshaft::FrameState > frame_state, CheckForMinusZeroMode minus_zero_mode, const FeedbackSource &feedback)
V< Object > LoadProtectedFixedArrayElement(V< ProtectedFixedArray > array, int index)
V< AnyFixedArray > NewArray(V< WordPtr > length, NewArrayOp::Kind kind, AllocationType allocation_type)
V< Float64 > BitcastWord32PairToFloat64(ConstOrV< Word32 > high_word32, ConstOrV< Word32 > low_word32)
V< Word32 > StackPointerGreaterThan(V< WordPtr > limit, StackCheckKind kind)
V< Smi > RestLength(int formal_parameter_count)
void StoreNonArrayBufferElement(V< Base > object, const ElementAccess &access, V< WordPtr > index, V< Any > value)
V< Object > ConvertJSPrimitiveToObject(V< JSPrimitive > value, V< Context > native_context, V< JSGlobalProxy > global_proxy, ConvertReceiverMode mode)
UnsignedLessThan SignedLessThanOrEqual Word64 UnsignedLessThanOrEqual Word64 SignedLessThanOrEqual Float64 V< Word32 > Comparison(OpIndex left, OpIndex right, ComparisonOp::Kind kind, RegisterRepresentation rep)
void StoreElement(V< Class > object, const ElementAccessTS< Class, T > &access, ConstOrV< WordPtr > index, V< T > value)
detail::index_type_for_t< typename Descriptor::results_t > CallBuiltin(Isolate *isolate, V< Context > context, const typename Descriptor::arguments_t &args)
V< Untagged > ConvertJSPrimitiveToUntagged(V< JSPrimitive > primitive, ConvertJSPrimitiveToUntaggedOp::UntaggedKind kind, ConvertJSPrimitiveToUntaggedOp::InputAssumptions input_assumptions)
Descriptor::result_t CallRuntime(Isolate *isolate, V< Context > context, const typename Descriptor::arguments_t &args)
void FailAssert(const char *message, const std::vector< FileAndLine > &files_and_lines, const SourceLocation &loc)
V< Object > LoadProtectedPointerField(V< Object > base, LoadOp::Kind kind, int32_t offset)
void StoreSignedSmallElement(V< JSArray > array, V< WordPtr > index, V< Word32 > value)
V< Object > LoadStackArgument(V< Object > base, V< WordPtr > index)
Uninitialized< T > Allocate(ConstOrV< WordPtr > size, AllocationType type)
ConditionalGotoStatus GotoIf(ConditionWithHint condition, Block *if_true)
V< Boolean > CallBuiltin_StringEqual(Isolate *isolate, V< String > left, V< String > right, V< WordPtr > length)
Float32 Float64 Float64 Float32 Float32 Float64 Float64 Float64 kFloatConversion
OpIndex TaggedIndexConstant(int32_t value)
V< Word32 > ObjectIs(V< Object > input, ObjectIsOp::Kind kind, ObjectIsOp::InputAssumptions input_assumptions)
V< Smi > TagSmi(ConstOrV< Word32 > input)
V< JSPrimitive > ConvertUntaggedToJSPrimitive(V< Untagged > input, ConvertUntaggedToJSPrimitiveOp::JSPrimitiveKind kind, RegisterRepresentation input_rep, ConvertUntaggedToJSPrimitiveOp::InputInterpretation input_interpretation, CheckForMinusZeroMode minus_zero_mode)
V< Word32Pair > Word32PairBinop(V< Word32 > left_low, V< Word32 > left_high, V< Word32 > right_low, V< Word32 > right_high, Word32PairBinopOp::Kind kind)
OpIndex IsolateField(IsolateFieldId id)
void CallRuntime_ThrowCalledNonCallable(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw, V< Object > value)
V< Object > CallRuntime_TryMigrateInstance(Isolate *isolate, V< Context > context, V< HeapObject > heap_object)
OpIndex LoadRootRegister()
V< Type > LoadTaggedField(V< Object > object, int field_offset)
V< WordPtr > RelocatableConstant(int64_t value, RelocInfo::Mode mode)
return ShiftRightLogical(left, this->Word32Constant(right), rep)
void Comment(const std::string &message)
V< Word32 > RelocatableWasmIndirectCallTarget(uint32_t function_index)
V< Float64 > Float64Constant(double value)
V< Word32 > Word32SignHintSigned(V< Word32 > input)
V< Boolean > StringLessThanOrEqual(V< String > left, V< String > right)
void RuntimeAbort(AbortReason reason)
V< Word > WordBinop(V< Word > left, V< Word > right, WordBinopOp::Kind kind, WordRepresentation rep)
V< Word32 > ChangeFloat64ToInt32OrDeopt(V< Float64 > input, V< turboshaft::FrameState > frame_state, CheckForMinusZeroMode minus_zero_mode, const FeedbackSource &feedback)
void DeoptimizeIfNot(V< Word32 > condition, V< turboshaft::FrameState > frame_state, DeoptimizeReason reason, const FeedbackSource &feedback)
V< Object > ToNumeric(V< Object > input, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw)
V< WordPtr > TypedArrayLength(V< JSTypedArray > typed_array, ElementsKind elements_kind)
void AbortCSADcheck(V< String > message)
UnsignedLessThan SignedLessThanOrEqual SignedLessThanOrEqual
V< Object > BitcastWordPtrToTagged(V< WordPtr > input)
kSignedFloatTruncateOverflowToMin
V< Boolean > BigIntComparison(V< BigInt > left, V< BigInt > right, BigIntComparisonOp::Kind kind)
V< Context > CallBuiltin_FastNewFunctionContextEval(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< ScopeInfo > scope_info, ConstOrV< Word32 > slot_count, LazyDeoptOnThrow lazy_deopt_on_throw)
V< Boolean > StringEqual(V< String > left, V< String > right)
V< Word64 > ChangeFloat64ToAdditiveSafeIntegerOrDeopt(V< Float64 > input, V< turboshaft::FrameState > frame_state, CheckForMinusZeroMode minus_zero_mode, const FeedbackSource &feedback)
DECL_MULTI_REP_BINOP(IntLessThan, Comparison, RegisterRepresentation, SignedLessThan) DECL_MULTI_REP_BINOP(UintLessThan
void Goto(Block *destination)
V< Object > CallRuntime_StackGuard(Isolate *isolate, V< Context > context)
OpIndex PendingLoopPhi(OpIndex first, RegisterRepresentation rep)
V< BigInt > BigIntNegate(V< BigInt > input)
void Check(V< Word32 > condition, const char *message, const char *file, int line, const SourceLocation &loc=SourceLocation::Current())
V< Smi > CallBuiltin_StringIndexOf(Isolate *isolate, V< String > string, V< String > search, V< Smi > position)
void JSFunctionEntryStackCheck(V< Context > context, V< turboshaft::FrameState > frame_state)
V< Word32 > Word32Constant(uint32_t value)
V< Word32 > Equal(V< Any > left, V< Any > right, RegisterRepresentation rep)
void StoreFixedDoubleArrayElement(V< FixedDoubleArray > array, V< WordPtr > index, V< Float64 > value)
V< Word32 > Word32Constant(int32_t value)
OpIndex Load(OpIndex base, OptionalOpIndex index, LoadOp::Kind kind, MemoryRepresentation loaded_rep, int32_t offset=0, uint8_t element_size_log2=0)
V< Word32 > TruncateFloat64ToFloat16RawBits(V< Float64 > input)
V< Object > Convert(V< Object > input, ConvertOp::Kind from, ConvertOp::Kind to)
V< WordPtr > ChangeInt32ToIntPtr(V< Word32 > input)
V< Word32 > Float64IsSmi(V< Float64 > input)
V< Float64 > resolve(const ConstOrV< Float64 > &v)
V< Numeric > CallBuiltin_ToNumeric(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, V< Object > input, LazyDeoptOnThrow lazy_deopt_on_throw)
void CallRuntime_Abort(Isolate *isolate, V< Context > context, V< Smi > reason)
UnsignedLessThan SignedLessThanOrEqual Word64 UnsignedLessThanOrEqual UnsignedLessThanOrEqual
OpIndex LoadOffHeap(OpIndex address, int32_t offset, MemoryRepresentation rep)
OpIndex FindOrderedHashEntry(V< Object > data_structure, OpIndex key, FindOrderedHashEntryOp::Kind kind)
V< Smi > CallBuiltin_FindOrderedHashMapEntry(Isolate *isolate, V< Context > context, V< Object > table, V< Smi > key)
void StoreMessage(V< WordPtr > offset, V< Object > object)
V< Word32 > Float64Is(V< Float64 > input, NumericKind kind)
V< Number > ConvertStringToNumber(V< String > input)
void Goto(Block *destination, bool is_backedge)
V< WordPtr > AdaptLocalArgument(V< Object > argument)
V< T > LoadElement(V< Base > object, const ElementAccess &access, V< WordPtr > index, bool is_array_buffer)
V< Word > WordConstant(uint64_t value, WordRepresentation rep)
void Retain(V< Object > value)
V< Number > CallBuiltin_PlainPrimitiveToNumber(Isolate *isolate, V< PlainPrimitive > input)
V< Number > DoubleArrayMinMax(V< JSArray > array, DoubleArrayMinMaxOp::Kind kind)
V< R > Call(V< CallTarget > callee, OptionalV< turboshaft::FrameState > frame_state, base::Vector< const OpIndex > arguments, const TSCallDescriptor *descriptor, OpEffects effects=OpEffects().CanCallAnything())
V< Word64 > Word64Constant(uint64_t value)
V< Object > LoadFixedArrayElement(V< FixedArray > array, V< WordPtr > index)
OpIndex AtomicWord32PairStore(V< WordPtr > base, OptionalV< WordPtr > index, V< Word32 > value_low, V< Word32 > value_high, int32_t offset)
Float32 Float64 Float64 Float32 Float32 Float64 Float64 WordPtr
V< Word32 > StringLength(V< String > string)
V< Word32 > TruncateNumberToInt32(V< Number > value)
void CallRuntime_ThrowNotSuperConstructor(Isolate *isolate, V< turboshaft::FrameState > frame_state, V< Context > context, LazyDeoptOnThrow lazy_deopt_on_throw, V< Object > constructor, V< Object > function)
V< Object > CallBuiltin_CopyFastSmiOrObjectElements(Isolate *isolate, V< Object > object)
OpIndex CallBuiltin(Builtin builtin, V< turboshaft::FrameState > frame_state, base::Vector< OpIndex > arguments, CanThrow can_throw, Isolate *isolate)
OpIndex LoadTypedElement(OpIndex buffer, V< Object > base, V< WordPtr > external, V< WordPtr > index, ExternalArrayType array_type)
V< Number > DoubleArrayMin(V< JSArray > array)
std::optional< V< T > > object_
Uninitialized(V< T > object)
static V< T > Cast(V< U > index)
Var & operator=(const Var)=delete
Var & operator=(Var &&)=delete
maybe_const_or_v_t< T > value_type
void operator=(value_type new_value)
Var(Reducer *reducer, value_type initial_value)
void Set(value_type new_value)
Var(Assembler &assembler)
static constexpr WordRepresentation Word32()
static constexpr WordRepresentation WordPtr()
static constexpr WordRepresentation Word64()
std::tuple< typename Iterables::value_type... > value_type
Zip(Iterables... iterables)
value_type Dereference(A &assembler, iterator_type current_iterator)
OptionalV< Word32 > IsEnd(A &assembler, iterator_type current_iterator)
iterator_type Advance(A &assembler, iterator_type current_iterator)
iterator_type Begin(A &assembler)
std::tuple< Iterables... > iterables_
std::tuple< typename Iterables::iterator_type... > iterator_type
#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name)
#define HEAP_CONSTANT_TEST(rootIndexName, rootAccessorName, name)
#define COMPRESS_POINTERS_BOOL
#define V8_ENABLE_SANDBOX_BOOL
#define DECL_UNSIGNED_FLOAT_TRUNCATE(FloatBits, ResultBits)
#define TURBOSHAFT_REDUCER_BOILERPLATE(Name)
#define DECL_GENERIC_UNOP(Name)
#define DECL_MULTI_REP_BINOP_V(name, operation, kind, tag)
#define DECL_SINGLE_REP_UNARY_V(name, operation, kind, tag)
#define DECL_SIGNED_FLOAT_TRUNCATE(FloatBits, ResultBits)
#define DECL_SINGLE_REP_COMPARISON_V(name, kind, tag)
#define DECL_SINGLE_REP_BINOP_DEOPT_OVERFLOW(operation, rep_type)
#define DECL_MULTI_REP_CHECK_BINOP_V(name, operation, kind, tag)
#define TURBOSHAFT_REDUCER_GENERIC_BOILERPLATE(Name)
#define DECL_GENERIC_UNOP_BUILTIN_CALL(Name)
#define REDUCE_THROWING_OP(Name)
#define DECL_GENERIC_BINOP_BUILTIN_CALL(Name)
#define DECL_SINGLE_REP_EQUAL_V(name, tag)
#define DECL_MULTI_REP_UNARY_V(name, operation, rep_type, kind, tag)
#define DECL_GENERIC_BINOP(Name)
#define DECL_SINGLE_REP_BINOP_V(name, operation, kind, tag)
#define DECL_CHANGE_V(name, kind, assumption, from, to)
#define DECL_MULTI_REP_BINOP(name, operation, rep_type, kind)
#define CONVERT_PRIMITIVE_TO_OBJECT(name, kind, input_rep, input_interpretation)
#define DECL_OBJECT_IS(kind)
#define DECL_SINGLE_REP_CHECK_BINOP_V(name, operation, kind, tag)
#define DECL_SINGLE_REP_SHIFT_V(name, kind, tag)
#define DECL_TAGGED_BITCAST(FromT, ToT, kind)
#define BIGINT_COMPARE(kind)
base::Vector< const DirectHandle< Object > > args
#define HEAP_IMMUTABLE_IMMOVABLE_OBJECT_LIST(V)
#define HEAP_IMMOVABLE_OBJECT_LIST(V)
#define HEAP_MUTABLE_IMMOVABLE_OBJECT_LIST(V)
ZoneVector< RpoNumber > & result
InstructionOperand destination
constexpr auto tuple_head(Tuple &&tpl)
int SNPrintF(Vector< char > str, const char *format,...)
bool all_equal(const C &container)
constexpr auto tuple_fold(T &&initial, Tuple &&tpl, Function &&function)
decltype(std::tuple_cat( std::declval< std::tuple< T > >(), std::declval< Tuple >())) prepend_tuple_type
constexpr auto tuple_map(Tuple &&tpl, Function &&function)
constexpr auto tuple_map2(TupleV &&tplv, TupleU &&tplu, Function &&function)
V8_INLINE Dest bit_cast(Source const &source)
constexpr Vector< T > VectorOf(T *start, size_t size)
typename detail::nth_type< N, T... >::type nth_type_t
constexpr auto tuple_drop(Tuple &&tpl)
auto ResolveAll(A &assembler, const ConstOrValues &const_or_values)
auto BuildResultTuple(bool bound, Iterable &&iterable, LoopLabel &&loop_header, Label<> loop_exit, Iterator current_iterator, Value current_value)
auto BuildResultTupleImpl(bool bound, Iterable &&iterable, LoopLabel &&loop_header, Label<> loop_exit, Iterator current_iterator, ValueTuple current_values, std::index_sequence< Indices... >)
bool SuppressUnusedWarning(bool b)
T && MakeShadowy(T &&value)
auto unwrap_unary_tuple(std::tuple< T > &&tpl)
typename IndexTypeFor< T >::type index_type_for_t
ConstOrV(V< T >) -> ConstOrV< T >
Zip(Iterables... iterables) -> Zip< Iterables... >
detail::LoopLabelForHelper< T >::type LoopLabelFor
constexpr bool const_or_v_exists_v
V8_INLINE const Operation & Get(const Graph &graph, OpIndex index)
any_of(const Args &...) -> any_of< Args... >
constexpr bool MayThrow(Opcode opcode)
constexpr nullrep_t nullrep
std::conditional_t< Is64(), Word64, Word32 > WordPtr
Range(V< T >, V< T >, V< T >) -> Range< T >
UntaggedUnion< Float32, Float64 > Float
OptionalV(V< T >) -> OptionalV< T >
UntaggedUnion< Word32, Word64 > Word
Handle< Code > BuiltinCodeHandle(Builtin builtin, Isolate *isolate)
typename detail::ConstOrVTypeHelper< T >::type maybe_const_or_v_t
Sequence(V< T >, V< T >) -> Sequence< T >
TNode< Float64T > Float64Add(TNode< Float64T > a, TNode< Float64T > b)
Node::Uses::const_iterator begin(const Node::Uses &uses)
constexpr int kWasmInstanceDataParameterIndex
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
bool TryCast(Tagged< From > value, Tagged< To > *out)
constexpr int kSimd128Size
constexpr int kMinParameterIndex
bool Is(IndirectHandle< U > value)
bool IsAnyHole(Tagged< Object > obj, PtrComprCageBase cage_base)
@ kIndirectPointerNullTag
constexpr int kTrustedPointerTableEntrySizeLog2
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
static constexpr bool is_taggable_v
static constexpr bool is_subtype_v
constexpr int kSimd256Size
constexpr int ElementsKindToShiftSize(ElementsKind elements_kind)
constexpr int kTaggedSizeLog2
constexpr bool SmiValuesAre31Bits()
T ReverseBytes(T value, int block_bytes_log2)
DONT_OVERRIDE DISABLE_ALLOCATION_SITES DISABLE_ALLOCATION_SITES HOLEY_DOUBLE_ELEMENTS
constexpr uint32_t kTrustedPointerHandleShift
V8_EXPORT_PRIVATE FlagValues v8_flags
const intptr_t kSmiTagMask
constexpr uint64_t kTrustedPointerTableMarkBit
void MemCopy(void *dest, const void *src, size_t size)
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
bool is_signed(Condition cond)
template const char * string
!IsContextMap !IsContextMap native_context
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define BIGINT_BINOP(Name)
#define GENERIC_BINOP_LIST(V)
#define TURBOSHAFT_OPERATION_LIST(V)
#define TURBOSHAFT_THROWING_STATIC_OUTPUTS_OPERATIONS_LIST(V)
#define GENERIC_UNOP_LIST(V)
#define DCHECK_LE(v1, v2)
#define DCHECK_NOT_NULL(val)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
constexpr T RoundUp(T x, intptr_t m)
AssemblerData(PipelineData *data, Graph &input_graph, Graph &output_graph, Zone *phase_zone)
static Kind KindFromBinOp(AtomicRMWOp::BinOp bin_op)
@ kJSFloat16ChangeWithBitcast
@ kJSFloat16TruncateWithBitcast
@ kFloat64ToAdditiveSafeInteger
Block * didnt_throw_block
@ kRelocatableWasmCanonicalSignatureId
@ kRelocatableWasmIndirectCallTarget
@ kRelocatableWasmStubCall
@ kFindOrderedHashMapEntryForInt32Key
@ kFindOrderedHashMapEntry
@ kFindOrderedHashSetEntry
base::SmallVector< Block *, 4 > predecessors
recorded_values_t recorded_values
static constexpr Kind TaggedBase()
static constexpr Kind RawAligned()
static constexpr Kind Aligned(BaseTaggedness base_is_tagged)
V8_INLINE OpIndex & input(size_t i)
base::Vector< const OpIndex > inputs() const
const underlying_operation_t< Op > * TryCast() const
underlying_operation_t< Op > & Cast()
RegisterRepresentation rep
RegisterRepresentation rep
reducer_list_to_stack< WithGenericAndEmitProjection, StackBottom< ReducerList > >::type type
reducer_list_insert_at< ReducerList, base_index, GenericReducerBase >::type WithGeneric
static constexpr size_t base_index
static constexpr size_t ep_index
reducer_list_insert_at< WithGeneric, ep_index, EmitProjectionReducer >::type WithGenericAndEmitProjection
Assembler< ReducerList > & Asm()
base::Vector< Case > cases
static const TSCallDescriptor * Create(const CallDescriptor *descriptor, CanThrow can_throw, LazyDeoptOnThrow lazy_deopt_on_throw, Zone *graph_zone, const JSWasmCallParameters *js_wasm_call_parameters=nullptr)
static constexpr int bits
#define OFFSET_OF_DATA_START(Type)
#define T1(name, string, precedence)
#define T2(name, string, precedence)
#define V8_UNLIKELY(condition)