Preallocate jump stubs for dynamic methods (dotnet/coreclr#9883)
authorKoundinya Veluri <kouvel@microsoft.com>
Thu, 2 Mar 2017 04:52:15 +0000 (20:52 -0800)
committerGitHub <noreply@github.com>
Thu, 2 Mar 2017 04:52:15 +0000 (20:52 -0800)
commit3d2ae11d7744fe623f9f3b93822748bd78c61843
tree5da38258b79c96b076e52bfd6110dd507a0399a8
parenta9e59228565c0d328d6179491df61e2ee36c9d67
Preallocate jump stubs for dynamic methods (dotnet/coreclr#9883)

Preallocate jump stubs for dynamic methods

- This eliminates the possibility of running into an out-of-memory situation after compiling the method
- The temporary entry points block containing FixupPrecodes is extended for dynamic methods to include sufficient space for jump stubs
- When the target is too far for the FixupPrecode to encode a short relative jump, it instead does a short relative call or jump to the corresponding jump stub, which does an absolute jump to the target

Commit migrated from https://github.com/dotnet/coreclr/commit/4bafc1004b99013eaa58450e4f974dc7169b5af1
src/coreclr/src/vm/amd64/cgenamd64.cpp
src/coreclr/src/vm/amd64/cgencpu.h
src/coreclr/src/vm/crossgencompile.cpp
src/coreclr/src/vm/i386/stublinkerx86.cpp
src/coreclr/src/vm/i386/stublinkerx86.h
src/coreclr/src/vm/precode.cpp
src/coreclr/src/vm/precode.h
src/coreclr/tests/src/CoreMangLib/cti/system/reflection/emit/DynMethodJumpStubTests/DynMethodJumpStubTests.cs [new file with mode: 0644]
src/coreclr/tests/src/CoreMangLib/cti/system/reflection/emit/DynMethodJumpStubTests/DynMethodJumpStubTests.csproj [new file with mode: 0644]
src/coreclr/tests/testsUnsupportedOnARM32.txt
src/coreclr/tests/testsUnsupportedOutsideWindows.txt