-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[browser][coreCLR] Support interpreter code resolution on portable entrypoint platforms #127370
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
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -959,32 +959,41 @@ BOOL StubPrecode::IsStubPrecodeByASM(PCODE addr) | |||||||||||||||||
|
|
||||||||||||||||||
| #endif // !FEATURE_PORTABLE_ENTRYPOINTS | ||||||||||||||||||
|
|
||||||||||||||||||
| TADDR GetInterpreterCodeFromInterpreterPrecodeIfPresent(TADDR codePointerMaybeInterpreterStub) | ||||||||||||||||||
| TADDR GetInterpreterCodeFromEntryPointIfPresent(TADDR entryPoint, MethodDesc* pMethodDesc) | ||||||||||||||||||
|
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. We should not need to pass in MethodDesc as an extra argument. You can get the methoddesc from the portable entrypoint by calling |
||||||||||||||||||
| { | ||||||||||||||||||
| CONTRACTL { | ||||||||||||||||||
| NOTHROW; | ||||||||||||||||||
| GC_NOTRIGGER; | ||||||||||||||||||
| SUPPORTS_DAC; | ||||||||||||||||||
| } CONTRACTL_END; | ||||||||||||||||||
|
|
||||||||||||||||||
| #if defined(FEATURE_INTERPRETER) && !defined(FEATURE_PORTABLE_ENTRYPOINTS) | ||||||||||||||||||
|
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.
Suggested change
|
||||||||||||||||||
| if (codePointerMaybeInterpreterStub == (TADDR)NULL) | ||||||||||||||||||
| if (entryPoint == (TADDR)NULL) | ||||||||||||||||||
| { | ||||||||||||||||||
| return (TADDR)NULL; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| RangeSection * pRS = ExecutionManager::FindCodeRange(codePointerMaybeInterpreterStub, ExecutionManager::GetScanFlags()); | ||||||||||||||||||
| RangeSection * pRS = ExecutionManager::FindCodeRange(entryPoint, ExecutionManager::GetScanFlags()); | ||||||||||||||||||
| if (pRS != NULL && pRS->_flags & RangeSection::RANGE_SECTION_RANGELIST) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (pRS->_pRangeList->GetCodeBlockKind() == STUB_CODE_BLOCK_STUBPRECODE) | ||||||||||||||||||
| { | ||||||||||||||||||
| if (dac_cast<PTR_StubPrecode>(PCODEToPINSTR(codePointerMaybeInterpreterStub))->GetType() == PRECODE_INTERPRETER) | ||||||||||||||||||
| if (dac_cast<PTR_StubPrecode>(PCODEToPINSTR(entryPoint))->GetType() == PRECODE_INTERPRETER) | ||||||||||||||||||
| { | ||||||||||||||||||
| codePointerMaybeInterpreterStub = (dac_cast<PTR_InterpreterPrecode>(PCODEToPINSTR(codePointerMaybeInterpreterStub)))->GetData()->ByteCodeAddr; | ||||||||||||||||||
| entryPoint = (dac_cast<PTR_InterpreterPrecode>(PCODEToPINSTR(entryPoint)))->GetData()->ByteCodeAddr; | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| #elif defined(FEATURE_INTERPRETER) && defined(FEATURE_PORTABLE_ENTRYPOINTS) | ||||||||||||||||||
| if (pMethodDesc != NULL) | ||||||||||||||||||
| { | ||||||||||||||||||
| PTR_InterpByteCodeStart pInterpCode = pMethodDesc->GetInterpreterCode(); | ||||||||||||||||||
| if (pInterpCode != NULL) | ||||||||||||||||||
| { | ||||||||||||||||||
| return dac_cast<TADDR>(pInterpCode); | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| #endif | ||||||||||||||||||
|
|
||||||||||||||||||
| return codePointerMaybeInterpreterStub; | ||||||||||||||||||
| return entryPoint; | ||||||||||||||||||
| } | ||||||||||||||||||
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.