Skip to content
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

JIT: Switch config values to UTF8 #109418

Merged
merged 17 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitHostMaxSlabCache, W("JitHostMaxSlabCache"),
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitOptimizeType, W("JitOptimizeType"), 0 /* OPT_DEFAULT */, "")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitPrintInlinedMethods, W("JitPrintInlinedMethods"), 0, "")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitTelemetry, W("JitTelemetry"), 1, "If non-zero, gather JIT telemetry data")
RETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogFile, W("JitTimeLogFile"), "If set, gather JIT throughput data and write to this file.")
RETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogCsv, W("JitTimeLogCsv"), "If set, gather JIT throughput data and write to a CSV file. This mode must be used in internal retail builds.")
RETAIL_CONFIG_STRING_INFO(INTERNAL_JitFuncInfoLogFile, W("JitFuncInfoLogFile"), "If set, gather JIT function info and write to this file.")
CONFIG_DWORD_INFO(INTERNAL_JitVerificationDisable, W("JitVerificationDisable"), 0, "")
RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitLockWrite, W("JitLockWrite"), 0, "Force all volatile writes to be 'locked'")
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2962,9 +2962,6 @@ class ICorStaticInfo
CORINFO_EE_INFO *pEEInfoOut
) = 0;

// Returns name of the JIT timer log
virtual const char16_t *getJitTimeLogFilename() = 0;

/*********************************************************************************/
//
// Diagnostic methods
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/inc/corjithost.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ class ICorJitHost

// Return an integer config value for the given key, if any exists.
virtual int getIntConfigValue(
const WCHAR* name,
const char* name,
int defaultValue
) = 0;

// Return a string config value for the given key, if any exists.
virtual const WCHAR* getStringConfigValue(
const WCHAR* name
virtual const char* getStringConfigValue(
const char* name
) = 0;

// Free a string ConfigValue returned by the runtime.
// JITs using the getStringConfigValue query are required
// to return the string values to the runtime for deletion.
// This avoids leaking the memory in the JIT.
virtual void freeStringConfigValue(
const WCHAR* value
const char* value
) = 0;

// Allocate memory slab of the given size in bytes. The host is expected to pool
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/inc/icorjitinfoimpl_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,6 @@ bool runWithSPMIErrorTrap(
void getEEInfo(
CORINFO_EE_INFO* pEEInfoOut) override;

const char16_t* getJitTimeLogFilename() override;

mdMethodDef getMethodDefFromMethod(
CORINFO_METHOD_HANDLE hMethod) override;

Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID;
#define GUID_DEFINED
#endif // !GUID_DEFINED

constexpr GUID JITEEVersionIdentifier = { /* d0b6417d-14c1-491c-8819-339ca5c84422 */
0xd0b6417d,
0x14c1,
0x491c,
{0x88, 0x19, 0x33, 0x9c, 0xa5, 0xc8, 0x44, 0x22}
constexpr GUID JITEEVersionIdentifier = { /* e5f6fa37-6fdd-4668-85ce-ec8bbde9aab0 */
0xe5f6fa37,
0x6fdd,
0x4668,
{0x85, 0xce, 0xec, 0x8b, 0xbd, 0xe9, 0xaa, 0xb0}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/ICorJitInfo_names_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ DEF_CLR_API(getHFAType)
DEF_CLR_API(runWithErrorTrap)
DEF_CLR_API(runWithSPMIErrorTrap)
DEF_CLR_API(getEEInfo)
DEF_CLR_API(getJitTimeLogFilename)
DEF_CLR_API(getMethodDefFromMethod)
DEF_CLR_API(printMethodName)
DEF_CLR_API(getMethodNameFromMetadata)
Expand Down
8 changes: 0 additions & 8 deletions src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,14 +1181,6 @@ void WrapICorJitInfo::getEEInfo(
API_LEAVE(getEEInfo);
}

const char16_t* WrapICorJitInfo::getJitTimeLogFilename()
{
API_ENTER(getJitTimeLogFilename);
const char16_t* temp = wrapHnd->getJitTimeLogFilename();
API_LEAVE(getJitTimeLogFilename);
return temp;
}

mdMethodDef WrapICorJitInfo::getMethodDefFromMethod(
CORINFO_METHOD_HANDLE hMethod)
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/bitset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void BitSetSupport::BitSetOpCounter::RecordOp(BitSetSupport::Operation op)
{
if (OpOutputFile == nullptr)
{
OpOutputFile = fopen(m_fileName, "a");
OpOutputFile = fopen_utf8(m_fileName, "a");
}
fprintf(OpOutputFile, "@ %d total ops.\n", TotalOps);

Expand Down
10 changes: 4 additions & 6 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2259,14 +2259,12 @@ void CodeGen::genEmitUnwindDebugGCandEH()
BYTE* dumpAddr = (BYTE*)codePtrRW;
size_t dumpSize = finalHotCodeSize;

const WCHAR* rawHexCodeFilePath = JitConfig.JitRawHexCodeFile();
const char* rawHexCodeFilePath = JitConfig.JitRawHexCodeFile();
if (rawHexCodeFilePath)
{
FILE* hexDmpf;
errno_t ec = _wfopen_s(&hexDmpf, rawHexCodeFilePath, W("at")); // NOTE: file append mode
if (ec == 0)
FILE* hexDmpf = fopen_utf8(rawHexCodeFilePath, "at"); // NOTE: file append mode
if (hexDmpf != nullptr)
{
assert(hexDmpf);
hexDump(hexDmpf, dumpAddr, dumpSize);
fclose(hexDmpf);
}
Expand Down Expand Up @@ -6823,7 +6821,7 @@ void CodeGen::genReportRichDebugInfoToFile()
static CritSecObject s_critSect;
CritSecHolder holder(s_critSect);

FILE* file = _wfopen(JitConfig.WriteRichDebugInfoFile(), W("a"));
FILE* file = fopen(JitConfig.WriteRichDebugInfoFile(), "a");
if (file == nullptr)
{
return;
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/jit/codegenlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,7 @@ void CodeGen::genEmitterUnitTests()
return;
}

const WCHAR* unitTestSection = JitConfig.JitEmitUnitTestsSections();
const char* unitTestSection = JitConfig.JitEmitUnitTestsSections();

if (unitTestSection == nullptr)
{
Expand All @@ -2695,24 +2695,24 @@ void CodeGen::genEmitterUnitTests()
// Add NOPs at the start and end for easier script parsing.
instGen(INS_nop);

bool unitTestSectionAll = (u16_strstr(unitTestSection, W("all")) != nullptr);
AaronRobinsonMSFT marked this conversation as resolved.
Show resolved Hide resolved
bool unitTestSectionAll = (strstr(unitTestSection, "all") != nullptr);

#if defined(TARGET_AMD64)
if (unitTestSectionAll || (u16_strstr(unitTestSection, W("sse2")) != nullptr))
if (unitTestSectionAll || (strstr(unitTestSection, "sse2") != nullptr))
{
genAmd64EmitterUnitTestsSse2();
}

#elif defined(TARGET_ARM64)
if (unitTestSectionAll || (u16_strstr(unitTestSection, W("general")) != nullptr))
if (unitTestSectionAll || (strstr(unitTestSection, "general") != nullptr))
{
genArm64EmitterUnitTestsGeneral();
}
if (unitTestSectionAll || (u16_strstr(unitTestSection, W("advsimd")) != nullptr))
if (unitTestSectionAll || (strstr(unitTestSection, "advsimd") != nullptr))
{
genArm64EmitterUnitTestsAdvSimd();
}
if (unitTestSectionAll || (u16_strstr(unitTestSection, W("sve")) != nullptr))
if (unitTestSectionAll || (strstr(unitTestSection, "sve") != nullptr))
{
genArm64EmitterUnitTestsSve();
}
Expand Down
Loading
Loading