diff options
author | Steve <hez2010@outlook.com> | 2023-10-24 09:53:09 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-23 19:53:09 -0500 |
commit | c5ffd005980d69c049bea397a9a6294ea5a0504c (patch) | |
tree | c017f856800e8b6a224d7cae8b25f77f9c991129 /lib/compilers | |
parent | 7a31a135a012acc1dbcfa1e226ee9d1e16f42db4 (diff) | |
download | compiler-explorer-c5ffd005980d69c049bea397a9a6294ea5a0504c.tar.gz compiler-explorer-c5ffd005980d69c049bea397a9a6294ea5a0504c.zip |
Allow disabling diffable asm manually (#5585)gh-9185
When we see JitDisasmDiffable being set manually, we can stop
automatically emitting JitDisasmDiffable.
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/dotnet.ts | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/compilers/dotnet.ts b/lib/compilers/dotnet.ts index 2c9c9a0b4..a55a9a172 100644 --- a/lib/compilers/dotnet.ts +++ b/lib/compilers/dotnet.ts @@ -301,8 +301,6 @@ class DotNetCompiler extends BaseCompiler { const toolOptions: string[] = [ '--codegenopt', this.sdkMajorVersion === 6 ? 'NgenDisasm=*' : 'JitDisasm=*', - '--codegenopt', - this.sdkMajorVersion < 8 ? 'JitDiffableDasm=1' : 'JitDisasmDiffable=1', '--parallelism', '1', ]; const toolSwitches: string[] = []; @@ -315,9 +313,9 @@ class DotNetCompiler extends BaseCompiler { 'DOTNET_JitDisasm=*', 'DOTNET_JitDisasmAssemblies=CompilerExplorer', 'DOTNET_TieredCompilation=0', - this.sdkMajorVersion < 8 ? 'DOTNET_JitDiffableDasm=1' : 'DOTNET_JitDisasmDiffable=1', ]; let isAot = false; + let overrideDiffable = false; let isCrossgen2 = this.sdkMajorVersion === 6; while (options.length > 0) { @@ -338,6 +336,9 @@ class DotNetCompiler extends BaseCompiler { ) { continue; } + if (normalizedName === 'DOTNET_JITDIFFABLEDASM' || normalizedName === 'DOTNET_JITDISASMDIFFABLE') { + overrideDiffable = true; + } envVarFileContents.push(envVar); } } else if (currentOption === '-p' || currentOption === '--property') { @@ -357,10 +358,25 @@ class DotNetCompiler extends BaseCompiler { const value = options.shift(); if (value) { toolOptions.push(currentOption, value); + const normalizedValue = value.trim().toUpperCase(); + if ( + (currentOption === '--codegenopt' || currentOption === '--codegen-options') && + (normalizedValue.startsWith('JITDIFFABLEDASM=') || + normalizedValue.startsWith('JITDISASMDIFFABLE=')) + ) { + overrideDiffable = true; + } } } } + if (!overrideDiffable) { + toolOptions.push('--codegenopt', this.sdkMajorVersion < 8 ? 'JitDiffableDasm=1' : 'JitDisasmDiffable=1'); + envVarFileContents.push( + this.sdkMajorVersion < 8 ? 'DOTNET_JitDiffableDasm=1' : 'DOTNET_JitDisasmDiffable=1', + ); + } + this.setCompilerExecOptions(execOptions, programDir); let compilerResult; |