Fix some interactions between tiering and multi-core JIT (#40948)
authorKoundinya Veluri <kouvel@users.noreply.github.com>
Thu, 3 Sep 2020 18:31:32 +0000 (14:31 -0400)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 18:31:32 +0000 (11:31 -0700)
commit41fe0d36c7a13d054c335d741b8197a9722157d6
treee711e2cb83ffeb9f8e43acaaee9c0a1651d30196
parenteb364d68bb1945a4ad63f07f17a594a20810e0c8
Fix some interactions between tiering and multi-core JIT (#40948)

Fix some interactions between tiering and multi-core JIT

Issues:
- When a multi-core JIT profile includes a method for which prejitted code is available, and the method contains a loop, when playing back the profile the multi-core JIT of the method disables call counting for the method, then when the method gets called the prejitted code is used but does not get tiered up later. Also hits assertion failures.
- Tier 1 rejits also record the method in the multi-core JIT profile, another case where the above situation can occur

Fixes:
- Only record a method in the multi-core JIT profile for the default code version and only once for the code version
- When playing back a profile, don't disable call counting for a method immediately. Just record some info that may be used later when the method is actually gets called, if the multi-core jitted code gets used, to disable call counting if necessary.
12 files changed:
src/coreclr/src/vm/method.hpp
src/coreclr/src/vm/multicorejit.cpp
src/coreclr/src/vm/multicorejit.h
src/coreclr/src/vm/multicorejitimpl.h
src/coreclr/src/vm/multicorejitplayer.cpp
src/coreclr/src/vm/prestub.cpp
src/coreclr/tests/issues.targets
src/tests/baseservices/TieredCompilation/BasicTest.cs
src/tests/baseservices/TieredCompilation/BasicTestWithMcj.cs [new file with mode: 0644]
src/tests/baseservices/TieredCompilation/BasicTestWithMcj.csproj [new file with mode: 0644]
src/tests/baseservices/TieredCompilation/RunBasicTestWithMcj.cmd [new file with mode: 0644]
src/tests/baseservices/TieredCompilation/RunBasicTestWithMcj.sh [new file with mode: 0755]