Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add support for reverse PInvoke callouts to the JIT - #4952

Merged
jkotas merged 1 commit into
dotnet:masterfrom
jkotas:reverse-callouts
May 14, 2016
Merged

jkotas merged 1 commit into
dotnet:masterfrom
jkotas:reverse-callouts

Conversation

@jkotas

@jkotas jkotas commented May 13, 2016

Copy link
Copy Markdown
Member

Call reverse pinvoke enter/exit callouts in reverse pinvoke method prolog/epilog. This is fixing dotnet/corert#611, no impact on CoreCLR.

@jkotas

jkotas commented May 13, 2016

Copy link
Copy Markdown
Member Author

cc @pgavlin @dotnet/jit-contrib

Comment thread src/jit/flowgraph.cpp
oneReturnStmtNode = tree;
}

fgInsertStmtAtEnd(genReturnBB, tree);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a minor cleanup on x86-only path, to make handling of callout insertion uniform for different cases.

Comment thread src/jit/flowgraph.cpp Outdated
TYP_VOID, 0,
gtNewArgList(tree));

assert(genReturnBB);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: assert(genReturnBB != nullptr)

@pgavlin

pgavlin commented May 13, 2016

Copy link
Copy Markdown

LGTM aside from a couple coding-convention-related nits.

Comment thread src/jit/flowgraph.cpp

// Add enter pinvoke exit callout at the start of prolog

tree = gtNewOperNode(GT_ADDR, TYP_I_IMPL, gtNewLclvNode(lvaReversePInvokeFrameVar, TYP_BLK));

@sivarv sivarv May 13, 2016 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Minor) if you prefer, variable declaration and initialization could be on the same line

GenTreePtr tree = gtNewOperNode(...);

@sivarv

sivarv commented May 13, 2016

Copy link
Copy Markdown

Looks good.

@briansull

Copy link
Copy Markdown

Looks good

@jkotas
jkotas force-pushed the reverse-callouts branch from 992d23f to 5645a3f Compare May 14, 2016 04:34
@jkotas
jkotas merged commit 2e30f2e into dotnet:master May 14, 2016
@jkotas
jkotas deleted the reverse-callouts branch May 22, 2016 22:54
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants