• Home
  • Raw
  • Download

Lines Matching refs:gate

47     for (const auto &gate : gateList) {  in CallRuntimeLowering()  local
48 auto op = acc_.GetOpCode(gate); in CallRuntimeLowering()
51 Lower(gate); in CallRuntimeLowering()
55 Environment env(gate, circuit_, &builder_); in CallRuntimeLowering()
56 LowerExceptionHandler(gate); in CallRuntimeLowering()
60 LowerConstruct(gate); in CallRuntimeLowering()
63 LowerTypedCall(gate); in CallRuntimeLowering()
66 LowerTypedFastCall(gate); in CallRuntimeLowering()
69 LowerCheckSafePointAndStackOver(gate); in CallRuntimeLowering()
72 LowerGetEnv(gate); in CallRuntimeLowering()
75 DeleteLoopExit(gate); in CallRuntimeLowering()
78 DeleteLoopExitValue(gate); in CallRuntimeLowering()
81 LowerLoadGetter(gate); in CallRuntimeLowering()
84 LowerLoadSetter(gate); in CallRuntimeLowering()
102 void SlowPathLowering::LowerGetEnv(GateRef gate) in LowerGetEnv() argument
104 GateRef jsFunc = acc_.GetValueIn(gate, 0); in LowerGetEnv()
107 acc_.UpdateAllUses(gate, env); in LowerGetEnv()
108 acc_.DeleteGate(gate); in LowerGetEnv()
111 void SlowPathLowering::DeleteLoopExit(GateRef gate) in DeleteLoopExit() argument
113 auto state = acc_.GetState(gate); in DeleteLoopExit()
114 acc_.ReplaceGate(gate, state, Circuit::NullGate(), Circuit::NullGate()); in DeleteLoopExit()
117 void SlowPathLowering::DeleteLoopExitValue(GateRef gate) in DeleteLoopExitValue() argument
119 auto state = acc_.GetState(gate); in DeleteLoopExitValue()
120 auto value = acc_.GetValueIn(gate, 0); in DeleteLoopExitValue()
121 acc_.ReplaceGate(gate, state, Circuit::NullGate(), value); in DeleteLoopExitValue()
212 void SlowPathLowering::Lower(GateRef gate) in Lower() argument
214 EcmaOpcode ecmaOpcode = acc_.GetByteCodeOpcode(gate); in Lower()
216 Environment env(gate, circuit_, &builder_); in Lower()
217 AddProfiling(gate); in Lower()
220 LowerCallArg0(gate); in Lower()
223 LowerCallthis0Imm8V8(gate); in Lower()
226 LowerCallArg1Imm8V8(gate); in Lower()
229 LowerWideCallrangePrefImm16V8(gate); in Lower()
232 LowerCallThisArg1(gate); in Lower()
235 LowerCallargs2Imm8V8V8(gate); in Lower()
238 LowerCallthis2Imm8V8V8V8(gate); in Lower()
241 LowerCallargs3Imm8V8V8(gate); in Lower()
244 LowerCallthis3Imm8V8V8V8V8(gate); in Lower()
247 LowerCallthisrangeImm8Imm8V8(gate); in Lower()
250 LowerWideCallthisrangePrefImm16V8(gate); in Lower()
253 LowerCallSpread(gate); in Lower()
256 LowerCallrangeImm8Imm8V8(gate); in Lower()
259 LowerGetUnmappedArgs(gate); in Lower()
262 LowerAsyncFunctionEnter(gate); in Lower()
265 LowerInc(gate); in Lower()
268 LowerDec(gate); in Lower()
271 LowerGetPropIterator(gate); in Lower()
274 LowerResumeGenerator(gate); in Lower()
277 LowerGetResumeMode(gate); in Lower()
281 LowerCloseIterator(gate); in Lower()
284 LowerAdd2(gate); in Lower()
287 LowerSub2(gate); in Lower()
290 LowerMul2(gate); in Lower()
293 LowerDiv2(gate); in Lower()
296 LowerMod2(gate); in Lower()
299 LowerEq(gate); in Lower()
302 LowerNotEq(gate); in Lower()
305 LowerLess(gate); in Lower()
308 LowerLessEq(gate); in Lower()
311 LowerGreater(gate); in Lower()
314 LowerGreaterEq(gate); in Lower()
317 LowerCreateIterResultObj(gate); in Lower()
320 LowerSuspendGenerator(gate); in Lower()
323 LowerAsyncFunctionAwaitUncaught(gate); in Lower()
326 LowerAsyncFunctionResolve(gate); in Lower()
329 LowerAsyncFunctionReject(gate); in Lower()
333 LowerTryLdGlobalByName(gate); in Lower()
336 LowerStGlobalVar(gate); in Lower()
340 LowerGetIterator(gate); in Lower()
343 LowerGetAsyncIterator(gate); in Lower()
347 LowerNewObjApply(gate); in Lower()
350 LowerThrow(gate); in Lower()
354 LowerTypeof(gate); in Lower()
357 LowerThrowConstAssignment(gate); in Lower()
360 LowerThrowThrowNotExists(gate); in Lower()
363 LowerThrowPatternNonCoercible(gate); in Lower()
366 LowerThrowIfNotObject(gate); in Lower()
369 LowerThrowUndefinedIfHole(gate); in Lower()
372 LowerThrowUndefinedIfHoleWithName(gate); in Lower()
376 LowerThrowIfSuperNotCorrectCall(gate); in Lower()
379 LowerThrowDeleteSuperProperty(gate); in Lower()
382 LowerLdSymbol(gate); in Lower()
385 LowerLdGlobal(gate); in Lower()
388 LowerToNumber(gate); in Lower()
391 LowerNeg(gate); in Lower()
394 LowerNot(gate); in Lower()
397 LowerShl2(gate); in Lower()
400 LowerShr2(gate); in Lower()
403 LowerAshr2(gate); in Lower()
406 LowerAnd2(gate); in Lower()
409 LowerOr2(gate); in Lower()
412 LowerXor2(gate); in Lower()
415 LowerDelObjProp(gate); in Lower()
419 LowerDefineMethod(gate); in Lower()
422 LowerExp(gate); in Lower()
425 LowerIsIn(gate); in Lower()
428 LowerInstanceof(gate); in Lower()
431 LowerFastStrictNotEqual(gate); in Lower()
434 LowerFastStrictEqual(gate); in Lower()
438 LowerCreateEmptyArray(gate); in Lower()
441 LowerCreateEmptyObject(gate); in Lower()
445 LowerCreateObjectWithBuffer(gate); in Lower()
449 LowerCreateArrayWithBuffer(gate); in Lower()
453 LowerStModuleVar(gate); in Lower()
456 LowerSetGeneratorState(gate); in Lower()
460 LowerGetTemplateObject(gate); in Lower()
464 LowerSetObjectWithProto(gate); in Lower()
467 LowerLdBigInt(gate); in Lower()
470 LowerToNumeric(gate); in Lower()
473 LowerDynamicImport(gate); in Lower()
477 LowerExternalModule(gate); in Lower()
481 LowerGetModuleNamespace(gate); in Lower()
486 LowerNewObjRange(gate); in Lower()
491 LowerConditionJump(gate, true); in Lower()
496 LowerConditionJump(gate, false); in Lower()
500 LowerSuperCall(gate); in Lower()
504 LowerSuperCallArrow(gate); in Lower()
507 LowerSuperCallSpread(gate); in Lower()
510 LowerIsTrueOrFalse(gate, true); in Lower()
513 LowerIsTrueOrFalse(gate, false); in Lower()
516 LowerGetNextPropName(gate); in Lower()
519 LowerCopyDataProperties(gate); in Lower()
523 LowerCreateObjectWithExcludedKeys(gate); in Lower()
527 LowerCreateRegExpWithLiteral(gate); in Lower()
531 LowerStOwnByValue(gate); in Lower()
536 LowerStOwnByIndex(gate); in Lower()
540 LowerStOwnByName(gate); in Lower()
544 LowerNewLexicalEnv(gate); in Lower()
548 LowerNewLexicalEnvWithName(gate); in Lower()
551 LowerPopLexicalEnv(gate); in Lower()
555 LowerLdSuperByValue(gate); in Lower()
559 LowerStSuperByValue(gate); in Lower()
563 LowerTryStGlobalByName(gate); in Lower()
566 LowerStConstToGlobalRecord(gate, true); in Lower()
569 LowerStConstToGlobalRecord(gate, false); in Lower()
573 LowerStOwnByValueWithNameSet(gate); in Lower()
577 LowerStOwnByNameWithNameSet(gate); in Lower()
580 LowerLdGlobalVar(gate); in Lower()
584 LowerLdObjByName(gate); in Lower()
588 LowerStObjByName(gate, false); in Lower()
591 LowerDefineGetterSetterByValue(gate); in Lower()
596 LowerLdObjByIndex(gate); in Lower()
601 LowerStObjByIndex(gate); in Lower()
605 LowerLdObjByValue(gate, false); in Lower()
609 LowerLdObjByValue(gate, true); in Lower()
613 LowerStObjByValue(gate, false); in Lower()
617 LowerStObjByValue(gate, true); in Lower()
621 LowerLdSuperByName(gate); in Lower()
625 LowerStSuperByName(gate); in Lower()
628 LowerCreateGeneratorObj(gate); in Lower()
631 LowerCreateAsyncGeneratorObj(gate); in Lower()
634 LowerAsyncGeneratorResolve(gate); in Lower()
637 LowerAsyncGeneratorReject(gate); in Lower()
640 LowerStArraySpread(gate); in Lower()
645 LowerLdLexVar(gate); in Lower()
650 LowerStLexVar(gate); in Lower()
654 LowerDefineClassWithBuffer(gate); in Lower()
658 LowerDefineFunc(gate); in Lower()
662 LowerCopyRestArgs(gate); in Lower()
665 LowerWideLdPatchVar(gate); in Lower()
668 LowerWideStPatchVar(gate); in Lower()
672 LowerLdLocalModuleVarByIndex(gate); in Lower()
706 LowerLdThisByName(gate); in Lower()
710 LowerStObjByName(gate, true); in Lower()
713 LowerLdPrivateProperty(gate); in Lower()
716 LowerStPrivateProperty(gate); in Lower()
719 LowerTestIn(gate); in Lower()
722 LowerNotifyConcurrentResult(gate); in Lower()
725 LowerDefineFieldByName(gate); in Lower()
728 LowerDefineFieldByValue(gate); in Lower()
731 LowerDefineFieldByIndex(gate); in Lower()
734 LowerToPropertyKey(gate); in Lower()
737 LowerCreatePrivateProperty(gate); in Lower()
740 LowerDefinePrivateProperty(gate); in Lower()
743 LowerCallInit(gate); in Lower()
746 LowerDefineSendableClass(gate); in Lower()
749 LowerLdSendableClass(gate); in Lower()
752 LowerLdStr(gate); in Lower()
759 void SlowPathLowering::LowerCallStubWithIC(GateRef gate, int sign, const std::vector<GateRef> &args) in LowerCallStubWithIC() argument
763 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerCallStubWithIC()
764 GateRef slotId = builder_.ZExtInt16ToInt32(acc_.GetValueIn(gate, 0)); in LowerCallStubWithIC()
768 GateRef result = builder_.CallStub(glue_, gate, sign, inputs); in LowerCallStubWithIC()
769 ReplaceHirWithValue(gate, result); in LowerCallStubWithIC()
772 GateRef SlowPathLowering::LowerCallRuntime(GateRef gate, int index, const std::vector<GateRef> &arg… in LowerCallRuntime() argument
776 …GateRef result = builder_.CallRuntime(glue_, index, Gate::InvalidGateRef, args, gate, name.c_str()… in LowerCallRuntime()
781 … GateRef result = builder_.Call(cs, glue_, target, builder_.GetDepend(), args, gate, name.c_str()); in LowerCallRuntime()
786 GateRef SlowPathLowering::LowerCallNGCRuntime(GateRef gate, int index, const std::vector<GateRef> &… in LowerCallNGCRuntime() argument
790 …GateRef result = builder_.CallNGCRuntime(glue_, index, Gate::InvalidGateRef, args, gate, name.c_st… in LowerCallNGCRuntime()
795 … GateRef result = builder_.Call(cs, glue_, target, builder_.GetDepend(), args, gate, name.c_str()); in LowerCallNGCRuntime()
800 void SlowPathLowering::LowerAdd2(GateRef gate) in LowerAdd2() argument
803 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerAdd2()
804 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Add, in LowerAdd2()
805 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerAdd2()
806 ReplaceHirWithValue(gate, result); in LowerAdd2()
809 void SlowPathLowering::LowerCreateIterResultObj(GateRef gate) in LowerCreateIterResultObj() argument
813 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerCreateIterResultObj()
814 …GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1)}); in LowerCreateIterResultObj()
815 ReplaceHirWithValue(gate, newGate); in LowerCreateIterResultObj()
820 void SlowPathLowering::SaveFrameToContext(GateRef gate) in SaveFrameToContext() argument
822 GateRef genObj = acc_.GetValueIn(gate, 1); in SaveFrameToContext()
823 GateRef saveRegister = acc_.GetDep(gate); in SaveFrameToContext()
829 acc_.SetDep(gate, acc_.GetDep(saveRegister)); in SaveFrameToContext()
839 GateRef taggedArray = LowerCallRuntime(gate, arrayId, {taggedLength}); in SaveFrameToContext()
858 GateRef thisObj = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::THIS_OBJECT); in SaveFrameToContext()
863 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in SaveFrameToContext()
868 GateRef curAccGate = acc_.GetValueIn(gate, acc_.GetNumValueIn(gate) - 1); // get current acc in SaveFrameToContext()
885 GateRef bcSizeGate = acc_.GetValueIn(gate, 0); // saved bc_offset in SaveFrameToContext()
897 void SlowPathLowering::LowerSuspendGenerator(GateRef gate) in LowerSuspendGenerator() argument
899 SaveFrameToContext(gate); in LowerSuspendGenerator()
900 acc_.SetDep(gate, builder_.GetDepend()); in LowerSuspendGenerator()
901 AddProfiling(gate, false); in LowerSuspendGenerator()
903 auto value = acc_.GetValueIn(gate, 2); // 2: acc in LowerSuspendGenerator()
904 auto genObj = acc_.GetValueIn(gate, 1); in LowerSuspendGenerator()
905 GateRef newGate = LowerCallRuntime(gate, id, { genObj, value }); in LowerSuspendGenerator()
906 ReplaceHirWithValue(gate, newGate); in LowerSuspendGenerator()
909 void SlowPathLowering::LowerAsyncFunctionAwaitUncaught(GateRef gate) in LowerAsyncFunctionAwaitUncaught() argument
913 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerAsyncFunctionAwaitUncaught()
914 …GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1)}); in LowerAsyncFunctionAwaitUncaught()
915 ReplaceHirWithValue(gate, newGate); in LowerAsyncFunctionAwaitUncaught()
918 void SlowPathLowering::LowerAsyncFunctionResolve(GateRef gate) in LowerAsyncFunctionResolve() argument
922 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerAsyncFunctionResolve()
924 …GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1), … in LowerAsyncFunctionResolve()
925 ReplaceHirWithValue(gate, newGate); in LowerAsyncFunctionResolve()
928 void SlowPathLowering::LowerAsyncFunctionReject(GateRef gate) in LowerAsyncFunctionReject() argument
932 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerAsyncFunctionReject()
934 …GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1), … in LowerAsyncFunctionReject()
935 ReplaceHirWithValue(gate, newGate); in LowerAsyncFunctionReject()
938 void SlowPathLowering::LowerTryLdGlobalByName(GateRef gate) in LowerTryLdGlobalByName() argument
941 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerTryLdGlobalByName()
942 GateRef stringId = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerTryLdGlobalByName()
943 LowerCallStubWithIC(gate, CommonStubCSigns::TryLdGlobalByName, { stringId }); in LowerTryLdGlobalByName()
946 void SlowPathLowering::LowerStGlobalVar(GateRef gate) in LowerStGlobalVar() argument
949 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStGlobalVar()
950 GateRef id = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerStGlobalVar()
951 GateRef value = acc_.GetValueIn(gate, 2); // 2: the 2nd para is value in LowerStGlobalVar()
952 LowerCallStubWithIC(gate, CommonStubCSigns::StGlobalVar, { id, value }); in LowerStGlobalVar()
955 void SlowPathLowering::LowerGetIterator(GateRef gate) in LowerGetIterator() argument
957 auto result = LowerCallRuntime(gate, RTSTUB_ID(GetIterator), {acc_.GetValueIn(gate, 0)}, true); in LowerGetIterator()
958 ReplaceHirWithValue(gate, result); in LowerGetIterator()
961 void SlowPathLowering::LowerGetAsyncIterator(GateRef gate) in LowerGetAsyncIterator() argument
963 …auto result = LowerCallRuntime(gate, RTSTUB_ID(GetAsyncIterator), {acc_.GetValueIn(gate, 0)}, true… in LowerGetAsyncIterator()
964 ReplaceHirWithValue(gate, result); in LowerGetAsyncIterator()
967 void SlowPathLowering::LowerCallArg0(GateRef gate) in LowerCallArg0() argument
970 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerCallArg0()
972 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallArg0()
976 GateRef func = acc_.GetValueIn(gate, 0); in LowerCallArg0()
977 LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj}, {glue_, func, thisObj}); in LowerCallArg0()
980 void SlowPathLowering::LowerCallthisrangeImm8Imm8V8(GateRef gate) in LowerCallthisrangeImm8Imm8V8() argument
984 ASSERT(acc_.GetNumValueIn(gate) - fixedInputsNum >= 0); in LowerCallthisrangeImm8Imm8V8()
985 size_t numIns = acc_.GetNumValueIn(gate); in LowerCallthisrangeImm8Imm8V8()
986 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallthisrangeImm8Imm8V8()
989 GateRef callTarget = acc_.GetValueIn(gate, numIns - callTargetIndex); // acc in LowerCallthisrangeImm8Imm8V8()
990 GateRef thisObj = acc_.GetValueIn(gate, 0); in LowerCallthisrangeImm8Imm8V8()
995 vec.emplace_back(acc_.GetValueIn(gate, i)); in LowerCallthisrangeImm8Imm8V8()
1000 vec1.emplace_back(acc_.GetValueIn(gate, i)); in LowerCallthisrangeImm8Imm8V8()
1002 LowerToJSCall(gate, vec, vec1); in LowerCallthisrangeImm8Imm8V8()
1005 void SlowPathLowering::LowerWideCallthisrangePrefImm16V8(GateRef gate) in LowerWideCallthisrangePrefImm16V8() argument
1009 ASSERT(acc_.GetNumValueIn(gate) - fixedInputsNum >= 0); in LowerWideCallthisrangePrefImm16V8()
1010 size_t numIns = acc_.GetNumValueIn(gate); in LowerWideCallthisrangePrefImm16V8()
1011 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerWideCallthisrangePrefImm16V8()
1014 GateRef callTarget = acc_.GetValueIn(gate, numIns - callTargetIndex); in LowerWideCallthisrangePrefImm16V8()
1015 GateRef thisObj = acc_.GetValueIn(gate, 0); in LowerWideCallthisrangePrefImm16V8()
1020 vec.emplace_back(acc_.GetValueIn(gate, i)); in LowerWideCallthisrangePrefImm16V8()
1025 vec1.emplace_back(acc_.GetValueIn(gate, i)); in LowerWideCallthisrangePrefImm16V8()
1027 LowerToJSCall(gate, vec, vec1); in LowerWideCallthisrangePrefImm16V8()
1030 void SlowPathLowering::LowerCallSpread(GateRef gate) in LowerCallSpread() argument
1035 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerCallSpread()
1037 GateRef newGate = LowerCallRuntime(gate, id, in LowerCallSpread()
1038 {acc_.GetValueIn(gate, 2), acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1)}); in LowerCallSpread()
1039 ReplaceHirWithPendingException(gate, stateInGate, newGate, newGate); in LowerCallSpread()
1042 void SlowPathLowering::LowerCallrangeImm8Imm8V8(GateRef gate) in LowerCallrangeImm8Imm8V8() argument
1044 size_t numArgs = acc_.GetNumValueIn(gate); in LowerCallrangeImm8Imm8V8()
1045 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallrangeImm8Imm8V8()
1048 GateRef callTarget = acc_.GetValueIn(gate, numArgs - callTargetIndex); in LowerCallrangeImm8Imm8V8()
1053 vec.emplace_back(acc_.GetValueIn(gate, i)); in LowerCallrangeImm8Imm8V8()
1057 vec1.emplace_back(acc_.GetValueIn(gate, i)); in LowerCallrangeImm8Imm8V8()
1059 LowerToJSCall(gate, vec, vec1); in LowerCallrangeImm8Imm8V8()
1062 void SlowPathLowering::LowerNewObjApply(GateRef gate) in LowerNewObjApply() argument
1066 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerNewObjApply()
1067 GateRef newGate = LowerCallRuntime(gate, id, in LowerNewObjApply()
1068 {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerNewObjApply()
1069 ReplaceHirWithValue(gate, newGate); in LowerNewObjApply()
1072 void SlowPathLowering::LowerThrow(GateRef gate) in LowerThrow() argument
1074 GateRef exception = acc_.GetValueIn(gate, 0); in LowerThrow()
1079 ReplaceHirToThrowCall(gate, result); in LowerThrow()
1082 void SlowPathLowering::LowerThrowConstAssignment(GateRef gate) in LowerThrowConstAssignment() argument
1086 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerThrowConstAssignment()
1087 GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0)}); in LowerThrowConstAssignment()
1088 ReplaceHirToThrowCall(gate, newGate); in LowerThrowConstAssignment()
1091 void SlowPathLowering::LowerThrowThrowNotExists(GateRef gate) in LowerThrowThrowNotExists() argument
1094 GateRef newGate = LowerCallRuntime(gate, id, {}); in LowerThrowThrowNotExists()
1095 ReplaceHirToThrowCall(gate, newGate); in LowerThrowThrowNotExists()
1098 void SlowPathLowering::LowerThrowPatternNonCoercible(GateRef gate) in LowerThrowPatternNonCoercible() argument
1101 GateRef newGate = LowerCallRuntime(gate, id, {}); in LowerThrowPatternNonCoercible()
1102 ReplaceHirToThrowCall(gate, newGate); in LowerThrowPatternNonCoercible()
1105 void SlowPathLowering::LowerThrowIfNotObject(GateRef gate) in LowerThrowIfNotObject() argument
1108 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerThrowIfNotObject()
1109 GateRef value = acc_.GetValueIn(gate, 0); in LowerThrowIfNotObject()
1124 LowerCallRuntime(gate, RTSTUB_ID(ThrowIfNotObject), {}, true); in LowerThrowIfNotObject()
1128 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, Circuit::NullGate()); in LowerThrowIfNotObject()
1131 void SlowPathLowering::LowerThrowUndefinedIfHole(GateRef gate) in LowerThrowUndefinedIfHole() argument
1134 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerThrowUndefinedIfHole()
1135 GateRef hole = acc_.GetValueIn(gate, 0); in LowerThrowUndefinedIfHole()
1136 GateRef obj = acc_.GetValueIn(gate, 1); in LowerThrowUndefinedIfHole()
1148 LowerCallRuntime(gate, RTSTUB_ID(ThrowUndefinedIfHole), {obj}, true); in LowerThrowUndefinedIfHole()
1152 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, Circuit::NullGate()); in LowerThrowUndefinedIfHole()
1155 void SlowPathLowering::LowerThrowUndefinedIfHoleWithName(GateRef gate) in LowerThrowUndefinedIfHoleWithName() argument
1158 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerThrowUndefinedIfHoleWithName()
1159 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerThrowUndefinedIfHoleWithName()
1160 GateRef hole = acc_.GetValueIn(gate, 1); in LowerThrowUndefinedIfHoleWithName()
1172 GateRef obj = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, in LowerThrowUndefinedIfHoleWithName()
1173 … builder_.ZExtInt16ToInt32(acc_.GetValueIn(gate, 0)), in LowerThrowUndefinedIfHoleWithName()
1175 LowerCallRuntime(gate, RTSTUB_ID(ThrowUndefinedIfHole), {obj}, true); in LowerThrowUndefinedIfHoleWithName()
1179 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, Circuit::NullGate()); in LowerThrowUndefinedIfHoleWithName()
1182 void SlowPathLowering::LowerThrowIfSuperNotCorrectCall(GateRef gate) in LowerThrowIfSuperNotCorrectCall() argument
1185 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerThrowIfSuperNotCorrectCall()
1186 GateRef result = LowerCallRuntime(gate, RTSTUB_ID(ThrowIfSuperNotCorrectCall), in LowerThrowIfSuperNotCorrectCall()
1187 {builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)), acc_.GetValueIn(gate, 1)}, true); in LowerThrowIfSuperNotCorrectCall()
1188 ReplaceHirWithValue(gate, result); in LowerThrowIfSuperNotCorrectCall()
1191 void SlowPathLowering::LowerThrowDeleteSuperProperty(GateRef gate) in LowerThrowDeleteSuperProperty() argument
1194 GateRef newGate = LowerCallRuntime(gate, id, {}); in LowerThrowDeleteSuperProperty()
1195 ReplaceHirToThrowCall(gate, newGate); in LowerThrowDeleteSuperProperty()
1221 void SlowPathLowering::LowerLdSymbol(GateRef gate) in LowerLdSymbol() argument
1224 GateRef newGate = LowerCallRuntime(gate, id, {}); in LowerLdSymbol()
1225 ReplaceHirWithValue(gate, newGate); in LowerLdSymbol()
1228 void SlowPathLowering::LowerLdGlobal(GateRef gate) in LowerLdGlobal() argument
1235 ReplaceHirWithValue(gate, newGate); in LowerLdGlobal()
1238 void SlowPathLowering::LowerSub2(GateRef gate) in LowerSub2() argument
1241 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerSub2()
1242 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Sub, in LowerSub2()
1243 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerSub2()
1244 ReplaceHirWithValue(gate, result); in LowerSub2()
1247 void SlowPathLowering::LowerMul2(GateRef gate) in LowerMul2() argument
1250 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerMul2()
1251 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Mul, in LowerMul2()
1252 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerMul2()
1253 ReplaceHirWithValue(gate, result); in LowerMul2()
1256 void SlowPathLowering::LowerDiv2(GateRef gate) in LowerDiv2() argument
1259 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerDiv2()
1260 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Div, in LowerDiv2()
1261 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerDiv2()
1262 ReplaceHirWithValue(gate, result); in LowerDiv2()
1265 void SlowPathLowering::LowerMod2(GateRef gate) in LowerMod2() argument
1268 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerMod2()
1269 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Mod, in LowerMod2()
1270 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerMod2()
1271 ReplaceHirWithValue(gate, result); in LowerMod2()
1274 void SlowPathLowering::LowerEq(GateRef gate) in LowerEq() argument
1277 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerEq()
1278 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Equal, in LowerEq()
1279 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerEq()
1280 ReplaceHirWithValue(gate, result); in LowerEq()
1283 void SlowPathLowering::LowerNotEq(GateRef gate) in LowerNotEq() argument
1286 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerNotEq()
1287 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::NotEqual, in LowerNotEq()
1288 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerNotEq()
1289 ReplaceHirWithValue(gate, result); in LowerNotEq()
1292 void SlowPathLowering::LowerLess(GateRef gate) in LowerLess() argument
1295 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerLess()
1296 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Less, in LowerLess()
1297 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerLess()
1298 ReplaceHirWithValue(gate, result); in LowerLess()
1301 void SlowPathLowering::LowerLessEq(GateRef gate) in LowerLessEq() argument
1304 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerLessEq()
1305 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::LessEq, in LowerLessEq()
1306 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerLessEq()
1307 ReplaceHirWithValue(gate, result); in LowerLessEq()
1310 void SlowPathLowering::LowerGreater(GateRef gate) in LowerGreater() argument
1313 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerGreater()
1314 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Greater, in LowerGreater()
1315 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerGreater()
1316 ReplaceHirWithValue(gate, result); in LowerGreater()
1319 void SlowPathLowering::LowerGreaterEq(GateRef gate) in LowerGreaterEq() argument
1322 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerGreaterEq()
1323 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::GreaterEq, in LowerGreaterEq()
1324 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerGreaterEq()
1325 ReplaceHirWithValue(gate, result); in LowerGreaterEq()
1328 void SlowPathLowering::LowerGetPropIterator(GateRef gate) in LowerGetPropIterator() argument
1331 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerGetPropIterator()
1332 GateRef object = {acc_.GetValueIn(gate, 0)}; in LowerGetPropIterator()
1333 …GateRef newGate = builder_.CallStub(glue_, gate, CommonStubCSigns::Getpropiterator, {glue_, object… in LowerGetPropIterator()
1334 ReplaceHirWithValue(gate, newGate); in LowerGetPropIterator()
1337 void SlowPathLowering::LowerCloseIterator(GateRef gate) in LowerCloseIterator() argument
1341 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerCloseIterator()
1342 GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0)}); in LowerCloseIterator()
1343 ReplaceHirWithValue(gate, newGate); in LowerCloseIterator()
1346 void SlowPathLowering::LowerInc(GateRef gate) in LowerInc() argument
1349 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerInc()
1350 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Inc, in LowerInc()
1351 { glue_, acc_.GetValueIn(gate, 0) }); in LowerInc()
1352 ReplaceHirWithValue(gate, result); in LowerInc()
1355 void SlowPathLowering::LowerDec(GateRef gate) in LowerDec() argument
1358 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerDec()
1359 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Dec, in LowerDec()
1360 { glue_, acc_.GetValueIn(gate, 0) }); in LowerDec()
1361 ReplaceHirWithValue(gate, result); in LowerDec()
1364 void SlowPathLowering::LowerToNumber(GateRef gate) in LowerToNumber() argument
1367 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerToNumber()
1370 GateRef value = acc_.GetValueIn(gate, 0); in LowerToNumber()
1375 result = LowerCallRuntime(gate, RTSTUB_ID(ToNumber), { value }, true); in LowerToNumber()
1379 ReplaceHirWithValue(gate, *result); in LowerToNumber()
1382 void SlowPathLowering::LowerNeg(GateRef gate) in LowerNeg() argument
1385 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerNeg()
1386 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Neg, in LowerNeg()
1387 { glue_, acc_.GetValueIn(gate, 0) }); in LowerNeg()
1388 ReplaceHirWithValue(gate, result); in LowerNeg()
1391 void SlowPathLowering::LowerNot(GateRef gate) in LowerNot() argument
1394 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerNot()
1395 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Not, in LowerNot()
1396 { glue_, acc_.GetValueIn(gate, 0) }); in LowerNot()
1397 ReplaceHirWithValue(gate, result); in LowerNot()
1400 void SlowPathLowering::LowerShl2(GateRef gate) in LowerShl2() argument
1403 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerShl2()
1404 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Shl, in LowerShl2()
1405 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerShl2()
1406 ReplaceHirWithValue(gate, result); in LowerShl2()
1409 void SlowPathLowering::LowerShr2(GateRef gate) in LowerShr2() argument
1412 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerShr2()
1413 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Shr, in LowerShr2()
1414 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerShr2()
1415 ReplaceHirWithValue(gate, result); in LowerShr2()
1418 void SlowPathLowering::LowerAshr2(GateRef gate) in LowerAshr2() argument
1421 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerAshr2()
1422 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Ashr, in LowerAshr2()
1423 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerAshr2()
1424 ReplaceHirWithValue(gate, result); in LowerAshr2()
1427 void SlowPathLowering::LowerAnd2(GateRef gate) in LowerAnd2() argument
1430 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerAnd2()
1431 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::And, in LowerAnd2()
1432 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerAnd2()
1433 ReplaceHirWithValue(gate, result); in LowerAnd2()
1436 void SlowPathLowering::LowerOr2(GateRef gate) in LowerOr2() argument
1439 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerOr2()
1440 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Or, in LowerOr2()
1441 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerOr2()
1442 ReplaceHirWithValue(gate, result); in LowerOr2()
1445 void SlowPathLowering::LowerXor2(GateRef gate) in LowerXor2() argument
1448 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerXor2()
1449 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::Xor, in LowerXor2()
1450 { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerXor2()
1451 ReplaceHirWithValue(gate, result); in LowerXor2()
1454 void SlowPathLowering::LowerDelObjProp(GateRef gate) in LowerDelObjProp() argument
1457 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerDelObjProp()
1460 GateRef newGate = builder_.CallStub(glue_, gate, CommonStubCSigns::DeleteObjectProperty, in LowerDelObjProp()
1461 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerDelObjProp()
1465 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, newGate); in LowerDelObjProp()
1468 void SlowPathLowering::LowerExp(GateRef gate) in LowerExp() argument
1472 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerExp()
1473 …GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1)}); in LowerExp()
1474 ReplaceHirWithValue(gate, newGate); in LowerExp()
1477 void SlowPathLowering::LowerIsIn(GateRef gate) in LowerIsIn() argument
1481 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerIsIn()
1482 …GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1)}); in LowerIsIn()
1483 ReplaceHirWithValue(gate, newGate); in LowerIsIn()
1486 void SlowPathLowering::LowerInstanceof(GateRef gate) in LowerInstanceof() argument
1489 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerInstanceof()
1490 GateRef obj = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerInstanceof()
1491 GateRef target = acc_.GetValueIn(gate, 2); // 2: the third parameter in LowerInstanceof()
1492 LowerCallStubWithIC(gate, CommonStubCSigns::Instanceof, { obj, target }); in LowerInstanceof()
1495 void SlowPathLowering::LowerFastStrictNotEqual(GateRef gate) in LowerFastStrictNotEqual() argument
1498 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerFastStrictNotEqual()
1500 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerFastStrictNotEqual()
1501 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::StrictNotEqual, in LowerFastStrictNotEqual()
1502 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerFastStrictNotEqual()
1503 ReplaceHirWithValue(gate, result); in LowerFastStrictNotEqual()
1506 void SlowPathLowering::LowerFastStrictEqual(GateRef gate) in LowerFastStrictEqual() argument
1509 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerFastStrictEqual()
1510 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::StrictEqual, in LowerFastStrictEqual()
1511 … { glue_, acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1) }); in LowerFastStrictEqual()
1512 ReplaceHirWithValue(gate, result); in LowerFastStrictEqual()
1515 void SlowPathLowering::LowerCreateEmptyArray(GateRef gate) in LowerCreateEmptyArray() argument
1517 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::CreateEmptyArray, { glue_ }); in LowerCreateEmptyArray()
1518 GateRef newRes = LowerUpdateArrayHClass(gate, result); in LowerCreateEmptyArray()
1519 ReplaceHirWithValue(gate, newRes, true); in LowerCreateEmptyArray()
1522 void SlowPathLowering::LowerCreateEmptyObject(GateRef gate) in LowerCreateEmptyObject() argument
1524 GateRef result = LowerCallRuntime(gate, RTSTUB_ID(CreateEmptyObject), {}, true); in LowerCreateEmptyObject()
1525 ReplaceHirWithValue(gate, result, true); in LowerCreateEmptyObject()
1528 void SlowPathLowering::LowerCreateArrayWithBuffer(GateRef gate) in LowerCreateArrayWithBuffer() argument
1530 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerCreateArrayWithBuffer()
1531 GateRef index = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerCreateArrayWithBuffer()
1532 …GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::CreateArrayWithBuffer, { glue_, … in LowerCreateArrayWithBuffer()
1533 GateRef newRes = LowerUpdateArrayHClass(gate, result); in LowerCreateArrayWithBuffer()
1534 ReplaceHirWithValue(gate, newRes, true); in LowerCreateArrayWithBuffer()
1537 GateRef SlowPathLowering::LowerUpdateArrayHClass(GateRef gate, GateRef array) in LowerUpdateArrayHClass() argument
1539 ElementsKind kind = acc_.TryGetElementsKind(gate); in LowerUpdateArrayHClass()
1552 void SlowPathLowering::LowerCreateObjectWithBuffer(GateRef gate) in LowerCreateObjectWithBuffer() argument
1555 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerCreateObjectWithBuffer()
1556 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerCreateObjectWithBuffer()
1557 GateRef index = acc_.GetValueIn(gate, 0); in LowerCreateObjectWithBuffer()
1558 …GateRef obj = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, builder_.TruncInt64ToInt32(inde… in LowerCreateObjectWithBuffer()
1560 GateRef lexEnv = acc_.GetValueIn(gate, 1); in LowerCreateObjectWithBuffer()
1561 …GateRef result = LowerCallRuntime(gate, RTSTUB_ID(CreateObjectHavingMethod), { obj, lexEnv }, true… in LowerCreateObjectWithBuffer()
1562 ReplaceHirWithValue(gate, result); in LowerCreateObjectWithBuffer()
1565 void SlowPathLowering::LowerStModuleVar(GateRef gate) in LowerStModuleVar() argument
1568 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerStModuleVar()
1569 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerStModuleVar()
1570 GateRef index = builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)); in LowerStModuleVar()
1571 auto result = LowerCallRuntime(gate, RTSTUB_ID(StModuleVarByIndexOnJSFunc), in LowerStModuleVar()
1572 {index, acc_.GetValueIn(gate, 1), jsFunc}, true); in LowerStModuleVar()
1573 ReplaceHirWithValue(gate, result, true); in LowerStModuleVar()
1576 void SlowPathLowering::LowerSetGeneratorState(GateRef gate) in LowerSetGeneratorState() argument
1579 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerSetGeneratorState()
1580 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerSetGeneratorState()
1581 GateRef index = builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)); in LowerSetGeneratorState()
1582 auto result = LowerCallRuntime(gate, RTSTUB_ID(SetGeneratorState), in LowerSetGeneratorState()
1583 {acc_.GetValueIn(gate, 1), index, jsFunc}, true); in LowerSetGeneratorState()
1584 ReplaceHirWithValue(gate, result, true); in LowerSetGeneratorState()
1587 void SlowPathLowering::LowerGetTemplateObject(GateRef gate) in LowerGetTemplateObject() argument
1591 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerGetTemplateObject()
1592 GateRef literal = acc_.GetValueIn(gate, 0); in LowerGetTemplateObject()
1593 GateRef newGate = LowerCallRuntime(gate, id, { literal }); in LowerGetTemplateObject()
1594 ReplaceHirWithValue(gate, newGate); in LowerGetTemplateObject()
1597 void SlowPathLowering::LowerSetObjectWithProto(GateRef gate) in LowerSetObjectWithProto() argument
1601 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerSetObjectWithProto()
1602 GateRef proto = acc_.GetValueIn(gate, 0); in LowerSetObjectWithProto()
1603 GateRef obj = acc_.GetValueIn(gate, 1); in LowerSetObjectWithProto()
1604 GateRef newGate = LowerCallRuntime(gate, id, { proto, obj }); in LowerSetObjectWithProto()
1605 ReplaceHirWithValue(gate, newGate); in LowerSetObjectWithProto()
1608 void SlowPathLowering::LowerLdBigInt(GateRef gate) in LowerLdBigInt() argument
1611 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerLdBigInt()
1612 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerLdBigInt()
1613 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerLdBigInt()
1614 …GateRef numberBigInt = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolTyp… in LowerLdBigInt()
1615 GateRef result = LowerCallRuntime(gate, RTSTUB_ID(LdBigInt), {numberBigInt}, true); in LowerLdBigInt()
1616 ReplaceHirWithValue(gate, result); in LowerLdBigInt()
1619 void SlowPathLowering::LowerToNumeric(GateRef gate) in LowerToNumeric() argument
1622 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerToNumeric()
1625 GateRef value = acc_.GetValueIn(gate, 0); in LowerToNumeric()
1630 result = LowerCallRuntime(gate, RTSTUB_ID(ToNumeric), { value }, true); in LowerToNumeric()
1634 ReplaceHirWithValue(gate, *result); in LowerToNumeric()
1637 void SlowPathLowering::LowerDynamicImport(GateRef gate) in LowerDynamicImport() argument
1641 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerDynamicImport()
1642 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerDynamicImport()
1643 GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), jsFunc}); in LowerDynamicImport()
1644 ReplaceHirWithValue(gate, newGate); in LowerDynamicImport()
1647 void SlowPathLowering::LowerLdLocalModuleVarByIndex(GateRef gate) in LowerLdLocalModuleVarByIndex() argument
1650 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerLdLocalModuleVarByIndex()
1651 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerLdLocalModuleVarByIndex()
1652 GateRef index = builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)); in LowerLdLocalModuleVarByIndex()
1653 …GateRef result = LowerCallRuntime(gate, RTSTUB_ID(LdLocalModuleVarByIndexOnJSFunc), {index, jsFunc… in LowerLdLocalModuleVarByIndex()
1654 ReplaceHirWithValue(gate, result); in LowerLdLocalModuleVarByIndex()
1657 void SlowPathLowering::LowerExternalModule(GateRef gate) in LowerExternalModule() argument
1659 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerExternalModule()
1660 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerExternalModule()
1661 GateRef index = builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)); in LowerExternalModule()
1662 …GateRef result = LowerCallRuntime(gate, RTSTUB_ID(LdExternalModuleVarByIndexOnJSFunc), {index, jsF… in LowerExternalModule()
1663 ReplaceHirWithValue(gate, result); in LowerExternalModule()
1666 void SlowPathLowering::LowerGetModuleNamespace(GateRef gate) in LowerGetModuleNamespace() argument
1669 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerGetModuleNamespace()
1670 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerGetModuleNamespace()
1671 GateRef index = builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)); in LowerGetModuleNamespace()
1672 …GateRef result = LowerCallRuntime(gate, RTSTUB_ID(GetModuleNamespaceByIndexOnJSFunc), {index, jsFu… in LowerGetModuleNamespace()
1673 ReplaceHirWithValue(gate, result); in LowerGetModuleNamespace()
1676 void SlowPathLowering::LowerSuperCall(GateRef gate) in LowerSuperCall() argument
1679 ASSERT(acc_.GetNumValueIn(gate) >= 0); in LowerSuperCall()
1680 GateRef func = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerSuperCall()
1681 GateRef newTarget = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::NEW_TARGET); in LowerSuperCall()
1682 size_t numIns = acc_.GetNumValueIn(gate); in LowerSuperCall()
1685 vec.emplace_back(acc_.GetValueIn(gate, i)); in LowerSuperCall()
1687 GateRef newGate = LowerCallRuntime(gate, id, vec); in LowerSuperCall()
1688 ReplaceHirWithValue(gate, newGate); in LowerSuperCall()
1691 void SlowPathLowering::LowerSuperCallArrow(GateRef gate) in LowerSuperCallArrow() argument
1694 ASSERT(acc_.GetNumValueIn(gate) > 0); in LowerSuperCallArrow()
1695 GateRef newTarget = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::NEW_TARGET); in LowerSuperCallArrow()
1696 size_t numIns = acc_.GetNumValueIn(gate); in LowerSuperCallArrow()
1698 GateRef func = acc_.GetValueIn(gate, funcIndex); in LowerSuperCallArrow()
1701 vec.emplace_back(acc_.GetValueIn(gate, i)); in LowerSuperCallArrow()
1703 GateRef newGate = LowerCallRuntime(gate, id, vec); in LowerSuperCallArrow()
1704 ReplaceHirWithValue(gate, newGate); in LowerSuperCallArrow()
1707 void SlowPathLowering::LowerSuperCallSpread(GateRef gate) in LowerSuperCallSpread() argument
1711 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerSuperCallSpread()
1712 GateRef newTarget = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::NEW_TARGET); in LowerSuperCallSpread()
1713 GateRef func = acc_.GetValueIn(gate, 1); in LowerSuperCallSpread()
1714 GateRef array = acc_.GetValueIn(gate, 0); in LowerSuperCallSpread()
1715 GateRef newGate = LowerCallRuntime(gate, id, { func, newTarget, array }); in LowerSuperCallSpread()
1716 ReplaceHirWithValue(gate, newGate); in LowerSuperCallSpread()
1719 void SlowPathLowering::LowerIsTrueOrFalse(GateRef gate, bool flag) in LowerIsTrueOrFalse() argument
1726 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerIsTrueOrFalse()
1727 auto value = acc_.GetValueIn(gate, 0); in LowerIsTrueOrFalse()
1730 result = builder_.CallStub(glue_, gate, CommonStubCSigns::ToBooleanTrue, { glue_, value }); in LowerIsTrueOrFalse()
1732 result = builder_.CallStub(glue_, gate, CommonStubCSigns::ToBooleanFalse, { glue_, value }); in LowerIsTrueOrFalse()
1734 ReplaceHirWithValue(gate, *result, true); in LowerIsTrueOrFalse()
1737 void SlowPathLowering::LowerNewObjRange(GateRef gate) in LowerNewObjRange() argument
1747 GateRef ctor = acc_.GetValueIn(gate, 0); in LowerNewObjRange()
1748 …GateRef thisObj = builder_.CallStub(glue_, gate, CommonStubCSigns::NewThisObjectChecked, { glue_, … in LowerNewObjRange()
1753 … GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerNewObjRange()
1755 size_t range = acc_.GetNumValueIn(gate); in LowerNewObjRange()
1764 args.emplace_back(acc_.GetValueIn(gate, i)); in LowerNewObjRange()
1766 LowerFastCall(gate, glue_, ctor, actualArgc, args, args, &result, &exit, true); in LowerNewObjRange()
1768 …result = builder_.CallStub(glue_, gate, CommonStubCSigns::ConstructorCheck, { glue_, ctor, *result… in LowerNewObjRange()
1773 size_t range = acc_.GetNumValueIn(gate); in LowerNewObjRange()
1776 args[i] = acc_.GetValueIn(gate, i); in LowerNewObjRange()
1778 result = LowerCallRuntime(gate, RTSTUB_ID(OptNewObjRange), args, true); in LowerNewObjRange()
1782 ReplaceHirWithPendingException(gate, builder_.GetState(), builder_.GetDepend(), *result); in LowerNewObjRange()
1785 void SlowPathLowering::LowerConditionJump(GateRef gate, bool isEqualJump) in LowerConditionJump() argument
1788 GateRef value = acc_.GetValueIn(gate, 0); in LowerConditionJump()
1791 GateRef ifBranch = builder_.Branch(acc_.GetState(gate), condition); in LowerConditionJump()
1826 auto uses = acc_.Uses(gate); in LowerConditionJump()
1837 it = acc_.ReplaceIn(it, acc_.GetDep(gate)); in LowerConditionJump()
1844 acc_.DeleteGate(gate); in LowerConditionJump()
1847 void SlowPathLowering::LowerGetNextPropName(GateRef gate) in LowerGetNextPropName() argument
1850 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerGetNextPropName()
1851 GateRef iter = acc_.GetValueIn(gate, 0); in LowerGetNextPropName()
1880 result = LowerCallRuntime(gate, RTSTUB_ID(GetNextPropNameSlowpath), { iter }, true); in LowerGetNextPropName()
1885 ReplaceHirWithValue(gate, *result); in LowerGetNextPropName()
1888 void SlowPathLowering::LowerCopyDataProperties(GateRef gate) in LowerCopyDataProperties() argument
1892 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerCopyDataProperties()
1893 GateRef dst = acc_.GetValueIn(gate, 0); in LowerCopyDataProperties()
1894 GateRef src = acc_.GetValueIn(gate, 1); in LowerCopyDataProperties()
1895 GateRef newGate = LowerCallRuntime(gate, id, { dst, src }); in LowerCopyDataProperties()
1896 ReplaceHirWithValue(gate, newGate); in LowerCopyDataProperties()
1899 void SlowPathLowering::LowerCreateObjectWithExcludedKeys(GateRef gate) in LowerCreateObjectWithExcludedKeys() argument
1903 ASSERT(acc_.GetNumValueIn(gate) >= 2); in LowerCreateObjectWithExcludedKeys()
1904 size_t numIn = acc_.GetNumValueIn(gate); in LowerCreateObjectWithExcludedKeys()
1907 GateRef tmpGate = acc_.GetValueIn(gate, idx); in LowerCreateObjectWithExcludedKeys()
1910 GateRef newGate = LowerCallRuntime(gate, id, args); in LowerCreateObjectWithExcludedKeys()
1911 ReplaceHirWithValue(gate, newGate); in LowerCreateObjectWithExcludedKeys()
1914 void SlowPathLowering::LowerCreateRegExpWithLiteral(GateRef gate) in LowerCreateRegExpWithLiteral() argument
1918 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerCreateRegExpWithLiteral()
1919 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerCreateRegExpWithLiteral()
1920 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerCreateRegExpWithLiteral()
1921 …GateRef pattern = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::ST… in LowerCreateRegExpWithLiteral()
1922 GateRef flags = acc_.GetValueIn(gate, 1); in LowerCreateRegExpWithLiteral()
1923 GateRef newGate = LowerCallRuntime(gate, id, { pattern, builder_.ToTaggedInt(flags) }, true); in LowerCreateRegExpWithLiteral()
1924 ReplaceHirWithValue(gate, newGate); in LowerCreateRegExpWithLiteral()
1927 void SlowPathLowering::LowerStOwnByValue(GateRef gate) in LowerStOwnByValue() argument
1930 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStOwnByValue()
1931 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerStOwnByValue()
1932 GateRef propKey = acc_.GetValueIn(gate, 1); in LowerStOwnByValue()
1933 GateRef accValue = acc_.GetValueIn(gate, 2); in LowerStOwnByValue()
1937 result = builder_.CallStub(glue_, gate, CommonStubCSigns::StOwnByValue, in LowerStOwnByValue()
1939 ReplaceHirWithValue(gate, *result); in LowerStOwnByValue()
1942 void SlowPathLowering::LowerStOwnByIndex(GateRef gate) in LowerStOwnByIndex() argument
1945 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStOwnByIndex()
1946 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerStOwnByIndex()
1947 GateRef index = acc_.GetValueIn(gate, 1); in LowerStOwnByIndex()
1948 GateRef accValue = acc_.GetValueIn(gate, 2); in LowerStOwnByIndex()
1952 result = builder_.CallStub(glue_, gate, CommonStubCSigns::StOwnByIndex, in LowerStOwnByIndex()
1954 ReplaceHirWithValue(gate, *result); in LowerStOwnByIndex()
1957 void SlowPathLowering::LowerStOwnByName(GateRef gate) in LowerStOwnByName() argument
1960 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStOwnByName()
1961 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerStOwnByName()
1962 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerStOwnByName()
1963 …GateRef propKey = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::ST… in LowerStOwnByName()
1964 GateRef receiver = acc_.GetValueIn(gate, 1); in LowerStOwnByName()
1965 GateRef accValue = acc_.GetValueIn(gate, 2); in LowerStOwnByName()
1969 result = builder_.CallStub(glue_, gate, CommonStubCSigns::StOwnByName, in LowerStOwnByName()
1971 ReplaceHirWithValue(gate, *result); in LowerStOwnByName()
1974 void SlowPathLowering::LowerNewLexicalEnv(GateRef gate) in LowerNewLexicalEnv() argument
1977 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerNewLexicalEnv()
1978 GateRef lexEnv = acc_.GetValueIn(gate, 1); in LowerNewLexicalEnv()
1979 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::NewLexicalEnv, in LowerNewLexicalEnv()
1980 { glue_, lexEnv, builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)) }); in LowerNewLexicalEnv()
1981 ReplaceHirWithValue(gate, result); in LowerNewLexicalEnv()
1984 void SlowPathLowering::LowerNewLexicalEnvWithName(GateRef gate) in LowerNewLexicalEnvWithName() argument
1987 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerNewLexicalEnvWithName()
1988 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerNewLexicalEnvWithName()
1989 GateRef lexEnv = acc_.GetValueIn(gate, 2); // 2: Get current lexEnv in LowerNewLexicalEnvWithName()
1990 auto args = { builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)), in LowerNewLexicalEnvWithName()
1991 builder_.ToTaggedInt(acc_.GetValueIn(gate, 1)), in LowerNewLexicalEnvWithName()
1993 GateRef result = LowerCallRuntime(gate, RTSTUB_ID(OptNewLexicalEnvWithName), args, true); in LowerNewLexicalEnvWithName()
1994 ReplaceHirWithValue(gate, result, true); in LowerNewLexicalEnvWithName()
1997 void SlowPathLowering::LowerPopLexicalEnv(GateRef gate) in LowerPopLexicalEnv() argument
1999 GateRef currentEnv = acc_.GetValueIn(gate, 0); in LowerPopLexicalEnv()
2002 ReplaceHirWithValue(gate, parentEnv, true); in LowerPopLexicalEnv()
2005 void SlowPathLowering::LowerLdSuperByValue(GateRef gate) in LowerLdSuperByValue() argument
2009 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerLdSuperByValue()
2010 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerLdSuperByValue()
2011 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerLdSuperByValue()
2012 GateRef propKey = acc_.GetValueIn(gate, 1); in LowerLdSuperByValue()
2013 GateRef newGate = LowerCallRuntime(gate, id, { receiver, propKey, jsFunc }); in LowerLdSuperByValue()
2014 ReplaceHirWithValue(gate, newGate); in LowerLdSuperByValue()
2017 void SlowPathLowering::LowerStSuperByValue(GateRef gate) in LowerStSuperByValue() argument
2021 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStSuperByValue()
2022 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerStSuperByValue()
2023 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerStSuperByValue()
2024 GateRef propKey = acc_.GetValueIn(gate, 1); in LowerStSuperByValue()
2025 GateRef value = acc_.GetValueIn(gate, 2); in LowerStSuperByValue()
2026 GateRef newGate = LowerCallRuntime(gate, id, { receiver, propKey, value, jsFunc}); in LowerStSuperByValue()
2027 ReplaceHirWithValue(gate, newGate); in LowerStSuperByValue()
2030 void SlowPathLowering::LowerTryStGlobalByName(GateRef gate) in LowerTryStGlobalByName() argument
2033 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerTryStGlobalByName()
2034 GateRef stringId = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerTryStGlobalByName()
2035 GateRef value = acc_.GetValueIn(gate, 2); // 2: the 2nd para is value in LowerTryStGlobalByName()
2036 LowerCallStubWithIC(gate, CommonStubCSigns::TryStGlobalByName, { stringId, value }); in LowerTryStGlobalByName()
2039 void SlowPathLowering::LowerStConstToGlobalRecord(GateRef gate, bool isConst) in LowerStConstToGlobalRecord() argument
2041 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerStConstToGlobalRecord()
2042 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerStConstToGlobalRecord()
2043 …GateRef propKey = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::ST… in LowerStConstToGlobalRecord()
2044 acc_.SetDep(gate, propKey); in LowerStConstToGlobalRecord()
2046 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerStConstToGlobalRecord()
2048 GateRef value = acc_.GetValueIn(gate, 1); in LowerStConstToGlobalRecord()
2050 GateRef result = LowerCallRuntime(gate, id, { propKey, value, isConstGate }, true); in LowerStConstToGlobalRecord()
2051 ReplaceHirWithValue(gate, result); in LowerStConstToGlobalRecord()
2054 void SlowPathLowering::LowerStOwnByValueWithNameSet(GateRef gate) in LowerStOwnByValueWithNameSet() argument
2057 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStOwnByValueWithNameSet()
2058 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerStOwnByValueWithNameSet()
2059 GateRef propKey = acc_.GetValueIn(gate, 1); in LowerStOwnByValueWithNameSet()
2060 GateRef accValue = acc_.GetValueIn(gate, 2); in LowerStOwnByValueWithNameSet()
2063 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::StOwnByValueWithNameSet, in LowerStOwnByValueWithNameSet()
2068 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, Circuit::NullGate()); in LowerStOwnByValueWithNameSet()
2071 void SlowPathLowering::LowerStOwnByNameWithNameSet(GateRef gate) in LowerStOwnByNameWithNameSet() argument
2074 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStOwnByNameWithNameSet()
2075 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerStOwnByNameWithNameSet()
2076 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerStOwnByNameWithNameSet()
2077 …GateRef propKey = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::ST… in LowerStOwnByNameWithNameSet()
2078 GateRef receiver = acc_.GetValueIn(gate, 1); in LowerStOwnByNameWithNameSet()
2079 GateRef accValue = acc_.GetValueIn(gate, 2); in LowerStOwnByNameWithNameSet()
2082 GateRef result = builder_.CallStub(glue_, gate, CommonStubCSigns::StOwnByNameWithNameSet, in LowerStOwnByNameWithNameSet()
2087 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, Circuit::NullGate()); in LowerStOwnByNameWithNameSet()
2090 void SlowPathLowering::LowerLdGlobalVar(GateRef gate) in LowerLdGlobalVar() argument
2093 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerLdGlobalVar()
2094 GateRef stringId = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerLdGlobalVar()
2095 LowerCallStubWithIC(gate, CommonStubCSigns::LdGlobalVar, { stringId }); in LowerLdGlobalVar()
2098 void SlowPathLowering::LowerLdObjByName(GateRef gate) in LowerLdObjByName() argument
2101 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerLdObjByName()
2102 GateRef stringId = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerLdObjByName()
2103 GateRef receiver = acc_.GetValueIn(gate, 2); // 2: the third parameter in LowerLdObjByName()
2104 LowerCallStubWithIC(gate, CommonStubCSigns::GetPropertyByName, { receiver, stringId }); in LowerLdObjByName()
2107 void SlowPathLowering::LowerStObjByName(GateRef gate, bool isThis) in LowerStObjByName() argument
2112 ASSERT(acc_.GetNumValueIn(gate) == 3); // 3: number of value inputs in LowerStObjByName()
2113 receiver = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::THIS_OBJECT); in LowerStObjByName()
2114 value = acc_.GetValueIn(gate, 2); // 2: the third para is value in LowerStObjByName()
2116 ASSERT(acc_.GetNumValueIn(gate) == 4); // 4: number of value inputs in LowerStObjByName()
2117 receiver = acc_.GetValueIn(gate, 2); // 2: the third para is receiver in LowerStObjByName()
2118 value = acc_.GetValueIn(gate, 3); // 3: the 4th para is value in LowerStObjByName()
2120 GateRef stringId = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerStObjByName()
2121 LowerCallStubWithIC(gate, CommonStubCSigns::SetPropertyByName, { receiver, stringId, value }); in LowerStObjByName()
2124 void SlowPathLowering::LowerDefineGetterSetterByValue(GateRef gate) in LowerDefineGetterSetterByValue() argument
2128 ASSERT(acc_.GetNumValueIn(gate) == 5); in LowerDefineGetterSetterByValue()
2129 GateRef obj = acc_.GetValueIn(gate, 0); in LowerDefineGetterSetterByValue()
2130 GateRef prop = acc_.GetValueIn(gate, 1); in LowerDefineGetterSetterByValue()
2131 GateRef getter = acc_.GetValueIn(gate, 2); in LowerDefineGetterSetterByValue()
2132 GateRef setter = acc_.GetValueIn(gate, 3); in LowerDefineGetterSetterByValue()
2133 GateRef acc = acc_.GetValueIn(gate, 4); in LowerDefineGetterSetterByValue()
2136 GateRef result = LowerCallRuntime(gate, id, args); in LowerDefineGetterSetterByValue()
2137 ReplaceHirWithValue(gate, result); in LowerDefineGetterSetterByValue()
2140 void SlowPathLowering::LowerLdObjByIndex(GateRef gate) in LowerLdObjByIndex() argument
2143 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerLdObjByIndex()
2146 GateRef index = acc_.GetValueIn(gate, 0); in LowerLdObjByIndex()
2147 GateRef receiver = acc_.GetValueIn(gate, 1); in LowerLdObjByIndex()
2148 varAcc = builder_.CallStub(glue_, gate, CommonStubCSigns::LdObjByIndex, in LowerLdObjByIndex()
2150 ReplaceHirWithValue(gate, *varAcc); in LowerLdObjByIndex()
2153 void SlowPathLowering::LowerStObjByIndex(GateRef gate) in LowerStObjByIndex() argument
2156 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStObjByIndex()
2157 GateRef receiver = acc_.GetValueIn(gate, 0); in LowerStObjByIndex()
2158 GateRef index = acc_.GetValueIn(gate, 1); in LowerStObjByIndex()
2159 GateRef accValue = acc_.GetValueIn(gate, 2); in LowerStObjByIndex()
2161 result = builder_.CallStub(glue_, gate, CommonStubCSigns::StObjByIndex, in LowerStObjByIndex()
2163 ReplaceHirWithValue(gate, *result); in LowerStObjByIndex()
2166 void SlowPathLowering::LowerLdObjByValue(GateRef gate, bool isThis) in LowerLdObjByValue() argument
2171 ASSERT(acc_.GetNumValueIn(gate) == 2); // 2: number of value inputs in LowerLdObjByValue()
2172 receiver = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::THIS_OBJECT); in LowerLdObjByValue()
2173 propKey = acc_.GetValueIn(gate, 1); in LowerLdObjByValue()
2175 ASSERT(acc_.GetNumValueIn(gate) == 3); // 3: number of value inputs in LowerLdObjByValue()
2176 receiver = acc_.GetValueIn(gate, 1); in LowerLdObjByValue()
2177 propKey = acc_.GetValueIn(gate, 2); // 2: the third parameter in LowerLdObjByValue()
2179 LowerCallStubWithIC(gate, CommonStubCSigns::GetPropertyByValue, { receiver, propKey }); in LowerLdObjByValue()
2182 void SlowPathLowering::LowerStObjByValue(GateRef gate, bool isThis) in LowerStObjByValue() argument
2188 ASSERT(acc_.GetNumValueIn(gate) == 3); // 3: number of value inputs in LowerStObjByValue()
2189 receiver = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::THIS_OBJECT); in LowerStObjByValue()
2190 propKey = acc_.GetValueIn(gate, 1); in LowerStObjByValue()
2191 value = acc_.GetValueIn(gate, 2); // 2: the third parameter in LowerStObjByValue()
2194 ASSERT(acc_.GetNumValueIn(gate) == 4); in LowerStObjByValue()
2195 receiver = acc_.GetValueIn(gate, 1); in LowerStObjByValue()
2196 propKey = acc_.GetValueIn(gate, 2); // 2: the third parameter in LowerStObjByValue()
2197 value = acc_.GetValueIn(gate, 3); // 3: the 4th parameter in LowerStObjByValue()
2199 LowerCallStubWithIC(gate, CommonStubCSigns::SetPropertyByValue, { receiver, propKey, value }); in LowerStObjByValue()
2202 void SlowPathLowering::LowerLdSuperByName(GateRef gate) in LowerLdSuperByName() argument
2205 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerLdSuperByName()
2206 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerLdSuperByName()
2207 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerLdSuperByName()
2208 …GateRef prop = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::STRIN… in LowerLdSuperByName()
2210 …LowerCallRuntime(gate, RTSTUB_ID(OptLdSuperByValue), {acc_.GetValueIn(gate, 1), prop, jsFunc}, tru… in LowerLdSuperByName()
2211 ReplaceHirWithValue(gate, result); in LowerLdSuperByName()
2214 void SlowPathLowering::LowerStSuperByName(GateRef gate) in LowerStSuperByName() argument
2217 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStSuperByName()
2218 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerStSuperByName()
2219 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerStSuperByName()
2220 …GateRef prop = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::STRIN… in LowerStSuperByName()
2221 auto args2 = { acc_.GetValueIn(gate, 1), prop, acc_.GetValueIn(gate, 2), jsFunc }; in LowerStSuperByName()
2222 GateRef result = LowerCallRuntime(gate, RTSTUB_ID(OptStSuperByValue), args2, true); in LowerStSuperByName()
2223 ReplaceHirWithValue(gate, result); in LowerStSuperByName()
2226 void SlowPathLowering::LowerCreateGeneratorObj(GateRef gate) in LowerCreateGeneratorObj() argument
2230 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerCreateGeneratorObj()
2231 GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0)}); in LowerCreateGeneratorObj()
2232 ReplaceHirWithValue(gate, newGate); in LowerCreateGeneratorObj()
2235 void SlowPathLowering::LowerCreateAsyncGeneratorObj(GateRef gate) in LowerCreateAsyncGeneratorObj() argument
2239 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerCreateAsyncGeneratorObj()
2240 GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0)}); in LowerCreateAsyncGeneratorObj()
2241 ReplaceHirWithValue(gate, newGate); in LowerCreateAsyncGeneratorObj()
2244 void SlowPathLowering::LowerAsyncGeneratorResolve(GateRef gate) in LowerAsyncGeneratorResolve() argument
2246 SaveFrameToContext(gate); in LowerAsyncGeneratorResolve()
2247 acc_.SetDep(gate, builder_.GetDepend()); in LowerAsyncGeneratorResolve()
2249 GateRef asyncGen = acc_.GetValueIn(gate, 1); in LowerAsyncGeneratorResolve()
2250 GateRef value = acc_.GetValueIn(gate, 2); in LowerAsyncGeneratorResolve()
2251 GateRef flag = acc_.GetValueIn(gate, 3); in LowerAsyncGeneratorResolve()
2252 GateRef newGate = LowerCallRuntime(gate, id, {asyncGen, value, flag}); in LowerAsyncGeneratorResolve()
2253 ReplaceHirWithValue(gate, newGate); in LowerAsyncGeneratorResolve()
2256 void SlowPathLowering::LowerAsyncGeneratorReject(GateRef gate) in LowerAsyncGeneratorReject() argument
2260 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerAsyncGeneratorReject()
2261 …GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1)}); in LowerAsyncGeneratorReject()
2262 ReplaceHirWithValue(gate, newGate); in LowerAsyncGeneratorReject()
2265 void SlowPathLowering::LowerStArraySpread(GateRef gate) in LowerStArraySpread() argument
2269 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerStArraySpread()
2270 auto args = { acc_.GetValueIn(gate, 0), acc_.GetValueIn(gate, 1), acc_.GetValueIn(gate, 2) }; in LowerStArraySpread()
2271 GateRef newGate = LowerCallRuntime(gate, id, args); in LowerStArraySpread()
2272 ReplaceHirWithValue(gate, newGate); in LowerStArraySpread()
2275 void SlowPathLowering::LowerLdLexVar(GateRef gate) in LowerLdLexVar() argument
2278 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerLdLexVar()
2279 GateRef level = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerLdLexVar()
2280 GateRef slot = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 1)); in LowerLdLexVar()
2281 …DEFVALUE(currentEnv, (&builder_), VariableType::JS_ANY(), acc_.GetValueIn(gate, 2)); // 2: Get cur… in LowerLdLexVar()
2284 uint64_t constLevel = acc_.TryGetValue(acc_.GetValueIn(gate, 0)); in LowerLdLexVar()
2305 ReplaceHirWithValue(gate, result, true); in LowerLdLexVar()
2308 void SlowPathLowering::LowerStLexVar(GateRef gate) in LowerStLexVar() argument
2311 ASSERT(acc_.GetNumValueIn(gate) == 4); in LowerStLexVar()
2312 GateRef level = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerStLexVar()
2313 GateRef slot = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 1)); in LowerStLexVar()
2314 GateRef value = acc_.GetValueIn(gate, 3); in LowerStLexVar()
2315 …DEFVALUE(currentEnv, (&builder_), VariableType::JS_ANY(), acc_.GetValueIn(gate, 2)); // 2: Get cur… in LowerStLexVar()
2318 uint64_t constLevel = acc_.TryGetValue(acc_.GetValueIn(gate, 0)); in LowerStLexVar()
2340 ReplaceHirWithValue(gate, result, true); in LowerStLexVar()
2343 void SlowPathLowering::LowerDefineClassWithBuffer(GateRef gate) in LowerDefineClassWithBuffer() argument
2346 ASSERT(acc_.GetNumValueIn(gate) == 5); in LowerDefineClassWithBuffer()
2347 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerDefineClassWithBuffer()
2348 GateRef methodId = acc_.GetValueIn(gate, 0); in LowerDefineClassWithBuffer()
2349 GateRef proto = acc_.GetValueIn(gate, 3); in LowerDefineClassWithBuffer()
2350 GateRef literalId = acc_.GetValueIn(gate, 1); in LowerDefineClassWithBuffer()
2351 GateRef length = acc_.GetValueIn(gate, 2); // 2: second arg in LowerDefineClassWithBuffer()
2352 GateRef lexicalEnv = acc_.GetValueIn(gate, 4); // 4: Get current env in LowerDefineClassWithBuffer()
2362 result = LowerCallRuntime(gate, RTSTUB_ID(CreateClassWithBuffer), args, true); in LowerDefineClassWithBuffer()
2365 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, result); in LowerDefineClassWithBuffer()
2368 void SlowPathLowering::LowerDefineFunc(GateRef gate) in LowerDefineFunc() argument
2370 Environment env(gate, circuit_, &builder_); in LowerDefineFunc()
2372 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerDefineFunc()
2373 GateRef methodId = acc_.GetValueIn(gate, 0); in LowerDefineFunc()
2374 GateRef length = acc_.GetValueIn(gate, 1); in LowerDefineFunc()
2375 GateRef lexEnv = acc_.GetValueIn(gate, 2); // 2: Get current env in LowerDefineFunc()
2393 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, *result); in LowerDefineFunc()
2396 void SlowPathLowering::LowerAsyncFunctionEnter(GateRef gate) in LowerAsyncFunctionEnter() argument
2400 ASSERT(acc_.GetNumValueIn(gate) == 0); in LowerAsyncFunctionEnter()
2401 GateRef newGate = LowerCallRuntime(gate, id, {}); in LowerAsyncFunctionEnter()
2402 ReplaceHirWithValue(gate, newGate); in LowerAsyncFunctionEnter()
2405 void SlowPathLowering::LowerTypeof(GateRef gate) in LowerTypeof() argument
2408 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerTypeof()
2409 GateRef obj = acc_.GetValueIn(gate, 0); in LowerTypeof()
2541 ReplaceHirWithValue(gate, *result, true); in LowerTypeof()
2553 void SlowPathLowering::LowerStoreRegister(GateRef gate, GateRef arrayGate) in LowerStoreRegister() argument
2555 ASSERT((acc_.GetOpCode(gate) == OpCode::RESTORE_REGISTER)); in LowerStoreRegister()
2556 auto index = acc_.GetVirtualRegisterIndex(gate); in LowerStoreRegister()
2559 acc_.ReplaceGate(gate, Circuit::NullGate(), Circuit::NullGate(), value); in LowerStoreRegister()
2562 void SlowPathLowering::LowerResumeGenerator(GateRef gate) in LowerResumeGenerator() argument
2564 GateRef obj = acc_.GetValueIn(gate, 0); in LowerResumeGenerator()
2567 AddProfiling(gate, false); in LowerResumeGenerator()
2573 auto uses = acc_.Uses(gate); in LowerResumeGenerator()
2584 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerResumeGenerator()
2603 ReplaceHirWithValue(gate, *result, true); in LowerResumeGenerator()
2606 void SlowPathLowering::LowerGetResumeMode(GateRef gate) in LowerGetResumeMode() argument
2609 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerGetResumeMode()
2614 GateRef obj = acc_.GetValueIn(gate, 0); in LowerGetResumeMode()
2640 ReplaceHirWithValue(gate, *result, true); in LowerGetResumeMode()
2643 void SlowPathLowering::LowerDefineMethod(GateRef gate) in LowerDefineMethod() argument
2646 ASSERT(acc_.GetNumValueIn(gate) == 4); in LowerDefineMethod()
2647 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerDefineMethod()
2648 GateRef methodId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerDefineMethod()
2649 …auto method = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, methodId, ConstPoolType::METHOD… in LowerDefineMethod()
2650 GateRef length = acc_.GetValueIn(gate, 1); in LowerDefineMethod()
2651 GateRef env = acc_.GetValueIn(gate, 2); // 2: Get current env in LowerDefineMethod()
2652 GateRef homeObject = acc_.GetValueIn(gate, 3); // 3: second arg in LowerDefineMethod()
2657 GateRef result = LowerCallRuntime(gate, RTSTUB_ID(DefineMethod), in LowerDefineMethod()
2662 acc_.ReplaceHirWithIfBranch(gate, successControl, failControl, result); in LowerDefineMethod()
2665 void SlowPathLowering::LowerGetUnmappedArgs(GateRef gate) in LowerGetUnmappedArgs() argument
2667 GateRef actualArgc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::ACTUAL_ARGC); in LowerGetUnmappedArgs()
2668 GateRef newGate = builder_.CallStub(glue_, gate, CommonStubCSigns::GetUnmapedArgs, in LowerGetUnmappedArgs()
2670 ReplaceHirWithValue(gate, newGate); in LowerGetUnmappedArgs()
2673 void SlowPathLowering::LowerCopyRestArgs(GateRef gate) in LowerCopyRestArgs() argument
2675 GateRef actualArgc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::ACTUAL_ARGC); in LowerCopyRestArgs()
2677 GateRef restIdx = acc_.GetValueIn(gate, 0); in LowerCopyRestArgs()
2681 GateRef newGate = LowerCallRuntime(gate, id, {taggedArgc, taggedRestIdx}); in LowerCopyRestArgs()
2682 ReplaceHirWithValue(gate, newGate); in LowerCopyRestArgs()
2685 void SlowPathLowering::LowerWideLdPatchVar(GateRef gate) in LowerWideLdPatchVar() argument
2688 GateRef index = acc_.GetValueIn(gate, 0); in LowerWideLdPatchVar()
2689 GateRef newGate = LowerCallRuntime(gate, id, {builder_.ToTaggedInt(index)}); in LowerWideLdPatchVar()
2690 ReplaceHirWithValue(gate, newGate); in LowerWideLdPatchVar()
2693 void SlowPathLowering::LowerWideStPatchVar(GateRef gate) in LowerWideStPatchVar() argument
2696 GateRef index = acc_.GetValueIn(gate, 0); in LowerWideStPatchVar()
2697 GateRef newGate = LowerCallRuntime(gate, id, {builder_.ToTaggedInt(index)}); in LowerWideStPatchVar()
2698 ReplaceHirWithValue(gate, newGate); in LowerWideStPatchVar()
2701 void SlowPathLowering::AddProfiling(GateRef gate, bool skipGenerator) in AddProfiling() argument
2704 EcmaOpcode ecmaOpcode = acc_.GetByteCodeOpcode(gate); in AddProfiling()
2712 GateRef debugGate = builder_.CallRuntime(glue_, RTSTUB_ID(DebugAOTPrint), acc_.GetDep(gate), in AddProfiling()
2713 { constOpcode, slowPath }, gate); in AddProfiling()
2714 acc_.SetDep(gate, debugGate); in AddProfiling()
2718 EcmaOpcode ecmaOpcode = acc_.GetByteCodeOpcode(gate); in AddProfiling()
2724 if (acc_.HasFrameState(gate)) { in AddProfiling()
2725 GateRef func = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in AddProfiling()
2726 GateRef bcIndex = builder_.Int32ToTaggedInt(builder_.Int32(acc_.TryGetBcIndex(gate))); in AddProfiling()
2731 …GateRef profiling = builder_.CallRuntime(glue_, RTSTUB_ID(ProfileOptimizedCode), acc_.GetDep(gate), in AddProfiling()
2732 { func, bcIndex, constOpcode, mode }, gate); in AddProfiling()
2733 acc_.SetDep(gate, profiling); in AddProfiling()
2738 void SlowPathLowering::LowerCallthis0Imm8V8(GateRef gate) in LowerCallthis0Imm8V8() argument
2741 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerCallthis0Imm8V8()
2743 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallthis0Imm8V8()
2746 GateRef thisObj = acc_.GetValueIn(gate, 0); in LowerCallthis0Imm8V8()
2747 GateRef func = acc_.GetValueIn(gate, 1); in LowerCallthis0Imm8V8()
2748 LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj}, {glue_, func, thisObj}); in LowerCallthis0Imm8V8()
2751 void SlowPathLowering::LowerCallArg1Imm8V8(GateRef gate) in LowerCallArg1Imm8V8() argument
2754 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerCallArg1Imm8V8()
2755 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallArg1Imm8V8()
2759 GateRef a0Value = acc_.GetValueIn(gate, 0); in LowerCallArg1Imm8V8()
2761 GateRef func = acc_.GetValueIn(gate, 1); // acc in LowerCallArg1Imm8V8()
2762 …LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj, a0Value}, {glue_, func, thisObj,… in LowerCallArg1Imm8V8()
2765 void SlowPathLowering::LowerWideCallrangePrefImm16V8(GateRef gate) in LowerWideCallrangePrefImm16V8() argument
2769 size_t numIns = acc_.GetNumValueIn(gate); in LowerWideCallrangePrefImm16V8()
2771 ASSERT(acc_.GetNumValueIn(gate) >= fixedInputsNum); in LowerWideCallrangePrefImm16V8()
2772 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerWideCallrangePrefImm16V8()
2774 GateRef callTarget = acc_.GetValueIn(gate, numIns - fixedInputsNum); // acc in LowerWideCallrangePrefImm16V8()
2785 vec.emplace_back(acc_.GetValueIn(gate, i)); in LowerWideCallrangePrefImm16V8()
2793 vec.emplace_back(acc_.GetValueIn(gate, i)); in LowerWideCallrangePrefImm16V8()
2795 LowerToJSCall(gate, vec, vec1); in LowerWideCallrangePrefImm16V8()
2798 void SlowPathLowering::LowerCallThisArg1(GateRef gate) in LowerCallThisArg1() argument
2801 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerCallThisArg1()
2802 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallThisArg1()
2805 GateRef thisObj = acc_.GetValueIn(gate, 0); in LowerCallThisArg1()
2806 GateRef a0 = acc_.GetValueIn(gate, 1); // 1:first parameter in LowerCallThisArg1()
2807 GateRef func = acc_.GetValueIn(gate, 2); // 2:function in LowerCallThisArg1()
2808 …LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj, a0}, {glue_, func, thisObj, a0}); in LowerCallThisArg1()
2811 void SlowPathLowering::LowerCallargs2Imm8V8V8(GateRef gate) in LowerCallargs2Imm8V8V8() argument
2814 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerCallargs2Imm8V8V8()
2815 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallargs2Imm8V8V8()
2819 GateRef a0 = acc_.GetValueIn(gate, 0); in LowerCallargs2Imm8V8V8()
2820 GateRef a1 = acc_.GetValueIn(gate, 1); // 1:first parameter in LowerCallargs2Imm8V8V8()
2821 GateRef func = acc_.GetValueIn(gate, 2); // 2:function in LowerCallargs2Imm8V8V8()
2823 …LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj, a0, a1}, {glue_, func, thisObj, … in LowerCallargs2Imm8V8V8()
2826 void SlowPathLowering::LowerCallargs3Imm8V8V8(GateRef gate) in LowerCallargs3Imm8V8V8() argument
2829 ASSERT(acc_.GetNumValueIn(gate) == 4); in LowerCallargs3Imm8V8V8()
2830 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallargs3Imm8V8V8()
2834 GateRef a0 = acc_.GetValueIn(gate, 0); in LowerCallargs3Imm8V8V8()
2835 GateRef a1 = acc_.GetValueIn(gate, 1); in LowerCallargs3Imm8V8V8()
2836 GateRef a2 = acc_.GetValueIn(gate, 2); in LowerCallargs3Imm8V8V8()
2837 GateRef func = acc_.GetValueIn(gate, 3); in LowerCallargs3Imm8V8V8()
2839 …LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj, a0, a1, a2}, {glue_, func, thisO… in LowerCallargs3Imm8V8V8()
2842 void SlowPathLowering::LowerCallthis2Imm8V8V8V8(GateRef gate) in LowerCallthis2Imm8V8V8V8() argument
2845 ASSERT(acc_.GetNumValueIn(gate) == 4); in LowerCallthis2Imm8V8V8V8()
2846 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallthis2Imm8V8V8V8()
2849 GateRef thisObj = acc_.GetValueIn(gate, 0); in LowerCallthis2Imm8V8V8V8()
2850 GateRef a0Value = acc_.GetValueIn(gate, 1); in LowerCallthis2Imm8V8V8V8()
2851 GateRef a1Value = acc_.GetValueIn(gate, 2); in LowerCallthis2Imm8V8V8V8()
2852 GateRef func = acc_.GetValueIn(gate, 3); //acc in LowerCallthis2Imm8V8V8V8()
2854 LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj, a0Value, a1Value}, in LowerCallthis2Imm8V8V8V8()
2858 void SlowPathLowering::LowerCallthis3Imm8V8V8V8V8(GateRef gate) in LowerCallthis3Imm8V8V8V8V8() argument
2861 ASSERT(acc_.GetNumValueIn(gate) == 5); in LowerCallthis3Imm8V8V8V8V8()
2862 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallthis3Imm8V8V8V8V8()
2865 GateRef thisObj = acc_.GetValueIn(gate, 0); in LowerCallthis3Imm8V8V8V8V8()
2866 GateRef a0Value = acc_.GetValueIn(gate, 1); in LowerCallthis3Imm8V8V8V8V8()
2867 GateRef a1Value = acc_.GetValueIn(gate, 2); in LowerCallthis3Imm8V8V8V8V8()
2868 GateRef a2Value = acc_.GetValueIn(gate, 3); in LowerCallthis3Imm8V8V8V8V8()
2869 GateRef func = acc_.GetValueIn(gate, 4); in LowerCallthis3Imm8V8V8V8V8()
2870 LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj, a0Value, a1Value, a2Value}, in LowerCallthis3Imm8V8V8V8V8()
2874 void SlowPathLowering::LowerLdThisByName(GateRef gate) in LowerLdThisByName() argument
2876 ASSERT(acc_.GetNumValueIn(gate) == 2); // 2: number of parameter in LowerLdThisByName()
2877 GateRef thisObj = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::THIS_OBJECT); in LowerLdThisByName()
2878 GateRef prop = acc_.GetValueIn(gate, 1); // 1: the second parameter in LowerLdThisByName()
2879 LowerCallStubWithIC(gate, CommonStubCSigns::GetPropertyByName, { thisObj, prop }); in LowerLdThisByName()
2882 void SlowPathLowering::LowerConstruct(GateRef gate) in LowerConstruct() argument
2884 Environment env(gate, circuit_, &builder_); in LowerConstruct()
2885 size_t num = acc_.GetNumValueIn(gate); in LowerConstruct()
2888 args[i] = acc_.GetValueIn(gate, i); in LowerConstruct()
2894 argsFastCall[j++] = acc_.GetValueIn(gate, i); in LowerConstruct()
2897 GateRef ctor = acc_.GetValueIn(gate, static_cast<size_t>(CommonArgIdx::FUNC)); in LowerConstruct()
2898 GateRef argc = acc_.GetValueIn(gate, static_cast<size_t>(CommonArgIdx::ACTUAL_ARGC)); in LowerConstruct()
2901 LowerFastCall(gate, glue_, ctor, argc, args, argsFastCall, &res, &exit, true); in LowerConstruct()
2903 GateRef thisObj = acc_.GetValueIn(gate, static_cast<size_t>(CommonArgIdx::THIS_OBJECT)); in LowerConstruct()
2905 glue_, gate, CommonStubCSigns::ConstructorCheck, { glue_, ctor, *res, thisObj }); in LowerConstruct()
2907 ReplaceHirWithPendingException(gate, state, result, result); in LowerConstruct()
2910 void SlowPathLowering::LowerFastCall(GateRef gate, GateRef glue, GateRef func, GateRef argc, in LowerFastCall() argument
2950 builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true); in LowerFastCall()
2954 … result->WriteVariable(builder_.Call(cs, glue, code, depend, argsFastCall, gate)); in LowerFastCall()
2955 builder_.EndCallTimer(glue_, gate, {glue_, func}, true); in LowerFastCall()
2960 builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true); in LowerFastCall()
2964 result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate)); in LowerFastCall()
2965 builder_.EndCallTimer(glue_, gate, {glue_, func}, true); in LowerFastCall()
2980 builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true); in LowerFastCall()
2984 result->WriteVariable(builder_.Call(cs, glue, code, depend, args, gate)); in LowerFastCall()
2985 builder_.EndCallTimer(glue_, gate, {glue_, func}, true); in LowerFastCall()
2990 builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true); in LowerFastCall()
2994 result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate)); in LowerFastCall()
2995 builder_.EndCallTimer(glue_, gate, {glue_, func}, true); in LowerFastCall()
3004 builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true); in LowerFastCall()
3008 result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate)); in LowerFastCall()
3009 builder_.EndCallTimer(glue_, gate, {glue_, func}, true); in LowerFastCall()
3012 builder_.StartCallTimer(glue_, gate, {glue_, func, builder_.True()}, true); in LowerFastCall()
3016 result->WriteVariable(builder_.Call(cs, glue, target, depend, args, gate)); in LowerFastCall()
3017 builder_.EndCallTimer(glue_, gate, {glue_, func}, true); in LowerFastCall()
3023 void SlowPathLowering::LowerTypedCall(GateRef gate) in LowerTypedCall() argument
3025 Environment env(gate, circuit_, &builder_); in LowerTypedCall()
3026 GateRef func = acc_.GetValueIn(gate, static_cast<size_t>(CommonArgIdx::FUNC)); in LowerTypedCall()
3029 size_t num = acc_.GetNumValueIn(gate); in LowerTypedCall()
3032 args[i] = acc_.GetValueIn(gate, i); in LowerTypedCall()
3037 GateRef result = builder_.Call(cs, glue_, code, depend, args, gate); in LowerTypedCall()
3038 ReplaceHirWithPendingException(gate, state, result, result); in LowerTypedCall()
3041 void SlowPathLowering::LowerTypedFastCall(GateRef gate) in LowerTypedFastCall() argument
3043 Environment env(gate, circuit_, &builder_); in LowerTypedFastCall()
3044 GateRef func = acc_.GetValueIn(gate, static_cast<size_t>(FastCallArgIdx::FUNC)); in LowerTypedFastCall()
3047 size_t num = acc_.GetNumValueIn(gate); in LowerTypedFastCall()
3050 args[i] = acc_.GetValueIn(gate, i); in LowerTypedFastCall()
3055 GateRef result = builder_.Call(cs, glue_, code, depend, args, gate); in LowerTypedFastCall()
3056 ReplaceHirWithPendingException(gate, state, result, result); in LowerTypedFastCall()
3059 void SlowPathLowering::LowerCheckSafePointAndStackOver(GateRef gate) in LowerCheckSafePointAndStackOver() argument
3061 Environment env(gate, circuit_, &builder_); in LowerCheckSafePointAndStackOver()
3089 acc_.ReplaceGate(gate, builder_.GetState(), builder_.GetDepend(), Circuit::NullGate()); in LowerCheckSafePointAndStackOver()
3092 void SlowPathLowering::LowerLdPrivateProperty(GateRef gate) in LowerLdPrivateProperty() argument
3096 ASSERT(acc_.GetNumValueIn(gate) == 5); in LowerLdPrivateProperty()
3097 [[maybe_unused]] GateRef slotId = acc_.GetValueIn(gate, 0); in LowerLdPrivateProperty()
3098 GateRef levelIndex = acc_.GetValueIn(gate, 1); in LowerLdPrivateProperty()
3099 GateRef slotIndex = acc_.GetValueIn(gate, 2); in LowerLdPrivateProperty()
3100 GateRef lexicalEnv = acc_.GetValueIn(gate, 3); in LowerLdPrivateProperty()
3101 GateRef obj = acc_.GetValueIn(gate, 4); // acc in LowerLdPrivateProperty()
3103 GateRef newGate = LowerCallRuntime(gate, id, {lexicalEnv, in LowerLdPrivateProperty()
3105 ReplaceHirWithValue(gate, newGate); in LowerLdPrivateProperty()
3108 void SlowPathLowering::LowerStPrivateProperty(GateRef gate) in LowerStPrivateProperty() argument
3112 ASSERT(acc_.GetNumValueIn(gate) == 6); in LowerStPrivateProperty()
3113 [[maybe_unused]] GateRef slotId = acc_.GetValueIn(gate, 0); in LowerStPrivateProperty()
3114 GateRef levelIndex = acc_.GetValueIn(gate, 1); in LowerStPrivateProperty()
3115 GateRef slotIndex = acc_.GetValueIn(gate, 2); in LowerStPrivateProperty()
3116 GateRef obj = acc_.GetValueIn(gate, 3); in LowerStPrivateProperty()
3117 GateRef lexicalEnv = acc_.GetValueIn(gate, 4); in LowerStPrivateProperty()
3118 GateRef value = acc_.GetValueIn(gate, 5); // acc in LowerStPrivateProperty()
3120 GateRef newGate = LowerCallRuntime(gate, id, {lexicalEnv, in LowerStPrivateProperty()
3122 ReplaceHirWithValue(gate, newGate); in LowerStPrivateProperty()
3125 void SlowPathLowering::LowerTestIn(GateRef gate) in LowerTestIn() argument
3129 ASSERT(acc_.GetNumValueIn(gate) == 5); in LowerTestIn()
3130 [[maybe_unused]] GateRef slotId = acc_.GetValueIn(gate, 0); in LowerTestIn()
3131 GateRef levelIndex = acc_.GetValueIn(gate, 1); in LowerTestIn()
3132 GateRef slotIndex = acc_.GetValueIn(gate, 2); in LowerTestIn()
3133 GateRef lexicalEnv = acc_.GetValueIn(gate, 3); in LowerTestIn()
3134 GateRef obj = acc_.GetValueIn(gate, 4); // acc in LowerTestIn()
3136 GateRef newGate = LowerCallRuntime(gate, id, {lexicalEnv, in LowerTestIn()
3138 ReplaceHirWithValue(gate, newGate); in LowerTestIn()
3141 void SlowPathLowering::LowerNotifyConcurrentResult(GateRef gate) in LowerNotifyConcurrentResult() argument
3145 GateRef newGate = LowerCallRuntime(gate, id, {acc_.GetValueIn(gate, 0), in LowerNotifyConcurrentResult()
3146 argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC)}); in LowerNotifyConcurrentResult()
3147 ReplaceHirWithValue(gate, newGate); in LowerNotifyConcurrentResult()
3150 void SlowPathLowering::LowerDefineFieldByName(GateRef gate) in LowerDefineFieldByName() argument
3154 ASSERT(acc_.GetNumValueIn(gate) == 4); in LowerDefineFieldByName()
3155 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerDefineFieldByName()
3156 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 1)); in LowerDefineFieldByName()
3157 GateRef obj = acc_.GetValueIn(gate, 2); in LowerDefineFieldByName()
3158 …GateRef propKey = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::ST… in LowerDefineFieldByName()
3159 GateRef value = acc_.GetValueIn(gate, 3); // acc in LowerDefineFieldByName()
3161 …GateRef newGate = LowerCallRuntime(gate, id, {obj, propKey, value}); // note that HClass may chan… in LowerDefineFieldByName()
3162 ReplaceHirWithValue(gate, newGate); in LowerDefineFieldByName()
3165 void SlowPathLowering::LowerDefineFieldByValue(GateRef gate) in LowerDefineFieldByValue() argument
3169 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerDefineFieldByValue()
3170 GateRef obj = acc_.GetValueIn(gate, 1); in LowerDefineFieldByValue()
3171 GateRef propKey = acc_.GetValueIn(gate, 0); in LowerDefineFieldByValue()
3172 GateRef value = acc_.GetValueIn(gate, 2); // acc in LowerDefineFieldByValue()
3174 …GateRef newGate = LowerCallRuntime(gate, id, {obj, propKey, value}); // note that HClass may chan… in LowerDefineFieldByValue()
3175 ReplaceHirWithValue(gate, newGate); in LowerDefineFieldByValue()
3178 void SlowPathLowering::LowerDefineFieldByIndex(GateRef gate) in LowerDefineFieldByIndex() argument
3182 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerDefineFieldByIndex()
3183 GateRef obj = acc_.GetValueIn(gate, 1); in LowerDefineFieldByIndex()
3184 GateRef propKey = builder_.ToTaggedInt(acc_.GetValueIn(gate, 0)); in LowerDefineFieldByIndex()
3185 GateRef value = acc_.GetValueIn(gate, 2); // acc in LowerDefineFieldByIndex()
3187 …GateRef newGate = LowerCallRuntime(gate, id, {obj, propKey, value}); // note that HClass may chan… in LowerDefineFieldByIndex()
3188 ReplaceHirWithValue(gate, newGate); in LowerDefineFieldByIndex()
3191 void SlowPathLowering::LowerToPropertyKey(GateRef gate) in LowerToPropertyKey() argument
3195 ASSERT(acc_.GetNumValueIn(gate) == 1); in LowerToPropertyKey()
3196 GateRef value = acc_.GetValueIn(gate, 0); // acc in LowerToPropertyKey()
3198 GateRef newGate = LowerCallRuntime(gate, id, {value}); in LowerToPropertyKey()
3199 ReplaceHirWithValue(gate, newGate); in LowerToPropertyKey()
3202 void SlowPathLowering::LowerCreatePrivateProperty(GateRef gate) in LowerCreatePrivateProperty() argument
3206 ASSERT(acc_.GetNumValueIn(gate) == 3); in LowerCreatePrivateProperty()
3207 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerCreatePrivateProperty()
3208 GateRef count = acc_.GetValueIn(gate, 0); in LowerCreatePrivateProperty()
3209 GateRef literalId = acc_.GetValueIn(gate, 1); in LowerCreatePrivateProperty()
3210 GateRef lexicalEnv = acc_.GetValueIn(gate, 2); in LowerCreatePrivateProperty()
3214 GateRef newGate = LowerCallRuntime(gate, id, {lexicalEnv, in LowerCreatePrivateProperty()
3216 ReplaceHirWithValue(gate, newGate); in LowerCreatePrivateProperty()
3219 void SlowPathLowering::LowerDefinePrivateProperty(GateRef gate) in LowerDefinePrivateProperty() argument
3223 ASSERT(acc_.GetNumValueIn(gate) == 5); in LowerDefinePrivateProperty()
3224 GateRef levelIndex = acc_.GetValueIn(gate, 0); in LowerDefinePrivateProperty()
3225 GateRef slotIndex = acc_.GetValueIn(gate, 1); in LowerDefinePrivateProperty()
3226 GateRef obj = acc_.GetValueIn(gate, 2); in LowerDefinePrivateProperty()
3227 GateRef lexicalEnv = acc_.GetValueIn(gate, 3); in LowerDefinePrivateProperty()
3228 GateRef value = acc_.GetValueIn(gate, 4); // acc in LowerDefinePrivateProperty()
3230 GateRef newGate = LowerCallRuntime(gate, id, {lexicalEnv, in LowerDefinePrivateProperty()
3232 ReplaceHirWithValue(gate, newGate); in LowerDefinePrivateProperty()
3235 void SlowPathLowering::LowerDefineSendableClass(GateRef gate) in LowerDefineSendableClass() argument
3238 ASSERT(acc_.GetNumValueIn(gate) == 4); in LowerDefineSendableClass()
3239 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerDefineSendableClass()
3240 GateRef methodId = acc_.GetValueIn(gate, 0); in LowerDefineSendableClass()
3241 GateRef literalId = acc_.GetValueIn(gate, 1); in LowerDefineSendableClass()
3242 GateRef length = acc_.GetValueIn(gate, 2); // 2: second arg in LowerDefineSendableClass()
3243 GateRef proto = acc_.GetValueIn(gate, 3); in LowerDefineSendableClass()
3248 GateRef newGate = LowerCallRuntime(gate, RTSTUB_ID(CreateSharedClass), args); in LowerDefineSendableClass()
3249 ReplaceHirWithValue(gate, newGate); in LowerDefineSendableClass()
3252 void SlowPathLowering::LowerLdSendableClass(GateRef gate) in LowerLdSendableClass() argument
3254 GateRef level = acc_.GetValueIn(gate, 0); in LowerLdSendableClass()
3255 GateRef lexicalEnv = acc_.GetValueIn(gate, 1); in LowerLdSendableClass()
3256 …GateRef newGate = LowerCallRuntime(gate, RTSTUB_ID(LdSendableClass), { lexicalEnv, builder_.ToTagg… in LowerLdSendableClass()
3257 ReplaceHirWithValue(gate, newGate); in LowerLdSendableClass()
3260 void SlowPathLowering::LowerCallInit(GateRef gate) in LowerCallInit() argument
3264 ASSERT(acc_.GetNumValueIn(gate) == 2); in LowerCallInit()
3266 GateRef actualArgc = builder_.Int64(BytecodeCallArgc::ComputeCallArgc(acc_.GetNumValueIn(gate), in LowerCallInit()
3269 GateRef thisObj = acc_.GetValueIn(gate, 0); in LowerCallInit()
3270 GateRef func = acc_.GetValueIn(gate, 1); in LowerCallInit()
3271 LowerToJSCall(gate, {glue_, actualArgc, func, newTarget, thisObj}, {glue_, func, thisObj}); in LowerCallInit()
3274 void SlowPathLowering::LowerLdStr(GateRef gate) in LowerLdStr() argument
3276 GateRef stringId = builder_.TruncInt64ToInt32(acc_.GetValueIn(gate, 0)); in LowerLdStr()
3277 GateRef jsFunc = argAcc_.GetFrameArgsIn(gate, FrameArgIdx::FUNC); in LowerLdStr()
3278 …GateRef res = builder_.GetObjectFromConstPool(glue_, gate, jsFunc, stringId, ConstPoolType::STRING… in LowerLdStr()
3279 ReplaceHirWithValue(gate, res); in LowerLdStr()
3282 void SlowPathLowering::LowerLoadGetter(GateRef gate) in LowerLoadGetter() argument
3284 Environment env(gate, circuit_, &builder_); in LowerLoadGetter()
3285 ASSERT(acc_.GetNumValueIn(gate) == 2); // 2: holder, plr in LowerLoadGetter()
3286 GateRef holder = acc_.GetValueIn(gate, 0); in LowerLoadGetter()
3287 GateRef propertyLookupResult = acc_.GetValueIn(gate, 1); in LowerLoadGetter()
3301 acc_.ReplaceGate(gate, Circuit::NullGate(), builder_.GetDepend(), getter); in LowerLoadGetter()
3304 void SlowPathLowering::LowerLoadSetter(GateRef gate) in LowerLoadSetter() argument
3306 Environment env(gate, circuit_, &builder_); in LowerLoadSetter()
3307 ASSERT(acc_.GetNumValueIn(gate) == 2); // 2: holder, plr in LowerLoadSetter()
3308 GateRef holder = acc_.GetValueIn(gate, 0); in LowerLoadSetter()
3309 GateRef propertyLookupResult = acc_.GetValueIn(gate, 1); in LowerLoadSetter()
3323 acc_.ReplaceGate(gate, Circuit::NullGate(), builder_.GetDepend(), setter); in LowerLoadSetter()