-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[Wasm RyuJIT] Initial scaffolding for calls and helper calls #123044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
80f3865
8e40508
68e168d
9567c1f
131a1b5
adb7d50
d91d875
53f7b25
09189bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -511,6 +511,10 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) | |||||||||||||||||||||||||||||||||||||||||||||
| genCodeForStoreInd(treeNode->AsStoreInd()); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| case GT_CALL: | ||||||||||||||||||||||||||||||||||||||||||||||
| genCall(treeNode->AsCall()); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||
| #ifdef DEBUG | ||||||||||||||||||||||||||||||||||||||||||||||
| NYIRAW(GenTree::OpName(treeNode->OperGet())); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1016,45 +1020,61 @@ void CodeGen::genCodeForDivMod(GenTreeOp* treeNode) | |||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||
| void CodeGen::genCodeForConstant(GenTree* treeNode) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| instruction ins; | ||||||||||||||||||||||||||||||||||||||||||||||
| cnsval_ssize_t bits; | ||||||||||||||||||||||||||||||||||||||||||||||
| instruction ins = INS_none; | ||||||||||||||||||||||||||||||||||||||||||||||
| cnsval_ssize_t bits = 0; | ||||||||||||||||||||||||||||||||||||||||||||||
| var_types type = treeNode->TypeIs(TYP_REF, TYP_BYREF) ? TYP_I_IMPL : treeNode->TypeGet(); | ||||||||||||||||||||||||||||||||||||||||||||||
| static_assert(sizeof(cnsval_ssize_t) >= sizeof(double)); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| switch (type) | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTreeIntConCommon* icon = nullptr; | ||||||||||||||||||||||||||||||||||||||||||||||
| if ((type == TYP_INT) || (type == TYP_LONG)) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_INT: | ||||||||||||||||||||||||||||||||||||||||||||||
| icon = treeNode->AsIntConCommon(); | ||||||||||||||||||||||||||||||||||||||||||||||
| if (icon->ImmedValNeedsReloc(compiler)) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_i32_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTreeIntConCommon* con = treeNode->AsIntConCommon(); | ||||||||||||||||||||||||||||||||||||||||||||||
| bits = con->IntegralValue(); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| // WASM-TODO: Generate reloc for this handle | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_I_const; | ||||||||||||||||||||||||||||||||||||||||||||||
kg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||
| bits = 0; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_LONG: | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_i64_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTreeIntConCommon* con = treeNode->AsIntConCommon(); | ||||||||||||||||||||||||||||||||||||||||||||||
| bits = con->IntegralValue(); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_FLOAT: | ||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_f32_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTreeDblCon* con = treeNode->AsDblCon(); | ||||||||||||||||||||||||||||||||||||||||||||||
| double value = con->DconValue(); | ||||||||||||||||||||||||||||||||||||||||||||||
| memcpy(&bits, &value, sizeof(double)); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| bits = icon->IntegralValue(); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_DOUBLE: | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if (ins == INS_none) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| switch (type) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_f64_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTreeDblCon* con = treeNode->AsDblCon(); | ||||||||||||||||||||||||||||||||||||||||||||||
| double value = con->DconValue(); | ||||||||||||||||||||||||||||||||||||||||||||||
| memcpy(&bits, &value, sizeof(double)); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_INT: | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_i32_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| assert(((INT64)(INT32)bits) == bits); | ||||||||||||||||||||||||||||||||||||||||||||||
kg marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_LONG: | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_i64_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_FLOAT: | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_f32_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTreeDblCon* con = treeNode->AsDblCon(); | ||||||||||||||||||||||||||||||||||||||||||||||
| double value = con->DconValue(); | ||||||||||||||||||||||||||||||||||||||||||||||
| memcpy(&bits, &value, sizeof(double)); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| case TYP_DOUBLE: | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| ins = INS_f64_const; | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTreeDblCon* con = treeNode->AsDblCon(); | ||||||||||||||||||||||||||||||||||||||||||||||
| double value = con->DconValue(); | ||||||||||||||||||||||||||||||||||||||||||||||
| memcpy(&bits, &value, sizeof(double)); | ||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||
| unreached(); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||
| unreached(); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // The IF_ for the selected instruction, i.e. IF_F64, determines how these bits are emitted | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1373,6 +1393,187 @@ void CodeGen::genCodeForStoreInd(GenTreeStoreInd* tree) | |||||||||||||||||||||||||||||||||||||||||||||
| genUpdateLife(tree); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| //------------------------------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||
| // genCall: Produce code for a GT_CALL node | ||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||
| void CodeGen::genCall(GenTreeCall* call) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| if (call->NeedsNullCheck()) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| NYI_WASM("Insert nullchecks for calls that need it in lowering"); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| assert(!call->IsTailCall()); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| genCallInstruction(call); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Arguments need to be consumed. Something like: |
||||||||||||||||||||||||||||||||||||||||||||||
| genProduceReg(call); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| //------------------------------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||
| // genCallInstruction - Generate instructions necessary to transfer control to the call. | ||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||
| // Arguments: | ||||||||||||||||||||||||||||||||||||||||||||||
| // call - the GT_CALL node | ||||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||||
| void CodeGen::genCallInstruction(GenTreeCall* call) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| // Determine return value size(s). | ||||||||||||||||||||||||||||||||||||||||||||||
| const ReturnTypeDesc* pRetTypeDesc = call->GetReturnTypeDesc(); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1420
to
+1421
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Unused. |
||||||||||||||||||||||||||||||||||||||||||||||
| EmitCallParams params; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // unused values are of no interest to GC. | ||||||||||||||||||||||||||||||||||||||||||||||
| if (!call->IsUnusedValue()) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| if (call->HasMultiRegRetVal()) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| NYI_WASM("multi-reg return values"); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| assert(!call->TypeIs(TYP_STRUCT)); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if (call->TypeIs(TYP_REF)) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| params.retSize = EA_GCREF; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| else if (call->TypeIs(TYP_BYREF)) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| params.retSize = EA_BYREF; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1423
to
+1445
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Only relevant for GC info tracking in emitter which we don't need. |
||||||||||||||||||||||||||||||||||||||||||||||
| params.isJump = call->IsFastTailCall(); | ||||||||||||||||||||||||||||||||||||||||||||||
| params.hasAsyncRet = call->IsAsync(); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // We need to propagate the debug information to the call instruction, so we can emit | ||||||||||||||||||||||||||||||||||||||||||||||
| // an IL to native mapping record for the call, to support managed return value debugging. | ||||||||||||||||||||||||||||||||||||||||||||||
| // We don't want tail call helper calls that were converted from normal calls to get a record, | ||||||||||||||||||||||||||||||||||||||||||||||
| // so we skip this hash table lookup logic in that case. | ||||||||||||||||||||||||||||||||||||||||||||||
| if (compiler->opts.compDbgInfo && compiler->genCallSite2DebugInfoMap != nullptr && !call->IsTailCall()) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| DebugInfo di; | ||||||||||||||||||||||||||||||||||||||||||||||
| (void)compiler->genCallSite2DebugInfoMap->Lookup(call, &di); | ||||||||||||||||||||||||||||||||||||||||||||||
| params.debugInfo = di; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| #ifdef DEBUG | ||||||||||||||||||||||||||||||||||||||||||||||
| // Pass the call signature information down into the emitter so the emitter can associate | ||||||||||||||||||||||||||||||||||||||||||||||
| // native call sites with the signatures they were generated from. | ||||||||||||||||||||||||||||||||||||||||||||||
| if (!call->IsHelperCall()) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| params.sigInfo = call->callSig; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| #endif // DEBUG | ||||||||||||||||||||||||||||||||||||||||||||||
| GenTree* target = getCallTarget(call, ¶ms.methHnd); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if (target != nullptr) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| // A call target can not be a contained indirection | ||||||||||||||||||||||||||||||||||||||||||||||
| assert(!target->isContainedIndir()); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1472
to
+1474
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We can't contain anything for WASM calls. |
||||||||||||||||||||||||||||||||||||||||||||||
| // Codegen should have already evaluated our target node (last) and pushed it onto the stack, | ||||||||||||||||||||||||||||||||||||||||||||||
| // ready for call_indirect. Consume it. | ||||||||||||||||||||||||||||||||||||||||||||||
| genConsumeReg(target); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| params.callType = EC_INDIR_R; | ||||||||||||||||||||||||||||||||||||||||||||||
| genEmitCallWithCurrentGC(params); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| // If we have no target and this is a call with indirection cell then | ||||||||||||||||||||||||||||||||||||||||||||||
| // we do an optimization where we load the call address directly from | ||||||||||||||||||||||||||||||||||||||||||||||
| // the indirection cell instead of duplicating the tree. In BuildCall | ||||||||||||||||||||||||||||||||||||||||||||||
| // we ensure that get an extra register for the purpose. Note that for | ||||||||||||||||||||||||||||||||||||||||||||||
| // CFG the call might have changed to | ||||||||||||||||||||||||||||||||||||||||||||||
| // CORINFO_HELP_DISPATCH_INDIRECT_CALL in which case we still have the | ||||||||||||||||||||||||||||||||||||||||||||||
| // indirection cell but we should not try to optimize. | ||||||||||||||||||||||||||||||||||||||||||||||
| WellKnownArg indirectionCellArgKind = WellKnownArg::None; | ||||||||||||||||||||||||||||||||||||||||||||||
| if (!call->IsHelperCall(compiler, CORINFO_HELP_DISPATCH_INDIRECT_CALL)) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| indirectionCellArgKind = call->GetIndirectionCellArgKind(); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if (indirectionCellArgKind != WellKnownArg::None) | ||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part of the code doesn't look right. On native platforms:
Now, this is perfectly translatable to WASM as well, where we could have, say: Instead of: But the current code doesn't do this. I would propose to do this optimization in lowering with regular IR instead seeing as we don't have something like |
||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| assert(call->IsR2ROrVirtualStubRelativeIndir()); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| params.callType = EC_INDIR_R; | ||||||||||||||||||||||||||||||||||||||||||||||
| // params.ireg = targetAddrReg; | ||||||||||||||||||||||||||||||||||||||||||||||
| genEmitCallWithCurrentGC(params); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| // Generate a direct call to a non-virtual user defined or helper method | ||||||||||||||||||||||||||||||||||||||||||||||
| assert(call->IsHelperCall() || (call->gtCallType == CT_USER_FUNC)); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if (call->gtEntryPoint.addr != NULL) | ||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the calling convention, for user and helper calls we'll also be invoking them indirectly.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. I'm not clear on whether that means there won't be an addr filled in |
||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| NYI_WASM("Call with statically known address"); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| if (call->IsHelperCall()) | ||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||
| NYI_WASM("Call helper statically without indirection cell"); | ||||||||||||||||||||||||||||||||||||||||||||||
| CorInfoHelpFunc helperNum = compiler->eeGetHelperNum(params.methHnd); | ||||||||||||||||||||||||||||||||||||||||||||||
| noway_assert(helperNum != CORINFO_HELP_UNDEF); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| CORINFO_CONST_LOOKUP helperLookup = compiler->compGetHelperFtn(helperNum); | ||||||||||||||||||||||||||||||||||||||||||||||
| params.addr = helperLookup.addr; | ||||||||||||||||||||||||||||||||||||||||||||||
| assert(helperLookup.accessType == IAT_VALUE); | ||||||||||||||||||||||||||||||||||||||||||||||
kg marked this conversation as resolved.
Show resolved
Hide resolved
kg marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+1519
to
+1524
|
||||||||||||||||||||||||||||||||||||||||||||||
| CorInfoHelpFunc helperNum = compiler->eeGetHelperNum(params.methHnd); | |
| noway_assert(helperNum != CORINFO_HELP_UNDEF); | |
| CORINFO_CONST_LOOKUP helperLookup = compiler->compGetHelperFtn(helperNum); | |
| params.addr = helperLookup.addr; | |
| assert(helperLookup.accessType == IAT_VALUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // params.ireg = params.isJump ? rsGetRsvdReg() : REG_RA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // TODO-WASM: Just put helperFunction.addr in params.addr and do the indirect load | |
| // further down in the emitter for all IAT_PVALUE calls instead of doing it here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endif comment is incorrect. The opening directive at line 5641 is "#if !defined(TARGET_WASM)" so the comment should be "#endif // !TARGET_WASM" not "#endif // TARGET_WASM".