63 reducer->
broker(), reducer->JSGraphForGraphAssembler(),
80 std::unordered_set<Node*>* generated_calls_with_array_like_or_spread);
86 StringRef search_element_string);
148 template <
typename T,
typename U>
154 template <
typename T,
typename U>
163 bool has_stability_dependency) {
166 if (!has_stability_dependency) {
192 Effect handler_effect{
nullptr};
193 Control handler_control{
nullptr};
210 catch_body(handler_exception);
223 return {
this, try_body};
282 return {
this, initial_value, cond, step};
286 return {
this, initial_value,
324 arg0 = loop_header->PhiAt<
Object>(1);
354 return {
this, initial_value, cond, step, initial_arg0};
366 return {
this, initial_value, cond, step, initial_arg0};
391 template <
typename T>
442 const bool has_stability_dependency,
446 const bool has_stability_dependency,
451 const bool has_stability_dependency,
456 const bool has_stability_dependency,
461 const bool has_stability_dependency,
467 MapInference* inference,
const bool has_stability_dependency,
471 bool needs_fallback_builtin_call);
494 return std::make_pair(index, value);
497 template <
typename... Vars>
545 DCHECK_EQ(IrOpcode::kJSConstruct, node->opcode());
585 DCHECK(shared.HasBuiltinId());
601 Node* no_feedback = UndefinedConstant();
607 executor, UndefinedConstant(), resolve, reject, no_feedback,
608 n.context(), frame_state, effect(),
control()));
617 Node* no_feedback = UndefinedConstant();
623 reject, UndefinedConstant(), exception, no_feedback, n.context(),
624 frame_state, effect(),
control()));
644 DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
655 const int c_argument_count =
659 const int slow_arg_count =
666 const int value_input_count =
672 inputs[cursor++] = n.receiver();
676 int js_args_count = c_argument_count -
kReceiver;
677 for (
int i = 0;
i < js_args_count; ++
i) {
678 if (
i < n.ArgumentCount()) {
679 inputs[cursor++] = n.Argument(
i);
681 inputs[cursor++] = UndefinedConstant();
698 isolate(), no_profiling ? Builtin::kCallApiCallbackOptimizedNoProfiling
699 : Builtin::kCallApiCallbackOptimized);
712 static_cast<unsigned>(
733 inputs[cursor++] = continuation_frame_state;
735 inputs[cursor++] =
effect();
755 size_t inputs_size) {
758 static_cast<int>(inputs_size), inputs));
827 arg0, arg1, arg2, arg3, context));
841 function,
this_arg, arg0, arg1, arg2, n.feedback_vector(),
858 function,
this_arg, arg0, arg1, arg2, arg3, n.feedback_vector(),
875 graph()->NewNode(
javascript()->CreateArray(1, std::nullopt), ctor, ctor,
887 Node* empty_fixed_array =
jsgraph()->EmptyFixedArrayConstant();
892 for (
int i = 0;
i < map.GetInObjectProperties(); ++
i) {
894 jsgraph()->UndefinedConstant());
922 graph()->NewNode(op, left_number, right_number));
963 int search_string_length = search_element_string.
length();
968 auto search_string_too_long =
976 for (
int i = 0;
i < search_string_length;
i++) {
980 Node* receiver_string_char =
985 search_string_char, receiver_string_char);
986 GotoIfNot(is_equal, &out, FalseConstant());
989 Goto(&out, TrueConstant());
1022 Node* receiver_string_char =
1024 if (!
v8_flags.turbo_loop_variable) {
1033 receiver_string_char, search_string_char);
1034 GotoIfNot(is_equal, &out, FalseConstant());
1037 Goto(&out, TrueConstant());
1052 int search_string_length = search_element_string.
length();
1072 for (
int i = 0;
i < search_string_length;
i++) {
1076 Node* receiver_string_char =
1081 receiver_string_char, search_string_char);
1082 GotoIfNot(is_equal, &out, FalseConstant());
1085 Goto(&out, TrueConstant());
1121 Node* receiver_string_char =
1123 if (!
v8_flags.turbo_loop_variable) {
1132 receiver_string_char, search_string_char);
1133 GotoIfNot(is_equal, &out, FalseConstant());
1136 Goto(&out, TrueConstant());
1144 DCHECK(s.IsContentAccessible());
1145 if (s.IsOneByteRepresentation()) {
1146 OptionalObjectRef elem = s.GetCharAsStringOrUndefined(
broker(), index);
1151 : EmptyStringConstant();
1154 const uint32_t length =
static_cast<uint32_t
>(s.length());
1155 if (index >= length)
return EmptyStringConstant();
1158 ->local_isolate_or_isolate()
1161 .ToHandleChecked());
1162 flat->SeqTwoByteStringSet(0, s.GetChar(
broker(), index).
value());
1165 return two_byte_elem;
1182 return result_string;
1205 .Else(
_ {
return NumberMin(start_smi, length); })
1215 .Else(
_ {
return NumberMin(end_smi, length); })
1224 .Else(
_ {
return EmptyStringConstant(); })
1244 auto check_instance_type =
1246 GotoIfNot(check_instance_type, &call_builtin);
1252 auto check_element_kind =
NumberEqual(arguments_list_elements_kind,
1254 GotoIfNot(check_element_kind, &call_builtin);
1260 Goto(&done, builtin == Builtin::kMathMax
1265 Bind(&call_builtin);
1278 return done.PhiAt<
Object>(0);
1294 for (
MapRef map : maps) {
1298 Branch(is_map_equal, &correct_map_label, &wrong_map_label);
1299 Bind(&correct_map_label);
1307 .Then(
_ {
return NumberAdd(length, index_num); })
1308 .Else(
_ {
return index_num; })
1314 UndefinedConstant());
1316 UndefinedConstant());
1317 if (
v8_flags.turbo_typer_hardening) {
1318 real_index_num =
CheckBounds(real_index_num, length,
1335 Goto(&out, element);
1337 Bind(&wrong_map_label);
1340 if (needs_fallback_builtin_call) {
1355 op, fallback_builtin,
receiver, index, n.feedback_vector(),
1360 Goto(&out, UndefinedConstant());
1364 return out.PhiAt<
Object>(0);
1375 for (
int i = 0;
i < num_push_arguments; ++
i) {
1383 auto double_label =
MakeLabel(argument_reps);
1384 auto smi_label =
MakeLabel(argument_reps);
1385 auto object_label =
MakeLabel(argument_reps);
1387 for (
size_t i = 0;
i < receiver_maps.
size();
i++) {
1388 MapRef map = receiver_maps[
i];
1391 if (
i < receiver_maps.
size() - 1) {
1394 GotoIf(is_map_equal, &double_label, argument_nodes);
1396 GotoIf(is_map_equal, &smi_label, argument_nodes);
1398 GotoIf(is_map_equal, &object_label, argument_nodes);
1402 Goto(&double_label, argument_nodes);
1404 Goto(&smi_label, argument_nodes);
1406 Goto(&object_label, argument_nodes);
1424 if (num_push_arguments > 0) {
1443 for (
int i = 0;
i < num_push_arguments; ++
i) {
1450 Goto(&return_label, return_value);
1453 if (double_label.IsUsed()) {
1454 Bind(&double_label);
1456 for (
int i = 0;
i < num_push_arguments; ++
i) {
1462 push_arguments[
i] =
value;
1467 if (smi_label.IsUsed()) {
1470 for (
int i = 0;
i < num_push_arguments; ++
i) {
1472 push_arguments[
i] =
value;
1474 Goto(&object_label, push_arguments);
1477 if (object_label.IsUsed()) {
1478 Bind(&object_label);
1480 for (
int i = 0;
i < num_push_arguments; ++
i) {
1481 push_arguments[
i] = object_label.PhiAt(
i);
1486 Bind(&return_label);
1492struct ForEachFrameStateParams {
1494 SharedFunctionInfoRef shared;
1495 TNode<Context> context;
1496 TNode<Object> target;
1504FrameState ForEachLoopLazyFrameState(
const ForEachFrameStateParams& params,
1506 Builtin builtin = Builtin::kArrayForEachLoopLazyDeoptContinuation;
1507 Node* checkpoint_params[] = {params.receiver, params.callback,
1508 params.this_arg, k, params.original_length};
1510 params.jsgraph, params.shared, builtin, params.target, params.context,
1511 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
1515FrameState ForEachLoopEagerFrameState(
const ForEachFrameStateParams& params,
1517 Builtin builtin = Builtin::kArrayForEachLoopEagerDeoptContinuation;
1518 Node* checkpoint_params[] = {params.receiver, params.callback,
1519 params.this_arg, k, params.original_length};
1521 params.jsgraph, params.shared, builtin, params.target, params.context,
1522 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
1530 MapInference* inference,
const bool has_stability_dependency,
1541 ForEachFrameStateParams frame_state_params{
1549 Checkpoint(ForEachLoopEagerFrameState(frame_state_params, k));
1562 ForEachLoopLazyFrameState(frame_state_params, next_k));
1564 Goto(&continue_label);
1565 Bind(&continue_label);
1568 return UndefinedConstant();
1573struct ReduceFrameStateParams {
1577 TNode<Context> context;
1578 TNode<Object> target;
1582FrameState ReducePreLoopLazyFrameState(
const ReduceFrameStateParams& params,
1584 TNode<Object>
callback, TNode<Object> k,
1587 ? Builtin::kArrayReduceLoopLazyDeoptContinuation
1588 : Builtin::kArrayReduceRightLoopLazyDeoptContinuation;
1591 params.jsgraph, params.shared, builtin, params.target, params.context,
1592 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
1596FrameState ReducePreLoopEagerFrameState(
const ReduceFrameStateParams& params,
1602 ? Builtin::kArrayReducePreLoopEagerDeoptContinuation
1603 :
Builtin::kArrayReduceRightPreLoopEagerDeoptContinuation;
1606 params.jsgraph, params.shared, builtin, params.target, params.context,
1607 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
1611FrameState ReduceLoopLazyFrameState(
const ReduceFrameStateParams& params,
1613 TNode<Object>
callback, TNode<Object> k,
1616 ? Builtin::kArrayReduceLoopLazyDeoptContinuation
1617 :
Builtin::kArrayReduceRightLoopLazyDeoptContinuation;
1620 params.jsgraph, params.shared, builtin, params.target, params.context,
1621 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
1625FrameState ReduceLoopEagerFrameState(
const ReduceFrameStateParams& params,
1627 TNode<Object>
callback, TNode<Object> k,
1629 TNode<Object> accumulator) {
1631 ? Builtin::kArrayReduceLoopEagerDeoptContinuation
1632 :
Builtin::kArrayReduceRightLoopEagerDeoptContinuation;
1636 params.jsgraph, params.shared, builtin, params.target, params.context,
1637 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
1644 MapInference* inference,
const bool has_stability_dependency,
1653 ReduceFrameStateParams frame_state_params{
1675 fncallback, ReducePreLoopLazyFrameState(frame_state_params,
receiver,
1693 CheckIf(cond(k), DeoptimizeReason::kNoInitialElement);
1702 Bind(&continue_label);
1708 Bind(&found_initial_element);
1709 k = step(found_initial_element.PhiAt<
Number>(0));
1710 accumulator = found_initial_element.PhiAt<
Object>(1);
1714 For1(k, cond, step, accumulator)
1732 fncallback, UndefinedConstant(), *accumulator, element, k,
1734 ReduceLoopLazyFrameState(frame_state_params,
receiver,
1736 Goto(&continue_label, next_accumulator);
1738 Bind(&continue_label);
1739 *accumulator = continue_label.PhiAt<
Object>(0);
1748struct MapFrameStateParams {
1757 std::optional<TNode<JSArray>> a;
1761FrameState MapPreLoopLazyFrameState(
const MapFrameStateParams& params) {
1763 Node* checkpoint_params[] = {params.receiver, params.callback,
1764 params.this_arg, params.original_length};
1766 params.jsgraph, params.shared,
1767 Builtin::kArrayMapPreLoopLazyDeoptContinuation, params.target,
1768 params.context, checkpoint_params,
arraysize(checkpoint_params),
1772FrameState MapLoopLazyFrameState(
const MapFrameStateParams& params,
1774 Node* checkpoint_params[] = {
1775 params.receiver, params.callback, params.this_arg, *params.a, k,
1776 params.original_length};
1778 params.jsgraph, params.shared,
1779 Builtin::kArrayMapLoopLazyDeoptContinuation, params.target,
1780 params.context, checkpoint_params,
arraysize(checkpoint_params),
1784FrameState MapLoopEagerFrameState(
const MapFrameStateParams& params,
1786 Node* checkpoint_params[] = {
1787 params.receiver, params.callback, params.this_arg, *params.a, k,
1788 params.original_length};
1790 params.jsgraph, params.shared,
1791 Builtin::kArrayMapLoopEagerDeoptContinuation, params.target,
1792 params.context, checkpoint_params,
arraysize(checkpoint_params),
1799 MapInference* inference,
const bool has_stability_dependency,
1822 .GetConstructor(
broker()));
1824 MapFrameStateParams frame_state_params{
1830 MapPreLoopLazyFrameState(frame_state_params));
1831 frame_state_params.a =
a;
1834 MapLoopLazyFrameState(frame_state_params, ZeroConstant()));
1837 Checkpoint(MapLoopEagerFrameState(frame_state_params, k));
1847 MapLoopLazyFrameState(frame_state_params, k));
1852 MapRef holey_double_map =
1858 Goto(&continue_label);
1859 Bind(&continue_label);
1867struct FilterFrameStateParams {
1880FrameState FilterLoopLazyFrameState(
const FilterFrameStateParams& params,
1883 Node* checkpoint_params[] = {params.receiver,
1888 params.original_length,
1892 params.jsgraph, params.shared,
1893 Builtin::kArrayFilterLoopLazyDeoptContinuation, params.target,
1894 params.context, checkpoint_params,
arraysize(checkpoint_params),
1898FrameState FilterLoopEagerPostCallbackFrameState(
1899 const FilterFrameStateParams& params, TNode<Number> k, TNode<Number> to,
1900 TNode<Object> element, TNode<Object> callback_value) {
1905 Node* checkpoint_params[] = {params.receiver,
1910 params.original_length,
1915 params.jsgraph, params.shared,
1916 Builtin::kArrayFilterLoopLazyDeoptContinuation, params.target,
1917 params.context, checkpoint_params,
arraysize(checkpoint_params),
1921FrameState FilterLoopEagerFrameState(
const FilterFrameStateParams& params,
1922 TNode<Number> k, TNode<Number> to) {
1923 Node* checkpoint_params[] = {params.receiver,
1928 params.original_length,
1931 params.jsgraph, params.shared,
1932 Builtin::kArrayFilterLoopEagerDeoptContinuation, params.target,
1933 params.context, checkpoint_params,
arraysize(checkpoint_params),
1941 MapInference* inference,
const bool has_stability_dependency,
1957 FilterFrameStateParams frame_state_params{
1974 Checkpoint(FilterLoopEagerFrameState(frame_state_params, k, a_length));
1985 FilterLoopLazyFrameState(frame_state_params, k, a_length, element));
1989 Checkpoint(FilterLoopEagerPostCallbackFrameState(frame_state_params, k,
1990 a_length, element, v));
2006 Goto(&continue_label, new_a_length);
2009 Bind(&continue_label);
2020struct FindFrameStateParams {
2032FrameState FindLoopLazyFrameState(
const FindFrameStateParams& params,
2035 ? Builtin::kArrayFindLoopLazyDeoptContinuation
2036 :
Builtin::kArrayFindIndexLoopLazyDeoptContinuation;
2037 Node* checkpoint_params[] = {params.receiver, params.callback,
2038 params.this_arg, k, params.original_length};
2040 params.jsgraph, params.shared, builtin, params.target, params.context,
2041 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
2045FrameState FindLoopEagerFrameState(
const FindFrameStateParams& params,
2048 ? Builtin::kArrayFindLoopEagerDeoptContinuation
2049 :
Builtin::kArrayFindIndexLoopEagerDeoptContinuation;
2050 Node* checkpoint_params[] = {params.receiver, params.callback,
2051 params.this_arg, k, params.original_length};
2053 params.jsgraph, params.shared, builtin, params.target, params.context,
2054 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
2058FrameState FindLoopAfterCallbackLazyFrameState(
2059 const FindFrameStateParams& params, TNode<Number> next_k,
2063 ? Builtin::kArrayFindLoopAfterCallbackLazyDeoptContinuation
2064 :
Builtin::kArrayFindIndexLoopAfterCallbackLazyDeoptContinuation;
2065 Node* checkpoint_params[] = {params.receiver, params.callback,
2066 params.this_arg, next_k,
2067 params.original_length, if_found_value};
2069 params.jsgraph, params.shared, builtin, params.target, params.context,
2070 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
2077 MapInference* inference,
const bool has_stability_dependency,
2089 FindFrameStateParams frame_state_params{
2095 FindLoopLazyFrameState(frame_state_params, ZeroConstant(), variant));
2101 Checkpoint(FindLoopEagerFrameState(frame_state_params, k, variant));
2111 TNode<Object> if_found_value = is_find_variant ? element : k;
2117 FindLoopAfterCallbackLazyFrameState(frame_state_params, next_k,
2118 if_found_value, variant));
2127 Goto(&out, if_not_found_value);
2130 return out.PhiAt<
Object>(0);
2135struct EverySomeFrameStateParams {
2147FrameState EverySomeLoopLazyFrameState(
const EverySomeFrameStateParams& params,
2151 ? Builtin::kArrayEveryLoopLazyDeoptContinuation
2152 :
Builtin::kArraySomeLoopLazyDeoptContinuation;
2153 Node* checkpoint_params[] = {params.receiver, params.callback,
2154 params.this_arg, k, params.original_length};
2156 params.jsgraph, params.shared, builtin, params.target, params.context,
2157 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
2161FrameState EverySomeLoopEagerFrameState(
const EverySomeFrameStateParams& params,
2165 ? Builtin::kArrayEveryLoopEagerDeoptContinuation
2166 :
Builtin::kArraySomeLoopEagerDeoptContinuation;
2167 Node* checkpoint_params[] = {params.receiver, params.callback,
2168 params.this_arg, k, params.original_length};
2170 params.jsgraph, params.shared, builtin, params.target, params.context,
2171 checkpoint_params,
arraysize(checkpoint_params), params.outer_frame_state,
2179 MapInference* inference,
const bool has_stability_dependency,
2191 EverySomeFrameStateParams frame_state_params{
2197 EverySomeLoopLazyFrameState(frame_state_params, ZeroConstant(), variant));
2202 Checkpoint(EverySomeLoopEagerFrameState(frame_state_params, k, variant));
2213 EverySomeLoopLazyFrameState(frame_state_params, k, variant));
2221 Goto(&continue_label);
2222 Bind(&continue_label);
2238 switch (elements_kind) {
2245 Builtin::kArrayIndexOfSmiOrObject);
2248 Builtin::kArrayIndexOfPackedDoubles);
2252 Builtin::kArrayIndexOfHoleyDoubles);
2256 switch (elements_kind) {
2263 Builtin::kArrayIncludesSmiOrObject);
2266 Builtin::kArrayIncludesPackedDoubles);
2270 Builtin::kArrayIncludesHoleyDoubles);
2294 if (have_from_index) {
2306 .Else(
_ {
return from_index_smi; })
2312 context, elements, search_element, length, from_index);
2316struct PromiseCtorFrameStateParams {
2320 TNode<Context> context;
2321 TNode<Object> target;
2327FrameState CreateConstructInvokeStubFrameState(
2329 Node* context, CommonOperatorBuilder* common, TFGraph* graph) {
2330 const FrameStateFunctionInfo* state_info =
2332 1, 0, 0, shared.object(), {});
2334 const Operator* op = common->FrameState(
2337 Node* node0 = graph->NewNode(op0);
2339 static constexpr int kTargetInputIndex = 0;
2340 static constexpr int kReceiverInputIndex = 1;
2341 std::vector<Node*> params;
2342 params.push_back(node->InputAt(kReceiverInputIndex));
2343 const Operator* op_param = common->StateValues(
2345 Node* params_node = graph->NewNode(op_param,
static_cast<int>(params.size()),
2348 return FrameState(graph->NewNode(op, params_node, node0, node0, context,
2349 node->InputAt(kTargetInputIndex),
2353FrameState PromiseConstructorFrameState(
2354 const PromiseCtorFrameStateParams& params, CommonOperatorBuilder* common,
2357 params.shared.internal_formal_parameter_count_without_receiver());
2358 return CreateConstructInvokeStubFrameState(
2359 params.node_ptr, params.outer_frame_state, params.shared, params.context,
2363FrameState PromiseConstructorLazyFrameState(
2364 const PromiseCtorFrameStateParams& params,
2365 FrameState constructor_frame_state) {
2368 JSGraph*
jsgraph = params.jsgraph;
2369 Node* checkpoint_params[] = {
2376 jsgraph, params.shared, Builtin::kPromiseConstructorLazyDeoptContinuation,
2377 params.target, params.context, checkpoint_params,
2378 arraysize(checkpoint_params), constructor_frame_state,
2382FrameState PromiseConstructorLazyWithCatchFrameState(
2383 const PromiseCtorFrameStateParams& params,
2384 FrameState constructor_frame_state, TNode<JSPromise> promise,
2385 TNode<JSFunction> reject) {
2388 Node* checkpoint_params[] = {
2389 params.jsgraph->UndefinedConstant(),
2392 params.jsgraph, params.shared,
2393 Builtin::kPromiseConstructorLazyDeoptContinuation, params.target,
2394 params.context, checkpoint_params,
arraysize(checkpoint_params),
2414 PromiseCtorFrameStateParams frame_state_params{
jsgraph(), promise_shared,
2423 PromiseConstructorFrameState(frame_state_params,
common(),
graph());
2428 Runtime::kThrowTypeError,
2432 PromiseConstructorLazyFrameState(frame_state_params,
2433 constructor_frame_state));
2454 ->promise_capability_default_resolve_shared_fun());
2462 ->promise_capability_default_reject_shared_fun());
2467 PromiseConstructorLazyWithCatchFrameState(
2468 frame_state_params, constructor_frame_state, promise, reject);
2488 DCHECK(catch_scope->is_outermost());
2490 if (catch_scope->has_handler() &&
2491 catch_scope->has_exceptional_control_flow()) {
2493 Effect handler_effect{
nullptr};
2494 Control handler_control{
nullptr};
2496 &handler_exception, &handler_effect, &handler_control);
2499 handler_effect, handler_control);
2519 DCHECK(catch_scope->is_outermost());
2521 if (catch_scope->has_handler() &&
2522 catch_scope->has_exceptional_control_flow()) {
2524 Effect handler_effect{
nullptr};
2525 Control handler_control{
nullptr};
2527 &handler_exception, &handler_effect, &handler_control);
2530 handler_effect, handler_control);
2542 if (n.ArgumentCount() < 1) {
2549 Node* subgraph = a.ReduceMathUnary(op);
2559 if (n.ArgumentCount() < 1) {
2566 Node* subgraph = a.ReduceMathBinary(op);
2577 if (n.ArgumentCount() < 1) {
2582 Node* left = n.Argument(0);
2583 Node* right = n.ArgumentOr(1,
jsgraph()->ZeroConstant());
2584 Effect effect = n.effect();
2585 Control control = n.control();
2590 left, effect, control);
2594 right, effect, control);
2609 if (n.ArgumentCount() < 1) {
2614 Node* input = n.Argument(0);
2615 Effect effect = n.effect();
2616 Control control = n.control();
2621 input, effect, control);
2631 Node* empty_value) {
2637 if (n.ArgumentCount() < 1) {
2644 Node* value = effect =
2647 n.Argument(0), effect, control);
2648 for (
int i = 1;
i < n.ArgumentCount();
i++) {
2652 n.Argument(
i), effect, control);
2661 switch (node->opcode()) {
2662 case IrOpcode::kJSConstruct:
2664 case IrOpcode::kJSConstructWithArrayLike:
2666 case IrOpcode::kJSConstructWithSpread:
2668 case IrOpcode::kJSConstructForwardAllArgs:
2670 case IrOpcode::kJSCall:
2672 case IrOpcode::kJSCallWithArrayLike:
2674 case IrOpcode::kJSCallWithSpread:
2686 std::set<Node*>
const waitlist = std::move(
waitlist_);
2687 for (
Node* node : waitlist) {
2688 if (!node->IsDead()) {
2692 if (reduction.Changed()) {
2693 Node* replacement = reduction.replacement();
2694 if (replacement != node) {
2695 Replace(node, replacement, max_id);
2705 Node* target = n.target();
2710 node->RemoveInput(n.FeedbackVectorIndex());
2714 javascript()->CreateArray(arity, std::nullopt));
2722 Node* value = n.ArgumentOrUndefined(0,
jsgraph());
2731 if (n.ArgumentCount() < 1)
return NoChange();
2732 Node* value = n.Argument(0);
2733 Effect effect = n.effect();
2768 node->ReplaceInput(n.TargetIndex(), n.receiver());
2769 node->ReplaceInput(n.ReceiverIndex(),
jsgraph()->UndefinedConstant());
2774 node->RemoveInput(n.TargetIndex());
2789 Node* target = n.receiver();
2790 Node* this_argument = n.Argument(0);
2791 Node* arguments_list = n.Argument(1);
2792 Node* context = n.context();
2794 Effect effect = n.effect();
2795 Control control = n.control();
2801 node->ReplaceInput(n.TargetIndex(), target);
2802 node->ReplaceInput(n.ReceiverIndex(), this_argument);
2803 node->ReplaceInput(n.ArgumentIndex(0), arguments_list);
2804 while (arity-- > 1) node->RemoveInput(n.ArgumentIndex(1));
2810 new_feedback_relation));
2824 Node* check_undefined =
2826 jsgraph()->UndefinedConstant());
2828 check_undefined, control);
2834 Node* effect0 = effect;
2835 Node* control0 = control;
2839 new_feedback_relation),
2840 target, this_argument, arguments_list, n.feedback_vector(), context,
2841 frame_state, effect0, control0);
2844 Node* effect1 = effect;
2848 n.feedback_vector(), context, frame_state, effect1, control1);
2851 Node* if_exception =
nullptr;
2854 Node* if_exception0 =
2857 Node* if_exception1 =
2865 if_exception1, merge);
2868 if_exception0, if_exception1, merge);
2897 Node* context = n.context();
2898 Effect effect = n.effect();
2899 Control control = n.control();
2909 MapRef first_receiver_map = receiver_maps[0];
2914 for (
MapRef receiver_map : receiver_maps) {
2918 if (!map_prototype.equals(prototype) ||
2920 !InstanceTypeChecker::IsJSFunctionOrBoundFunctionOrWrappedFunction(
2921 receiver_map.instance_type())) {
2927 if (receiver_map.is_dictionary_map())
return inference.
NoChange();
2934 int minimum_nof_descriptors =
2937 JSFunctionOrBoundFunctionOrWrappedFunction::
2938 kNameDescriptorIndex}) +
2940 if (receiver_map.NumberOfOwnDescriptors() < minimum_nof_descriptors) {
2950 OptionalObjectRef length_value(
2951 receiver_map.GetStrongValue(
broker(), kLengthIndex));
2952 OptionalObjectRef name_value(
2953 receiver_map.GetStrongValue(
broker(), kNameIndex));
2954 if (!length_value || !name_value) {
2956 broker(),
"name or length descriptors on map " << receiver_map);
2959 if (!receiver_map.GetPropertyKey(
broker(), kLengthIndex)
2960 .
equals(length_string) ||
2961 !length_value->IsAccessorInfo() ||
2962 !receiver_map.GetPropertyKey(
broker(), kNameIndex)
2964 !name_value->IsAccessorInfo()) {
2981 static constexpr int kBoundThis = 1;
2982 static constexpr int kReceiverContextEffectAndControl = 4;
2983 int const arity = n.ArgumentCount();
2993 int const arity_with_bound_this = std::max(arity, kBoundThis);
2994 int const input_count =
2995 arity_with_bound_this + kReceiverContextEffectAndControl;
2999 inputs[cursor++] = n.ArgumentOrUndefined(0,
jsgraph());
3000 for (
int i = 1;
i < arity; ++
i) {
3001 inputs[cursor++] = n.Argument(
i);
3004 inputs[cursor++] = effect;
3005 inputs[cursor++] = control;
3007 Node* value = effect =
3009 arity_with_bound_this - kBoundThis, map),
3010 input_count, inputs);
3019 Node* target = n.target();
3020 Effect effect = n.effect();
3021 Control control = n.control();
3027 if (
m.HasResolvedValue() &&
m.Ref(
broker()).IsJSFunction()) {
3046 node->ReplaceInput(n.TargetIndex(), n.receiver());
3047 node->ReplaceInput(n.ReceiverIndex(),
jsgraph()->UndefinedConstant());
3051 node->RemoveInput(n.TargetIndex());
3066 Node*
object = n.ArgumentOrUndefined(0,
jsgraph());
3067 Node* context = n.context();
3069 Effect effect = n.effect();
3070 Control control = n.control();
3079 node->ReplaceInput(1,
object);
3080 node->ReplaceInput(2, context);
3081 node->ReplaceInput(3, frame_state);
3082 node->ReplaceInput(4, effect);
3083 node->ReplaceInput(5, control);
3084 node->TrimInputCount(6);
3097 MapRef candidate_map = object_maps[0];
3101 for (
size_t i = 0;
i < object_maps.
size(); ++
i) {
3102 MapRef object_map = object_maps[
i];
3105 !map_prototype.equals(candidate_prototype)) {
3126 Node*
object = n.ArgumentOrUndefined(0,
jsgraph());
3191 if (name->opcode() == IrOpcode::kJSForInNext) {
3194 Node*
object = n.receiver();
3195 Node* cache_type = n.cache_type();
3196 if (object->opcode() == IrOpcode::kJSToObject) {
3203 Node* receiver_map = effect =
3207 receiver_map, cache_type);
3209 simplified()->CheckIf(DeoptimizeReason::kWrongMap), check, effect,
3233 if (
receiver->opcode() == IrOpcode::kHeapConstant) {
3239 if (receiver_maps.
size() == 1) {
3240 const MapRef receiver_map = *receiver_maps.
begin();
3265 &done,
__ TrueConstant());
3267 __ Goto(&done,
__ FalseConstant());
3270 Node* value = done.PhiAt(0);
3287 Node* value = n.ArgumentOrUndefined(0,
jsgraph());
3288 Effect effect = n.effect();
3302 for (
int i = node->op()->ValueInputCount();
i > 2;
i--) {
3303 node->RemoveInput(2);
3315 static_assert(n.ReceiverIndex() > n.TargetIndex());
3316 node->RemoveInput(n.ReceiverIndex());
3317 node->RemoveInput(n.TargetIndex());
3319 node->InsertInput(
graph()->zone(), arity++,
jsgraph()->UndefinedConstant());
3321 while (arity-- > 3) {
3322 node->RemoveInput(arity);
3341 static_assert(n.ReceiverIndex() > n.TargetIndex());
3342 node->RemoveInput(n.ReceiverIndex());
3343 node->RemoveInput(n.TargetIndex());
3349 node->InsertInput(
graph()->zone(), arity++,
jsgraph()->UndefinedConstant());
3351 while (arity-- > 3) {
3352 node->RemoveInput(arity);
3355 static_assert(JSConstructNode::TargetIndex() == 0);
3356 static_assert(JSConstructNode::NewTargetIndex() == 1);
3358 node->ReplaceInput(JSConstructNode::TargetIndex(), arg_target);
3359 node->ReplaceInput(JSConstructNode::NewTargetIndex(), arg_new_target);
3370 Node* target = n.ArgumentOrUndefined(0,
jsgraph());
3377 Node* properties = n.ArgumentOrUndefined(1,
jsgraph());
3380 Node* context = n.context();
3382 Effect effect = n.effect();
3383 Control control = n.control();
3384 Node* prototype = n.ArgumentOrUndefined(0,
jsgraph());
3386 node->ReplaceInput(1, context);
3387 node->ReplaceInput(2, frame_state);
3388 node->ReplaceInput(3, effect);
3389 node->ReplaceInput(4, control);
3390 node->TrimInputCount(5);
3401 Node* target = n.Argument(0);
3403 Node* context = n.context();
3405 Effect effect = n.effect();
3406 Control control = n.control();
3415 Node* efalse = effect;
3420 static_cast<int>(MessageTemplate::kCalledOnNonObject)),
3422 frame_state, efalse, if_false);
3427 Node* etrue = effect;
3436 vtrue = etrue = if_true =
3438 key, context, frame_state, etrue, if_true);
3442 Node* on_exception =
nullptr;
3456 extrue, exfalse, merge);
3472 Node* target = n.ArgumentOrUndefined(0,
jsgraph());
3474 Node* context = n.context();
3475 Effect effect = n.effect();
3476 Control control = n.control();
3486 Node* efalse = effect;
3491 static_cast<int>(MessageTemplate::kCalledOnNonObject)),
3493 frame_state, efalse, if_false);
3498 Node* etrue = effect;
3504 jsgraph()->UndefinedConstant(), context, frame_state, etrue, if_true);
3508 Node* on_exception =
nullptr;
3522 extrue, exfalse, merge);
3541 *kind_return = receiver_maps[0].elements_kind();
3542 for (
MapRef map : receiver_maps) {
3543 if (!map.supports_fast_array_iteration(
broker) ||
3551bool CanInlineArrayResizingBuiltin(JSHeapBroker*
broker,
3553 std::vector<ElementsKind>* kinds,
3554 bool builtin_is_push =
false) {
3556 for (MapRef map : receiver_maps) {
3557 if (!map.supports_fast_array_resize(
broker))
return false;
3564 auto kind_ptr = kinds->data();
3566 for (
i = 0;
i < kinds->size();
i++, kind_ptr++) {
3571 if (
i == kinds->size()) kinds->push_back(current_kind);
3577class IteratingArrayBuiltinHelper {
3579 IteratingArrayBuiltinHelper(Node* node, JSHeapBroker*
broker,
3581 CompilationDependencies* dependencies)
3582 :
receiver_(NodeProperties::GetValueInput(node, 1)),
3583 effect_(NodeProperties::GetEffectInput(node)),
3584 control_(NodeProperties::GetControlInput(node)),
3586 if (!
v8_flags.turbo_inline_array_builtins)
return;
3588 DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
3598 if (!CanInlineArrayIteratingBuiltin(
broker, receiver_maps,
3604 if (!dependencies->DependOnNoElementsProtector())
return;
3606 has_stability_dependency_ =
inference_.RelyOnMapsPreferStability(
3607 dependencies,
jsgraph, &effect_, control_, p.feedback());
3614 Effect effect()
const {
return effect_; }
3615 Control control()
const {
return control_; }
3616 MapInference* inference() {
return &
inference_; }
3634 if (!h.can_reduce())
return h.inference()->NoChange();
3637 a.InitializeEffectControl(h.effect(), h.control());
3639 h.inference(), h.has_stability_dependency(), h.elements_kind(), shared);
3646 if (!h.can_reduce())
return h.inference()->NoChange();
3649 a.InitializeEffectControl(h.effect(), h.control());
3651 h.inference(), h.has_stability_dependency(), h.elements_kind(),
3659 if (!h.can_reduce())
return h.inference()->NoChange();
3662 a.InitializeEffectControl(h.effect(), h.control());
3664 h.inference(), h.has_stability_dependency(), h.elements_kind(),
3672 if (!h.can_reduce())
return h.inference()->NoChange();
3675 if (!
dependencies()->DependOnArraySpeciesProtector()) {
3676 return h.inference()->NoChange();
3680 a.InitializeEffectControl(h.effect(), h.control());
3683 a.ReduceArrayPrototypeMap(h.inference(), h.has_stability_dependency(),
3691 if (!h.can_reduce())
return h.inference()->NoChange();
3694 if (!
dependencies()->DependOnArraySpeciesProtector()) {
3695 return h.inference()->NoChange();
3699 a.InitializeEffectControl(h.effect(), h.control());
3702 a.ReduceArrayPrototypeFilter(h.inference(), h.has_stability_dependency(),
3710 if (!h.can_reduce())
return h.inference()->NoChange();
3713 a.InitializeEffectControl(h.effect(), h.control());
3716 h.inference(), h.has_stability_dependency(), h.elements_kind(), shared,
3724 if (!h.can_reduce())
return h.inference()->NoChange();
3727 a.InitializeEffectControl(h.effect(), h.control());
3730 h.inference(), h.has_stability_dependency(), h.elements_kind(), shared,
3738 if (!h.can_reduce())
return h.inference()->NoChange();
3741 a.InitializeEffectControl(h.effect(), h.control());
3744 h.inference(), h.has_stability_dependency(), h.elements_kind(), shared,
3753 if (!h.can_reduce())
return h.inference()->NoChange();
3756 a.InitializeEffectControl(h.effect(), h.control());
3758 TNode<Object> subgraph = a.ReduceArrayPrototypeIndexOfIncludes(
3767 if (!h.can_reduce())
return h.inference()->NoChange();
3770 a.InitializeEffectControl(h.effect(), h.control());
3772 TNode<Object> subgraph = a.ReduceArrayPrototypeIndexOfIncludes(
3780 if (!h.can_reduce())
return h.inference()->NoChange();
3783 a.InitializeEffectControl(h.effect(), h.control());
3786 h.inference(), h.has_stability_dependency(), h.elements_kind(), shared,
3791#if V8_ENABLE_WEBASSEMBLY
3800 for (
auto type : wasm_signature->
all()) {
3801#if defined(V8_TARGET_ARCH_32_BIT)
3817 SharedFunctionInfoRef shared) {
3821 const CallParameters& p = n.Parameters();
3834 if (function_data->is_promising())
return NoChange();
3837 function_data->instance_data();
3838 const wasm::CanonicalSig* wasm_signature = function_data->sig();
3839 if (!CanInlineJSToWasmCall(wasm_signature)) {
3843 wasm::NativeModule* native_module =
instance_data->native_module();
3844 const wasm::WasmModule* wasm_module = native_module->module();
3845 int wasm_function_index = function_data->function_index();
3847 if (wasm_module_for_inlining_ ==
nullptr) {
3848 wasm_module_for_inlining_ = wasm_module;
3855 const Operator* op =
3856 javascript()->CallWasm(wasm_module, wasm_signature, wasm_function_index,
3857 shared, native_module, p.feedback());
3860 size_t actual_arity = n.ArgumentCount();
3862 DCHECK_EQ(actual_arity + JSWasmCallNode::kExtraInputCount - 1,
3863 n.FeedbackVectorIndex());
3864 size_t expected_arity = wasm_signature->parameter_count();
3866 while (actual_arity > expected_arity) {
3868 static_cast<int>(n.FirstArgumentIndex() + expected_arity);
3869 DCHECK_LT(removal_index,
static_cast<int>(node->InputCount()));
3870 node->RemoveInput(removal_index);
3875 while (actual_arity < expected_arity) {
3876 int insertion_index = n.ArgumentIndex(n.ArgumentCount());
3877 node->InsertInput(
graph()->zone(), insertion_index,
3892 Node* target = n.target();
3898 Node* context = n.context();
3899 Effect effect = n.effect();
3900 Control control = n.control();
3903 if (!shared.function_template_info(
broker()).has_value()) {
3905 broker(),
"FunctionTemplateInfo for function with SFI " << shared);
3939 MapRef first_receiver_map = receiver_maps[0];
3944 first_receiver_map);
3968 CHECK(first_receiver_map.IsJSReceiverMap());
3972 for (
size_t i = 1;
i < receiver_maps.
size(); ++
i) {
3973 MapRef receiver_map = receiver_maps[
i];
3988 CHECK(receiver_map.IsJSReceiverMap());
4012 builtin_name = Builtin::kCallFunctionTemplate_CheckCompatibleReceiver;
4014 builtin_name = Builtin::kCallFunctionTemplate_CheckAccess;
4017 Builtin::kCallFunctionTemplate_CheckAccessAndCompatibleReceiver;
4032 node->RemoveInput(n.FeedbackVectorIndex());
4033 node->InsertInput(
graph()->zone(), 0,
4036 1,
jsgraph()->ConstantNoHole(function_template_info,
broker()));
4037 node->InsertInput(
graph()->zone(), 2,
4040 node->ReplaceInput(6 + argc, effect);
4049 compiler::OptionalObjectRef maybe_callback_data =
4052 if (!maybe_callback_data.has_value()) {
4056 << function_template_info);
4062 broker(), function_template_info, argc);
4066 c_function,
receiver, shared, target, argc,
4068 Node* fast_call_subgraph = a.ReduceFastApiCall();
4070 return Replace(fast_call_subgraph);
4077 isolate(), no_profiling ? Builtin::kCallApiCallbackOptimizedNoProfiling
4078 : Builtin::kCallApiCallbackOptimized);
4080 auto call_descriptor =
4090 node->RemoveInput(n.FeedbackVectorIndex());
4091 node->InsertInput(
graph()->zone(), 0,
4093 node->ReplaceInput(1,
jsgraph()->ExternalConstant(function_reference));
4094 node->InsertInput(
graph()->zone(), 2,
jsgraph()->ConstantNoHole(argc));
4100 node->ReplaceInput(5 + argc + 1, continuation_frame_state);
4101 node->ReplaceInput(5 + argc + 2, effect);
4111bool IsSafeArgumentsElements(
Node* node) {
4112 for (
Edge const edge : node->use_edges()) {
4114 if (edge.from()->opcode() != IrOpcode::kLoadField &&
4115 edge.from()->opcode() != IrOpcode::kLoadElement) {
4123bool IsCallOrConstructWithArrayLike(Node* node) {
4124 return node->opcode() == IrOpcode::kJSCallWithArrayLike ||
4125 node->opcode() == IrOpcode::kJSConstructWithArrayLike;
4129bool IsCallOrConstructWithSpread(Node* node) {
4130 return node->opcode() == IrOpcode::kJSCallWithSpread ||
4131 node->opcode() == IrOpcode::kJSConstructWithSpread;
4134bool IsCallWithArrayLikeOrSpread(Node* node) {
4135 return node->opcode() == IrOpcode::kJSCallWithArrayLike ||
4136 node->opcode() == IrOpcode::kJSCallWithSpread;
4152 Control control = n.control();
4156 Node* check_branch =
4162 static_cast<int>(MessageTemplate::kNotConstructor)),
4163 new_target, n.context(), n.frame_state(), n.effect(), check_fail);
4168 Node* on_exception =
nullptr;
4171 Node* if_exception =
4179 on_exception, merge);
4182 if_exception, on_exception, merge);
4186 phi->ReplaceInput(1, on_exception);
4199bool ShouldUseCallICFeedback(
Node* node) {
4201 if (
m.HasResolvedValue() ||
m.IsCheckClosure() ||
m.IsJSCreateClosure()) {
4206 }
else if (
m.IsPhi()) {
4209 if (control->opcode() == IrOpcode::kLoop ||
4210 control->opcode() == IrOpcode::kDead)
4214 int const value_input_count =
m.node()->op()->ValueInputCount();
4215 for (
int n = 0; n < value_input_count; ++
n) {
4216 if (ShouldUseCallICFeedback(node->InputAt(n)))
return true;
4226 uint32_t array_length,
4231 array, effect, control);
4233 jsgraph()->ConstantNoHole(array_length));
4235 simplified()->CheckIf(DeoptimizeReason::kArrayLengthChanged,
4237 check, effect, control);
4242 Node* node,
Node* arguments_list,
int arraylike_or_spread_index,
4251 Node*
const user = edge.from();
4252 switch (user->opcode()) {
4253 case IrOpcode::kCheckMaps:
4254 case IrOpcode::kFrameState:
4255 case IrOpcode::kStateValues:
4256 case IrOpcode::kReferenceEqual:
4257 case IrOpcode::kReturn:
4260 case IrOpcode::kLoadField: {
4263 if (access.offset == JSArray::kLengthOffset) {
4266 static_cast<int>(JSArray::kLengthOffset) ==
4267 static_cast<int>(JSStrictArgumentsObject::kLengthOffset));
4269 static_cast<int>(JSArray::kLengthOffset) ==
4270 static_cast<int>(JSSloppyArgumentsObject::kLengthOffset));
4272 }
else if (access.offset == JSObject::kElementsOffset) {
4274 if (IsSafeArgumentsElements(user))
continue;
4278 case IrOpcode::kJSCallWithArrayLike: {
4281 if (edge.index() == n.ArgumentIndex(0))
continue;
4284 case IrOpcode::kJSConstructWithArrayLike: {
4287 if (edge.index() == n.ArgumentIndex(0))
continue;
4290 case IrOpcode::kJSCallWithSpread: {
4293 if (edge.index() == n.LastArgumentIndex())
continue;
4296 case IrOpcode::kJSConstructWithSpread: {
4299 if (edge.index() == n.LastArgumentIndex())
continue;
4319 int formal_parameter_count;
4325 formal_parameter_count =
4327 .internal_formal_parameter_count_without_receiver();
4334 if (formal_parameter_count != 0) {
4346 if (IsCallOrConstructWithSpread(node)) {
4351 node->RemoveInput(arraylike_or_spread_index);
4357 ? formal_parameter_count
4367 if (IsCallWithArrayLikeOrSpread(node)) {
4368 static constexpr int kTargetAndReceiver = 2;
4372 static constexpr int kTargetAndNewTarget = 2;
4387 frame_state = outer_state;
4394 node->InsertInput(
graph()->zone(),
4398 if (IsCallWithArrayLikeOrSpread(node)) {
4402 speculation_mode, feedback_relation));
4407 frequency, feedback));
4418 Node* node,
int argument_count,
int arraylike_or_spread_index,
4422 DCHECK(IsCallOrConstructWithArrayLike(node) ||
4423 IsCallOrConstructWithSpread(node));
4427 Node* arguments_list =
4430 if (arguments_list->
opcode() == IrOpcode::kJSCreateArguments) {
4432 node, arguments_list, arraylike_or_spread_index, frequency,
4433 feedback_source, speculation_mode, feedback_relation);
4439 if (!IsCallWithArrayLikeOrSpread(node))
return NoChange();
4445 if (arguments_list->
opcode() != IrOpcode::kJSCreateLiteralArray &&
4446 arguments_list->
opcode() != IrOpcode::kJSCreateEmptyLiteralArray) {
4453 if (IsCallOrConstructWithSpread(node)) {
4457 if (arguments_list->
opcode() == IrOpcode::kJSCreateEmptyLiteralArray) {
4462 Node* subgraph = a.ReduceJSCallWithArrayLikeOrSpreadOfEmpty(
4468 int new_argument_count;
4477 if (feedback.IsInsufficient())
return NoChange();
4483 int const array_length =
4487 new_argument_count = argument_count - 1 + array_length;
4491 const int kMaxArityForOptimizedFunctionApply = 32;
4492 if (new_argument_count > kMaxArityForOptimizedFunctionApply) {
4509 node->RemoveInput(arraylike_or_spread_index);
4516 arguments_list, effect, control);
4522 feedback_source, effect, control);
4528 arguments_list, effect, control);
4529 for (
int i = 0;
i < array_length;
i++) {
4535 elements, index, effect, control);
4559 return function.shared(
broker()).HasBuiltinId() ||
4560 function.shared(
broker()).function_template_info(
broker()).has_value();
4568 Node* target = n.target();
4569 Effect effect = n.effect();
4570 Control control = n.control();
4575 if (
m.HasResolvedValue()) {
4576 ObjectRef target_ref =
m.Ref(
broker());
4577 if (target_ref.IsJSFunction()) {
4586 }
else if (target_ref.IsJSBoundFunction()) {
4588 ObjectRef bound_this = function.bound_this(
broker());
4590 bound_this.IsNullOrUndefined()
4597 const uint32_t bound_arguments_length = bound_arguments.
length();
4598 if (arity + bound_arguments_length + 1 >
4602 static constexpr int kInlineSize = 16;
4604 for (uint32_t
i = 0;
i < bound_arguments_length; ++
i) {
4605 OptionalObjectRef maybe_arg = bound_arguments.
TryGet(
broker(),
i);
4606 if (!maybe_arg.has_value()) {
4617 jsgraph()->ConstantNoHole(function.bound_target_function(
broker()),
4619 JSCallNode::TargetIndex());
4622 JSCallNode::ReceiverIndex());
4625 for (uint32_t
i = 0;
i < bound_arguments_length; ++
i) {
4626 node->InsertInput(
graph()->zone(),
i + 2,
args[
i]);
4650 if (target->opcode() == IrOpcode::kJSCreateClosure) {
4654 }
else if (target->opcode() == IrOpcode::kCheckClosure) {
4656 OptionalSharedFunctionInfoRef shared = cell.shared_function_info(
broker());
4657 if (!shared.has_value()) {
4659 << cell <<
" has no FeedbackVector");
4668 if (target->opcode() == IrOpcode::kJSCreateBoundFunction) {
4671 uint32_t
const bound_arguments_length =
4680 for (uint32_t
i = 0;
i < bound_arguments_length; ++
i) {
4682 node->InsertInput(
graph()->zone(), n.ArgumentIndex(
i), value);
4701 if (!ShouldUseCallICFeedback(target) ||
4709 if (feedback.IsInsufficient()) {
4711 node, DeoptimizeReason::kInsufficientTypeFeedbackForCall);
4714 OptionalHeapObjectRef feedback_target;
4716 feedback_target = feedback.AsCall().target();
4722 if (feedback_target.has_value() &&
4723 feedback_target->map(
broker()).is_callable()) {
4724 Node* target_function =
4731 simplified()->CheckIf(DeoptimizeReason::kWrongCallTarget), check,
4740 }
else if (feedback_target.has_value() && feedback_target->IsFeedbackCell()) {
4746 Node* target_closure = effect =
4748 target, effect, control);
4764 Node* target = n.target();
4778 Runtime::kThrowConstructorNonCallableError, 1));
4787 case Builtin::kArrayConstructor:
4789 case Builtin::kBooleanConstructor:
4791 case Builtin::kFunctionPrototypeApply:
4793 case Builtin::kFastFunctionPrototypeBind:
4795 case Builtin::kFunctionPrototypeCall:
4797 case Builtin::kFunctionPrototypeHasInstance:
4799 case Builtin::kObjectConstructor:
4801 case Builtin::kObjectCreate:
4803 case Builtin::kObjectGetPrototypeOf:
4805 case Builtin::kObjectIs:
4807 case Builtin::kObjectPrototypeGetProto:
4809 case Builtin::kObjectPrototypeHasOwnProperty:
4811 case Builtin::kObjectPrototypeIsPrototypeOf:
4813 case Builtin::kReflectApply:
4815 case Builtin::kReflectConstruct:
4817 case Builtin::kReflectGet:
4819 case Builtin::kReflectGetPrototypeOf:
4821 case Builtin::kReflectHas:
4823 case Builtin::kArrayForEach:
4825 case Builtin::kArrayMap:
4827 case Builtin::kArrayFilter:
4829 case Builtin::kArrayReduce:
4831 case Builtin::kArrayReduceRight:
4833 case Builtin::kArrayPrototypeFind:
4835 case Builtin::kArrayPrototypeFindIndex:
4837 case Builtin::kArrayEvery:
4839 case Builtin::kArrayIndexOf:
4841 case Builtin::kArrayIncludes:
4843 case Builtin::kArraySome:
4845 case Builtin::kArrayPrototypeAt:
4847 case Builtin::kArrayPrototypePush:
4849 case Builtin::kArrayPrototypePop:
4857 case Builtin::kArrayPrototypeSlice:
4859 case Builtin::kArrayPrototypeEntries:
4862 case Builtin::kArrayPrototypeKeys:
4865 case Builtin::kArrayPrototypeValues:
4868 case Builtin::kArrayIteratorPrototypeNext:
4870 case Builtin::kArrayIsArray:
4872 case Builtin::kArrayBufferIsView:
4874 case Builtin::kDataViewPrototypeGetByteLength:
4878 case Builtin::kDataViewPrototypeGetByteOffset:
4882 case Builtin::kDataViewPrototypeGetUint8:
4885 case Builtin::kDataViewPrototypeGetInt8:
4888 case Builtin::kDataViewPrototypeGetUint16:
4891 case Builtin::kDataViewPrototypeGetInt16:
4894 case Builtin::kDataViewPrototypeGetUint32:
4897 case Builtin::kDataViewPrototypeGetInt32:
4900 case Builtin::kDataViewPrototypeGetFloat16:
4903 case Builtin::kDataViewPrototypeGetFloat32:
4906 case Builtin::kDataViewPrototypeGetFloat64:
4909 case Builtin::kDataViewPrototypeGetBigInt64:
4912 case Builtin::kDataViewPrototypeGetBigUint64:
4915 case Builtin::kDataViewPrototypeSetUint8:
4918 case Builtin::kDataViewPrototypeSetInt8:
4921 case Builtin::kDataViewPrototypeSetUint16:
4924 case Builtin::kDataViewPrototypeSetInt16:
4927 case Builtin::kDataViewPrototypeSetUint32:
4930 case Builtin::kDataViewPrototypeSetInt32:
4933 case Builtin::kDataViewPrototypeSetFloat16:
4936 case Builtin::kDataViewPrototypeSetFloat32:
4939 case Builtin::kDataViewPrototypeSetFloat64:
4942 case Builtin::kDataViewPrototypeSetBigInt64:
4945 case Builtin::kDataViewPrototypeSetBigUint64:
4948 case Builtin::kTypedArrayPrototypeByteLength:
4951 case Builtin::kTypedArrayPrototypeByteOffset:
4954 case Builtin::kTypedArrayPrototypeLength:
4956 case Builtin::kTypedArrayPrototypeToStringTag:
4958 case Builtin::kMathAbs:
4960 case Builtin::kMathAcos:
4962 case Builtin::kMathAcosh:
4964 case Builtin::kMathAsin:
4966 case Builtin::kMathAsinh:
4968 case Builtin::kMathAtan:
4970 case Builtin::kMathAtanh:
4972 case Builtin::kMathCbrt:
4974 case Builtin::kMathCeil:
4976 case Builtin::kMathCos:
4978 case Builtin::kMathCosh:
4980 case Builtin::kMathExp:
4982 case Builtin::kMathExpm1:
4984 case Builtin::kMathFloor:
4986 case Builtin::kMathFround:
4988 case Builtin::kMathLog:
4990 case Builtin::kMathLog1p:
4992 case Builtin::kMathLog10:
4994 case Builtin::kMathLog2:
4996 case Builtin::kMathRound:
4998 case Builtin::kMathSign:
5000 case Builtin::kMathSin:
5002 case Builtin::kMathSinh:
5004 case Builtin::kMathSqrt:
5006 case Builtin::kMathTan:
5008 case Builtin::kMathTanh:
5010 case Builtin::kMathTrunc:
5012 case Builtin::kMathAtan2:
5014 case Builtin::kMathPow:
5016 case Builtin::kMathClz32:
5018 case Builtin::kMathImul:
5020 case Builtin::kMathMax:
5023 case Builtin::kMathMin:
5026 case Builtin::kNumberIsFinite:
5028 case Builtin::kNumberIsInteger:
5030 case Builtin::kNumberIsSafeInteger:
5032 case Builtin::kNumberIsNaN:
5034 case Builtin::kNumberParseInt:
5036 case Builtin::kGlobalIsFinite:
5038 case Builtin::kGlobalIsNaN:
5040 case Builtin::kMapPrototypeGet:
5042 case Builtin::kMapPrototypeHas:
5044 case Builtin::kSetPrototypeHas:
5046 case Builtin::kRegExpPrototypeTest:
5048 case Builtin::kReturnReceiver:
5050 case Builtin::kStringPrototypeIndexOf:
5053 case Builtin::kStringPrototypeIncludes:
5056 case Builtin::kStringPrototypeCharAt:
5058 case Builtin::kStringPrototypeCharCodeAt:
5061 case Builtin::kStringPrototypeCodePointAt:
5064 case Builtin::kStringPrototypeSubstring:
5066 case Builtin::kStringPrototypeSlice:
5068 case Builtin::kStringPrototypeSubstr:
5070 case Builtin::kStringPrototypeStartsWith:
5072 case Builtin::kStringPrototypeEndsWith:
5074#ifdef V8_INTL_SUPPORT
5075 case Builtin::kStringPrototypeLocaleCompareIntl:
5076 return ReduceStringPrototypeLocaleCompareIntl(node);
5077 case Builtin::kStringPrototypeToLowerCaseIntl:
5078 return ReduceStringPrototypeToLowerCaseIntl(node);
5079 case Builtin::kStringPrototypeToUpperCaseIntl:
5080 return ReduceStringPrototypeToUpperCaseIntl(node);
5082 case Builtin::kStringFromCharCode:
5084 case Builtin::kStringFromCodePoint:
5086 case Builtin::kStringPrototypeIterator:
5088 case Builtin::kStringIteratorPrototypeNext:
5090 case Builtin::kStringPrototypeConcat:
5092 case Builtin::kTypedArrayPrototypeEntries:
5095 case Builtin::kTypedArrayPrototypeKeys:
5098 case Builtin::kTypedArrayPrototypeValues:
5101 case Builtin::kPromisePrototypeCatch:
5103 case Builtin::kPromisePrototypeFinally:
5105 case Builtin::kPromisePrototypeThen:
5107 case Builtin::kPromiseResolveTrampoline:
5109 case Builtin::kMapPrototypeEntries:
5112 case Builtin::kMapPrototypeKeys:
5115 case Builtin::kMapPrototypeGetSize:
5117 case Builtin::kMapPrototypeValues:
5120 case Builtin::kMapIteratorPrototypeNext:
5123 FIRST_JS_MAP_ITERATOR_TYPE, LAST_JS_MAP_ITERATOR_TYPE);
5124 case Builtin::kSetPrototypeEntries:
5127 case Builtin::kSetPrototypeGetSize:
5129 case Builtin::kSetPrototypeValues:
5132 case Builtin::kSetIteratorPrototypeNext:
5135 FIRST_JS_SET_ITERATOR_TYPE, LAST_JS_SET_ITERATOR_TYPE);
5136 case Builtin::kDatePrototypeGetTime:
5138 case Builtin::kDateNow:
5140 case Builtin::kNumberConstructor:
5142 case Builtin::kBigIntConstructor:
5144 case Builtin::kBigIntAsIntN:
5145 case Builtin::kBigIntAsUintN:
5147#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
5148 case Builtin::kGetContinuationPreservedEmbedderData:
5149 return ReduceGetContinuationPreservedEmbedderData(node);
5150 case Builtin::kSetContinuationPreservedEmbedderData:
5151 return ReduceSetContinuationPreservedEmbedderData(node);
5157 if (shared.function_template_info(
broker()).has_value()) {
5161#if V8_ENABLE_WEBASSEMBLY
5165 IsWasmExportedFunctionData(shared.object()->GetTrustedData())) {
5174 std::unordered_set<Node*>* generated_calls_with_array_like_or_spread) {
5180 IrOpcode::kJSCreateEmptyLiteralArray);
5188 ->target_native_context()
5189 .initial_array_prototype(
broker())
5215 static_cast<Node*
>(call)->RemoveInput(n.LastArgumentIndex());
5224 generated_calls_with_array_like_or_spread->insert(call);
5239 OptionalSharedFunctionInfoRef
shared;
5241 if (
m.HasResolvedValue()) {
5242 ObjectRef target_ref =
m.Ref(
broker);
5243 if (target_ref.IsJSFunction()) {
5245 shared = function.shared(
broker);
5247 }
else if (target->opcode() == IrOpcode::kJSCreateClosure) {
5248 CreateClosureParameters
const& ccp =
5249 JSCreateClosureNode{target}.Parameters();
5250 shared = ccp.shared_info();
5251 }
else if (target->opcode() == IrOpcode::kCheckClosure) {
5253 shared = cell.shared_function_info(
broker);
5269 if (TargetIsClassConstructor(node,
broker())) {
5273 std::optional<Reduction> maybe_result =
5275 if (maybe_result.has_value()) {
5276 return maybe_result.value();
5280 node, n.ArgumentCount(), n.LastArgumentIndex(), p.
frequency(),
5282 n.effect(), n.control());
5291 if (TargetIsClassConstructor(node,
broker())) {
5295 node, n.ArgumentCount(), n.LastArgumentIndex(), p.
frequency(),
5297 n.effect(), n.control());
5306 Node* target = n.target();
5308 Effect effect = n.effect();
5309 Control control = n.control();
5314 if (feedback.IsInsufficient()) {
5316 node, DeoptimizeReason::kInsufficientTypeFeedbackForConstruct);
5319 OptionalHeapObjectRef feedback_target = feedback.
AsCall().
target();
5320 if (feedback_target.has_value() && feedback_target->IsAllocationSite()) {
5333 simplified()->CheckIf(DeoptimizeReason::kWrongCallTarget), check,
5338 static_assert(JSConstructNode::NewTargetIndex() == 1);
5339 node->ReplaceInput(n.NewTargetIndex(), array_function);
5340 node->RemoveInput(n.FeedbackVectorIndex());
5343 feedback_target->AsAllocationSite()));
5345 }
else if (feedback_target.has_value() &&
5348 Node* new_target_feedback =
5353 new_target_feedback);
5355 simplified()->CheckIf(DeoptimizeReason::kWrongCallTarget), check,
5359 node->
ReplaceInput(n.NewTargetIndex(), new_target_feedback);
5362 node->ReplaceInput(n.TargetIndex(), new_target_feedback);
5372 if (
m.HasResolvedValue()) {
5380 Runtime::kThrowConstructedNonConstructable));
5384 if (target_ref.IsJSFunction()) {
5403 case Builtin::kArrayConstructor: {
5406 static_assert(JSConstructNode::NewTargetIndex() == 1);
5407 node->ReplaceInput(n.NewTargetIndex(),
new_target);
5408 node->RemoveInput(n.FeedbackVectorIndex());
5410 node,
javascript()->CreateArray(arity, std::nullopt));
5413 case Builtin::kObjectConstructor: {
5417 node->RemoveInput(n.FeedbackVectorIndex());
5429 node->RemoveInput(n.FeedbackVectorIndex());
5430 for (
int i = n.ArgumentCount() - 1;
i >= 0;
i--) {
5431 node->RemoveInput(n.ArgumentIndex(
i));
5438 case Builtin::kPromiseConstructor:
5440 case Builtin::kStringConstructor:
5442 case Builtin::kTypedArrayConstructor:
5447 }
else if (target_ref.IsJSBoundFunction()) {
5450 function.bound_target_function(
broker());
5452 const uint32_t bound_arguments_length = bound_arguments.
length();
5456 static constexpr int kInlineSize = 16;
5458 for (uint32_t
i = 0;
i < bound_arguments_length; ++
i) {
5459 OptionalObjectRef maybe_arg = bound_arguments.
TryGet(
broker(),
i);
5460 if (!maybe_arg.has_value()) {
5469 node->ReplaceInput(n.TargetIndex(),
jsgraph()->ConstantNoHole(
5470 bound_target_function,
broker()));
5477 jsgraph()->ConstantNoHole(bound_target_function,
broker()));
5490 for (uint32_t
i = 0;
i < bound_arguments_length; ++
i) {
5491 node->InsertInput(
graph()->zone(), n.ArgumentIndex(
i),
args[
i]);
5510 if (target->opcode() == IrOpcode::kJSCreateBoundFunction) {
5512 uint32_t
const bound_arguments_length =
5516 node->ReplaceInput(n.TargetIndex(), bound_target_function);
5521 node->ReplaceInput(n.NewTargetIndex(), bound_target_function);
5532 for (uint32_t
i = 0;
i < bound_arguments_length; ++
i) {
5534 node->InsertInput(
graph()->zone(), n.ArgumentIndex(
i), value);
5560 Effect effect = n.effect();
5561 Control control = n.control();
5562 if (n.ArgumentCount() > 0) {
5567 Node* search_string = n.Argument(0);
5568 Node* new_search_string = effect =
5573 if (n.ArgumentCount() > 1) {
5578 Node* receiver_length =
5589 node->ReplaceInput(0, new_receiver);
5590 node->ReplaceInput(1, new_search_string);
5591 node->ReplaceInput(2, new_position);
5592 node->TrimInputCount(3);
5613 if (n.ArgumentCount() < 1)
return NoChange();
5619 Node* subgraph = a.ReduceStringPrototypeSubstring();
5627 if (n.ArgumentCount() < 1)
return NoChange();
5633 Node* subgraph = a.ReduceStringPrototypeSlice();
5641 if (n.ArgumentCount() < 1)
return NoChange();
5646 Effect effect = n.effect();
5647 Control control = n.control();
5663 jsgraph()->UndefinedConstant());
5668 Node* etrue = effect;
5672 Node* efalse = effect;
5679 vtrue, vfalse, control);
5709 Node* result_string =
nullptr;
5713 jsgraph()->ZeroConstant(), resultLength);
5719 Node* etrue = effect;
5720 Node* vtrue = etrue =
5722 to, etrue, if_true);
5725 Node* efalse = effect;
5732 vtrue, vfalse, control);
5736 return Replace(result_string);
5742 const int arraylike_index = n.LastArgumentIndex();
5747 n.target(), n.effect(), n.control());
5753 const int spread_index = n.LastArgumentIndex();
5758 n.target(), n.effect(), n.control());
5776 frame_state = outer_state;
5783 node->InsertInput(
graph()->zone(),
5804 DCHECK(node->opcode() == IrOpcode::kJSCall ||
5805 node->opcode() == IrOpcode::kJSConstruct);
5814 frame_state, effect, control);
5816 node->TrimInputCount(0);
5823 Node* effect_node = *effect;
5824 Node* receiver_map = effect_node =
5829 effect_node, control);
5833 simplified()->NumberBitwiseAnd(), receiver_bit_field2,
5834 jsgraph()->ConstantNoHole(Map::Bits2::ElementsKindBits::kMask)),
5835 jsgraph()->ConstantNoHole(Map::Bits2::ElementsKindBits::kShift));
5836 *effect = effect_node;
5837 return receiver_elements_kind;
5843 Node* is_packed_kind =
5846 Node* packed_branch =
5852 Node* is_holey_kind =
5855 Node* holey_branch =
5859 Node* if_not_packed_not_holey =
5863 *if_false = if_not_packed_not_holey;
5865 *if_true = if_packed;
5881 Effect effect = n.effect();
5882 Control control = n.control();
5890 bool needs_fallback_builtin_call =
false;
5892 if (map.supports_fast_array_iteration(
broker())) {
5893 maps.push_back(map);
5895 needs_fallback_builtin_call =
true;
5912 a.InitializeEffectControl(effect, control);
5915 a.ReduceArrayPrototypeAt(maps, needs_fallback_builtin_call);
5928 Effect effect = n.effect();
5929 Control control = n.control();
5935 std::vector<ElementsKind> kinds;
5936 if (!CanInlineArrayResizingBuiltin(
broker(), receiver_maps, &kinds,
true)) {
5947 a.InitializeEffectControl(effect, control);
5949 TNode<Object> subgraph = a.ReduceArrayPrototypePush(&inference);
5961 Effect effect = n.effect();
5962 Control control = n.control();
5969 std::vector<ElementsKind> kinds;
5970 if (!CanInlineArrayResizingBuiltin(
broker(), receiver_maps, &kinds)) {
5979 std::vector<Node*> controls_to_merge;
5980 std::vector<Node*> effects_to_merge;
5981 std::vector<Node*> values_to_merge;
5984 Node* receiver_elements_kind =
5986 Node* next_control = control;
5987 Node* next_effect = effect;
5988 for (
size_t i = 0;
i < kinds.size();
i++) {
5990 control = next_control;
5991 effect = next_effect;
5993 if (
i != kinds.size() - 1) {
5994 Node* control_node = control;
5996 &control_node, &next_control);
5997 control = control_node;
6012 Node* etrue = effect;
6016 Node* efalse = effect;
6031 receiver, elements, efalse, if_false);
6036 length,
jsgraph()->OneConstant());
6038 if (
v8_flags.turbo_typer_hardening) {
6065 vtrue, vfalse, control);
6074 controls_to_merge.push_back(control);
6075 effects_to_merge.push_back(effect);
6076 values_to_merge.push_back(value);
6079 if (controls_to_merge.size() > 1) {
6080 int const count =
static_cast<int>(controls_to_merge.size());
6083 &controls_to_merge.front());
6084 effects_to_merge.push_back(control);
6086 &effects_to_merge.front());
6087 values_to_merge.push_back(control);
6090 count + 1, &values_to_merge.front());
6106 Node* target = n.target();
6108 Node* context = n.context();
6110 Effect effect = n.effect();
6111 Control control = n.control();
6117 std::vector<ElementsKind> kinds;
6118 if (!CanInlineArrayResizingBuiltin(
broker(), receiver_maps, &kinds)) {
6127 std::vector<Node*> controls_to_merge;
6128 std::vector<Node*> effects_to_merge;
6129 std::vector<Node*> values_to_merge;
6132 Node* receiver_elements_kind =
6134 Node* next_control = control;
6135 Node* next_effect = effect;
6136 for (
size_t i = 0;
i < kinds.size();
i++) {
6138 control = next_control;
6139 effect = next_effect;
6141 if (
i != kinds.size() - 1) {
6142 Node* control_node = control;
6144 &control_node, &next_control);
6145 control = control_node;
6160 Node* etrue0 = effect;
6164 Node* efalse0 = effect;
6169 simplified()->NumberLessThanOrEqual(), length,
6175 Node* etrue1 = efalse0;
6186 elements,
jsgraph()->ZeroConstant(), etrue1, if_true1);
6192 receiver, elements, etrue1, if_true1);
6216 Node* effect2 = etrue1;
6229 Node* index_retyped = effect2 =
6231 index, effect2, control2);
6233 Node* value2 = effect2 =
6235 index_retyped, effect2, control2);
6237 simplified()->StoreElement(access), elements,
6240 value2, effect2, control2);
6244 index->ReplaceInput(1,
6251 length,
jsgraph()->OneConstant());
6253 if (
v8_flags.turbo_typer_hardening) {
6274 Node* efalse1 = efalse0;
6278 const Builtin builtin = Builtin::kArrayShift;
6283 const bool has_builtin_exit_frame =
true;
6285 has_builtin_exit_frame);
6295 if_false1 = efalse1 = vfalse1 =
6298 target,
jsgraph()->UndefinedConstant(), entry,
6299 argc, context, frame_state, efalse1, if_false1);
6307 vtrue1, vfalse1, if_false0);
6313 vtrue0, vfalse0, control);
6322 controls_to_merge.push_back(control);
6323 effects_to_merge.push_back(effect);
6324 values_to_merge.push_back(value);
6327 if (controls_to_merge.size() > 1) {
6328 int const count =
static_cast<int>(controls_to_merge.size());
6331 &controls_to_merge.front());
6332 effects_to_merge.push_back(control);
6334 &effects_to_merge.front());
6335 values_to_merge.push_back(control);
6338 count + 1, &values_to_merge.front());
6357 Node* context = n.context();
6358 Effect effect = n.effect();
6359 Control control = n.control();
6385 bool can_be_holey =
false;
6386 for (
MapRef receiver_map : receiver_maps) {
6387 if (!receiver_map.supports_fast_array_iteration(
broker())) {
6391 can_be_holey =
true;
6395 if (!
dependencies()->DependOnArraySpeciesProtector()) {
6398 if (can_be_holey && !
dependencies()->DependOnNoElementsProtector()) {
6419 Node* clone = effect =
6422 context, effect, control);
6432 if (n.ArgumentCount() < 1) {
6438 Effect effect = n.effect();
6439 Control control = n.control();
6440 Node* context = n.context();
6442 Node*
object = n.Argument(0);
6444 node->ReplaceInput(1, context);
6445 node->ReplaceInput(2, frame_state);
6446 node->ReplaceInput(3, effect);
6447 node->ReplaceInput(4, control);
6448 node->TrimInputCount(5);
6458 Node* context = n.context();
6459 Effect effect = n.effect();
6460 Control control = n.control();
6477 if (!
dependencies()->DependOnArrayBufferDetachingProtector()) {
6483 std::set<ElementsKind> elements_kinds;
6485 elements_kinds.insert(map.elements_kind());
6495 a.CheckIfTypedArrayWasDetachedOrOutOfBounds(
6497 std::move(elements_kinds), p.
feedback());
6508 node->ReplaceInput(1, context);
6509 node->ReplaceInput(2, effect);
6510 node->ReplaceInput(3, control);
6511 node->TrimInputCount(4);
6513 javascript()->CreateArrayIterator(iteration_kind));
6521 Node* iterator = n.receiver();
6522 Node* context = n.context();
6523 Effect effect = n.effect();
6524 Control control = n.control();
6530 if (iterator->
opcode() != IrOpcode::kJSCreateArrayIterator)
return NoChange();
6542 ElementsKind elements_kind = iterated_object_maps[0].elements_kind();
6545 if (elements_kind == BIGUINT64_ELEMENTS ||
6546 elements_kind == BIGINT64_ELEMENTS) {
6549 for (
MapRef iterated_object_map : iterated_object_maps) {
6550 if (iterated_object_map.elements_kind() != elements_kind) {
6555 if (!CanInlineArrayIteratingBuiltin(
broker(), iterated_object_maps,
6579 if (!
dependencies()->DependOnArrayBufferDetachingProtector()) {
6583 iterated_object, effect, control);
6586 buffer, effect, control);
6590 simplified()->NumberBitwiseAnd(), buffer_bit_field,
6591 jsgraph()->ConstantNoHole(JSArrayBuffer::WasDetachedBit::kMask)),
6594 simplified()->CheckIf(DeoptimizeReason::kArrayBufferWasDetached,
6596 check, effect, control);
6611 iterator, effect, control);
6621 iterated_object, effect, control);
6631 simplified()->LoadField(length_access), iterated_object, effect, control);
6640 Node* etrue = effect;
6645 if (
v8_flags.turbo_typer_hardening) {
6649 index, length, etrue, if_true);
6652 done_true =
jsgraph()->FalseConstant();
6661 Node* base_ptr = etrue =
6664 iterated_object, etrue, if_true);
6668 iterated_object, etrue, if_true);
6671 switch (elements_kind) {
6672#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) \
6673 case TYPE##_ELEMENTS: \
6674 array_type = kExternal##Type##Array; \
6679#undef TYPED_ARRAY_CASE
6682 Node* buffer = etrue =
6685 iterated_object, etrue, if_true);
6687 value_true = etrue =
6689 base_ptr, external_ptr, index, etrue, if_true);
6694 elements, index, etrue, if_true);
6704 value_true = etrue =
6706 value_true, context, etrue);
6717 next_index, etrue, if_true);
6722 Node* efalse = effect;
6726 done_false =
jsgraph()->TrueConstant();
6727 value_false =
jsgraph()->UndefinedConstant();
6742 iterator, end_index, efalse, if_false);
6750 value_true, value_false, control);
6753 done_true, done_false, control);
6757 value, done, context, effect);
6766 DCHECK(string_access_operator->
opcode() == IrOpcode::kStringCharCodeAt ||
6767 string_access_operator->
opcode() == IrOpcode::kStringCodePointAt);
6775 Node* index = n.ArgumentOr(0,
jsgraph()->ZeroConstant());
6776 Effect effect = n.effect();
6777 Control control = n.control();
6784 Node* receiver_length =
6789 index, receiver_length, effect, control);
6793 index, effect, control);
6819 ObjectRef target_ref = search_element_matcher.
Ref(
broker());
6820 if (!target_ref.IsString())
return NoChange();
6821 StringRef search_element_string = target_ref.AsString();
6823 int length = search_element_string.
length();
6829 Node* subgraph = a.ReduceStringPrototypeStartsWith(search_element_string);
6835 Node* subgraph = a.ReduceStringPrototypeStartsWith();
6859 ObjectRef target_ref = search_element_matcher.
Ref(
broker());
6860 if (!target_ref.IsString())
return NoChange();
6861 StringRef search_element_string = target_ref.AsString();
6863 int length = search_element_string.
length();
6869 Node* subgraph = a.ReduceStringPrototypeEndsWith(search_element_string);
6875 Node* subgraph = a.ReduceStringPrototypeEndsWith();
6888 Node* index = n.ArgumentOr(0,
jsgraph()->ZeroConstant());
6896 if (!receiver_ref.IsString())
return NoChange();
6897 StringRef receiver_string = receiver_ref.AsString();
6899 bool is_integer_in_max_range =
6903 if (is_content_accessible && is_integer_in_max_range) {
6905 Node* subgraph = a.ReduceStringPrototypeCharAt(
6913 Node* subgraph = a.ReduceStringPrototypeCharAt();
6917#ifdef V8_INTL_SUPPORT
6919Reduction JSCallReducer::ReduceStringPrototypeToLowerCaseIntl(
Node* node) {
6925 Effect effect = n.effect();
6926 Control control = n.control();
6934 node->TrimInputCount(1);
6940Reduction JSCallReducer::ReduceStringPrototypeToUpperCaseIntl(Node* node) {
6942 CallParameters
const& p = n.Parameters();
6946 Effect effect = n.effect();
6947 Control control = n.control();
6950 simplified()->CheckString(p.feedback()), n.receiver(), effect, control);
6955 node->TrimInputCount(1);
6970 if (n.ArgumentCount() == 1) {
6971 Effect effect = n.effect();
6972 Control control = n.control();
6973 Node* input = n.Argument(0);
6978 input, effect, control);
6995 if (n.ArgumentCount() != 1)
return NoChange();
6997 Effect effect = n.effect();
6998 Control control = n.control();
6999 Node* input = n.Argument(0);
7004 input,
jsgraph()->ConstantNoHole(0x10FFFF + 1), effect, control);
7022 Node* iterator = effect =
7024 jsgraph()->NoContextConstant(), effect);
7029#ifdef V8_INTL_SUPPORT
7031Reduction JSCallReducer::ReduceStringPrototypeLocaleCompareIntl(
Node* node) {
7034 if (n.ArgumentCount() < 1 || n.ArgumentCount() > 3) {
7042 if (!
m.HasResolvedValue())
return NoChange();
7043 if (
m.Is(
factory()->undefined_value())) {
7044 locales =
factory()->undefined_value();
7046 ObjectRef ref =
m.Ref(
broker());
7047 if (!ref.IsString())
return NoChange();
7048 StringRef sref = ref.AsString();
7050 sref.ObjectIfContentAccessible(
broker())) {
7051 locales = *maybe_locales;
7058 TNode<Object> options = n.ArgumentOrUndefined(2,
jsgraph());
7061 if (!
m.Is(
factory()->undefined_value())) {
7067 locales,
factory()->undefined_value()) !=
7076 graph()->zone(), callable.descriptor(),
7077 callable.descriptor().GetStackParameterCount(),
7079 node->RemoveInput(n.FeedbackVectorIndex());
7080 if (n.ArgumentCount() == 3) {
7081 node->RemoveInput(n.ArgumentIndex(2));
7082 }
else if (n.ArgumentCount() == 1) {
7083 node->InsertInput(
graph()->zone(), n.LastArgumentIndex() + 1,
7088 node->InsertInput(
graph()->zone(), 0,
7098 Effect effect = n.effect();
7099 Control control = n.control();
7100 Node* context = n.context();
7122 Node* etrue0 = effect;
7127 done_true =
jsgraph()->FalseConstant();
7129 string, index, etrue0, if_true0);
7136 receiver, index, etrue0, if_true0);
7143 vfalse0 =
jsgraph()->UndefinedConstant();
7144 done_false =
jsgraph()->TrueConstant();
7154 done_true, done_false, control);
7157 value, done, context, effect);
7173 Effect effect = n.effect();
7174 Control control = n.control();
7185 Node* receiver_length =
7187 Node* argument_length =
7204FrameState CreateStringCreateLazyDeoptContinuationFrameState(
7209 const int stack_parameter_count =
arraysize(stack_parameters);
7211 graph, shared, Builtin::kStringCreateLazyDeoptContinuation, target,
7221 if (n.target() != n.new_target())
return NoChange();
7224 DCHECK(constructor.initial_map(
broker_).IsJSPrimitiveWrapperMap());
7226 Node* context = n.context();
7228 Effect effect = n.effect();
7229 Control control = n.control();
7231 Node* primitive_value;
7232 if (n.ArgumentCount() == 0) {
7233 primitive_value =
jsgraph()->EmptyStringConstant();
7237 frame_state = CreateConstructInvokeStubFrameState(
7238 node, frame_state, constructor.shared(
broker_), context,
common(),
7243 Node* continuation_frame_state =
7244 CreateStringCreateLazyDeoptContinuationFrameState(
7248 primitive_value = effect = control =
7250 continuation_frame_state, effect, control);
7253 Node* on_exception =
nullptr;
7256 Node* if_exception =
7264 on_exception, merge);
7267 if_exception, on_exception, merge);
7271 phi->ReplaceInput(1, on_exception);
7276 node->ReplaceInput(0, primitive_value);
7277 node->ReplaceInput(1, context);
7278 node->ReplaceInput(2, effect);
7279 node->TrimInputCount(3);
7288 if (a.ConstructArity() < 1)
return NoChange();
7290 if (a.TargetInput() != a.NewTargetInput())
return NoChange();
7298 if (!inference->
HaveMaps())
return false;
7303 for (
MapRef receiver_map : receiver_maps) {
7304 if (!receiver_map.IsJSPromiseMap())
return false;
7323 Effect effect = n.effect();
7324 Control control = n.control();
7342 for (; arity > 1; --arity) node->RemoveInput(3);
7343 for (; arity < 2; ++arity) {
7344 node->InsertInput(
graph()->zone(), 2,
jsgraph()->UndefinedConstant());
7356 DCHECK(shared.HasBuiltinId());
7373 Node* on_finally = n.ArgumentOrUndefined(0,
jsgraph());
7374 Effect effect = n.effect();
7375 Control control = n.control();
7390 if (!
dependencies()->DependOnPromiseSpeciesProtector()) {
7403 Node* etrue = effect;
7422 context, on_finally, etrue, if_true);
7426 context, constructor, etrue, if_true);
7432 promise_catch_finally, context, etrue, if_true);
7438 promise_then_finally, context, etrue, if_true);
7442 Node* efalse = effect;
7443 Node* catch_false = on_finally;
7444 Node* then_false = on_finally;
7448 Node* catch_finally =
7450 catch_true, catch_false, control);
7451 Node* then_finally =
7453 then_true, then_false, control);
7471 for (; arity > 2; --arity) node->RemoveInput(2);
7472 for (; arity < 2; ++arity) {
7473 node->InsertInput(
graph()->zone(), 2, then_finally);
7475 node->ReplaceInput(2, then_finally);
7476 node->ReplaceInput(3, catch_finally);
7493 Node* on_fulfilled = n.ArgumentOrUndefined(0,
jsgraph());
7494 Node* on_rejected = n.ArgumentOrUndefined(1,
jsgraph());
7495 Node* context = n.context();
7496 Effect effect = n.effect();
7497 Control control = n.control();
7506 if (!
dependencies()->DependOnPromiseSpeciesProtector()) {
7516 on_fulfilled,
jsgraph()->UndefinedConstant());
7522 on_rejected,
jsgraph()->UndefinedConstant());
7525 Node* promise = effect =
7531 promise, context, frame_state, effect, control);
7543 promise, effect, control);
7553 Node* value = n.ArgumentOrUndefined(0,
jsgraph());
7554 Node* context = n.context();
7555 Effect effect = n.effect();
7556 Control control = n.control();
7567 node->ReplaceInput(1, value);
7568 node->ReplaceInput(2, context);
7569 node->ReplaceInput(3, frame_state);
7570 node->ReplaceInput(4, effect);
7571 node->ReplaceInput(5, control);
7572 node->TrimInputCount(6);
7581 Node* target = n.target();
7586 Node* context = n.context();
7588 Effect effect = n.effect();
7589 Control control = n.control();
7593 frame_state = CreateConstructInvokeStubFrameState(node, frame_state, shared,
7605 continuation_frame_state, effect, control);
7623 values.push_back(
jsgraph()->UndefinedConstant());
7628 Node* receiver_map = effect =
7637 simplified()->NumberBitwiseAnd(), receiver_bit_field2,
7638 jsgraph()->ConstantNoHole(Map::Bits2::ElementsKindBits::kMask)),
7639 jsgraph()->ConstantNoHole(Map::Bits2::ElementsKindBits::kShift));
7645 simplified()->NumberSubtract(), receiver_elements_kind,
7652#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) \
7654 Node* check = graph()->NewNode( \
7655 simplified()->NumberEqual(), receiver_elements_kind, \
7656 jsgraph()->ConstantNoHole(TYPE##_ELEMENTS - \
7657 FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND)); \
7658 control = graph()->NewNode(common()->Branch(), check, control); \
7659 values.push_back(jsgraph()->ConstantNoHole( \
7660 broker()->GetTypedArrayStringTag(TYPE##_ELEMENTS), broker())); \
7661 effects.push_back(effect); \
7662 controls.push_back(graph()->NewNode(common()->IfTrue(), control)); \
7663 control = graph()->NewNode(common()->IfFalse(), control); \
7667#undef TYPED_ARRAY_CASE
7669 values.push_back(
jsgraph()->UndefinedConstant());
7673 int const count =
static_cast<int>(controls.
size());
7678 values.push_back(control);
7681 count + 1, &values.front());
7689 DCHECK(instance_type == JS_TYPED_ARRAY_TYPE ||
7690 instance_type == JS_DATA_VIEW_TYPE);
7701 std::set<ElementsKind> elements_kinds;
7702 bool maybe_rab_gsab =
false;
7703 if (instance_type == JS_TYPED_ARRAY_TYPE) {
7706 elements_kinds.insert(
kind);
7711 if (!maybe_rab_gsab) {
7714 USE(unused_reduction);
7730 const bool depended_on_detaching_protector =
7732 if (!depended_on_detaching_protector && instance_type == JS_DATA_VIEW_TYPE) {
7745 typed_array, instance_type, std::move(elements_kinds), a.ContextInput());
7753 DCHECK(instance_type == JS_TYPED_ARRAY_TYPE ||
7754 instance_type == JS_DATA_VIEW_TYPE);
7765 std::set<ElementsKind> elements_kinds;
7766 bool maybe_rab_gsab =
false;
7767 if (instance_type == JS_TYPED_ARRAY_TYPE) {
7770 elements_kinds.insert(
kind);
7775 if (!maybe_rab_gsab) {
7778 USE(unused_reduction);
7800 std::set<ElementsKind> elements_kinds;
7801 bool maybe_rab_gsab =
false;
7804 elements_kinds.insert(
kind);
7808 if (!maybe_rab_gsab) {
7811 USE(unused_reduction);
7815 Builtin::kTypedArrayPrototypeLength);
7826 typed_array, std::move(elements_kinds), a.ContextInput());
7828 if (!
dependencies()->DependOnArrayBufferDetachingProtector()) {
7830 a.MachineSelectIf<
Number>(a.ArrayBufferViewDetachedBit(typed_array))
7831 .Then([&]() {
return a.NumberConstant(0); })
7832 .Else([&]() {
return length; })
7843 if (n.ArgumentCount() < 1) {
7848 Node* input = n.Argument(0);
7857 if (n.ArgumentCount() < 1) {
7862 Node* input = n.Argument(0);
7871 if (n.ArgumentCount() < 1) {
7876 Node* input = n.Argument(0);
7885 if (n.ArgumentCount() < 1) {
7890 Node* input = n.Argument(0);
7899 if (n.ArgumentCount() != 1)
return NoChange();
7916 key, effect, control);
7919 jsgraph()->MinusOneConstant());
7925 Node* etrue = effect;
7930 Node* efalse = effect;
7933 table, entry, efalse, if_false);
7962 if (n.ArgumentCount() != 1)
return NoChange();
7967 InstanceType instance_type = InstanceTypeForCollectionKind(collection_kind);
7980 simplified()->FindOrderedCollectionEntry(collection_kind), table,
key,
7984 jsgraph()->MinusOneConstant());
8001 DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
8007 InstanceType type = InstanceTypeForCollectionKind(collection_kind);
8014 javascript()->CreateCollectionIterator(collection_kind, iteration_kind),
8015 receiver, context, effect, control);
8017 return Replace(js_create_iterator);
8022 DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
8027 InstanceType type = InstanceTypeForCollectionKind(collection_kind);
8039 table, effect, control);
8055 Node* context = n.context();
8056 Effect effect = n.effect();
8057 Control control = n.control();
8076 receiver_instance_type = receiver_maps[0].instance_type();
8077 for (
size_t i = 1;
i < receiver_maps.
size(); ++
i) {
8078 if (receiver_maps[
i].instance_type() != receiver_instance_type) {
8082 if (receiver_instance_type < collection_iterator_instance_type_first ||
8083 receiver_instance_type > collection_iterator_instance_type_last) {
8095 Node* loop = control =
8097 Node* eloop = effect =
8106 Node* next_table = effect =
8109 table, effect, control);
8116 done_eloop = effect;
8134 index,
jsgraph()->NoContextConstant(), effect);
8146 receiver, next_table, effect, control);
8152 control = done_loop;
8153 effect = done_eloop;
8168 jsgraph()->TrueConstant(), context, effect);
8178 table, effect, control);
8182 table, effect, control);
8186 table, effect, control);
8187 Node* used_capacity =
8189 number_of_deleted_elements);
8210 Node* efalse0 = effect;
8219 controls[0] = if_false0;
8220 effects[0] = efalse0;
8224 Node* etrue0 = effect;
8234 jsgraph()->ConstantNoHole(entry_size)),
8239 table, entry_start_position, etrue0, if_true0);
8247 jsgraph()->HashTableHoleConstant());
8255 Node* value = effect =
8257 entry_key, effect, control);
8267 switch (receiver_instance_type) {
8268 case JS_MAP_KEY_ITERATOR_TYPE:
8269 case JS_SET_VALUE_ITERATOR_TYPE:
8272 case JS_SET_KEY_VALUE_ITERATOR_TYPE:
8275 value, context, effect);
8278 case JS_MAP_VALUE_ITERATOR_TYPE:
8284 simplified()->NumberAdd(), entry_start_position,
8289 case JS_MAP_KEY_VALUE_ITERATOR_TYPE:
8295 simplified()->NumberAdd(), entry_start_position,
8300 entry_key, value, context, effect);
8311 iterator_result, value, effect, control);
8315 iterator_result, done, effect, control);
8317 controls[1] = control;
8318 effects[1] = effect;
8334 return Replace(iterator_result);
8339 Node* value = n.ArgumentOrUndefined(0,
jsgraph());
8341 node->ReplaceInput(0, value);
8342 node->TrimInputCount(1);
8361 DCHECK_IMPLIES((builtin == Builtin::kTypedArrayPrototypeLength ||
8362 builtin == Builtin::kTypedArrayPrototypeByteLength),
8364 return IsRabGsabTypedArrayElementsKind(map.elements_kind());
8371 const bool depended_on_detaching_protector =
8373 if (!depended_on_detaching_protector && instance_type == JS_DATA_VIEW_TYPE) {
8385 DCHECK_EQ(access.machine_type.representation(),
8391 if (!depended_on_detaching_protector) {
8400 a.UintPtrConstant(0), value,
8416 Effect effect = n.effect();
8417 Control control = n.control();
8420 Node* value =
nullptr;
8428 value = n.ArgumentOrUndefined(1,
jsgraph());
8431 Node* is_little_endian =
8432 n.ArgumentOr(endian_index,
jsgraph()->FalseConstant());
8447 if (
m.HasResolvedValue() &&
m.Ref(
broker()).IsJSDataView()) {
8453 if (length < element_size)
return NoChange();
8458 offset, byte_length, effect, control);
8461 Node* byte_length = effect =
8465 if (element_size > 1) {
8475 jsgraph()->ConstantNoHole(element_size - 1)));
8480 offset, byte_length, effect, control);
8494 value, effect, control);
8499 value, effect, control);
8509 if (!
dependencies()->DependOnArrayBufferDetachingProtector()) {
8518 buffer, effect, control);
8522 simplified()->NumberBitwiseAnd(), buffer_bit_field,
8523 jsgraph()->ConstantNoHole(JSArrayBuffer::WasDetachedBit::kMask)),
8526 simplified()->CheckIf(DeoptimizeReason::kArrayBufferWasDetached,
8528 check, effect, control);
8532 buffer_or_receiver = buffer;
8544 simplified()->LoadDataViewElement(element_type), buffer_or_receiver,
8545 data_pointer,
offset, is_little_endian, effect, control);
8550 simplified()->StoreDataViewElement(element_type), buffer_or_receiver,
8551 data_pointer,
offset, value, is_little_endian, effect, control);
8552 value =
jsgraph()->UndefinedConstant();
8567 if (n.ArgumentCount() < 1) {
8573 Effect effect = n.effect();
8574 Control control = n.control();
8575 Node* input = n.Argument(0);
8580 input, effect, control);
8593 if (n.ArgumentCount() < 1) {
8599 Effect effect = n.effect();
8600 Control control = n.control();
8601 Node* input = n.Argument(0);
8606 input, effect, control);
8623 Node* value = effect =
8634 Node* value = effect =
8643 if (n.ArgumentCount() < 1) {
8649 Effect effect = n.effect();
8650 Control control = n.control();
8651 Node* context = n.context();
8653 Node*
object = n.Argument(0);
8654 Node* radix = n.ArgumentOrUndefined(1,
jsgraph());
8661 object_matcher.
Ref(
broker()).IsString() &&
8662 (radix_object_matcher.
Is(
factory()->undefined_value()) ||
8666 int radix_value = radix_object_matcher.
Is(
factory()->undefined_value())
8669 if (radix_value != 0 && (radix_value < 2 || radix_value > 36)) {
8675 std::optional<double> number = input_value.
ToInt(
broker(), radix_value);
8676 if (number.has_value()) {
8683 node->ReplaceInput(0,
object);
8684 node->ReplaceInput(1, radix);
8685 node->ReplaceInput(2, context);
8686 node->ReplaceInput(3, frame_state);
8687 node->ReplaceInput(4, effect);
8688 node->ReplaceInput(5, control);
8689 node->TrimInputCount(6);
8698 if (n.ArgumentCount() < 1)
return NoChange();
8704 Effect effect = n.effect();
8705 Control control = n.control();
8706 Node* regexp = n.receiver();
8711 MapRef regexp_initial_map =
8715 if (!inference.
Is(regexp_initial_map))
return inference.
NoChange();
8721 for (
MapRef map : regexp_maps) {
8733 OptionalJSObjectRef holder = ai_exec.
holder();
8734 if (!holder.has_value())
return inference.
NoChange();
8738 OptionalObjectRef constant = holder->GetOwnFastConstantDataProperty(
8741 if (!constant.has_value() ||
8753 Node* context = n.context();
8755 Node* search = n.Argument(0);
8767 jsgraph()->ZeroConstant(), lastIndexSmi);
8771 is_positive, effect, control);
8774 node->ReplaceInput(1, search_string);
8775 node->ReplaceInput(2, context);
8776 node->ReplaceInput(3, frame_state);
8777 node->ReplaceInput(4, effect);
8778 node->ReplaceInput(5, control);
8779 node->TrimInputCount(6);
8787 Node* target = n.target();
8789 Node* value = n.ArgumentOr(0,
jsgraph()->ZeroConstant());
8790 Node* context = n.context();
8811 if (n.ArgumentCount() < 1) {
8815 Node* target = n.target();
8817 Node* value = n.Argument(0);
8818 Node* context = n.context();
8835 DCHECK(builtin == Builtin::kBigIntAsIntN ||
8836 builtin == Builtin::kBigIntAsUintN);
8845 if (n.ArgumentCount() < 2) {
8849 Effect effect = n.effect();
8850 Control control = n.control();
8851 Node* bits = n.Argument(0);
8852 Node* value = n.Argument(1);
8856 const int bits_value =
static_cast<int>(matcher.
ResolvedValue());
8858 (builtin == Builtin::kBigIntAsIntN
8860 : simplified()->SpeculativeBigIntAsUintN(bits_value,
8862 value, effect, control);
8872 if (!
v8_flags.turbo_optimize_math_minmax)
return std::nullopt;
8876 Node* target = n.target();
8877 Effect effect = n.effect();
8878 Control control = n.control();
8881 return std::nullopt;
8884 if (n.ArgumentCount() != 1) {
8885 return std::nullopt;
8889 return std::nullopt;
8895 Node* arguments_list = n.Argument(0);
8896 if (arguments_list->
opcode() == IrOpcode::kJSCreateLiteralArray ||
8897 arguments_list->
opcode() == IrOpcode::kJSCreateArguments) {
8898 return std::nullopt;
8902 if (
m.HasResolvedValue()) {
8903 ObjectRef target_ref =
m.Ref(
broker());
8904 if (target_ref.IsJSFunction()) {
8909 return std::nullopt;
8915 if (builtin == Builtin::kMathMax || builtin == Builtin::kMathMin) {
8918 return std::nullopt;
8924 if (ShouldUseCallICFeedback(target) &&
8929 if (feedback.IsInsufficient()) {
8930 return std::nullopt;
8932 OptionalHeapObjectRef feedback_target = feedback.
AsCall().
target();
8933 if (feedback_target.has_value() &&
8934 feedback_target->map(
broker()).is_callable()) {
8935 Node* target_function =
8937 ObjectRef target_ref = feedback_target.value();
8938 if (!target_ref.IsJSFunction()) {
8939 return std::nullopt;
8945 if (builtin == Builtin::kMathMax || builtin == Builtin::kMathMin) {
8950 simplified()->CheckIf(DeoptimizeReason::kWrongCallTarget), check,
8964 return std::nullopt;
8970 DCHECK_NE(n.Parameters().speculation_mode(),
8975 Node* subgraph = a.ReduceJSCallMathMinMaxWithArrayLike(builtin);
8979#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
8980Reduction JSCallReducer::ReduceGetContinuationPreservedEmbedderData(
8983 Effect effect = n.effect();
8984 Control control = n.control();
8987 simplified()->GetContinuationPreservedEmbedderData(), effect);
8993Reduction JSCallReducer::ReduceSetContinuationPreservedEmbedderData(
8996 Effect effect = n.effect();
8997 Control control = n.control();
8999 if (n.ArgumentCount() == 0)
return NoChange();
9003 n.Argument(0), effect);
9005 Node* value =
jsgraph()->UndefinedConstant();
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype)
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
static constexpr int kNumExtraArgsWithReceiver
static constexpr int kNewTargetIndex
static constexpr int kPaddingIndex
static constexpr int kArgcIndex
static constexpr int kTargetIndex
static Address CppEntryOf(Builtin builtin)
static V8_EXPORT_PRIVATE const char * name(Builtin builtin)
static V8_EXPORT_PRIVATE Callable CallableFor(Isolate *isolate, Builtin builtin)
static constexpr BytecodeOffset None()
int GetStackParameterCount() const
int GetParameterCount() const
bool HasContextParameter() const
Handle< Code > code() const
CallInterfaceDescriptor descriptor() const
static const int kMaxArguments
static ExternalReference Create(const SCTableReference &table_ref)
static V8_EXPORT_PRIVATE CompareStringsOptions CompareStringsOptionsFor(IsolateT *isolate, DirectHandle< Object > locales, DirectHandle< Object > options)
v8::internal::Factory * factory()
static const int kMaxCopyElements
static constexpr uint32_t kMaxFastArrayLength
static const int kLengthDescriptorIndex
static const int kNameDescriptorIndex
static constexpr uint32_t kMaxElementIndex
static constexpr MachineRepresentation PointerRepresentation()
static const int kValueOffset
static const int kEntrySize
static constexpr int HashTableStartIndex()
@ kPromiseFinallyContextLength
constexpr bool IsDouble() const
size_t return_count() const
base::Vector< const T > all() const
static constexpr Tagged< Smi > FromEnum(E value)
static const uint32_t kMaxLength
static TNode UncheckedCast(compiler::Node *node)
const_iterator begin() const
void push_back(const T &value)
T * AllocateArray(size_t length)
static FieldAccess ForJSArrayBufferViewBuffer()
static ElementAccess ForFixedArrayElement()
static FieldAccess ForJSCollectionIteratorTable()
static FieldAccess ForJSArrayBufferViewByteLength()
static FieldAccess ForMap(WriteBarrierKind write_barrier=kMapWriteBarrier)
static FieldAccess ForJSArrayBufferViewByteOffset()
static FieldAccess ForJSCollectionTable()
static FieldAccess ForJSStringIteratorString()
static FieldAccess ForJSArrayIteratorNextIndex()
static FieldAccess ForJSObjectPropertiesOrHashKnownPointer()
static FieldAccess ForJSStringIteratorIndex()
static FieldAccess ForJSCollectionIteratorIndex()
static FieldAccess ForOrderedHashMapOrSetNextTable()
static FieldAccess ForJSArrayBufferBitField()
static FieldAccess ForJSObjectInObjectProperty(MapRef map, int index, MachineType machine_type=MachineType::AnyTagged())
static FieldAccess ForFixedArrayLength()
static FieldAccess ForMapBitField2()
static FieldAccess ForJSArrayLength(ElementsKind elements_kind)
static ElementAccess ForOrderedHashMapEntryValue()
static FieldAccess ForJSIteratorResultValue()
static FieldAccess ForOrderedHashMapOrSetNumberOfBuckets()
static FieldAccess ForContextSlot(size_t index)
static FieldAccess ForJSFunctionContext()
static FieldAccess ForMapPrototype()
static FieldAccess ForJSIteratorResultDone()
static FieldAccess ForJSDateValue()
static FieldAccess ForJSRegExpLastIndex()
static FieldAccess ForJSTypedArrayExternalPointer()
static FieldAccess ForMapInstanceType()
static FieldAccess ForJSTypedArrayLength()
static FieldAccess ForJSTypedArrayBasePointer()
static FieldAccess ForJSDataViewDataPointer()
static FieldAccess ForOrderedHashMapOrSetNumberOfDeletedElements()
static FieldAccess ForOrderedHashMapOrSetNumberOfElements()
static FieldAccess ForJSObjectElements()
PropertyAccessInfo FinalizePropertyAccessInfosAsOne(ZoneVector< PropertyAccessInfo > infos, AccessMode access_mode) const
void ReplaceWithValue(Node *node, Node *value, Node *effect=nullptr, Node *control=nullptr)
void RelaxEffectsAndControls(Node *node)
void MergeControlToEnd(TFGraph *graph, CommonOperatorBuilder *common, Node *node)
static Reduction Replace(Node *node)
void RelaxControls(Node *node, Node *control=nullptr)
void Allocate(int size, AllocationType allocation=AllocationType::kYoung, Type type=Type::Any())
bool CanAllocateArray(int length, MapRef map, AllocationType allocation=AllocationType::kYoung)
void Store(const FieldAccess &access, Node *value)
OptionalHeapObjectRef target() const
ConvertReceiverMode convert_mode() const
CallFeedbackRelation feedback_relation() const
CallFrequency const & frequency() const
int arity_without_implicit_args() const
FeedbackSource const & feedback() const
SpeculationMode speculation_mode() const
bool DependOnNoProfilingProtector()
void DependOnStablePrototypeChains(ZoneVector< MapRef > const &receiver_maps, WhereToStart start, OptionalJSObjectRef last_prototype=OptionalJSObjectRef())
bool DependOnArrayBufferDetachingProtector()
int arity_without_implicit_args() const
FeedbackSource const & feedback() const
CallFrequency const & frequency() const
FeedbackSource const & feedback() const
NameRef GetPropertyKey(JSHeapBroker *broker, InternalIndex descriptor_index) const
static constexpr int ArityForArgc(int c_arg_count, int slow_arg_count)
const FunctionTemplateInfoRef function_template_info_
static constexpr int kReceiver
static constexpr int kEffectAndControl
TNode< Object > ReduceFastApiCall()
const SharedFunctionInfoRef shared_
FastApiCallReducerAssembler(JSCallReducer *reducer, Node *node, const FunctionTemplateInfoRef function_template_info, FastApiCallFunction c_function, Node *receiver, const SharedFunctionInfoRef shared, Node *target, const int arity, Node *effect)
static constexpr int kInlineSize
static constexpr int kSlowBuiltinParams
FastApiCallFunction c_function_
TNode< Object > FastApiCall(CallDescriptor *descriptor, Node **inputs, size_t inputs_size)
IndirectHandle< FeedbackCell > object() const
OptionalFeedbackVectorRef feedback_vector(JSHeapBroker *broker) const
ObjectRef value(JSHeapBroker *broker) const
OptionalObjectRef TryGet(JSHeapBroker *broker, int i) const
FrameStateType type() const
Node * outer_frame_state() const
const FrameStateInfo & frame_state_info() const
Node * parameters() const
HolderLookupResult LookupHolderOfExpectedType(JSHeapBroker *broker, MapRef receiver_map)
IndirectHandle< FunctionTemplateInfo > object() const
Address callback(JSHeapBroker *broker) const
bool is_signature_undefined(JSHeapBroker *broker) const
OptionalObjectRef callback_data(JSHeapBroker *broker) const
bool accept_any_receiver() const
GraphAssemblerLabel< sizeof...(Reps)> * loop_header_label()
detail::GraphAssemblerLabelForReps< Reps... > MakeLabel(Reps... reps)
void BranchWithHint(Node *condition, detail::GraphAssemblerLabelForVars< Vars... > *if_true, detail::GraphAssemblerLabelForVars< Vars... > *if_false, BranchHint hint, Vars...)
Node * Checkpoint(FrameState frame_state)
Node * ExternalConstant(ExternalReference ref)
Node * TypeGuard(Type type, Node *value)
void InitializeEffectControl(Node *effect, Node *control)
TNode< Object > Call(const CallDescriptor *call_descriptor, int inputs_size, Node **inputs)
detail::GraphAssemblerLabelForReps< Reps... > MakeDeferredLabel(Reps... reps)
void GotoIf(Node *condition, detail::GraphAssemblerLabelForVars< Vars... > *label, BranchHint hint, Vars...)
CommonOperatorBuilder * common() const
void Bind(GraphAssemblerLabel< VarCount > *label)
void GotoIfNot(Node *condition, detail::GraphAssemblerLabelForVars< Vars... > *label, BranchHint hint, Vars...)
void Branch(Node *condition, detail::GraphAssemblerLabelForVars< Vars... > *if_true, detail::GraphAssemblerLabelForVars< Vars... > *if_false, Vars...)
void Goto(detail::GraphAssemblerLabelForVars< Vars... > *label, Vars...)
Node * AddNode(Node *node)
V8_EXPORT_PRIVATE MapRef map(JSHeapBroker *broker) const
IteratingArrayBuiltinReducerAssembler(JSCallReducer *reducer, Node *node)
std::pair< TNode< Number >, TNode< Object > > SafeLoadElement(ElementsKind kind, TNode< JSArray > o, TNode< Number > index)
TNode< Number > ReduceArrayPrototypePush(MapInference *inference)
TNode< Object > ReduceArrayPrototypeFind(MapInference *inference, const bool has_stability_dependency, ElementsKind kind, SharedFunctionInfoRef shared, NativeContextRef native_context, ArrayFindVariant variant)
TNode< Smi > LoadJSArrayLength(TNode< JSArray > array, ElementsKind kind)
TNode< FixedArrayBase > LoadElements(TNode< JSObject > o)
TNode< Boolean > ReduceArrayPrototypeEverySome(MapInference *inference, const bool has_stability_dependency, ElementsKind kind, SharedFunctionInfoRef shared, NativeContextRef native_context, ArrayEverySomeVariant variant)
TNode< Object > ReduceArrayPrototypeIndexOfIncludes(ElementsKind kind, ArrayIndexOfIncludesVariant variant)
void StoreFixedArrayBaseElement(TNode< FixedArrayBase > o, TNode< Number > index, TNode< Object > v, ElementsKind kind)
TNode< Object > ReduceArrayPrototypeReduce(MapInference *inference, const bool has_stability_dependency, ElementsKind kind, ArrayReduceDirection direction, SharedFunctionInfoRef shared)
TNode< Object > MaybeSkipHole(TNode< Object > o, ElementsKind kind, GraphAssemblerLabel< sizeof...(Vars)> *continue_label, TNode< Vars >... vars)
TNode< Boolean > HoleCheck(ElementsKind kind, TNode< Object > v)
void StoreJSArrayLength(TNode< JSArray > array, TNode< Number > value, ElementsKind kind)
TNode< Object > ReduceArrayPrototypeAt(ZoneVector< MapRef > kinds, bool needs_fallback_builtin_call)
TNode< JSArray > ReduceArrayPrototypeFilter(MapInference *inference, const bool has_stability_dependency, ElementsKind kind, SharedFunctionInfoRef shared, NativeContextRef native_context)
TNode< Object > ReduceArrayPrototypeForEach(MapInference *inference, const bool has_stability_dependency, ElementsKind kind, SharedFunctionInfoRef shared)
TNode< JSArray > ReduceArrayPrototypeMap(MapInference *inference, const bool has_stability_dependency, ElementsKind kind, SharedFunctionInfoRef shared, NativeContextRef native_context)
TNode< Smi > LoadFixedArrayBaseLength(TNode< FixedArrayBase > o)
ObjectRef GetBoilerplateLength(JSHeapBroker *broker) const
const CallParameters & Parameters() const
int ArgumentCount() const override
TNode< Object > Argument(int i) const
static constexpr int ArityForArgc(int parameters)
static constexpr int FeedbackVectorIndexForArgc(int argc)
static constexpr int ArgumentIndex(int i)
static constexpr int FirstArgumentIndex()
static constexpr bool kFeedbackVectorIsLastInput
TNode< Object > ArgumentOrUndefined(int i, JSGraph *jsgraph) const
void Do(const For0BodyFunction &body)
const TNode< Number > initial_value_
JSGraphAssembler *const gasm_
const ConditionFunction1 cond_
static constexpr MachineRepresentation kPhiRepresentation
ForBuilder0(JSGraphAssembler *gasm, TNode< Number > initial_value, const ConditionFunction1 &cond, const StepFunction1 &step)
std::function< void(TNode< Number >)> For0BodyFunction
const StepFunction1 step_
static constexpr MachineRepresentation kPhiRepresentation
V8_WARN_UNUSED_RESULT TNode< Object > Value()
const StepFunction1 step_
V8_WARN_UNUSED_RESULT ForBuilder1 & Do(const For1BodyFunction &body)
JSGraphAssembler *const gasm_
ForBuilder1(JSGraphAssembler *gasm, TNode< Number > initial_value, const ConditionFunction1 &cond, const StepFunction1 &step, TNode< Object > initial_arg0)
const ConditionFunction1 cond_
const TNode< Object > initial_arg0_
const TNode< Number > initial_value_
TryCatchBuilder0(JSCallReducerAssembler *gasm, const TryFunction &try_body)
JSCallReducerAssembler *const gasm_
const VoidGenerator0 try_body_
VoidGenerator0 TryFunction
std::function< void(TNode< Object >)> CatchFunction
void Catch(const CatchFunction &catch_body)
TNode< Smi > TypeGuardUnsignedSmall(TNode< Object > value)
TNode< JSArray > CreateArrayNoThrow(TNode< Object > ctor, TNode< Number > size, FrameState frame_state)
const FeedbackSource & feedback() const
TNode< T > ArgumentAs(int index) const
TNode< Number > CheckBounds(TNode< Number > value, TNode< Number > limit, CheckBoundsFlags flags={})
TNode< Object > ReduceMathBinary(const Operator *op)
TNode< Object > TypeGuardNonInternal(TNode< Object > value)
TNode< Number > CheckNumber(TNode< Object > value)
JSCallReducerAssembler(JSCallReducer *reducer, Node *node, Node *effect=nullptr, Node *control=nullptr)
ForBuilder1 For1ZeroUntil(TNode< Number > excluded_limit, TNode< Object > initial_arg0)
TNode< Object > CopyNode()
TNode< Number > LoadMapElementsKind(TNode< Map > map)
TNode< String > ReduceStringPrototypeCharAt()
FrameState FrameStateInput() const
std::function< TNode< Number >(TNode< Number >)> StepFunction1
int ArgumentCount() const
TryCatchBuilder0 Try(const VoidGenerator0 &try_body)
TNode< Number > SpeculativeToNumber(TNode< Object > value, NumberOperationHint hint=NumberOperationHint::kNumberOrOddball)
std::function< TNode< Boolean >(TNode< Number >)> ConditionFunction1
std::function< void(TNode< Number >, TNode< Object > *)> For1BodyFunction
ForBuilder0 ForZeroUntil(TNode< Number > excluded_limit)
TNode< T > ReceiverInputAs() const
TNode< Object > ConvertHoleToUndefined(TNode< Object > value, ElementsKind kind)
TNode< Object > JSCall3(TNode< Object > function, TNode< Object > this_arg, TNode< Object > arg0, TNode< Object > arg1, TNode< Object > arg2, FrameState frame_state)
TNode< Object > Call4(const Callable &callable, TNode< Context > context, TNode< Object > arg0, TNode< Object > arg1, TNode< Object > arg2, TNode< Object > arg3)
CompilationDependencies *const dependencies_
TNode< JSArray > AllocateEmptyJSArray(ElementsKind kind, NativeContextRef native_context)
static constexpr bool kMarkLoopExits
TNode< Object > ReduceMathUnary(const Operator *op)
TNode< Object > TargetInput() const
TNode< Number > ArgumentOrZero(int index)
TNode< String > CheckString(TNode< Object > value)
TNode< Object > ReceiverInput() const
TNode< T > EnterMachineGraph(TNode< U > input, UseInfo use_info)
TNode< Context > ContextInput() const
ForBuilder0 Forever(TNode< Number > initial_value, const StepFunction1 &step)
void ThrowIfNotCallable(TNode< Object > maybe_callable, FrameState frame_state)
TNode< Number > NumberInc(TNode< Number > value)
TNode< Boolean > ReduceStringPrototypeEndsWith()
TNode< Number > TypeGuardFixedArrayLength(TNode< Object > value)
TNode< Object > JSCall4(TNode< Object > function, TNode< Object > this_arg, TNode< Object > arg0, TNode< Object > arg1, TNode< Object > arg2, TNode< Object > arg3, FrameState frame_state)
TNode< Object > ArgumentOrNaN(int index)
TNode< Object > ReduceJSCallWithArrayLikeOrSpreadOfEmpty(std::unordered_set< Node * > *generated_calls_with_array_like_or_spread)
TNode< Object > Argument(int index) const
CompilationDependencies * dependencies() const
TNode< Object > ReduceJSCallMathMinMaxWithArrayLike(Builtin builtin)
ForBuilder1 For1(TNode< Number > initial_value, const ConditionFunction1 &cond, const StepFunction1 &step, TNode< Object > initial_arg0)
TNode< Boolean > ReduceStringPrototypeStartsWith()
TNode< T > ExitMachineGraph(TNode< U > input, MachineRepresentation output_representation, Type output_type)
TNode< String > ReduceStringPrototypeSubstring()
TNode< Object > ArgumentOrUndefined(int index)
void MaybeInsertMapChecks(MapInference *inference, bool has_stability_dependency)
TNode< Smi > CheckSmi(TNode< Object > value)
TNode< String > ReduceStringPrototypeSlice()
Reduction ReduceJSCall(Node *node)
void CheckIfConstructor(Node *call)
Reduction ReduceDatePrototypeGetTime(Node *node)
Reduction ReduceArrayMap(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceStringPrototypeStringAt(const Operator *string_access_operator, Node *node)
NativeContextRef native_context() const
bool IsBuiltinOrApiFunction(JSFunctionRef target_ref) const
Reduction ReduceTypedArrayPrototypeToStringTag(Node *node)
Reduction ReduceArrayFindIndex(Node *node, SharedFunctionInfoRef shared)
bool DoPromiseChecks(MapInference *inference)
std::set< Node * > waitlist_
JSHeapBroker *const broker_
Reduction ReduceNumberConstructor(Node *node)
Reduction ReduceArrayIncludes(Node *node)
Reduction ReduceStringPrototypeEndsWith(Node *node)
Reduction ReduceReflectConstruct(Node *node)
Reduction ReduceSetPrototypeHas(Node *node)
Reduction ReduceMapPrototypeGet(Node *node)
Reduction ReduceObjectPrototypeIsPrototypeOf(Node *node)
Reduction ReplaceWithSubgraph(JSCallReducerAssembler *gasm, Node *subgraph)
Reduction ReduceArrayEvery(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceFunctionPrototypeHasInstance(Node *node)
Reduction ReduceCallApiFunction(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceMathBinary(Node *node, const Operator *op)
Reduction ReduceRegExpPrototypeTest(Node *node)
Reduction ReduceArrayReduceRight(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceMathUnary(Node *node, const Operator *op)
Node * ConvertHoleToUndefined(Node *value, ElementsKind elements_kind)
Reduction ReduceReflectHas(Node *node)
Reduction ReduceArrayReduce(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceArrayPrototypeShift(Node *node)
Reduction ReduceStringPrototypeStartsWith(Node *node)
Reduction ReduceBigIntConstructor(Node *node)
Node * CreateClosureFromBuiltinSharedFunctionInfo(SharedFunctionInfoRef shared, Node *context, Node *effect, Node *control)
Reduction ReduceArrayIterator(Node *node, ArrayIteratorKind array_kind, IterationKind iteration_kind)
Reduction ReduceFunctionPrototypeApply(Node *node)
Reduction ReduceNumberIsInteger(Node *node)
Reduction ReduceStringPrototypeConcat(Node *node)
Node * LoadReceiverElementsKind(Node *receiver, Effect *effect, Control control)
Reduction ReduceMathMinMax(Node *node, const Operator *op, Node *empty_value)
Reduction ReduceStringPrototypeCharAt(Node *node)
Reduction ReduceStringPrototypeSubstr(Node *node)
Reduction ReduceJSCallWithArrayLike(Node *node)
Reduction ReduceArrayFind(Node *node, SharedFunctionInfoRef shared)
StringIndexOfIncludesVariant
Reduction ReduceBigIntAsN(Node *node, Builtin builtin)
Reduction ReducePromiseResolveTrampoline(Node *node)
Reduction ReduceCollectionIteration(Node *node, CollectionKind collection_kind, IterationKind iteration_kind)
JSGraph * jsgraph() const
Reduction ReduceObjectPrototypeGetProto(Node *node)
Reduction ReducePromisePrototypeFinally(Node *node)
Reduction ReduceArrayIteratorPrototypeNext(Node *node)
JSOperatorBuilder * javascript() const
JSHeapBroker * broker() const
Reduction ReduceObjectGetPrototype(Node *node, Node *object)
Reduction ReduceFunctionPrototypeBind(Node *node)
Reduction ReduceStringIteratorPrototypeNext(Node *node)
Reduction ReduceJSConstructForwardAllArgs(Node *node)
Reduction ReducePromisePrototypeThen(Node *node)
Reduction ReduceCallOrConstructWithArrayLikeOrSpread(Node *node, int argument_count, int arraylike_or_spread_index, CallFrequency const &frequency, FeedbackSource const &feedback_source, SpeculationMode speculation_mode, CallFeedbackRelation feedback_relation, Node *target, Effect effect, Control control)
Reduction ReduceReflectGetPrototypeOf(Node *node)
Isolate * isolate() const
Reduction ReduceObjectPrototypeHasOwnProperty(Node *node)
Reduction ReduceReflectGet(Node *node)
std::optional< Reduction > TryReduceJSCallMathMinMaxWithArrayLike(Node *node)
Reduction ReduceJSCallWithSpread(Node *node)
Reduction ReduceMathClz32(Node *node)
@ kBailoutOnUninitialized
Reduction ReduceJSConstruct(Node *node)
Reduction ReduceDateNow(Node *node)
Reduction ReduceObjectIs(Node *node)
Reduction ReduceGlobalIsFinite(Node *node)
Reduction ReduceNumberIsFinite(Node *node)
Reduction ReduceGlobalIsNaN(Node *node)
Reduction ReduceStringPrototypeIndexOfIncludes(Node *node, StringIndexOfIncludesVariant variant)
Reduction ReduceObjectCreate(Node *node)
Reduction ReduceBooleanConstructor(Node *node)
void RevisitForGraphAssembler(Node *node)
Reduction ReduceStringPrototypeSubstring(Node *node)
Reduction ReduceArrayPrototypePush(Node *node)
Node * CheckArrayLength(Node *array, ElementsKind elements_kind, uint32_t array_length, const FeedbackSource &feedback_source, Effect effect, Control control)
Reduction ReduceObjectConstructor(Node *node)
Reduction ReduceReflectApply(Node *node)
Reduction ReduceArrayPrototypePop(Node *node)
CompilationDependencies * dependencies() const
Reduction ReduceCallWasmFunction(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceArrayIsArray(Node *node)
Reduction ReduceArrayBufferViewAccessor(Node *node, InstanceType instance_type, FieldAccess const &access, Builtin builtin)
Reduction ReduceJSCallMathMinMaxWithArrayLike(Node *node, Builtin builtin)
Reduction ReduceFunctionPrototypeCall(Node *node)
Reduction ReduceCollectionPrototypeSize(Node *node, CollectionKind collection_kind)
Reduction ReduceStringConstructor(Node *node, JSFunctionRef constructor)
void CheckIfElementsKind(Node *receiver_elements_kind, ElementsKind kind, Node *control, Node **if_true, Node **if_false)
Reduction ReduceArrayBufferIsView(Node *node)
Reduction ReduceArraySome(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceJSConstructWithArrayLike(Node *node)
Reduction ReduceForInsufficientFeedback(Node *node, DeoptimizeReason reason)
SimplifiedOperatorBuilder * simplified() const
Reduction ReducePromisePrototypeCatch(Node *node)
Reduction ReduceMathImul(Node *node)
std::pair< Node *, Node * > ReleaseEffectAndControlFromAssembler(JSCallReducerAssembler *gasm)
CommonOperatorBuilder * common() const
static constexpr int kMaxInlineMatchSequence
Reduction ReduceArrayBufferViewByteOffsetAccessor(Node *node, InstanceType instance_type, Builtin builtin)
Reduction ReduceNumberIsSafeInteger(Node *node)
Reduction ReduceJSConstructWithSpread(Node *node)
Reduction ReduceStringPrototypeIterator(Node *node)
Reduction Reduce(Node *node) final
Reduction ReduceNumberIsNaN(Node *node)
Reduction ReduceStringPrototypeSlice(Node *node)
Reduction ReducePromiseConstructor(Node *node)
Reduction ReduceCallOrConstructWithArrayLikeOrSpreadOfCreateArguments(Node *node, Node *arguments_list, int arraylike_or_spread_index, CallFrequency const &frequency, FeedbackSource const &feedback, SpeculationMode speculation_mode, CallFeedbackRelation feedback_relation)
Reduction ReduceObjectGetPrototypeOf(Node *node)
Reduction ReduceArrayBufferViewByteLengthAccessor(Node *node, InstanceType instance_type, Builtin builtin)
Reduction ReduceArrayConstructor(Node *node)
std::unordered_set< Node * > generated_calls_with_array_like_or_spread_
Reduction ReduceStringFromCharCode(Node *node)
Reduction ReduceArrayPrototypeAt(Node *node)
Reduction ReduceDataViewAccess(Node *node, DataViewAccess access, ExternalArrayType element_type)
Reduction ReduceCollectionIteratorPrototypeNext(Node *node, int entry_size, Handle< HeapObject > empty_collection, InstanceType collection_iterator_instance_type_first, InstanceType collection_iterator_instance_type_last)
Factory * factory() const
Reduction ReduceMapPrototypeHas(Node *node)
Reduction ReduceTypedArrayPrototypeLength(Node *node)
Reduction ReduceArrayPrototypeSlice(Node *node)
Reduction ReduceReturnReceiver(Node *node)
Reduction ReduceNumberParseInt(Node *node)
Reduction ReduceStringFromCodePoint(Node *node)
Reduction ReduceArrayFilter(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceArrayForEach(Node *node, SharedFunctionInfoRef shared)
Reduction ReduceCollectionPrototypeHas(Node *node, CollectionKind collection_kind)
Reduction ReduceArrayIndexOf(Node *node)
Reduction ReduceTypedArrayConstructor(Node *node, SharedFunctionInfoRef shared)
int ArgumentCount() const
const CreateClosureParameters & Parameters() const
const CreateLiteralParameters & Parameters() const
size_t byte_length() const
void MergeExceptionalPaths(TNode< Object > *exception_out, Effect *effect_out, Control *control_out)
void set_has_handler(bool v)
IfBuilder0 & Then(const VoidGenerator0 &body)
TNode< Number > StringLength(TNode< String > string)
TNode< Map > LoadMap(TNode< HeapObject > object)
TNode< Number > NumberConstant(double value)
CatchScope outermost_catch_scope_
std::function< void()> VoidGenerator0
Node * StoreField(FieldAccess const &, Node *object, Node *value)
TNode< Object > ConvertTaggedHoleToUndefined(TNode< Object > value)
Node * StringCharCodeAt(TNode< String > string, TNode< Number > position)
TNode< Number > NumberMax(TNode< Number > lhs, TNode< Number > rhs)
TNode< Object > DoubleArrayMin(TNode< JSArray > array)
Node * StoreElement(ElementAccess const &, Node *object, Node *index, Node *value)
TNode< HeapObject > HeapConstant(Handle< HeapObject > object)
TNode< Object > JSCallRuntime2(Runtime::FunctionId function_id, TNode< Object > arg0, TNode< Object > arg1, TNode< Context > context, FrameState frame_state)
TNode< Object > MayThrow(const NodeGenerator0 &body)
TNode< FixedArrayBase > MaybeGrowFastElements(ElementsKind kind, const FeedbackSource &feedback, TNode< JSArray > array, TNode< FixedArrayBase > elements, TNode< Number > new_length, TNode< Number > old_length)
Node * outermost_handler_
TNode< Boolean > NumberLessThan(TNode< Number > lhs, TNode< Number > rhs)
TNode< Object > Constant(ObjectRef ref)
TNode< Number > NumberBitwiseAnd(TNode< Number > lhs, TNode< Number > rhs)
TNode< Boolean > ToBoolean(TNode< Object > value)
TNode< Number > NumberShiftRightLogical(TNode< Number > lhs, TNode< Number > rhs)
IfBuilder1< T, Boolean > SelectIf(TNode< Boolean > cond)
Isolate * isolate() const
Node * CheckIf(Node *cond, DeoptimizeReason reason, const FeedbackSource &feedback={})
TNode< Number > NumberSubtract(TNode< Number > lhs, TNode< Number > rhs)
TNode< Boolean > ReferenceEqual(TNode< Object > lhs, TNode< Object > rhs)
CatchScope * catch_scope() const
TNode< Object > JSCallRuntime1(Runtime::FunctionId function_id, TNode< Object > arg0, TNode< Context > context, std::optional< FrameState > frame_state, Operator::Properties properties=Operator::kNoProperties)
Node * ClearPendingMessage()
void TransitionAndStoreElement(MapRef double_map, MapRef fast_map, TNode< HeapObject > object, TNode< Number > index, TNode< Object > value)
TNode< Number > NumberAdd(TNode< Number > lhs, TNode< Number > rhs)
TNode< Number > NumberMin(TNode< Number > lhs, TNode< Number > rhs)
JSOperatorBuilder * javascript() const
IfBuilder0 IfNot(TNode< Boolean > cond)
JSGraph * jsgraph() const
JSHeapBroker * broker() const
TNode< Boolean > ObjectIsSmi(TNode< Object > value)
TNode< Boolean > NumberLessThanOrEqual(TNode< Number > lhs, TNode< Number > rhs)
TNode< String > StringSubstring(TNode< String > string, TNode< Number > from, TNode< Number > to)
Node * LoadField(FieldAccess const &, Node *object)
Node * outermost_handler() const
TNode< Boolean > NumberEqual(TNode< Number > lhs, TNode< Number > rhs)
TNode< String > StringFromSingleCharCode(TNode< Number > code)
TNode< Smi > SmiConstant(int32_t value)
TNode< Object > DoubleArrayMax(TNode< JSArray > array)
SimplifiedOperatorBuilder * simplified() override
TNode< Boolean > NumberIsFloat64Hole(TNode< Number > value)
TNode< Boolean > ObjectIsCallable(TNode< Object > value)
Node * LoadElement(ElementAccess const &, Node *object, Node *index)
JSOperatorBuilder * javascript() const
SimplifiedOperatorBuilder * simplified() const
Node * HeapConstantNoHole(Handle< HeapObject > value)
Node * CEntryStubConstant(int result_size, ArgvMode argv_mode=ArgvMode::kStack, bool builtin_exit_frame=false)
Isolate * isolate() const
Node * ConstantNoHole(ObjectRef ref, JSHeapBroker *broker)
Handle< T > CanonicalPersistentHandle(Tagged< T > object)
CompilationDependencies * dependencies() const
ProcessedFeedback const & GetFeedbackForArrayOrObjectLiteral(FeedbackSource const &source)
ProcessedFeedback const & GetFeedbackForCall(FeedbackSource const &source)
NativeContextRef target_native_context() const
const Operator * CallForwardVarargs(size_t arity, uint32_t start_index)
const Operator * Call(size_t arity, CallFrequency const &frequency=CallFrequency(), FeedbackSource const &feedback=FeedbackSource(), ConvertReceiverMode convert_mode=ConvertReceiverMode::kAny, SpeculationMode speculation_mode=SpeculationMode::kDisallowSpeculation, CallFeedbackRelation feedback_relation=CallFeedbackRelation::kUnrelated)
const Operator * ConstructForwardVarargs(size_t arity, uint32_t start_index)
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)
static CallDescriptor * GetCEntryStubCallDescriptor(Zone *zone, int return_count, int js_parameter_count, const char *debug_name, Operator::Properties properties, CallDescriptor::Flags flags, StackArgumentOrder stack_order=StackArgumentOrder::kDefault)
Node * ExternalConstant(ExternalReference ref)
CommonOperatorBuilder * common() const
V8_WARN_UNUSED_RESULT bool Is(MapRef expected_map)
bool RelyOnMapsPreferStability(CompilationDependencies *dependencies, JSGraph *jsgraph, Effect *effect, Control control, const FeedbackSource &feedback)
V8_WARN_UNUSED_RESULT bool RelyOnMapsViaStability(CompilationDependencies *dependencies)
V8_WARN_UNUSED_RESULT ZoneRefSet< Map > const & GetMaps()
V8_WARN_UNUSED_RESULT bool AllOfInstanceTypesAre(InstanceType type) const
V8_WARN_UNUSED_RESULT Reduction NoChange()
void InsertMapChecks(JSGraph *jsgraph, Effect *effect, Control control, const FeedbackSource &feedback)
V8_WARN_UNUSED_RESULT bool HaveMaps() const
V8_WARN_UNUSED_RESULT bool AllOfInstanceTypesAreJSReceiver() const
DescriptorArrayRef instance_descriptors(JSHeapBroker *broker) const
bool is_access_check_needed() const
HeapObjectRef prototype(JSHeapBroker *broker) const
bool is_constructor() const
InstanceType instance_type() const
int NumberOfOwnDescriptors() const
ElementsKind elements_kind() const
bool is_dictionary_map() const
bool IsPrimitiveMap() const
bool supports_fast_array_iteration(JSHeapBroker *broker) const
IndirectHandle< Name > object() const
static void ChangeOp(Node *node, const Operator *new_op)
static void ReplaceEffectInput(Node *node, Node *effect, int index=0)
static void ReplaceControlInput(Node *node, Node *control, int index=0)
static bool CanBeNullOrUndefined(JSHeapBroker *broker, Node *receiver, Effect effect)
static Node * GetEffectInput(Node *node, int index=0)
static Node * GetContextInput(Node *node)
static bool IsValueEdge(Edge edge)
static void ReplaceContextInput(Node *node, Node *context)
static Node * GetFrameStateInput(Node *node)
static bool CanBePrimitive(JSHeapBroker *broker, Node *receiver, Effect effect)
static Node * GetValueInput(Node *node, int index)
static void SetType(Node *node, Type type)
static void ReplaceValueInput(Node *node, Node *value, int index)
static Node * FindFrameStateBefore(Node *node, Node *unreachable_sentinel)
static void ReplaceValueInputs(Node *node, Node *value)
static void ReplaceFrameStateInput(Node *node, Node *frame_state)
static bool NoObservableSideEffectBetween(Node *effect, Node *dominator)
static bool IsExceptionalCall(Node *node, Node **out_exception=nullptr)
static Node * GetControlInput(Node *node, int index=0)
constexpr IrOpcode::Value opcode() const
const Operator * op() const
void ReplaceInput(int index, Node *new_to)
Node * InputAt(int index) const
void InsertInput(Zone *zone, int index, Node *new_to)
constexpr Opcode opcode() const
static OutputFrameStateCombine Ignore()
CallFeedback const & AsCall() const
TNode< Object > NewTargetInput() const
TNode< Context > CreateFunctionContext(NativeContextRef native_context, TNode< Context > outer_context, int slot_count)
void StoreContextSlot(TNode< Context > context, size_t slot_index, TNode< Object > value)
TNode< Object > ReducePromiseConstructor(NativeContextRef native_context)
void CallPromiseReject(TNode< JSFunction > reject, TNode< Object > exception, FrameState frame_state)
TNode< JSFunction > CreateClosureFromBuiltinSharedFunctionInfo(SharedFunctionInfoRef shared, TNode< Context > context)
void CallPromiseExecutor(TNode< Object > executor, TNode< JSFunction > resolve, TNode< JSFunction > reject, FrameState frame_state)
int ConstructArity() const
TNode< JSPromise > CreatePromise(TNode< Context > context)
PromiseBuiltinReducerAssembler(JSCallReducer *reducer, Node *node)
TNode< Object > TargetInput() const
Representation field_representation() const
OptionalJSObjectRef holder() const
FieldIndex field_index() const
ZoneVector< MapRef > const & lookup_start_object_maps() const
bool IsFastDataConstant() const
static Reduction Changed(Node *node)
static Reduction NoChange()
Reduction FollowedBy(Reduction next) const
bool HasBreakInfo(JSHeapBroker *broker) const
Builtin builtin_id() const
iterator begin_without_receiver_and_skip(int n_skips)
iterator begin_without_receiver() const
std::optional< double > ToInt(JSHeapBroker *broker, int radix)
std::optional< uint16_t > GetChar(JSHeapBroker *broker, uint32_t index) const
bool IsContentAccessible() const
Node * CloneNode(const Node *node)
Node * NewNode(const Operator *op, int input_count, Node *const *inputs, bool incomplete=false)
Type const kJSArrayLengthType
Type const kJSTypedArrayLengthType
Type const kFixedArrayLengthType
static TypeCache const * Get()
static Type UnsignedSmall()
#define RAB_GSAB_TYPED_ARRAYS(V)
base::Vector< const DirectHandle< Object > > args
DirectHandle< Object > new_target
TNode< Object > original_length
std::optional< TNode< JSArray > > a
ArrayReduceDirection direction
SharedFunctionInfoRef shared
FrameState outer_frame_state
bool has_stability_dependency_
ElementsKind elements_kind_
#define TRACE_BROKER_MISSING(broker, x)
ZoneVector< RpoNumber > & result
MovableLabel continuation
bool none_of(const C &container, const P &predicate)
FastApiCallFunction GetFastApiCallTarget(JSHeapBroker *broker, FunctionTemplateInfoRef function_template_info, size_t arg_count)
TNode< Oddball > UndefinedConstant(JSGraph *jsgraph)
const CreateArrayIteratorParameters & CreateArrayIteratorParametersOf(const Operator *op)
JSCallNodeBase< IrOpcode::kJSCall > JSCallNode
@ kConvertStringAndMinusZero
NumberConstant(std::numeric_limits< double >::quiet_NaN())) DEFINE_GETTER(EmptyStateValues
FrameState CreateGenericLazyDeoptContinuationFrameState(JSGraph *graph, SharedFunctionInfoRef shared, Node *target, Node *context, Node *receiver, Node *outer_frame_state)
const CreateBoundFunctionParameters & CreateBoundFunctionParametersOf(const Operator *op)
const FieldAccess & FieldAccessOf(const Operator *op)
FloatMatcher< double, IrOpcode::kNumberConstant > NumberMatcher
const CallParameters & CallParametersOf(const Operator *op)
Handle< FeedbackCell > FeedbackCellOf(const Operator *op)
HeapConstantNoHole(BUILTIN_CODE(isolate(), AllocateInOldGeneration))) DEFINE_GETTER(ArrayConstructorStubConstant
Node * CreateInlinedApiFunctionFrameState(JSGraph *graph, SharedFunctionInfoRef shared, Node *target, Node *context, Node *receiver, Node *outer_frame_state)
FrameState CreateJavaScriptBuiltinContinuationFrameState(JSGraph *jsgraph, SharedFunctionInfoRef shared, Builtin name, Node *target, Node *context, Node *const *stack_parameters, int stack_parameter_count, Node *outer_frame_state, ContinuationFrameStateMode mode)
int ExternalArrayElementSize(const ExternalArrayType element_type)
std::string ToString(const BytecodeLivenessState &liveness)
CreateArgumentsType const & CreateArgumentsTypeOf(const Operator *op)
ArrayIndexOfIncludesVariant
ref_traits< T >::ref_type MakeRef(JSHeapBroker *broker, Tagged< T > object)
ZoneCompactSet< typename ref_traits< T >::ref_type > ZoneRefSet
HeapObjectMatcherImpl< IrOpcode::kHeapConstant > HeapObjectMatcher
constexpr IndependentValueType kWasmF32
constexpr IndependentHeapType kWasmExternRef
constexpr IndependentValueType kWasmI32
constexpr IndependentValueType kWasmF64
constexpr IndependentValueType kWasmI64
constexpr bool IsHoleyElementsKind(ElementsKind kind)
bool IsClassConstructor(FunctionKind kind)
bool Is(IndirectHandle< U > value)
bool IsSpecialReceiverInstanceType(InstanceType instance_type)
Map::Bits1::HasPrototypeSlotBit Map::Bits1::HasNamedInterceptorBit Map::Bits1::IsUndetectableBit Map::Bits1::IsConstructorBit bit_field2
bool IsTypedArrayElementsKind(ElementsKind kind)
bool IsRabGsabTypedArrayElementsKind(ElementsKind kind)
Tagged(T object) -> Tagged< T >
constexpr bool IsSmiElementsKind(ElementsKind kind)
kWasmInternalFunctionIndirectPointerTag instance_data
ElementsKind GetPackedElementsKind(ElementsKind holey_kind)
constexpr bool IsFloat16TypedArrayElementsKind(ElementsKind kind)
@ FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND
@ LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND
@ FIRST_RAB_GSAB_FIXED_TYPED_ARRAY_ELEMENTS_KIND
bool IsSmiOrObjectElementsKind(ElementsKind kind)
void Terminate(Isolate *isolate)
ElementsKind GetHoleyElementsKind(ElementsKind packed_kind)
DONT_OVERRIDE DISABLE_ALLOCATION_SITES HOLEY_ELEMENTS
uint32_t NumberToUint32(Tagged< Object > number)
@ LAST_SPECIAL_RECEIVER_TYPE
DONT_OVERRIDE DISABLE_ALLOCATION_SITES DISABLE_ALLOCATION_SITES HOLEY_DOUBLE_ELEMENTS
int32_t DoubleToInt32(double x)
bool UnionElementsKindUptoSize(ElementsKind *a_out, ElementsKind b)
V8_EXPORT_PRIVATE FlagValues v8_flags
constexpr int JSParameterCount(int param_count_without_receiver)
@ kExternalBigUint64Array
constexpr bool IsDoubleElementsKind(ElementsKind kind)
bool UnionElementsKindUptoPackedness(ElementsKind *a_out, ElementsKind b)
!IsContextMap !IsContextMap native_context
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK_LE(v1, v2)
#define CHECK_GE(lhs, rhs)
#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)
const CFunctionInfo * signature
bool IsInRange(const T &low, const T &high) const
bool Is(IndirectHandle< HeapObject > const &value) const
HeapObjectRef Ref(JSHeapBroker *broker) const
OptionalJSObjectRef holder
CallOptimization::HolderLookup lookup
const T & ResolvedValue() const
bool HasResolvedValue() const
#define V8_WARN_UNUSED_RESULT