diff --git a/src/absil/il.fs b/src/absil/il.fs index 211f6f5a01e6f3d0ecc5ec6ca1b48981f8c081cd..c10e80002cebed0b52e2e615009b5888618f7492 100755 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -3692,12 +3692,13 @@ type ILGlobals with mkILCustomAttribute this (mkSystemDiagnosticsDebuggableTypeRef this, [this.typ_Bool; this.typ_Bool], [ILAttribElem.Bool false; ILAttribElem.Bool jitOptimizerDisabled], []) - member this.mkDebuggableAttributeV2(ignoreSymbolStoreSequencePoints, jitOptimizerDisabled, enableEnC) = + member this.mkDebuggableAttributeV2(jitTracking, ignoreSymbolStoreSequencePoints, jitOptimizerDisabled, enableEnC) = let tref = mkSystemDiagnosticsDebuggableTypeRef this mkILCustomAttribute this (tref,[mkILNonGenericValueTy (tref_DebuggableAttribute_DebuggingModes this)], (* See System.Diagnostics.DebuggableAttribute.DebuggingModes *) - [ILAttribElem.Int32( (if jitOptimizerDisabled then 256 else 0) ||| + [ILAttribElem.Int32( (if jitTracking then 1 else 0) ||| + (if jitOptimizerDisabled then 256 else 0) ||| (if ignoreSymbolStoreSequencePoints then 2 else 0) ||| (if enableEnC then 4 else 0))],[]) diff --git a/src/absil/il.fsi b/src/absil/il.fsi index d61e3c24f5ae9edd40be118acb233b99cacc728b..6afa9974997441bf9ce76cc6dae15514be1f8bb4 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -1624,7 +1624,7 @@ type ILGlobals = with member mkDebuggableAttribute: bool (* disable JIT optimizations *) -> ILAttribute /// Some commonly used custom attibutes - member mkDebuggableAttributeV2 : bool (* ignoreSymbolStoreSequencePoints *) * bool (* disable JIT optimizations *) * bool (* enable EnC *) -> ILAttribute + member mkDebuggableAttributeV2 : bool (* jitTracking *) * bool (* ignoreSymbolStoreSequencePoints *) * bool (* disable JIT optimizations *) * bool (* enable EnC *) -> ILAttribute member mkCompilerGeneratedAttribute : unit -> ILAttribute member mkDebuggerNonUserCodeAttribute : unit -> ILAttribute member mkDebuggerStepThroughAttribute : unit -> ILAttribute diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index a0f9d1f4b2aa97626c97ded61a554c4c3090b3e2..7d8d9a47d7858847cd5faa4f1c59cd31cbac16d9 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2063,6 +2063,7 @@ type TcConfigBuilder = mutable onlyEssentialOptimizationData : bool mutable useOptimizationDataFile : bool mutable useSignatureDataFile : bool + mutable jitTracking : bool mutable portablePDB : bool mutable ignoreSymbolStoreSequencePoints : bool mutable internConstantStrings : bool @@ -2232,6 +2233,7 @@ type TcConfigBuilder = onlyEssentialOptimizationData = false useOptimizationDataFile = false useSignatureDataFile = false + jitTracking = true portablePDB = true ignoreSymbolStoreSequencePoints = false internConstantStrings = true @@ -2713,6 +2715,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) = member x.onlyEssentialOptimizationData = data.onlyEssentialOptimizationData member x.useOptimizationDataFile = data.useOptimizationDataFile member x.useSignatureDataFile = data.useSignatureDataFile + member x.jitTracking = data.jitTracking member x.portablePDB = data.portablePDB member x.ignoreSymbolStoreSequencePoints = data.ignoreSymbolStoreSequencePoints member x.internConstantStrings = data.internConstantStrings diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 28f5d73eb1390077559c1fd2feeb6295bb879d62..1d00cd89d98ef2523c80ded166b49ae5016f8b52 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -304,6 +304,7 @@ type TcConfigBuilder = mutable onlyEssentialOptimizationData : bool mutable useOptimizationDataFile : bool mutable useSignatureDataFile : bool + mutable jitTracking : bool mutable portablePDB : bool mutable ignoreSymbolStoreSequencePoints : bool mutable internConstantStrings : bool @@ -456,6 +457,7 @@ type TcConfig = member onlyEssentialOptimizationData : bool member useOptimizationDataFile : bool member useSignatureDataFile : bool + member jitTracking : bool member portablePDB : bool member ignoreSymbolStoreSequencePoints : bool member internConstantStrings : bool diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index b63775aa43889c6357feca0187d29266eadc9a89..ee965f6280d5bc5c4fca1aab2a38d13c0972bf9b 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -474,11 +474,11 @@ let SetDebugSwitch (tcConfigB : TcConfigBuilder) (dtype : string option) (s : Op match dtype with | Some(s) -> match s with - | "portable" -> tcConfigB.portablePDB <- true - | "pdbonly" -> tcConfigB.portablePDB <- false - | "full" -> tcConfigB.portablePDB <- false + | "portable" -> tcConfigB.portablePDB <- true ; tcConfigB.jitTracking <- false + | "pdbonly" -> tcConfigB.portablePDB <- false; tcConfigB.jitTracking <- false + | "full" -> tcConfigB.portablePDB <- false; tcConfigB.jitTracking <- true | _ -> error(Error(FSComp.SR.optsUnrecognizedDebugType(s), rangeCmdArgs)) - | None -> tcConfigB.portablePDB <- false + | None -> tcConfigB.portablePDB <- false; tcConfigB.jitTracking <- s = OptionSwitch.On; tcConfigB.debuginfo <- s = OptionSwitch.On let setOutFileName tcConfigB s = @@ -520,6 +520,7 @@ let PrintOptionInfo (tcConfigB:TcConfigBuilder) = printfn " doDetuple . . . . . . : %+A" tcConfigB.doDetuple printfn " doTLR . . . . . . . . : %+A" tcConfigB.doTLR printfn " doFinalSimplify. . . . : %+A" tcConfigB.doFinalSimplify + printfn " jitTracking . . . . . : %+A" tcConfigB.jitTracking printfn " portablePDB. . . . . . : %+A" tcConfigB.portablePDB printfn " debuginfo . . . . . . : %+A" tcConfigB.debuginfo printfn " resolutionEnvironment : %+A" tcConfigB.resolutionEnvironment @@ -910,8 +911,8 @@ let deprecatedFlagsFsc tcConfigB = cliRootFlag tcConfigB CompilerOption("jit-optimize", tagNone, OptionUnit (fun _ -> tcConfigB.optSettings <- { tcConfigB.optSettings with jitOptUser = Some true }), Some(DeprecatedCommandLineOptionNoDescription("--jit-optimize", rangeCmdArgs)), None) CompilerOption("no-jit-optimize", tagNone, OptionUnit (fun _ -> tcConfigB.optSettings <- { tcConfigB.optSettings with jitOptUser = Some false }), Some(DeprecatedCommandLineOptionNoDescription("--no-jit-optimize", rangeCmdArgs)), None) - CompilerOption("jit-tracking", tagNone, OptionUnit (fun _ -> () ), Some(DeprecatedCommandLineOptionNoDescription("--jit-tracking", rangeCmdArgs)), None) - CompilerOption("no-jit-tracking", tagNone, OptionUnit (fun _ -> () ), Some(DeprecatedCommandLineOptionNoDescription("--no-jit-tracking", rangeCmdArgs)), None) + CompilerOption("jit-tracking", tagNone, OptionUnit (fun _ -> (tcConfigB.jitTracking <- true) ), Some(DeprecatedCommandLineOptionNoDescription("--jit-tracking", rangeCmdArgs)), None) + CompilerOption("no-jit-tracking", tagNone, OptionUnit (fun _ -> (tcConfigB.jitTracking <- false) ), Some(DeprecatedCommandLineOptionNoDescription("--no-jit-tracking", rangeCmdArgs)), None) CompilerOption("progress", tagNone, OptionUnit (fun () -> progress := true), Some(DeprecatedCommandLineOptionNoDescription("--progress", rangeCmdArgs)), None) (compilingFsLibFlag tcConfigB) (compilingFsLib20Flag tcConfigB) diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index e17bad6956b43e8d42d200fa4b0ab768ca0d7293..4af99753d903610321a5817db10ea8fb7cd2c9b2 100755 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -1054,7 +1054,7 @@ module MainModuleBuilder = yield! iattrs yield! codegenResults.ilAssemAttrs if Option.isSome pdbfile then - yield (tcGlobals.ilg.mkDebuggableAttributeV2 (tcConfig.ignoreSymbolStoreSequencePoints, disableJitOptimizations, false (* enableEnC *) )) + yield (tcGlobals.ilg.mkDebuggableAttributeV2 (tcConfig.jitTracking, tcConfig.ignoreSymbolStoreSequencePoints, disableJitOptimizations, false (* enableEnC *) )) yield! reflectedDefinitionAttrs ] // Make the manifest of the assembly @@ -1068,6 +1068,7 @@ module MainModuleBuilder = Some { man with Version= Some ver CustomAttrs = manifestAttrs DisableJitOptimizations=disableJitOptimizations + JitTracking= tcConfig.jitTracking SecurityDecls=secDecls } let resources =