-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix for an issue with redeferral and stack func init in jitted code #2322
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
Conversation
| } | ||
| } | ||
|
|
||
| functionInfoOpnd = IR::IndirOpnd::New(functionProxyOpnd->AsRegOpnd(), Js::FunctionProxy::GetOffsetOfFunctionInfo(), TyMachReg, func); |
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.
@pleath - i was in two minds whether to directly use the nestedInfo for initializing functionInfo. I'm sure I have asked you this before, but do we expect functionInfo to be different from functionInfo->functionBodyImpl->functionInfo in some cases?
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.
No. Never. Once we allocate a FunctionInfo for a given user function, it never changes. So, yes, once we've loaded it from the nested array we can just reuse it throughout the code sequence.
| { | ||
| if (functionProxyOpnd->IsRegOpnd()) | ||
| { | ||
| functionInfoOpnd = IR::IndirOpnd::New(functionProxyOpnd->AsRegOpnd(), Js::FunctionProxy::GetOffsetOfFunctionInfo(), TyMachReg, func); |
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.
functionInfoOpnd [](start = 12, length = 16)
I am also wondering why we need re-check functionInfo from functionProxy, should it be the same?
|
@pleath please review |
2df25ca to
57e5e7e
Compare
|
You can now resolve the CI issues as described here: #2332 (comment) |
|
@dotnet-bot test this please |
|
Change checked in under another PR. |
For initializing a nested function object on the stack, the jitted code was using hardcoded field values and offsets from the function's functionProxy. This is not legal with redeferral as the proxy could have been a full function body and could be redeferred from the time its enclosing function was jitted to when it was executed. Redeferral will throw away the existing function body and reallocate a parseable function info which will then be set as function proxy on the function info. This reallocation means that the hardcoded values and offsets in the jitted code are no longer valid.
Fix is to not use compile time values but to jit indirections. We already do that for oop jit, just made in-proc jit also do the same.
This change is