45 switch (node->opcode()) {
46#define DECLARE_CASE(x, ...) \
47 case IrOpcode::k##x: \
59#define REPLACE_STUB_CALL(Name) \
60 void JSGenericLowering::LowerJS##Name(Node* node) { \
61 ReplaceWithBuiltinCall(node, Builtin::k##Name); \
81#undef REPLACE_STUB_CALL
108 int nargs_override) {
112 int nargs = (nargs_override < 0) ? fun->
nargs : nargs_override;
113 auto call_descriptor =
118 node->InsertInput(
zone(), nargs + 1, ref);
119 node->InsertInput(
zone(), nargs + 2, arity);
125 Builtin builtin_with_feedback) {
135 node->op()->properties());
137 static_assert(JSUnaryOpNode::ValueIndex() == 0);
138 static_assert(JSUnaryOpNode::FeedbackVectorIndex() == 1);
139 DCHECK_EQ(node->op()->ValueInputCount(), 2);
140 node->InsertInput(
zone(), 0, stub_code);
141 node->InsertInput(
zone(), 2, slot);
144 node->RemoveInput(JSUnaryOpNode::FeedbackVectorIndex());
149#define DEF_UNARY_LOWERING(Name) \
150 void JSGenericLowering::LowerJS##Name(Node* node) { \
151 ReplaceUnaryOpWithBuiltinCall(node, Builtin::k##Name, \
152 Builtin::k##Name##_WithFeedback); \
158#undef DEF_UNARY_LOWERING
162 Builtin builtin_with_feedback) {
168 static_assert(JSBinaryOpNode::LeftIndex() == 0);
169 static_assert(JSBinaryOpNode::RightIndex() == 1);
170 static_assert(JSBinaryOpNode::FeedbackVectorIndex() == 2);
171 DCHECK_EQ(node->op()->ValueInputCount(), 3);
172 node->InsertInput(
zone(), 2, slot);
173 builtin = builtin_with_feedback;
175 node->RemoveInput(JSBinaryOpNode::FeedbackVectorIndex());
176 builtin = builtin_without_feedback;
182#define DEF_BINARY_LOWERING(Name) \
183 void JSGenericLowering::LowerJS##Name(Node* node) { \
184 ReplaceBinaryOpWithBuiltinCall(node, Builtin::k##Name, \
185 Builtin::k##Name##_WithFeedback); \
207#undef DEF_BINARY_LOWERING
209void JSGenericLowering::LowerJSStrictEqual(Node* node) {
212 DCHECK_EQ(node->op()->ControlInputCount(), 1);
219 static_assert(JSStrictEqualNode::LeftIndex() == 0);
220 static_assert(JSStrictEqualNode::RightIndex() == 1);
221 static_assert(JSStrictEqualNode::FeedbackVectorIndex() == 2);
222 DCHECK_EQ(node->op()->ValueInputCount(), 3);
223 node->InsertInput(
zone(), 2, slot);
224 builtin = Builtin::kStrictEqual_WithFeedback;
226 node->RemoveInput(JSStrictEqualNode::FeedbackVectorIndex());
227 builtin = Builtin::kStrictEqual;
240bool ShouldUseMegamorphicAccessBuiltin(FeedbackSource
const& source,
243 ProcessedFeedback
const& feedback =
247 return feedback.AsElementAccess().transition_groups().empty();
249 return feedback.AsNamedAccess().maps().empty();
258void JSGenericLowering::LowerJSHasProperty(Node* node) {
259 JSHasPropertyNode
n(node);
260 const PropertyAccess& p = n.Parameters();
261 if (!p.feedback().IsValid()) {
262 node->RemoveInput(JSHasPropertyNode::FeedbackVectorIndex());
265 static_assert(n.FeedbackVectorIndex() == 2);
266 n->InsertInput(
zone(), 2,
267 jsgraph()->TaggedIndexConstant(p.feedback().index()));
272void JSGenericLowering::LowerJSLoadProperty(Node* node) {
273 JSLoadPropertyNode
n(node);
274 const PropertyAccess& p = n.Parameters();
275 FrameState frame_state = n.frame_state();
276 Node* outer_state = frame_state.outer_frame_state();
277 static_assert(n.FeedbackVectorIndex() == 2);
278 if (outer_state->opcode() != IrOpcode::kFrameState) {
279 n->RemoveInput(n.FeedbackVectorIndex());
280 n->InsertInput(
zone(), 2,
281 jsgraph()->TaggedIndexConstant(p.feedback().index()));
283 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), {},
285 ? Builtin::kKeyedLoadICTrampoline_Megamorphic
286 : Builtin::kKeyedLoadICTrampoline);
288 n->InsertInput(
zone(), 2,
289 jsgraph()->TaggedIndexConstant(p.feedback().index()));
291 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), {},
293 ? Builtin::kKeyedLoadIC_Megamorphic
294 : Builtin::kKeyedLoadIC);
298void JSGenericLowering::LowerJSLoadNamed(Node* node) {
299 JSLoadNamedNode
n(node);
300 NamedAccess
const& p = n.Parameters();
301 FrameState frame_state = n.frame_state();
302 Node* outer_state = frame_state.outer_frame_state();
303 static_assert(n.FeedbackVectorIndex() == 1);
304 if (!p.feedback().IsValid()) {
305 n->RemoveInput(n.FeedbackVectorIndex());
308 }
else if (outer_state->opcode() != IrOpcode::kFrameState) {
309 n->RemoveInput(n.FeedbackVectorIndex());
311 node->InsertInput(
zone(), 2,
312 jsgraph()->TaggedIndexConstant(p.feedback().index()));
314 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), p.name(),
316 ? Builtin::kLoadICTrampoline_Megamorphic
317 : Builtin::kLoadICTrampoline);
320 node->InsertInput(
zone(), 2,
321 jsgraph()->TaggedIndexConstant(p.feedback().index()));
323 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), p.name(),
325 ? Builtin::kLoadIC_Megamorphic
330void JSGenericLowering::LowerJSLoadNamedFromSuper(Node* node) {
331 JSLoadNamedFromSuperNode
n(node);
332 NamedAccess
const& p = n.Parameters();
340 n.home_object(), effect, control);
343 home_object_map, effect, control);
344 n->
ReplaceInput(n.HomeObjectIndex(), home_object_proto);
346 static_assert(n.FeedbackVectorIndex() == 2);
350 DCHECK(p.feedback().IsValid());
352 node->InsertInput(
zone(), 3,
353 jsgraph()->TaggedIndexConstant(p.feedback().index()));
357void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
358 JSLoadGlobalNode
n(node);
359 const LoadGlobalParameters& p = n.Parameters();
361 FrameState frame_state = n.frame_state();
362 Node* outer_state = frame_state.outer_frame_state();
363 static_assert(n.FeedbackVectorIndex() == 0);
364 if (outer_state->opcode() != IrOpcode::kFrameState) {
365 n->RemoveInput(n.FeedbackVectorIndex());
367 node->InsertInput(
zone(), 1,
368 jsgraph()->TaggedIndexConstant(p.feedback().index()));
373 node->InsertInput(
zone(), 1,
374 jsgraph()->TaggedIndexConstant(p.feedback().index()));
381void JSGenericLowering::LowerJSGetIterator(Node* node) {
392 JSGetIteratorNode
n(node);
393 GetIteratorParameters
const& p = n.Parameters();
398 static_assert(n.FeedbackVectorIndex() == 1);
400 node->InsertInput(
zone(), 2, call_slot);
405void JSGenericLowering::LowerJSSetKeyedProperty(Node* node) {
406 JSSetKeyedPropertyNode
n(node);
407 const PropertyAccess& p = n.Parameters();
408 FrameState frame_state = n.frame_state();
409 Node* outer_state = frame_state.outer_frame_state();
410 static_assert(n.FeedbackVectorIndex() == 3);
411 if (outer_state->opcode() != IrOpcode::kFrameState) {
412 n->RemoveInput(n.FeedbackVectorIndex());
413 node->InsertInput(
zone(), 3,
414 jsgraph()->TaggedIndexConstant(p.feedback().index()));
422 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), {},
424 ? Builtin::kKeyedStoreICTrampoline_Megamorphic
425 : Builtin::kKeyedStoreICTrampoline);
427 node->InsertInput(
zone(), 3,
428 jsgraph()->TaggedIndexConstant(p.feedback().index()));
430 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), {},
432 ? Builtin::kKeyedStoreIC_Megamorphic
433 : Builtin::kKeyedStoreIC);
437void JSGenericLowering::LowerJSDefineKeyedOwnProperty(Node* node) {
438 JSDefineKeyedOwnPropertyNode
n(node);
439 const PropertyAccess& p = n.Parameters();
440 FrameState frame_state = n.frame_state();
441 Node* outer_state = frame_state.outer_frame_state();
442 static_assert(n.FeedbackVectorIndex() == 4);
443 if (outer_state->opcode() != IrOpcode::kFrameState) {
444 n->RemoveInput(n.FeedbackVectorIndex());
445 node->InsertInput(
zone(), 4,
446 jsgraph()->TaggedIndexConstant(p.feedback().index()));
449 node->InsertInput(
zone(), 4,
450 jsgraph()->TaggedIndexConstant(p.feedback().index()));
455void JSGenericLowering::LowerJSSetNamedProperty(Node* node) {
456 JSSetNamedPropertyNode
n(node);
457 NamedAccess
const& p = n.Parameters();
458 FrameState frame_state = n.frame_state();
459 Node* outer_state = frame_state.outer_frame_state();
460 static_assert(n.FeedbackVectorIndex() == 2);
461 if (!p.feedback().IsValid()) {
462 n->RemoveInput(n.FeedbackVectorIndex());
465 }
else if (outer_state->opcode() != IrOpcode::kFrameState) {
466 n->RemoveInput(n.FeedbackVectorIndex());
468 node->InsertInput(
zone(), 3,
469 jsgraph()->TaggedIndexConstant(p.feedback().index()));
476 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), {},
478 ? Builtin::kStoreICTrampoline_Megamorphic
479 : Builtin::kStoreICTrampoline);
482 node->InsertInput(
zone(), 3,
483 jsgraph()->TaggedIndexConstant(p.feedback().index()));
485 node, ShouldUseMegamorphicAccessBuiltin(p.feedback(), {},
487 ? Builtin::kStoreIC_Megamorphic
488 : Builtin::kStoreIC);
492void JSGenericLowering::LowerJSDefineNamedOwnProperty(Node* node) {
494 JSDefineNamedOwnPropertyNode
n(node);
495 DefineNamedOwnPropertyParameters
const& p = n.Parameters();
496 FrameState frame_state = n.frame_state();
497 Node* outer_state = frame_state.outer_frame_state();
498 static_assert(n.FeedbackVectorIndex() == 2);
499 if (outer_state->opcode() != IrOpcode::kFrameState) {
500 n->RemoveInput(n.FeedbackVectorIndex());
502 node->InsertInput(
zone(), 3,
503 jsgraph()->TaggedIndexConstant(p.feedback().index()));
508 node->InsertInput(
zone(), 3,
509 jsgraph()->TaggedIndexConstant(p.feedback().index()));
515void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
516 JSStoreGlobalNode
n(node);
517 const StoreGlobalParameters& p = n.Parameters();
518 FrameState frame_state = n.frame_state();
519 Node* outer_state = frame_state.outer_frame_state();
520 static_assert(n.FeedbackVectorIndex() == 1);
521 if (outer_state->opcode() != IrOpcode::kFrameState) {
522 n->RemoveInput(n.FeedbackVectorIndex());
524 node->InsertInput(
zone(), 2,
525 jsgraph()->TaggedIndexConstant(p.feedback().index()));
529 node->InsertInput(
zone(), 2,
530 jsgraph()->TaggedIndexConstant(p.feedback().index()));
535void JSGenericLowering::LowerJSDefineKeyedOwnPropertyInLiteral(Node* node) {
536 JSDefineKeyedOwnPropertyInLiteralNode
n(node);
537 FeedbackParameter
const& p = n.Parameters();
538 static_assert(n.FeedbackVectorIndex() == 4);
540 node->InsertInput(
zone(), 5,
541 jsgraph()->TaggedIndexConstant(p.feedback().index()));
545void JSGenericLowering::LowerJSStoreInArrayLiteral(Node* node) {
546 JSStoreInArrayLiteralNode
n(node);
547 FeedbackParameter
const& p = n.Parameters();
548 static_assert(n.FeedbackVectorIndex() == 3);
550 node->InsertInput(
zone(), 3,
551 jsgraph()->TaggedIndexConstant(p.feedback().index()));
555void JSGenericLowering::LowerJSDeleteProperty(Node* node) {
559void JSGenericLowering::LowerJSGetSuperConstructor(Node* node) {
566 active_function, effect, control);
569 node->ReplaceInput(0, function_map);
570 node->ReplaceInput(1, effect);
571 node->ReplaceInput(2, control);
572 node->TrimInputCount(3);
577void JSGenericLowering::LowerJSFindNonDefaultConstructorOrConstruct(
582void JSGenericLowering::LowerJSHasInPrototypeChain(Node* node) {
586void JSGenericLowering::LowerJSOrdinaryHasInstance(Node* node) {
590void JSGenericLowering::LowerJSHasContextExtension(Node* node) {
594void JSGenericLowering::LowerJSLoadContext(Node* node) {
598void JSGenericLowering::LowerJSLoadScriptContext(Node* node) {
602void JSGenericLowering::LowerJSStoreContext(Node* node) {
606void JSGenericLowering::LowerJSStoreScriptContext(Node* node) {
610void JSGenericLowering::LowerJSCreate(Node* node) {
615void JSGenericLowering::LowerJSCreateArguments(Node* node) {
631void JSGenericLowering::LowerJSCreateArray(Node* node) {
633 int const arity =
static_cast<int>(p.arity());
634 auto interface_descriptor = ArrayConstructorDescriptor{};
637 node->op()->properties());
641 DCHECK_EQ(interface_descriptor.GetStackParameterCount(), 0);
642 Node* stub_code =
jsgraph()->ArrayConstructorStubConstant();
644 OptionalAllocationSiteRef
const site = p.site();
645 Node* type_info = site.has_value()
647 :
jsgraph()->UndefinedConstant();
649 node->InsertInput(
zone(), 0, stub_code);
650 node->InsertInput(
zone(), 3, stub_arity);
651 node->InsertInput(
zone(), 4, type_info);
656void JSGenericLowering::LowerJSCreateArrayIterator(Node* node) {
660void JSGenericLowering::LowerJSCreateAsyncFunctionObject(Node* node) {
664void JSGenericLowering::LowerJSCreateCollectionIterator(Node* node) {
668void JSGenericLowering::LowerJSCreateBoundFunction(Node* node) {
672void JSGenericLowering::LowerJSObjectIsArray(Node* node) {
676void JSGenericLowering::LowerJSCreateObject(Node* node) {
680void JSGenericLowering::LowerJSCreateStringWrapper(Node* node) {
684void JSGenericLowering::LowerJSParseInt(Node* node) {
688void JSGenericLowering::LowerJSRegExpTest(Node* node) {
692void JSGenericLowering::LowerJSCreateClosure(Node* node) {
693 JSCreateClosureNode
n(node);
694 CreateClosureParameters
const& p = n.Parameters();
695 SharedFunctionInfoRef shared_info = p.shared_info();
696 static_assert(n.FeedbackCellIndex() == 0);
697 node->InsertInput(
zone(), 0,
699 node->RemoveInput(4);
709void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) {
710 const CreateFunctionContextParameters& parameters =
712 ScopeInfoRef scope_info = parameters.scope_info();
713 int slot_count = parameters.slot_count();
714 ScopeType scope_type = parameters.scope_type();
720 node->InsertInput(
zone(), 0,
722 node->InsertInput(
zone(), 1,
jsgraph()->Int32Constant(slot_count));
725 node->InsertInput(
zone(), 0,
731void JSGenericLowering::LowerJSCreateGeneratorObject(Node* node) {
732 node->RemoveInput(4);
736void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) {
740void JSGenericLowering::LowerJSCreateStringIterator(Node* node) {
744void JSGenericLowering::LowerJSCreateKeyValueArray(Node* node) {
748void JSGenericLowering::LowerJSCreatePromise(Node* node) {
752void JSGenericLowering::LowerJSCreateTypedArray(Node* node) {
756void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) {
758 CreateLiteralParameters
const& p = n.Parameters();
759 static_assert(n.FeedbackVectorIndex() == 0);
760 node->InsertInput(
zone(), 1,
761 jsgraph()->TaggedIndexConstant(p.feedback().index()));
762 node->InsertInput(
zone(), 2,
764 node->InsertInput(
zone(), 3,
jsgraph()->SmiConstant(p.flags()));
776void JSGenericLowering::LowerJSGetTemplateObject(Node* node) {
777 JSGetTemplateObjectNode
n(node);
778 GetTemplateObjectParameters
const& p = n.Parameters();
779 SharedFunctionInfoRef shared = p.shared();
780 TemplateObjectDescriptionRef description = p.description();
782 DCHECK_EQ(node->op()->ControlInputCount(), 1);
785 static_assert(JSGetTemplateObjectNode::FeedbackVectorIndex() == 0);
787 node->InsertInput(
zone(), 1,
789 node->InsertInput(
zone(), 2,
790 jsgraph()->UintPtrConstant(p.feedback().index()));
795void JSGenericLowering::LowerJSCreateEmptyLiteralArray(Node* node) {
796 JSCreateEmptyLiteralArrayNode
n(node);
797 FeedbackParameter
const& p = n.Parameters();
798 static_assert(n.FeedbackVectorIndex() == 0);
799 node->InsertInput(
zone(), 1,
800 jsgraph()->TaggedIndexConstant(p.feedback().index()));
801 node->RemoveInput(4);
805void JSGenericLowering::LowerJSCreateArrayFromIterable(Node* node) {
809void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) {
811 CreateLiteralParameters
const& p = n.Parameters();
812 static_assert(n.FeedbackVectorIndex() == 0);
813 node->InsertInput(
zone(), 1,
814 jsgraph()->TaggedIndexConstant(p.feedback().index()));
815 node->InsertInput(
zone(), 2,
817 node->InsertInput(
zone(), 3,
jsgraph()->SmiConstant(p.flags()));
830void JSGenericLowering::LowerJSCloneObject(Node* node) {
831 JSCloneObjectNode
n(node);
832 CloneObjectParameters
const& p = n.Parameters();
833 static_assert(n.FeedbackVectorIndex() == 1);
834 node->InsertInput(
zone(), 1,
jsgraph()->SmiConstant(p.flags()));
835 node->InsertInput(
zone(), 2,
836 jsgraph()->TaggedIndexConstant(p.feedback().index()));
840void JSGenericLowering::LowerJSCreateEmptyLiteralObject(Node* node) {
844void JSGenericLowering::LowerJSCreateLiteralRegExp(Node* node) {
846 CreateLiteralParameters
const& p = n.Parameters();
847 static_assert(n.FeedbackVectorIndex() == 0);
848 node->InsertInput(
zone(), 1,
849 jsgraph()->TaggedIndexConstant(p.feedback().index()));
850 node->InsertInput(
zone(), 2,
852 node->InsertInput(
zone(), 3,
jsgraph()->SmiConstant(p.flags()));
857void JSGenericLowering::LowerJSCreateCatchContext(Node* node) {
863void JSGenericLowering::LowerJSCreateWithContext(Node* node) {
869void JSGenericLowering::LowerJSCreateBlockContext(Node* node) {
876void JSGenericLowering::LowerJSConstructForwardVarargs(Node* node) {
877 ConstructForwardVarargsParameters p =
879 int const arg_count =
static_cast<int>(p.arity() - 2);
885 DCHECK_EQ(callable.descriptor().GetStackParameterCount(), 0);
887 zone(), callable.descriptor(), arg_count + 1, flags);
892 node->InsertInput(
zone(), 0, stub_code);
893 node->InsertInput(
zone(), 3, stub_arity);
894 node->InsertInput(
zone(), 4, start_index);
899void JSGenericLowering::LowerJSConstructForwardAllArgs(Node* node) {
904 ->opcode() != IrOpcode::kFrameState);
912 DCHECK_EQ(callable.descriptor().GetStackParameterCount(), 0);
926void JSGenericLowering::LowerJSConstruct(Node* node) {
928 ConstructParameters
const& p = n.Parameters();
929 int const arg_count = p.arity_without_implicit_args();
934 const int stack_argument_count = arg_count +
kReceiver;
937 zone(), callable.descriptor(), stack_argument_count, flags);
941 node->RemoveInput(n.FeedbackVectorIndex());
942 node->InsertInput(
zone(), 0, stub_code);
943 node->InsertInput(
zone(), 3, stub_arity);
951void JSGenericLowering::LowerJSConstructWithArrayLike(Node* node) {
953 ConstructParameters
const& p = n.Parameters();
955 const int arg_count = p.arity_without_implicit_args();
959 static constexpr int kArgumentList = 1;
961 const int stack_argument_count = arg_count - kArgumentList +
kReceiver;
967 DCHECK_EQ(callable.descriptor().GetStackParameterCount(), 0);
969 zone(), callable.descriptor(), stack_argument_count, flags);
972 node->RemoveInput(n.FeedbackVectorIndex());
973 node->InsertInput(
zone(), 0, stub_code);
981void JSGenericLowering::LowerJSConstructWithSpread(Node* node) {
983 ConstructParameters
const& p = n.Parameters();
984 int const arg_count = p.arity_without_implicit_args();
989 static constexpr int kTheSpread = 1;
991 const int stack_argument_count = arg_count +
kReceiver - kTheSpread;
996 DCHECK_EQ(callable.descriptor().GetStackParameterCount(), 0);
998 zone(), callable.descriptor(), stack_argument_count, flags);
1005 DCHECK(n.FeedbackVectorIndex() > n.LastArgumentIndex());
1006 node->RemoveInput(n.FeedbackVectorIndex());
1007 Node* spread = node->RemoveInput(n.LastArgumentIndex());
1009 node->InsertInput(
zone(), 0, stub_code);
1010 node->InsertInput(
zone(), 3, stub_arity);
1011 node->InsertInput(
zone(), 4, spread);
1019void JSGenericLowering::LowerJSCallForwardVarargs(Node* node) {
1021 int const arg_count =
static_cast<int>(p.arity() - 2);
1025 zone(), callable.descriptor(), arg_count + 1, flags);
1030 node->InsertInput(
zone(), 2, stub_arity);
1031 node->InsertInput(
zone(), 3, start_index);
1035void JSGenericLowering::LowerJSCall(Node* node) {
1037 CallParameters
const& p = n.Parameters();
1038 int const arg_count = p.arity_without_implicit_args();
1041 node->RemoveInput(n.FeedbackVectorIndex());
1046 zone(), callable.descriptor(), arg_count + 1, flags);
1050 node->InsertInput(
zone(), 2, stub_arity);
1054void JSGenericLowering::LowerJSCallWithArrayLike(Node* node) {
1056 CallParameters
const& p = n.Parameters();
1057 const int arg_count = p.arity_without_implicit_args();
1061 static constexpr int kArgumentsList = 1;
1064 const int stack_argument_count = arg_count - kArgumentsList +
kReceiver;
1067 zone(), callable.descriptor(), stack_argument_count, flags);
1070 Node* arguments_list = n.Argument(0);
1077 node->ReplaceInput(2, arguments_list);
1085void JSGenericLowering::LowerJSCallWithSpread(Node* node) {
1087 CallParameters
const& p = n.Parameters();
1088 int const arg_count = p.arity_without_implicit_args();
1093 static constexpr int kTheSpread = 1;
1095 const int stack_argument_count = arg_count - kTheSpread +
kReceiver;
1100 DCHECK_EQ(callable.descriptor().GetStackParameterCount(), 0);
1102 zone(), callable.descriptor(), stack_argument_count, flags);
1113 Node* spread = node->
RemoveInput(n.LastArgumentIndex());
1116 node->InsertInput(
zone(), 2, stub_arity);
1117 node->InsertInput(
zone(), 3, spread);
1124void JSGenericLowering::LowerJSCallRuntime(Node* node) {
1129#if V8_ENABLE_WEBASSEMBLY
1131void JSGenericLowering::LowerJSWasmCall(Node* node) {}
1134void JSGenericLowering::LowerJSForInPrepare(Node* node) {
1138void JSGenericLowering::LowerJSForInNext(Node* node) {
1142void JSGenericLowering::LowerJSLoadMessage(Node* node) {
1147void JSGenericLowering::LowerJSStoreMessage(Node* node) {
1151void JSGenericLowering::LowerJSLoadModule(Node* node) {
1155void JSGenericLowering::LowerJSStoreModule(Node* node) {
1159void JSGenericLowering::LowerJSGetImportMeta(Node* node) {
1163void JSGenericLowering::LowerJSGeneratorStore(Node* node) {
1167void JSGenericLowering::LowerJSGeneratorRestoreContinuation(Node* node) {
1171void JSGenericLowering::LowerJSGeneratorRestoreContext(Node* node) {
1175void JSGenericLowering::LowerJSGeneratorRestoreInputOrDebugPos(Node* node) {
1179void JSGenericLowering::LowerJSGeneratorRestoreRegister(Node* node) {
1186 DCHECK(op->opcode() == IrOpcode::kJSStackCheck);
1192void JSGenericLowering::LowerJSStackCheck(Node* node) {
1195 StackCheckKind stack_check_kind = StackCheckKindOfJSStackCheck(node->op());
1202 ExternalReference::address_of_no_heap_write_interrupt_request(
1208 Node* limit = effect =
1211 ExternalReference::address_of_jslimit(
isolate())),
1215 machine()->StackPointerGreaterThan(stack_check_kind), limit, effect);
1221 Node* etrue = effect;
1226 Node* efalse = if_false =
node;
1239 for (Edge edge : merge->use_edges()) {
1241 if (edge.from()->opcode() == IrOpcode::kIfSuccess) {
1244 edge.UpdateTo(node);
1246 if (edge.from()->opcode() == IrOpcode::kIfException) {
1248 edge.UpdateTo(node);
1258 node->InsertInput(
zone(), 0,
1264void JSGenericLowering::LowerJSDebugger(Node* node) {
SimplifiedOperatorBuilder * simplified
static V8_EXPORT_PRIVATE Callable CallableFor(Isolate *isolate, Builtin builtin)
int GetStackParameterCount() const
Handle< Code > code() const
CallInterfaceDescriptor descriptor() const
static Callable ConstructWithSpread(Isolate *isolate)
static Callable DefineNamedOwnIC(Isolate *isolate)
static Callable LoadGlobalICInOptimizedCode(Isolate *isolate, TypeofMode typeof_mode)
static Callable LoadGlobalIC(Isolate *isolate, TypeofMode typeof_mode)
static Callable CallWithArrayLike(Isolate *isolate)
static Callable CallWithSpread(Isolate *isolate)
static Callable DefineNamedOwnICInOptimizedCode(Isolate *isolate)
static Callable Call(Isolate *isolate, ConvertReceiverMode mode=ConvertReceiverMode::kAny)
static Callable CallForwardVarargs(Isolate *isolate)
static Callable FastNewFunctionContext(Isolate *isolate, ScopeType scope_type)
static Callable ConstructForwardVarargs(Isolate *isolate)
static const int kMaximumClonedShallowArrayElements
static int MaximumFunctionContextSlots()
static const int kMaximumClonedShallowObjectProperties
static ExternalReference Create(const SCTableReference &table_ref)
static constexpr MachineType Pointer()
static constexpr MachineType Uint8()
static V8_EXPORT_PRIVATE const Function * FunctionForId(FunctionId id)
static FieldAccess ForMap(WriteBarrierKind write_barrier=kMapWriteBarrier)
static FieldAccess ForMapPrototype()
void RelaxControls(Node *node, Node *control=nullptr)
base::Flags< Flag > Flags
FeedbackSource const & feedback() const
void ReplaceBinaryOpWithBuiltinCall(Node *node, Builtin builtin_without_feedback, Builtin builtin_with_feedback)
Isolate * isolate() const
JSGraph * jsgraph() const
Reduction Reduce(Node *node) final
void ReplaceWithRuntimeCall(Node *node, Runtime::FunctionId f, int args=-1)
void ReplaceWithBuiltinCall(Node *node, Builtin builtin)
CommonOperatorBuilder * common() const
MachineOperatorBuilder * machine() const
void ReplaceUnaryOpWithBuiltinCall(Node *node, Builtin builtin_without_feedback, Builtin builtin_with_feedback)
~JSGenericLowering() final
JSHeapBroker * broker() const
JSGenericLowering(JSGraph *jsgraph, Editor *editor, JSHeapBroker *broker)
Node * HeapConstantNoHole(Handle< HeapObject > value)
Isolate * isolate() const
Node * ConstantNoHole(ObjectRef ref, JSHeapBroker *broker)
ProcessedFeedback const & GetFeedbackForPropertyAccess(FeedbackSource const &source, AccessMode mode, OptionalNameRef static_name)
static constexpr bool IsUnaryWithFeedback(Operator::Opcode opcode)
static constexpr bool IsBinaryWithFeedback(Operator::Opcode opcode)
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 * GetRuntimeCallDescriptor(Zone *zone, Runtime::FunctionId function, int js_parameter_count, Operator::Properties properties, CallDescriptor::Flags flags, LazyDeoptOnThrow lazy_deopt_on_throw=LazyDeoptOnThrow::kNo)
Node * UintPtrConstant(uintptr_t value)
Node * ExternalConstant(ExternalReference ref)
CommonOperatorBuilder * common() const
Node * TaggedIndexConstant(intptr_t value)
MachineOperatorBuilder * machine() const
Node * Uint32Constant(uint32_t value)
Node * Int32Constant(int32_t value)
static void ChangeOp(Node *node, const Operator *new_op)
static void ReplaceEffectInput(Node *node, Node *effect, int index=0)
static bool IsControlEdge(Edge edge)
static void ReplaceControlInput(Node *node, Node *control, int index=0)
static void ReplaceUses(Node *node, Node *value, Node *effect=nullptr, Node *success=nullptr, Node *exception=nullptr)
static Node * GetEffectInput(Node *node, int index=0)
static void ReplaceContextInput(Node *node, Node *context)
static Node * GetFrameStateInput(Node *node)
static Node * GetValueInput(Node *node, int index)
static int FirstControlIndex(Node *node)
static Node * GetControlInput(Node *node, int index=0)
void ReplaceInput(int index, Node *new_to)
Node * RemoveInput(int index)
void InsertInput(Zone *zone, int index, Node *new_to)
static bool HasFrameStateInput(const Operator *op)
static Reduction Changed(Node *node)
static Reduction NoChange()
Node * NewNode(const Operator *op, int input_count, Node *const *inputs, bool incomplete=false)
JSHeapBroker *const broker_
#define DEF_UNARY_LOWERING(Name)
#define DEF_BINARY_LOWERING(Name)
#define REPLACE_STUB_CALL(Name)
#define DECLARE_CASE(x,...)
bool Word32Equal(uint32_t a, uint32_t b)
JSCreateLiteralOpNode JSCreateLiteralRegExpNode
JSCallNodeBase< IrOpcode::kJSCall > JSCallNode
const CallRuntimeParameters & CallRuntimeParametersOf(const Operator *op)
JSCreateLiteralOpNode JSCreateLiteralArrayNode
CallForwardVarargsParameters const & CallForwardVarargsParametersOf(Operator const *op)
JSCreateLiteralOpNode JSCreateLiteralObjectNode
JSConstructNodeBase< IrOpcode::kJSConstructForwardAllArgs > JSConstructForwardAllArgsNode
Runtime::FunctionId GetBuiltinForStackCheckKind(StackCheckKind kind)
JSConstructNodeBase< IrOpcode::kJSConstructWithArrayLike > JSConstructWithArrayLikeNode
JSCallNodeBase< IrOpcode::kJSCallWithArrayLike > JSCallWithArrayLikeNode
JSConstructNodeBase< IrOpcode::kJSConstructWithSpread > JSConstructWithSpreadNode
ScopeInfoRef ScopeInfoOf(const Operator *op)
bool CollectFeedbackInGenericLowering()
ConstructForwardVarargsParameters const & ConstructForwardVarargsParametersOf(Operator const *op)
T const & OpParameter(const Operator *op)
CreateFunctionContextParameters const & CreateFunctionContextParametersOf(Operator const *op)
JSConstructNodeBase< IrOpcode::kJSConstruct > JSConstructNode
const CreateArrayParameters & CreateArrayParametersOf(const Operator *op)
FeedbackParameter const & FeedbackParameterOf(const Operator *op)
std::string ToString(const BytecodeLivenessState &liveness)
CreateArgumentsType const & CreateArgumentsTypeOf(const Operator *op)
JSCallNodeBase< IrOpcode::kJSCallWithSpread > JSCallWithSpreadNode
static const Operator * IntPtrConstant(CommonOperatorBuilder *common, intptr_t value)
const auto & function_map
int ToNumber(Register reg)
constexpr int JSParameterCount(int param_count_without_receiver)
i::Address Load(i::Address address)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)