1//
2// Copyright (c) Microsoft. All rights reserved.
3// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4//
5
6#include "standardpch.h"
7#include "icorjitcompiler.h"
8#include "icorjitinfo.h"
9
10interceptor_IEEMM* current_IEEMM = nullptr; // we want this to live beyond the scope of a single compileMethodCall
11
12CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* comp, /* IN */
13 struct CORINFO_METHOD_INFO* info, /* IN */
14 unsigned /* code:CorJitFlag */ flags, /* IN */
15 BYTE** nativeEntry, /* OUT */
16 ULONG* nativeSizeOfCode /* OUT */
17 )
18{
19 interceptor_ICJI our_ICorJitInfo;
20 our_ICorJitInfo.original_ICorJitInfo = comp;
21
22 if (current_IEEMM == nullptr)
23 current_IEEMM = new interceptor_IEEMM();
24 our_ICorJitInfo.mcs = mcs;
25
26 mcs->AddCall("compileMethod");
27 CorJitResult temp =
28 original_ICorJitCompiler->compileMethod(&our_ICorJitInfo, info, flags, nativeEntry, nativeSizeOfCode);
29
30 return temp;
31}
32
33void interceptor_ICJC::clearCache()
34{
35 mcs->AddCall("clearCache");
36 original_ICorJitCompiler->clearCache();
37}
38
39BOOL interceptor_ICJC::isCacheCleanupRequired()
40{
41 mcs->AddCall("isCacheCleanupRequired");
42 return original_ICorJitCompiler->isCacheCleanupRequired();
43}
44
45void interceptor_ICJC::ProcessShutdownWork(ICorStaticInfo* info)
46{
47 mcs->AddCall("ProcessShutdownWork");
48 original_ICorJitCompiler->ProcessShutdownWork(info);
49}
50
51void interceptor_ICJC::getVersionIdentifier(GUID* versionIdentifier /* OUT */)
52{
53 mcs->AddCall("getVersionIdentifier");
54 original_ICorJitCompiler->getVersionIdentifier(versionIdentifier);
55}
56
57unsigned interceptor_ICJC::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags)
58{
59 mcs->AddCall("getMaxIntrinsicSIMDVectorLength");
60 return original_ICorJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags);
61}
62
63void interceptor_ICJC::setRealJit(ICorJitCompiler* realJitCompiler)
64{
65 mcs->AddCall("setRealJit");
66 original_ICorJitCompiler->setRealJit(realJitCompiler);
67}
68