diff options
194 files changed, 2415 insertions, 3083 deletions
diff --git a/BuildToolsVersion.txt b/BuildToolsVersion.txt index aba00a2c97..d6ea201305 100644 --- a/BuildToolsVersion.txt +++ b/BuildToolsVersion.txt @@ -1 +1 @@ -2.0.0-prerelease-02118-01 +2.0.0-prerelease-02126-01 diff --git a/Documentation/building/unix-test-instructions.md b/Documentation/building/unix-test-instructions.md index a6dd77afa7..60f324ea9b 100644 --- a/Documentation/building/unix-test-instructions.md +++ b/Documentation/building/unix-test-instructions.md @@ -40,6 +40,46 @@ Or >`coreclr/Tools/dotnetcli/dotnet coreclr/Tools/MSBuild.dll /maxcpucount coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj /p:__BuildType=Release /p:__BuildOS=OSX` +**Aarch64/armhf multiarch** + +For machines that have aarch64/armhf support, all the armhf packages will need to also be downloaded. Please note you will need to enable multiplatform support as well. Check with your distro provider or kernel options to see if this is supported. For simplicity, these instructions relate to aarch64 ubuntu enabling arm32 (hf) coreclr runs. + +Please make sure your device is running a 64 bit aarch64 kernel. + +``` +# Example output + +[ubuntu:~]: uname -a +Linux tegra-ubuntu 4.4.38-tegra #1 SMP PREEMPT Thu Jul 20 00:41:06 PDT 2017 aarch64 aarch64 aarch64 GNU/Linux + +``` + +``` +# Enable armhf multiplatform support +[ubuntu:~]: sudo dpkg --add-architecture armhf +[ubuntu:~]: sudo apt-get update + +[ubuntu:~]: sudo apt-get install libstdc++6:armhf +```` + +At this point you should be able to run a 32bit corerun. You can verify this by downloading and running a recently built arm32 coreclr. + +``` +[ubuntu:~]: wget https://ci.dot.net/job/dotnet_coreclr/job/master/job/armlb_cross_checked_ubuntu/lastSuccessfulBuild/artifact/*zip*/archive.zip --no-check-certificate +[ubuntu:~]: unzip archive.zip +[ubuntu:~]: chmod +x && ./archive/bin/Product/Linux.arm.Checked/corerun +Execute the specified managed assembly with the passed in arguments + +Options: +-c, --clr-path path to the libcoreclr.so and the managed CLR assemblies +``` + +Now download the coreclr armhf dependencies. + +``` +sudo apt-get install libunwind8:armhf libunwind8-dev:armhf libicu-dev:armhf liblttng-ust-dev:armhf libcurl4-openssl-dev:armhf libicu-dev:armhf libssl-dev uuid-dev:armhf libkrb5-dev:armhf +``` + **Running tests** The following instructions assume that on the Unix machine: diff --git a/Documentation/design-docs/arm64-jit-frame-layout.md b/Documentation/design-docs/arm64-jit-frame-layout.md new file mode 100644 index 0000000000..aff44930ed --- /dev/null +++ b/Documentation/design-docs/arm64-jit-frame-layout.md @@ -0,0 +1,362 @@ +# ARM64 JIT frame layout + +NOTE: This document was written before the code was written, and hasn't been +verified to match existing code. It refers to some documents that might not be +open source. + +This document describes the frame layout constraints and options for the ARM64 +JIT compiler. + +These frame layouts were taken from the "Windows ARM64 Exception Data" +specification, and expanded for use by the JIT. + +We will generate chained frames in most case (where we save the frame pointer on +the stack, and point the frame pointer (x29) at the saved frame pointer), +including all non-leaf frames, to support ETW stack walks. This is recommended +by the "Windows ARM64 ABI" document. See `ETW_EBP_FRAMED` in the JIT code. (We +currently don’t set `ETW_EBP_FRAMED` for ARM64.) + +For frames with alloca (dynamic stack allocation), we must use a frame pointer +that is fixed after the prolog (and before any alloca), so the stack pointer can +vary. The frame pointer will be used to access locals, parameters, etc., in the +fixed part of the frame. + +For non-alloca frames, the stack pointer is set and not changed at the end of +the prolog. In this case, the stack pointer can be used for all frame member +access. If a frame pointer is also created, the frame pointer can optionally be +used to access frame members if it gives an encoding advantage. + +We require a frame pointer for several cases: (1) functions with exception +handling establish a frame pointer so handler funclets can use the frame pointer +to access parent function locals, (2) for functions with P/Invoke, (3) for +certain GC encoding limitations or requirements, (4) for varargs functions, (5) +for Edit & Continue functions, (6) for debuggable code, and (7) for MinOpts. +This list might not be exhaustive. + +On ARM64, the stack pointer must remain 16 byte aligned at all times. + +The immediate offset addressing modes for various instructions have different +offset ranges. We want the frames to be designed to efficiently use the +available instruction encodings. Some important offset ranges for immediate +offset addressing include: + +* ldrb /ldrsb / strb, unsigned offset: 0 to 4095 +* ldrh /ldrsh / strh, unsigned offset: 0 to 8190, multiples of 2 (aligned halfwords) +* ldr / str (32-bit variant) / ldrsw, unsigned offset: 0 to 16380, multiple of 4 (aligned words) +* ldr / str (64-bit variant), unsigned offset: 0 to 32760, multiple of 8 (aligned doublewords) +* ldp / stp (32-bit variant), pre-indexed, post-indexed, and signed offset: -256 to 252, multiple of 4 +* ldp / stp (64-bit variant), pre-indexed, post-indexed, and signed offset: -512 to 504, multiple of 8 +* ldurb / ldursb / ldurh / ldursb / ldur (32-bit and 64-bit variants) / ldursw / sturb / sturh / stur (32-bit and 64-bit variants): -256 to 255 +* ldr / ldrh / ldrb / ldrsw / ldrsh / ldrsb / str / strh / strb pre-indexed/post-indexed: -256 to 255 (unscaled) +* add / sub (immediate): 0 to 4095, or with 12 bit left shift: 4096 to 16777215 (multiples of 4096). + * Thus, to construct a frame larger than 4095 using `sub`, we could use one "small" sub, or one "large" / shifted sub followed by a single "small" / unshifted sub. The reverse applies for tearing down the frame. + * Note that we need to probe the stack for stack overflow when allocating large frames. + +Most of the offset modes (that aren't pre-indexed or post-indexed) are unsigned. +Thus, we want the frame pointer, if it exists, to be at a lower address than the +objects on the frame (with the small caveat that we could use the limited +negative offset addressing capability of the `ldu*` / `stu*` unscaled modes). +The stack pointer will point to the first slot of the outgoing stack argument +area, if any, even for alloca functions (thus, the alloca operation needs to +"move" the outgoing stack argument space down), so filling the outgoing stack +argument space will always use SP. + +For extremely large frames (e.g., frames larger than 32760, certainly, but +probably for any frame larger than 4095), we need to globally reserve and use an +additional register to construct an offset, and then use a register offset mode +(see `compRsvdRegCheck()`). It is unlikely we could accurately allocate a +register for this purpose at all points where it will be actually necessary. + +In general, we want to put objects close to the stack or frame pointer, to take +advantage of the limited addressing offsets described above, especially if we +use the ldp/stp instructions. If we do end up using ldp/stp, we will want to +consider pointing the frame pointer somewhere in the middle of the locals (or +other objects) in the frame, to maximize the limited, but signed, offset range. +For example, saved callee-saved registers should be far from the frame/stack +pointer, since they are going to be saved once and loaded once, whereas +locals/temps are expected to be used more frequently. + +For variadic (varargs) functions, and possibly for functions with incoming +struct register arguments, it is easier to put the arguments on the stack in the +prolog such that the entire argument list is contiguous in memory, including +both the register and stack arguments. On ARM32, we used the "prespill" concept, +where we used a register mask "push" instruction for the "prespilled" registers. +Note that on ARM32, structs could be split between incoming argument registers +and the stack. On ARM64, this is not true. A struct <=16 bytes is passed in one +or two consecutive registers, or entirely on the stack. Structs >16 bytes are +passed by reference (the caller allocates space for the struct in its frame, +copies the output struct value there, and passes a pointer to that space). On +ARM64, instead of prespill we can instead just allocate the appropriate stack +space, and use `str` or `stp` to save the incoming register arguments to the +reserved space. + +To support GC "return address hijacking", we need to, for all functions, save +the return address to the stack in the prolog, and load it from the stack in the +epilog before returning. We must do this so the VM can change the return address +stored on the stack to cause the function to return to a special location to +support suspension. + +Below are some sample frame layouts. In these examples, `#localsz` is the byte +size of the locals/temps area (everything except callee-saved registers and the +outgoing argument space, but including space to save FP and SP), `#outsz` is the +outgoing stack parameter size, and `#framesz` is the size of the entire stack +(meaning `#localsz` + `#outsz` + callee-saved register size, but not including +any alloca size). + +Note that in these frame layouts, the saved `<fp,lr>` pair is not contiguous +with the rest of the callee-saved registers. This is because for chained +functions, the frame pointer must point at the saved frame pointer. Also, if we +are to use the positive immediate offset addressing modes, we need the frame +pointer to be lowest on the stack. In addition, we want the callee-saved +registers to be "far away", especially for large frames where an immediate +offset addressing mode won’t be able to reach them, as we want locals to be +closer than the callee-saved registers. + +To maintain 16 byte stack alignment, we may need to add alignment padding bytes. +Ideally we design the frame such that we only need at most 15 alignment bytes. +Since our frame objects are minimally 4 bytes (or maybe even 8 bytes?) in size, +we should only need maximally 12 (or 8?) alignment bytes. Note that every time +the stack pointer is changed, it needs to be by 16 bytes, so every time we +adjust the stack might require alignment. (Technically, it might be the case +that you can change the stack pointer by values not a multiple of 16, but you +certainly can’t load or store from non-16-byte-aligned SP values. Also, the +ARM64 unwind code `alloc_s` is 8 byte scaled, so it can only handle multiple of +8 byte changes to SP.) Note that ldp/stp can be given an 8-byte aligned address +when reading/writing 8-byte register pairs, even though the total data transfer +for the instruction is 16 bytes. + +## 1. chained, `#framesz <= 512`, `#outsz = 0` + +``` +stp fp,lr,[sp,-#framesz]! // pre-indexed, save <fp,lr> at bottom of frame +mov fp,sp // fp points to bottom of stack +stp r19,r20,[sp,#framesz - 96] // save INT pair +stp d8,d9,[sp,#framesz - 80] // save FP pair +stp r0,r1,[sp,#framesz - 64] // home params (optional) +stp r2,r3,[sp,#framesz - 48] +stp r4,r5,[sp,#framesz - 32] +stp r6,r7,[sp,#framesz - 16] +``` + +8 instructions (for this set of registers saves, used in most examples given +here). There is a single SP adjustment, that is folded into the `<fp,lr>` +register pair store. Works with alloca. Frame access is via SP or FP. + +We will use this for most frames with no outgoing stack arguments (which is +likely to be the 99% case, since we have 8 integer register arguments and 8 +floating-point register arguments). + +Here is a similar example, but with an odd number of saved registers: + +``` +stp fp,lr,[sp,-#framesz]! // pre-indexed, save <fp,lr> at bottom of frame +mov fp,sp // fp points to bottom of stack +stp r19,r20,[sp,#framesz - 24] // save INT pair +str r21,[sp,#framesz - 8] // save INT reg +``` + +Note that the saved registers are "packed" against the "caller SP" value (that +is, they are at the "top" of the downward-growing stack). Any alignment is lower +than the callee-saved registers. + +For leaf functions, we don't need to save the callee-save registers, so we will +have, for chained function (such as functions with alloca): + +``` +stp fp,lr,[sp,-#framesz]! // pre-indexed, save <fp,lr> at bottom of frame +mov fp,sp // fp points to bottom of stack +``` + +## 2. chained, `#framesz - 16 <= 512`, `#outsz != 0` + +``` +sub sp,sp,#framesz +stp fp,lr,[sp,#outsz] // pre-indexed, save <fp,lr> +add fp,sp,#outsz // fp points to bottom of local area +stp r19,r20,[sp,#framez - 96] // save INT pair +stp d8,d9,[sp,#framesz - 80] // save FP pair +stp r0,r1,[sp,#framesz - 64] // home params (optional) +stp r2,r3,[sp,#framesz - 48] +stp r4,r5,[sp,#framesz - 32] +stp r6,r7,[sp,#framesz - 16] +``` + +9 instructions. There is a single SP adjustment. It isn’t folded into the +`<fp,lr>` register pair store because the SP adjustment points the new SP at the +outgoing argument space, and the `<fp,lr>` pair needs to be stored above that. +Works with alloca. Frame access is via SP or FP. + +We will use this for most non-leaf frames with outgoing argument stack space. + +As for #1, if there is an odd number of callee-save registers, they can easily +be put adjacent to the caller SP (at the "top" of the stack), so any alignment +bytes will be in the locals area. + +## 3. chained, `(#framesz - #outsz) <= 512`, `#outsz != 0`. + +Different from #2, as `#framesz` is too big. Might be useful for `#framesz > +512` but `(#framesz - #outsz) <= 512`. + +``` +stp fp,lr,[sp,-(#localsz + 96)]! // pre-indexed, save <fp,lr> above outgoing argument space +mov fp,sp // fp points to bottom of stack +stp r19,r20,[sp,#localsz + 80] // save INT pair +stp d8,d9,[sp,#localsz + 64] // save FP pair +stp r0,r1,[sp,#localsz + 48] // home params (optional) +stp r2,r3,[sp,#localsz + 32] +stp r4,r5,[sp,#localsz + 16] +stp r6,r7,[sp,#localsz] +sub sp,sp,#outsz +``` + +9 instructions. There are 2 SP adjustments. Works with alloca. Frame access is +via SP or FP. + +We will not use this. + +## 4. chained, `#localsz <= 512` + +``` +stp r19,r20,[sp,#-96]! // pre-indexed, save incoming 1st FP/INT pair +stp d8,d9,[sp,#16] // save incoming floating-point regs (optional) +stp r0,r1,[sp,#32] // home params (optional) +stp r2,r3,[sp,#48] +stp r4,r5,[sp,#64] +stp r6,r7,[sp,#80] +stp fp,lr,[sp,-#localsz]! // save <fp,lr> at bottom of local area +mov fp,sp // fp points to bottom of local area +sub sp,sp,#outsz // if #outsz != 0 +``` + +9 instructions. There are 3 SP adjustments: to set SP for saving callee-saved +registers, for allocating the local space (and storing `<fp,lr>`), and for +allocating the outgoing argument space. Works with alloca. Frame access is via +SP or FP. + +We likely will not use this. Instead, we will use #2 or #5/#6. + +## 5. chained, `#localsz > 512`, `#outsz <= 512`. + +Another case with an unlikely mix of sizes. + +``` +stp r19,r20,[sp,#-96]! // pre-indexed, save incoming 1st FP/INT pair +stp d8,d9,[sp,#16] // save in FP regs (optional) +stp r0,r1,[sp,#32] // home params (optional) +stp r2,r3,[sp,#48] +stp r4,r5,[sp,#64] +stp r6,r7,[sp,#80] +sub sp,sp,#localsz+#outsz // allocate remaining frame +stp fp,lr,[sp,#outsz] // save <fp,lr> at bottom of local area +add fp,sp,#outsz // fp points to the bottom of local area +``` + +9 instructions. There are 2 SP adjustments. Works with alloca. Frame access is +via SP or FP. + +We will use this. + +To handle an odd number of callee-saved registers with this layout, we would +need to insert alignment bytes higher in the stack. E.g.: + +``` +str r19,[sp,#-16]! // pre-indexed, save incoming 1st INT reg +sub sp,sp,#localsz + #outsz // allocate remaining frame +stp fp,lr,[sp,#outsz] // save <fp,lr> at bottom of local area +add fp,sp,#outsz // fp points to the bottom of local area +``` + +This is not ideal, since if `#localsz + #outsz` is not 16 byte aligned, it would +need to be padded, and we would end up with two different paddings that might +not be necessary. An alternative would be: + +``` +sub sp,sp,#16 +str r19,[sp,#8] // Save register at the top +sub sp,sp,#localsz + #outsz // allocate remaining frame. Note that there are 8 bytes of padding from the first "sub sp" that can be subtracted from "#localsz + #outsz" before padding them up to 16. +stp fp,lr,[sp,#outsz] // save <fp,lr> at bottom of local area +add fp,sp,#outsz // fp points to the bottom of local area +``` + +## 6. chained, `#localsz > 512`, `#outsz > 512` + +The most general case. It is a simple generalization of #5. `sub sp` (or a pair +of `sub sp` for really large sizes) is used for both sizes that might overflow +the pre-indexed addressing mode offset limit. + +``` +stp r19,r20,[sp,#-96]! // pre-indexed, save incoming 1st FP/INT pair +stp d8,d9,[sp,#16] // save in FP regs (optional) +stp r0,r1,[sp,#32] // home params (optional) +stp r2,r3,[sp,#48] +stp r4,r5,[sp,#64] +stp r6,r7,[sp,#80] +sub sp,sp,#localsz // allocate locals space +stp fp,lr,[sp] // save <fp,lr> at bottom of local area +mov fp,sp // fp points to the bottom of local area +sub sp,sp,#outsz // allocate outgoing argument space +``` + +10 instructions. There are 3 SP adjustments. Works with alloca. Frame access is +via SP or FP. + +We will use this. + +## 7. chained, any size frame, but no alloca. + +``` +stp fp,lr,[sp,#-112]! // pre-indexed, save <fp,lr> +mov fp,sp // fp points to top of local area +stp r19,r20,[sp,#16] // save INT pair +stp d8,d9,[sp,#32] // save FP pair +stp r0,r1,[sp,#48] // home params (optional) +stp r2,r3,[sp,#64] +stp r4,r5,[sp,#80] +stp r6,r7,[sp,#96] +sub sp,sp,#framesz - 112 // allocate the remaining local area +``` + +9 instructions. There are 2 SP adjustments. The frame pointer FP points to the +top of the local area, which means this is not suitable for frames with alloca. +All frame access will be SP-relative. #1 and #2 are better for small frames, or +with alloca. + +## 8. Unchained. No alloca. + +``` +stp r19,r20,[sp,#-80]! // pre-indexed, save incoming 1st FP/INT pair +stp r21,r22,[sp,#16] // ... +stp r23,lr,[sp,#32] // save last Int reg and lr +stp d8,d9,[sp,#48] // save FP pair (optional) +stp d10,d11,[sp,#64] // ... +sub sp,sp,#framesz-80 // allocate the remaining local area + +Or, with even number saved Int registers. Note that here we leave 8 bytes of +padding at the highest address in the frame. We might choose to use a different +format, to put the padding in the locals area, where it might be absorbed by the +locals. + +stp r19,r20,[sp,-80]! // pre-indexed, save in 1st FP/INT reg-pair +stp r21,r22,[sp,16] // ... +str lr,[sp, 32] // save lr +stp d8,d9,[sp, 40] // save FP reg-pair (optional) +stp d10,d11,[sp,56] // ... +sub sp,#framesz - 80 // allocate the remaining local area +``` + +All locals are accessed based on SP. FP points to the previous frame. + +For optimization purpose, FP can be put at any position in locals area to +provide a better coverage for "reg-pair" and pre-/post-indexed offset addressing +mode. Locals below frame pointers can be accessed based on SP. + +## 9. The minimal leaf frame + +``` +str lr,[sp,#-16]! // pre-indexed, save lr, align stack to 16 +... function body ... +ldr lr,[sp],#16 // epilog: reverse prolog, load return address +ret lr +``` + +Note that in this case, there is 8 bytes of alignment above the save of LR. diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json b/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json index 85214e9736..7b9f607b10 100644 --- a/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json +++ b/buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json @@ -502,11 +502,11 @@ "quality": "definition", "queue": { "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" }, - "id": 36, - "name": "DotNet-Build" + "id": 330, + "name": "DotNetCore-Build" }, "path": "\\", "type": "build", diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Linux.json b/buildpipeline/DotNet-CoreClr-Trusted-Linux.json index 2877ab8ce8..58fe12cba0 100644 --- a/buildpipeline/DotNet-CoreClr-Trusted-Linux.json +++ b/buildpipeline/DotNet-CoreClr-Trusted-Linux.json @@ -466,11 +466,11 @@ "quality": "definition", "queue": { "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" }, - "id": 36, - "name": "DotNet-Build" + "id": 330, + "name": "DotNetCore-Build" }, "path": "\\", "type": "build", diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json b/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json index 3b71cf41eb..18dc1aaa02 100644 --- a/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json +++ b/buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json @@ -359,11 +359,11 @@ "quality": "definition", "queue": { "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" }, - "id": 36, - "name": "DotNet-Build" + "id": 330, + "name": "DotNetCore-Build" }, "path": "\\", "type": "build", diff --git a/buildpipeline/DotNet-CoreClr-Trusted-Windows.json b/buildpipeline/DotNet-CoreClr-Trusted-Windows.json index ac7e3850ac..4e73ab7679 100644 --- a/buildpipeline/DotNet-CoreClr-Trusted-Windows.json +++ b/buildpipeline/DotNet-CoreClr-Trusted-Windows.json @@ -348,11 +348,11 @@ "quality": "definition", "queue": { "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" }, - "id": 36, - "name": "DotNet-Build" + "id": 330, + "name": "DotNetCore-Build" }, "path": "\\", "type": "build", diff --git a/buildpipeline/DotNet-Trusted-Publish-Symbols.json b/buildpipeline/DotNet-Trusted-Publish-Symbols.json index 9686780eb8..b16d47372f 100644 --- a/buildpipeline/DotNet-Trusted-Publish-Symbols.json +++ b/buildpipeline/DotNet-Trusted-Publish-Symbols.json @@ -250,11 +250,11 @@ "processParameters": {}, "quality": "definition", "queue": { - "id": 36, - "name": "DotNet-Build", + "id": 330, + "name": "DotNetCore-Build", "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" } }, "id": -1, diff --git a/buildpipeline/DotNet-Trusted-Publish.json b/buildpipeline/DotNet-Trusted-Publish.json index 795fb792e6..01c1205089 100644 --- a/buildpipeline/DotNet-Trusted-Publish.json +++ b/buildpipeline/DotNet-Trusted-Publish.json @@ -656,11 +656,11 @@ "quality": "definition", "queue": { "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" }, - "id": 36, - "name": "DotNet-Build" + "id": 330, + "name": "DotNetCore-Build" }, "path": "\\", "type": "build", diff --git a/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json b/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json index 6901c362e6..6baa190aef 100644 --- a/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json +++ b/buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json @@ -296,11 +296,11 @@ "quality": "definition", "queue": { "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" }, - "id": 36, - "name": "DotNet-Build" + "id": 330, + "name": "DotNetCore-Build" }, "path": "\\", "type": "build", diff --git a/buildpipeline/security/DotNet-CoreClr-Security-Windows.json b/buildpipeline/security/DotNet-CoreClr-Security-Windows.json index 4a27f1c2fc..9759a87bb3 100644 --- a/buildpipeline/security/DotNet-CoreClr-Security-Windows.json +++ b/buildpipeline/security/DotNet-CoreClr-Security-Windows.json @@ -555,11 +555,11 @@ "imageUrl": "https://devdiv.visualstudio.com/_api/_common/identityImage?id=9d5fdf9f-36b6-4d0c-a12e-2737a673af94" }, "queue": { - "id": 36, - "name": "DotNet-Build", + "id": 330, + "name": "DotNetCore-Build", "pool": { - "id": 39, - "name": "DotNet-Build" + "id": 97, + "name": "DotNetCore-Build" } }, "id": 6389, diff --git a/dependencies.props b/dependencies.props index fca42d74c5..07d0b03753 100644 --- a/dependencies.props +++ b/dependencies.props @@ -13,22 +13,22 @@ <!-- Source of truth for dependency tooling: the commit hash of the dotnet/versions master branch as of the last auto-upgrade. --> <PropertyGroup> - <CoreFxCurrentRef>075b515e3dfb615b45182c033af48abed349eea5</CoreFxCurrentRef> - <CoreClrCurrentRef>075b515e3dfb615b45182c033af48abed349eea5</CoreClrCurrentRef> - <BuildToolsCurrentRef>075b515e3dfb615b45182c033af48abed349eea5</BuildToolsCurrentRef> - <PgoDataCurrentRef>20937e8603d9d6ecd6952d7db3bee390137b338e</PgoDataCurrentRef> + <CoreFxCurrentRef>36a82eaf3ebf7ce0357648cd8bd77a511ad3b814</CoreFxCurrentRef> + <CoreClrCurrentRef>b18c2bda8803d708746b4d0cde65be5f6d54bf0d</CoreClrCurrentRef> + <BuildToolsCurrentRef>b18c2bda8803d708746b4d0cde65be5f6d54bf0d</BuildToolsCurrentRef> + <PgoDataCurrentRef>b18c2bda8803d708746b4d0cde65be5f6d54bf0d</PgoDataCurrentRef> </PropertyGroup> <!-- Auto-upgraded properties for each build info dependency. --> <PropertyGroup> - <CoreFxPackageVersion>4.5.0-preview1-25818-01</CoreFxPackageVersion> - <PlatformPackageVersion>2.1.0-preview1-25818-01</PlatformPackageVersion> - <PgoDataPackageVersion>99.99.99-master-20171012-0049</PgoDataPackageVersion> + <CoreFxPackageVersion>4.5.0-preview1-25825-08</CoreFxPackageVersion> + <PlatformPackageVersion>2.1.0-preview1-25825-08</PlatformPackageVersion> + <PgoDataPackageVersion>99.99.99-master-20171026-0034</PgoDataPackageVersion> </PropertyGroup> <!-- Full package version strings that are used in other parts of the build. --> <PropertyGroup> - <CoreClrPackageVersion>2.1.0-preview1-25818-02</CoreClrPackageVersion> + <CoreClrPackageVersion>2.1.0-preview1-25826-01</CoreClrPackageVersion> <XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion> <XUnitConsoleNetCoreVersion>1.0.2-prerelease-00177</XUnitConsoleNetCoreVersion> <XUnitPerformanceApiVersion>1.0.0-beta-build0007</XUnitPerformanceApiVersion> @@ -36,6 +36,12 @@ <VCRuntimeVersion>1.2.0</VCRuntimeVersion> </PropertyGroup> + <!-- Package versions used as toolsets --> + <PropertyGroup> + <FeedTasksPackage>Microsoft.DotNet.Build.Tasks.Feed</FeedTasksPackage> + <FeedTasksPackageVersion>1.0.0-prerelease-02126-01</FeedTasksPackageVersion> + </PropertyGroup> + <!-- Package dependency verification/auto-upgrade configuration. --> <PropertyGroup> <BaseDotNetBuildInfo>build-info/dotnet/</BaseDotNetBuildInfo> @@ -85,6 +91,11 @@ <Path>$(MSBuildThisFileDirectory)BuildToolsVersion.txt</Path> <PackageId>Microsoft.DotNet.BuildTools</PackageId> </UpdateStep> + <XmlUpdateStep Include="BuildTools"> + <Path>$(MSBuildThisFileFullPath)</Path> + <ElementName>FeedTasksPackageVersion</ElementName> + <PackageId>$(FeedTasksPackage)</PackageId> + </XmlUpdateStep> <XmlUpdateStep Include="PgoData"> <Path>$(MSBuildThisFileFullPath)</Path> <ElementName>PgoDataPackageVersion</ElementName> diff --git a/init-tools.cmd b/init-tools.cmd index 4793df0e79..c99d743c20 100644 --- a/init-tools.cmd +++ b/init-tools.cmd @@ -43,10 +43,10 @@ if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%" set DOTNET_ZIP_NAME=dotnet-sdk-%DOTNET_VERSION%-win-x64.zip set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME% set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME% -echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%" +echo %__MsgPrefix%Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%" powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> "%INIT_TOOLS_LOG%" if NOT exist "%DOTNET_LOCAL_PATH%" ( - echo ERROR: Could not install dotnet cli correctly. 1>&2 + echo %__MsgPrefix%ERROR: Could not install dotnet cli correctly. 1>&2 goto :error ) @@ -54,10 +54,10 @@ if NOT exist "%DOTNET_LOCAL_PATH%" ( if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore echo %__MsgPrefix%Restoring BuildTools version %BUILDTOOLS_VERSION%... -echo %__MsgPrefix%Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%" -call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%" +echo %__MsgPrefix%Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% >> "%INIT_TOOLS_LOG%" +call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% >> "%INIT_TOOLS_LOG%" if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" ( - echo ERROR: Could not restore build tools correctly. 1>&2 + %__MsgPrefix%echo ERROR: Could not restore build tools correctly. 1>&2 goto :error ) @@ -81,6 +81,6 @@ echo %__MsgPrefix%Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_V exit /b 0 :error -echo Please check the detailed log that follows. 1>&2 +echo %__MsgPrefix%Please check the detailed log that follows. 1>&2 type "%INIT_TOOLS_LOG%" 1>&2 exit /b 1
\ No newline at end of file diff --git a/init-tools.msbuild b/init-tools.msbuild index c8eaf702c7..3bc1f3c8b7 100644 --- a/init-tools.msbuild +++ b/init-tools.msbuild @@ -4,10 +4,9 @@ <EnableDefaultItems>false</EnableDefaultItems> <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> <BaseIntermediateOutputPath>$(ToolsDir)/$(BuildToolsPackageVersion)</BaseIntermediateOutputPath> - <FeedTasksVersion>1.0.0-prerelease-02111-01</FeedTasksVersion> - <FeedTasksPackage>microsoft.dotnet.build.tasks.feed</FeedTasksPackage> <PackageTargetFallback>$(PackageTargetFallback);netframework</PackageTargetFallback> </PropertyGroup> + <Import Project="dependencies.props" /> <ItemGroup> <PackageReference Include="microsoft.dotnet.buildtools"> <Version>$(BuildToolsPackageVersion)</Version> @@ -16,17 +15,7 @@ <Version>1.0.4-prerelease</Version> </PackageReference> <PackageReference Include="$(FeedTasksPackage)"> - <Version>$(FeedTasksVersion)</Version> + <Version>$(FeedTasksPackageVersion)</Version> </PackageReference> </ItemGroup> - - <Target Name="CopyFeedTasks" AfterTargets="Restore" > - <ItemGroup> - <FilesToCopy Include="$(MSBuildThisFileDirectory)\packages\$(FeedTasksPackage)\$(FeedTasksVersion)\lib\**\*.*"/> - </ItemGroup> - - <Copy SourceFiles="@(FilesToCopy)" - DestinationFiles="@(FilesToCopy->'$(ToolsDir)\$(FeedTasksPackage)\%(RecursiveDir)%(Filename)%(Extension)')" - /> - </Target> </Project>
\ No newline at end of file diff --git a/init-tools.sh b/init-tools.sh index 00b096199e..f712514262 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -119,8 +119,8 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then else if [ ! -e $__BUILD_TOOLS_PATH ]; then echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..." - echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION /p:ToolsDir=$__TOOLRUNTIME_DIR" >> $__init_tools_log - $__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION /p:ToolsDir=$__TOOLRUNTIME_DIR >> $__init_tools_log + echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION" >> $__init_tools_log + $__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION >> $__init_tools_log if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: Could not restore build tools correctly." 1>&2 display_error_message diff --git a/netci.groovy b/netci.groovy index 5bbc2fcecd..f1e00ddb40 100755 --- a/netci.groovy +++ b/netci.groovy @@ -721,13 +721,13 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os, } def arm64Users = [ - 'adiaaida', 'AndyAyersMS', 'briansull', 'BruceForstall', 'CarolEidt', 'cmckinsey', 'erozenfeld', + 'janvorli', 'jashook', 'JosephTremoulet', 'pgodeq', @@ -1126,7 +1126,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os, } break case 'Tizen': - if (architecture == 'armlb') { // Ubuntu arm is only for armlb currently + if (architecture == 'armlb') { // Tizen armel is only for armlb currently architecture='armel' job.with { publishers { @@ -1136,8 +1136,13 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os, } } // Removing the regex will cause this to run on each PR. - Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", - "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*") + if (configuration == 'Checked') { + Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build and Test") + } + else { + Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", + "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*") + } } break case 'Windows_NT': @@ -1496,8 +1501,6 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR buildCommands += "tests\\scripts\\build_illink.cmd clone ${arch}" } - buildOpts += " -priority=${priority}" - // If it is a release build for windows, ensure PGO is used, else fail the build if ((lowerConfiguration == 'release') && (scenario in Constants.basicScenarios) && @@ -1505,7 +1508,15 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR (architecture != 'x86_arm_altjit') && (architecture != 'x64_arm64_altjit')) { - buildOpts += ' enforcepgo' + buildOpts += ' -enforcepgo' + } + + if (enableCorefxTesting) { + buildOpts += ' skiptests'; + } else { + // Note: currently, build.cmd will pass through all arguments starting with an argument it doesn't recognize. + // Since it doesn't process/recognize '-priority', make sure this is the last argument passed. + buildOpts += " -priority=${priority}" } // Set __TestIntermediateDir for pri1 test builds. @@ -1523,7 +1534,6 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR scenario == 'ilrt' || scenario == 'illink' || Constants.r2rJitStressScenarios.indexOf(scenario) != -1) { - buildOpts += enableCorefxTesting ? ' skiptests' : '' buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}" } else if (isLongGc(scenario)) { diff --git a/src/classlibnative/bcltype/system.cpp b/src/classlibnative/bcltype/system.cpp index 6577ffcb4a..bb06ceceeb 100644 --- a/src/classlibnative/bcltype/system.cpp +++ b/src/classlibnative/bcltype/system.cpp @@ -229,49 +229,6 @@ FCIMPL0(Object*, SystemNative::GetCommandLineArgs) } FCIMPLEND - -FCIMPL1(FC_BOOL_RET, SystemNative::_GetCompatibilityFlag, int flag) -{ - FCALL_CONTRACT; - - FC_RETURN_BOOL(GetCompatibilityFlag((CompatibilityFlag)flag)); -} -FCIMPLEND - -// Note: Arguments checked in IL. -FCIMPL1(Object*, SystemNative::_GetEnvironmentVariable, StringObject* strVarUNSAFE) -{ - FCALL_CONTRACT; - - STRINGREF refRetVal; - STRINGREF strVar; - - refRetVal = NULL; - strVar = ObjectToSTRINGREF(strVarUNSAFE); - - HELPER_METHOD_FRAME_BEGIN_RET_2(refRetVal, strVar); - - int len; - - // Get the length of the environment variable. - PathString envPath; // prefix complains if pass a null ptr in, so rely on the final length parm instead - len = WszGetEnvironmentVariable(strVar->GetBuffer(), envPath); - - if (len != 0) - { - // Allocate the string. - refRetVal = StringObject::NewString(len); - - wcscpy_s(refRetVal->GetBuffer(), len + 1, envPath); - - } - - HELPER_METHOD_FRAME_END(); - - return OBJECTREFToObject(refRetVal); -} -FCIMPLEND - // Return a method info for the method were the exception was thrown FCIMPL1(ReflectMethodObject*, SystemNative::GetMethodFromStackTrace, ArrayBase* pStackTraceUNSAFE) { diff --git a/src/classlibnative/bcltype/system.h b/src/classlibnative/bcltype/system.h index da5674f4f1..87dde89bcd 100644 --- a/src/classlibnative/bcltype/system.h +++ b/src/classlibnative/bcltype/system.h @@ -52,12 +52,10 @@ public: void QCALLTYPE _GetCommandLine(QCall::StringHandleOnStack retString); static FCDECL0(Object*, GetCommandLineArgs); - static FCDECL1(FC_BOOL_RET, _GetCompatibilityFlag, int flag); static FCDECL1(VOID, FailFast, StringObject* refMessageUNSAFE); static FCDECL2(VOID, FailFastWithExitCode, StringObject* refMessageUNSAFE, UINT exitCode); static FCDECL2(VOID, FailFastWithException, StringObject* refMessageUNSAFE, ExceptionObject* refExceptionUNSAFE); - static FCDECL1(Object*, _GetEnvironmentVariable, StringObject* strVar); static FCDECL0(StringObject*, _GetModuleFileName); static FCDECL0(StringObject*, GetRuntimeDirectory); diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index ec6cb7a2eb..f41ce63375 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -3029,7 +3029,7 @@ DebuggerMethodInfo *Debugger::GetOrCreateMethodInfo(Module *pModule, mdMethodDef * structs will be returned, and some of the ilOffsets in this array * may be the values specified in CorDebugIlToNativeMappingTypes. ******************************************************************************/ -HRESULT Debugger::GetILToNativeMapping(MethodDesc *pMD, ULONG32 cMap, +HRESULT Debugger::GetILToNativeMapping(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[]) { CONTRACTL @@ -3058,7 +3058,7 @@ HRESULT Debugger::GetILToNativeMapping(MethodDesc *pMD, ULONG32 cMap, _ASSERTE(CORProfilerPresent()); #endif // PROFILING_SUPPORTED - DebuggerJitInfo *pDJI = GetLatestJitInfoFromMethodDesc(pMD); + DebuggerJitInfo *pDJI = GetJitInfoFromAddr(pNativeCodeStartAddress); // Dunno what went wrong if (pDJI == NULL) diff --git a/src/debug/ee/debugger.h b/src/debug/ee/debugger.h index 725d052a36..2ea7330ac0 100644 --- a/src/debug/ee/debugger.h +++ b/src/debug/ee/debugger.h @@ -2025,7 +2025,7 @@ public: DebuggerJitInfo *GetLatestJitInfoFromMethodDesc(MethodDesc * pMethodDesc); - HRESULT GetILToNativeMapping(MethodDesc *pMD, ULONG32 cMap, ULONG32 *pcMap, + HRESULT GetILToNativeMapping(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[]); HRESULT GetILToNativeMappingIntoArrays( diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h index fb2f9da488..6c878c1c21 100644 --- a/src/gc/env/gcenv.base.h +++ b/src/gc/env/gcenv.base.h @@ -420,12 +420,6 @@ typedef PTR_PTR_Object PTR_UNCHECKED_OBJECTREF; class Thread; -inline bool IsGCSpecialThread() -{ - // [LOCALGC TODO] this is not correct - return false; -} - inline bool dbgOnly_IsSpecialEEThread() { return false; @@ -454,12 +448,6 @@ namespace ETW } GC_ROOT_KIND; }; -inline bool IsGCThread() -{ - // [LOCALGC TODO] this is not correct - return false; -} - inline bool FitsInU1(uint64_t val) { return val == (uint64_t)(uint8_t)val; diff --git a/src/gc/env/gcenv.ee.h b/src/gc/env/gcenv.ee.h index e7103b15a5..3d2f659a75 100644 --- a/src/gc/env/gcenv.ee.h +++ b/src/gc/env/gcenv.ee.h @@ -80,6 +80,8 @@ public: static bool GetIntConfigValue(const char* key, int64_t* value); static bool GetStringConfigValue(const char* key, const char** value); static void FreeStringConfigValue(const char* key); + static bool IsGCThread(); + static bool IsGCSpecialThread(); }; #endif // __GCENV_EE_H__ diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index 8cee415081..7df1911668 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -1740,7 +1740,7 @@ static BOOL try_enter_spin_lock(GCSpinLock *pSpinLock) inline static void leave_spin_lock(GCSpinLock *pSpinLock) { - BOOL gc_thread_p = IsGCSpecialThread(); + bool gc_thread_p = GCToEEInterface::IsGCSpecialThread(); // _ASSERTE((pSpinLock->holding_thread == GCToEEInterface::GetThread()) || gc_thread_p || pSpinLock->released_by_gc_p); pSpinLock->released_by_gc_p = gc_thread_p; pSpinLock->holding_thread = (Thread*) -1; @@ -7450,7 +7450,7 @@ int gc_heap::grow_brick_card_tables (uint8_t* start, // Either this thread was the thread that did the suspension which means we are suspended; or this is called // from a GC thread which means we are in a blocking GC and also suspended. - BOOL is_runtime_suspended = IsGCThread(); + bool is_runtime_suspended = GCToEEInterface::IsGCThread(); if (!is_runtime_suspended) { // Note on points where the runtime is suspended anywhere in this function. Upon an attempt to suspend the @@ -7513,7 +7513,7 @@ int gc_heap::grow_brick_card_tables (uint8_t* start, // to be changed, so we are doing this after all global state has // been updated. See the comment above suspend_EE() above for more // info. - stomp_write_barrier_resize(!!IsGCThread(), la != saved_g_lowest_address); + stomp_write_barrier_resize(GCToEEInterface::IsGCThread(), la != saved_g_lowest_address); } @@ -15519,8 +15519,8 @@ void gc_heap::gc1() #endif //BACKGROUND_GC { #ifndef FEATURE_REDHAWK - // IsGCThread() always returns false on CoreRT, but this assert is useful in CoreCLR. - assert(!!IsGCThread()); + // GCToEEInterface::IsGCThread() always returns false on CoreRT, but this assert is useful in CoreCLR. + assert(GCToEEInterface::IsGCThread()); #endif // FEATURE_REDHAWK adjust_ephemeral_limits(); } @@ -34013,7 +34013,7 @@ bool GCHeap::StressHeap(gc_alloc_context * context) #ifdef BACKGROUND_GC // don't trigger a GC from the GC threads but still trigger GCs from user threads. - if (IsGCSpecialThread()) + if (GCToEEInterface::IsGCSpecialThread()) { return FALSE; } diff --git a/src/gc/gcenv.ee.standalone.inl b/src/gc/gcenv.ee.standalone.inl index 0dcf05da4d..0b6a1cfb11 100644 --- a/src/gc/gcenv.ee.standalone.inl +++ b/src/gc/gcenv.ee.standalone.inl @@ -246,4 +246,16 @@ inline void GCToEEInterface::FreeStringConfigValue(const char* value) g_theGCToCLR->FreeStringConfigValue(value); } +inline bool GCToEEInterface::IsGCThread() +{ + assert(g_theGCToCLR != nullptr); + return g_theGCToCLR->IsGCThread(); +} + +inline bool GCToEEInterface::IsGCSpecialThread() +{ + assert(g_theGCToCLR != nullptr); + return g_theGCToCLR->IsGCSpecialThread(); +} + #endif // __GCTOENV_EE_STANDALONE_INL__ diff --git a/src/gc/gcinterface.ee.h b/src/gc/gcinterface.ee.h index 1e08043b02..d65da60678 100644 --- a/src/gc/gcinterface.ee.h +++ b/src/gc/gcinterface.ee.h @@ -191,6 +191,17 @@ public: virtual void FreeStringConfigValue(const char* value) = 0; + + // Asks the EE about whether or not the current thread is a GC thread: + // a server GC thread, background GC thread, or the thread that suspended + // the EE at the start of a GC. + virtual + bool IsGCThread() = 0; + + // Asks the EE about whether or not the current thread is a GC "special" + // thread: a server GC thread or a background GC thread. + virtual + bool IsGCSpecialThread() = 0; }; #endif // _GCINTERFACE_EE_H_ diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index de1a2ad5ee..8fd4487192 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -316,6 +316,16 @@ void GCToEEInterface::FreeStringConfigValue(const char *value) } +bool GCToEEInterface::IsGCThread() +{ + return false; +} + +bool GCToEEInterface::IsGCSpecialThread() +{ + return false; +} + MethodTable* GCToEEInterface::GetFreeObjectMethodTable() { return g_pFreeObjectMethodTable; diff --git a/src/inc/CrstTypes.def b/src/inc/CrstTypes.def index 8dc0d26785..5afc1ed949 100644 --- a/src/inc/CrstTypes.def +++ b/src/inc/CrstTypes.def @@ -752,9 +752,6 @@ End Crst PinnedByrefValidation End -Crst AssemblyUsageLog -End - Crst VSDIndirectionCellLock AcquiredBefore LoaderHeap End diff --git a/src/inc/assemblyusagelog.idl b/src/inc/assemblyusagelog.idl deleted file mode 100644 index b942d59148..0000000000 --- a/src/inc/assemblyusagelog.idl +++ /dev/null @@ -1,51 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -//+--------------------------------------------------------------------------- -// -// File: assemblyusageloginterface.idl -// -// Contents: COM interface for assembly usage log. -// -// Classes: -// -// Functions: -// -// -//---------------------------------------------------------------------------- - -cpp_quote("") -cpp_quote("#ifdef _MSC_VER") -cpp_quote("#pragma comment(lib,\"uuid.lib\")") -cpp_quote("#endif") -cpp_quote("") -cpp_quote("//---------------------------------------------------------------------------=") -cpp_quote("// Assembly Usage Log Interfaces") -cpp_quote("") - -import "objidl.idl"; - -cpp_quote("#ifdef _MSC_VER") -cpp_quote("#pragma once") -cpp_quote("#endif") - -cpp_quote("// {ec2b5f70-d576-4d33-876f-6e3caeb0a7ba}") -cpp_quote("EXTERN_GUID(IID_IAssemblyUsageLog, 0xec2b5f70, 0xd576, 0x4d33, 0x87, 0x6f, 0x6e, 0x3c, 0xae, 0xb0, 0xa7, 0xba);") - -typedef enum -{ - ASSEMBLY_USAGE_LOG_FLAGS_NI = 1, - ASSEMBLY_USAGE_LOG_FLAGS_IL = 2, -} ASSEMBLY_USAGE_LOG_FLAGS; - -[ - local, - object, - uuid(ec2b5f70-d576-4d33-876f-6e3caeb0a7ba), - pointer_default(unique) -] -interface IAssemblyUsageLog : IUnknown -{ - HRESULT LogFile(LPCWSTR pwszILFile, LPCWSTR pwszNIFile, ASSEMBLY_USAGE_LOG_FLAGS flags); -}; - diff --git a/src/inc/assemblyusagelogmanager.h b/src/inc/assemblyusagelogmanager.h deleted file mode 100644 index 5fae606f56..0000000000 --- a/src/inc/assemblyusagelogmanager.h +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// - -#ifndef ASSEMBLY_USAGE_LOG_MANAGER_H -#define ASSEMBLY_USAGE_LOG_MANAGER_H - -#include "assemblyusagelog.h" -#include "daccess.h" - -class AssemblyUsageLogManager -{ -public: - - class Config - { - public: - LPCWSTR wszLogDir; - unsigned int cLogBufferSize; -#ifdef FEATURE_APPX - unsigned int uiLogRefreshInterval; -#endif - }; - - enum GENERATE_LOG_FLAGS - { - GENERATE_LOG_FLAGS_NONE = 0, - }; - - // we depend on static PODs being initialized to 0 which is why ASSEMBLY_USAGE_LOG_FLAGS_NONE is 0 - enum ASSEMBLY_USAGE_LOG_FLAGS : DWORD - { - ASSEMBLY_USAGE_LOG_FLAGS_NONE = 0, - ASSEMBLY_USAGE_LOG_FLAGS_INITTED = 1, - ASSEMBLY_USAGE_LOG_FLAGS_APPLOCALNGENDISABLED = 2, - }; - - static HRESULT Init(const Config *pConfig); - static HRESULT GenerateLog(GENERATE_LOG_FLAGS flags); - static HRESULT GetUsageLogForContext(LPCWSTR binder, LPCWSTR binderParameter, IAssemblyUsageLog **ppUsageLog); - static HRESULT RegisterBinderWithUsageLog(UINT_PTR binderId, IAssemblyUsageLog *pUsageLog); - static HRESULT UnRegisterBinderFromUsageLog(UINT_PTR binderId); - static IAssemblyUsageLog *GetUsageLogForBinder(UINT_PTR binderId); - static ASSEMBLY_USAGE_LOG_FLAGS GetUsageLogFlags(); - static HRESULT SetUsageLogFlag(ASSEMBLY_USAGE_LOG_FLAGS flag, BOOL); - -private: - SVAL_DECL(ASSEMBLY_USAGE_LOG_FLAGS, s_UsageLogFlags); -}; - -#endif /* ASSEMBLY_USAGE_LOG_MANAGER_H */ - diff --git a/src/inc/clrconfigvalues.h b/src/inc/clrconfigvalues.h index 96cd11014a..2b8026e283 100644 --- a/src/inc/clrconfigvalues.h +++ b/src/inc/clrconfigvalues.h @@ -149,21 +149,6 @@ RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DesignerNamespaceResolutionEnabled, W("desi CONFIG_DWORD_INFO_EX(INTERNAL_GetAssemblyIfLoadedIgnoreRidMap, W("GetAssemblyIfLoadedIgnoreRidMap"), 0, "Used to force loader to ignore assemblies cached in the rid-map", CLRConfig::REGUTIL_default) // -// BCL -// -RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_BCLCorrectnessWarnings, W("BCLCorrectnessWarnings"), "Flag a few common correctness bugs in the library with additional runtime checks.") -RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_BCLPerfWarnings, W("BCLPerfWarnings"), "Flag some performance-related problems via asserts when people mis-use the library.") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TimeSpan_LegacyFormatMode, W("TimeSpan_LegacyFormatMode"), 0, "Flag to enable System.TimeSpan legacy (.NET Framework 3.5 and earlier) ToString behavior.") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_CompatSortNLSVersion, W("CompatSortNLSVersion"), 0, "Determines the version of desired sorting behavior for AppCompat.") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_NetFx45_CultureAwareComparerGetHashCode_LongStrings, W("NetFx45_CultureAwareComparerGetHashCode_LongStrings"), 0, "Opt in to use the new (as of v4.5) constant space hash algorithm for strings") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Resources_DisableUserPreferredFallback, W("DisableUserPreferredFallback"), 0, "Resource lookups should be dependent only on the CurrentUICulture, not a user-defined list of preferred languages nor the OS preferred fallback language. Intended to avoid falling back to a right-to-left language, which is undisplayable in console apps.") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_RelativeBindForResources , W("relativeBindForResources"), 0, "Enables probing for satellite assemblies only next to the parent assembly") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_NetFx45_LegacyManagedDeflateStream, W("NetFx45_LegacyManagedDeflateStream"), 0, "Flag to enable legacy managed implementation of the deflater used by System.IO.Compression.DeflateStream.") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_DateTime_NetFX35ParseMode, W("DateTime_NetFX35ParseMode"), 0, "Flag to enable the .NET 3.5 System.DateTime Token Replacement Policy") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ThrowUnobservedTaskExceptions, W("ThrowUnobservedTaskExceptions"), 0, "Flag to propagate unobserved task exceptions on the finalizer thread.") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_DateTime_NetFX40AmPmParseAdjustment, W("EnableAmPmParseAdjustment"), 0, "Flag to enable the .NET 4.0 DateTimeParse to correctly parse AM/PM cases") - -// // Conditional breakpoints // RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnBadExit, W("BreakOnBadExit"), 0, "", CLRConfig::REGUTIL_default) @@ -740,21 +725,8 @@ CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureCount, W("NgenForceFailureCount"), CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureKind, W("NgenForceFailureKind"), 1, "If set to 1, We will throw a TypeLoad exception; If set to 2, We will cause an A/V", CLRConfig::REGUTIL_default) RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_NGenEnableCreatePdb, W("NGenEnableCreatePdb"), 0, "If set to >0 ngen.exe displays help on, recognizes createpdb in the command line") RETAIL_CONFIG_DWORD_INFO(INTERNAL_NGenSimulateDiskFull, W("NGenSimulateDiskFull"), 0, "If set to 1, ngen will throw a Disk full exception in ZapWriter.cpp:Save()") -RETAIL_CONFIG_STRING_INFO(INTERNAL_NGenAssemblyUsageLog, W("NGenAssemblyUsageLog"), "Directory to store ngen usage logs in.") -#ifdef FEATURE_APPX -RETAIL_CONFIG_DWORD_INFO(INTERNAL_NGenAssemblyUsageLogRefreshInterval, W("NGenAssemblyUsageLogRefreshInterval"), 24 * 60 * 60, "Interval to update usage log timestamp (seconds)"); -#endif -RETAIL_CONFIG_DWORD_INFO(INTERNAL_AppLocalAutongenNGenDisabled, W("AppLocalAutongenNGenDisabled"), 0, "Autongen disable flag.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_PartialNGen, W("PartialNGen"), -1, "Generate partial NGen images") RETAIL_CONFIG_DWORD_INFO(INTERNAL_NgenAllowMscorlibSoftbind, W("NgenAllowMscorlibSoftbind"), 0, "Disable forced hard-binding to mscorlib") -RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_RegistryRoot, W("RegistryRoot"), "Redirects all registry access under HKLM\Software to a specified alternative", CLRConfig::REGUTIL_default) -RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_AssemblyPath, W("AssemblyPath"), "Redirects v2 GAC access to a specified alternative path", CLRConfig::REGUTIL_default) -RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_AssemblyPath2, W("AssemblyPath2"), "Redirects v4 GAC access to a specified alternative path", CLRConfig::REGUTIL_default) -RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_NicPath, W("NicPath"), "Redirects NIC access to a specified alternative", CLRConfig::REGUTIL_default) -RETAIL_CONFIG_DWORD_INFO(INTERNAL_NGenTaskDelayStart, W("NGenTaskDelayStart"), 0, "Use NGen Task delay start trigger, instead of critical idle task") - -// Flag for cross-platform ngen: Removes all execution of managed or third-party code in the ngen compilation process. -RETAIL_CONFIG_DWORD_INFO(INTERNAL_Ningen, W("Ningen"), 1, "Enable no-impact ngen") CONFIG_DWORD_INFO(INTERNAL_NoASLRForNgen, W("NoASLRForNgen"), 0, "Turn off IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE bit in generated ngen images. Makes nidump output repeatable from run to run.") RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_NgenAllowOutput, W("NgenAllowOutput"), 0, "If set to 1, the NGEN worker will bind to the parent console, thus allowing stdout output to work", CLRConfig::REGUTIL_default) @@ -1062,7 +1034,6 @@ RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_RepositoryFlags, W("RepositoryFl RETAIL_CONFIG_STRING_INFO(EXTERNAL_RestrictedGCStressExe, W("RestrictedGCStressExe"), "") CONFIG_DWORD_INFO_EX(INTERNAL_ReturnSourceTypeForTesting, W("ReturnSourceTypeForTesting"), 0, "allows returning the (internal only) source type of an IL to Native mapping for debugging purposes", CLRConfig::REGUTIL_default) RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_RSStressLog, W("RSStressLog"), 0, "allows turning on logging for RS startup", CLRConfig::REGUTIL_default) -RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_SafeHandleStackTraces, W("SafeHandleStackTraces"), "Debug-only ability to get a stack trace attached to every SafeHandle instance at creation time, for tracking down handle corruption problems.") CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_SaveThreadInfo, W("SaveThreadInfo"), "") CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_SaveThreadInfoMask, W("SaveThreadInfoMask"), "") CONFIG_DWORD_INFO(INTERNAL_SBDumpOnNewIndex, W("SBDumpOnNewIndex"), 0, "Used for Syncblock debugging. It's been a while since any of those have been used.") diff --git a/src/inc/compatibilityflags.h b/src/inc/compatibilityflags.h deleted file mode 100644 index c52e6084f3..0000000000 --- a/src/inc/compatibilityflags.h +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// Unmanaged enum with compatibility flags. See compatibilityflagsdef.h for more details. - - -#ifndef __COMPATIBILITYFLAGS_H__ -#define __COMPATIBILITYFLAGS_H__ - -enum CompatibilityFlag { -#define COMPATFLAGDEF(name) compat##name, -#include "compatibilityflagsdef.h" - compatCount, -}; - -#endif // __COMPATIBILITYFLAGS_H__ diff --git a/src/inc/compatibilityflagsdef.h b/src/inc/compatibilityflagsdef.h deleted file mode 100644 index 611a043f2c..0000000000 --- a/src/inc/compatibilityflagsdef.h +++ /dev/null @@ -1,48 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// This file contains list of the CLR compatibility flags. The compatibility flags -// are used to mitigate breaking changes in the platform code. They are used to trigger the legacy -// behavior. - -// The general usage pattern is: - -// if (GetCompatibilityFlag(CompatibilityFlag.Foo)) { -// // the legacy behavior -// } -// else { -// // the new behavior -// } - -// Add your own compatibility flags to the end of the list. You should go through the breaking -// change approval process before adding it. -// -// Do not remove definitions for deprecated compatibility flags. Once the value is -// assigned to the compatibility flag, it has to be kept forever. - -// This file is compiled twice: once to generate managed enum in clr\src\bcl, and second time -// to generate the unmanaged enum in clr\src\vm. - - -#ifndef COMPATFLAGDEF -#error You must define COMPATFLAGDEF macro before including compatibilityflagsdef.h -#endif - -COMPATFLAGDEF(SwallowUnhandledExceptions) // Legacy exception handling policy - swallow unhandled exceptions - -COMPATFLAGDEF(NullReferenceExceptionOnAV) // Legacy null reference exception policy - throw NullReferenceExceptions for access violations - -COMPATFLAGDEF(EagerlyGenerateRandomAsymmKeys) // Legacy mode for DSACryptoServiceProvider/RSACryptoServiceProvider - create a random key in the constructor eagerly - -COMPATFLAGDEF(FullTrustListAssembliesInGac) // Legacy mode for not requiring FT list assemblies to be in the GAC - if set, the requirement to be in the GAC would not be enforced. - -COMPATFLAGDEF(DateTimeParseIgnorePunctuation) // Through to V1.1, DateTime parse would ignore any unrecognized punctuation. - // This flag restores that behavior. - -COMPATFLAGDEF(OnlyGACDomainNeutral) // This allows late setting of app domain security and - // assembly evidence, even when LoaderOptimization=MultiDomain - -COMPATFLAGDEF(DisableReplacementCustomCulture) // This allow disabling replacement custom cultures. will always get the shipped framework culture. - -#undef COMPATFLAGDEF diff --git a/src/inc/corprof.idl b/src/inc/corprof.idl index 7ec0172e05..f5da6e25a0 100644 --- a/src/inc/corprof.idl +++ b/src/inc/corprof.idl @@ -3891,6 +3891,24 @@ interface ICorProfilerInfo8 : ICorProfilerInfo7 [out] WCHAR wszName[]); }; +[ + object, + uuid(008170DB-F8CC-4796-9A51-DC8AA0B47012), + pointer_default(unique), + local +] +interface ICorProfilerInfo9 : ICorProfilerInfo8 +{ + //Given functionId + rejitId, enumerate the native code start address of all jitted versions of this code that currently exist + HRESULT GetNativeCodeStartAddresses(FunctionID functionID, ReJITID reJitId, ULONG32 cCodeStartAddresses, ULONG32 *pcCodeStartAddresses, UINT_PTR codeStartAddresses[]); + + //Given the native code start address, return the native->IL mapping information for this jitted version of the code + HRESULT GetILToNativeMapping3(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[]); + + //Given the native code start address, return the the blocks of virtual memory that store this code (method code is not necessarily stored in a single contiguous memory region) + HRESULT GetCodeInfo4(UINT_PTR pNativeCodeStartAddress, ULONG32 cCodeInfos, ULONG32* pcCodeInfos, COR_PRF_CODE_INFO codeInfos[]); +} + /* * This interface lets you iterate over methods in the runtime. */ diff --git a/src/inc/mscorcfg.h b/src/inc/mscorcfg.h deleted file mode 100644 index c90cfe8b0a..0000000000 --- a/src/inc/mscorcfg.h +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/***************************************************************************** - ** ** - ** Cor.h - general header for the Runtime. ** - ** ** - *****************************************************************************/ - - -#ifndef _MSCORCFG_H_ -#define _MSCORCFG_H_ -#include <ole2.h> // Definitions of OLE types. -#include <xmlparser.h> -#include <specstrings.h> - -#ifdef __cplusplus -extern "C" { -#endif - -// ----------------------------------------------------------------------- -// Returns an XMLParsr object. This can be used to parse any XML file. -STDAPI GetXMLElementAttribute(LPCWSTR pwszAttributeName, __out_ecount(cchBuffer) LPWSTR pbuffer, DWORD cchBuffer, DWORD* dwLen); -STDAPI GetXMLElement(LPCWSTR wszFileName, LPCWSTR pwszTag); - -STDAPI GetXMLObject(IXMLParser **ppv); -STDAPI CreateConfigStream(LPCWSTR pszFileName, IStream** ppStream); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif diff --git a/src/inc/winsqmevents.h b/src/inc/winsqmevents.h deleted file mode 100644 index 2394c84a8a..0000000000 --- a/src/inc/winsqmevents.h +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -//**********************************************************************` -//* This is an include file generated by Message Compiler. *` -//* *` - -//**********************************************************************` -#pragma once -//+ -// Provider Microsoft-Windows-CEIP Event Count 7 -//+ -EXTERN_C __declspec(selectany) const GUID S_Microsoft_Windows_CEIP = {0xa402fe09, 0xda6e, 0x45f2, {0x82, 0xaf, 0x3c, 0xb3, 0x71, 0x70, 0xee, 0x0c}}; - -// -// Event Descriptors -// -#define WSQMCONS_CONSOLIDATION_SUCCESS 0x400003EDL -#define WSQMCONS_CONSOLIDATION_ERROR 0xC00003EEL -#define WSQMCONS_UPLOAD_SUCCESS 0x400003EFL -#define WSQMCONS_UPLOAD_ERROR 0xC00003F0L -#define WSQMCONS_NOTIFY_SUCCESS 0x400003F1L -#define WSQMCONS_NOTIFY_ERROR 0xC00003F2L -#define WSQMCONS_MANIFEST_DOWNLOAD 0xC00003F3L -//+ -// Provider Microsoft-Windows-SQM-Events Event Count 26 -//+ -EXTERN_C __declspec(selectany) const GUID Microsoft_Windows_SQM_Provider = {0xa97524f6, 0x064c, 0x4c4e, {0xb7, 0x4b, 0x1a, 0xcc, 0x87, 0xc3, 0x70, 0x0d}}; - -// -// Event Descriptors -// -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR Microsoft_Windows_SQM_Provider_EVENT_0x3_0_0_4_0_0_8000000000000 = {0x3, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define Microsoft_Windows_SQM_Provider_EVENT_0x3_0_0_4_0_0_8000000000000_value 0x3 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR Microsoft_Windows_SQM_Provider_EVENT_0x4_0_0_4_0_0_8000000000000 = {0x4, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define Microsoft_Windows_SQM_Provider_EVENT_0x4_0_0_4_0_0_8000000000000_value 0x4 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SET_DWORD_V0 = {0x5, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SET_DWORD_V0_value 0x5 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_INCREMENT_DWORD_V0 = {0x6, 0x0, 0x0, 0x4, 0x2, 0x0, 0x8000000000000}; -#define SQM_INCREMENT_DWORD_V0_value 0x6 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_ADDTOAVERAGE_DWORD_V0 = {0x7, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_ADDTOAVERAGE_DWORD_V0_value 0x7 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SETIFMAX_DWORD_V0 = {0x8, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SETIFMAX_DWORD_V0_value 0x8 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SETIFMIN_DWORD_V0 = {0x9, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SETIFMIN_DWORD_V0_value 0x9 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR Microsoft_Windows_SQM_Provider_EVENT_0xb_0_0_4_0_0_8000000000000 = {0xb, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define Microsoft_Windows_SQM_Provider_EVENT_0xb_0_0_4_0_0_8000000000000_value 0xb -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_INIT = {0x1, 0x0, 0x0, 0x4, 0x1, 0x0, 0x8000000000000}; -#define SQM_INIT_value 0x1 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_CLEANUP = {0x2, 0x0, 0x0, 0x4, 0x2, 0x0, 0x8000000000000}; -#define SQM_CLEANUP_value 0x2 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_START_SESSION = {0x3, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_START_SESSION_value 0x3 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_END_SESSION = {0x4, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_END_SESSION_value 0x4 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SET_DWORD = {0x5, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SET_DWORD_value 0x5 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_INCREMENT_DWORD = {0x6, 0x1, 0x0, 0x4, 0x2, 0x0, 0x8000000000000}; -#define SQM_INCREMENT_DWORD_value 0x6 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_ADDTOAVERAGE_DWORD = {0x7, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_ADDTOAVERAGE_DWORD_value 0x7 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SETIFMAX_DWORD = {0x8, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SETIFMAX_DWORD_value 0x8 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SETIFMIN_DWORD = {0x9, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SETIFMIN_DWORD_value 0x9 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SET_STRING = {0xa, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SET_STRING_value 0xa -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_ADD_LEGACYSTREAMROW = {0xb, 0x1, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_ADD_LEGACYSTREAMROW_value 0xb -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_LOGON_USER = {0xc, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_LOGON_USER_value 0xc -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_LOGOFF_USER = {0xd, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_LOGOFF_USER_value 0xd -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_OPTIN_NOTIFICATION_SHOWN = {0xe, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_OPTIN_NOTIFICATION_SHOWN_value 0xe -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_OPTIN_NOTIFICATION_RESPONSE = {0xf, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_OPTIN_NOTIFICATION_RESPONSE_value 0xf -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_SET_DWORD64 = {0x10, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_SET_DWORD64_value 0x10 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR SQM_ADD_STREAMROW = {0x11, 0x0, 0x0, 0x4, 0x0, 0x0, 0x8000000000000}; -#define SQM_ADD_STREAMROW_value 0x11 -#define MSG_event_CEIP_EVENT_SOURCE 0x90000001L diff --git a/src/inc/xmlparser.h b/src/inc/xmlparser.h deleted file mode 100644 index 70bf380e58..0000000000 --- a/src/inc/xmlparser.h +++ /dev/null @@ -1,1385 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - - -#ifdef _MSC_VER -#pragma warning( disable: 4049 ) /* more than 64k source lines */ -#endif - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 6.00.0328 */ -/* Compiler settings for xmlparser.idl: - Oicf (OptLev=i2), W1, Zp8, env=Win32 (32b run) - protocol : dce , ms_ext, c_ext - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -//@@MIDL_FILE_HEADING( ) - - -/* verify that the <rpcndr.h> version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 440 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __xmlparser_h__ -#define __xmlparser_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IXMLNodeSource_FWD_DEFINED__ -#define __IXMLNodeSource_FWD_DEFINED__ -typedef interface IXMLNodeSource IXMLNodeSource; -#endif /* __IXMLNodeSource_FWD_DEFINED__ */ - - -#ifndef __IXMLParser_FWD_DEFINED__ -#define __IXMLParser_FWD_DEFINED__ -typedef interface IXMLParser IXMLParser; -#endif /* __IXMLParser_FWD_DEFINED__ */ - - -#ifndef __IXMLNodeFactory_FWD_DEFINED__ -#define __IXMLNodeFactory_FWD_DEFINED__ -typedef interface IXMLNodeFactory IXMLNodeFactory; -#endif /* __IXMLNodeFactory_FWD_DEFINED__ */ - - -#ifndef __XMLParser_FWD_DEFINED__ -#define __XMLParser_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class XMLParser XMLParser; -#else -typedef struct XMLParser XMLParser; -#endif /* __cplusplus */ - -#endif /* __XMLParser_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "objidl.h" -#include "oaidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); -void __RPC_USER MIDL_user_free( void __RPC_FAR * ); - -/* interface __MIDL_itf_xmlparser_0000 */ -/* [local] */ - -typedef /* [public] */ -enum __MIDL___MIDL_itf_xmlparser_0000_0001 - { XML_ELEMENT = 1, - XML_ATTRIBUTE = XML_ELEMENT + 1, - XML_PI = XML_ATTRIBUTE + 1, - XML_XMLDECL = XML_PI + 1, - XML_DOCTYPE = XML_XMLDECL + 1, - XML_DTDATTRIBUTE = XML_DOCTYPE + 1, - XML_ENTITYDECL = XML_DTDATTRIBUTE + 1, - XML_ELEMENTDECL = XML_ENTITYDECL + 1, - XML_ATTLISTDECL = XML_ELEMENTDECL + 1, - XML_NOTATION = XML_ATTLISTDECL + 1, - XML_GROUP = XML_NOTATION + 1, - XML_INCLUDESECT = XML_GROUP + 1, - XML_PCDATA = XML_INCLUDESECT + 1, - XML_CDATA = XML_PCDATA + 1, - XML_IGNORESECT = XML_CDATA + 1, - XML_COMMENT = XML_IGNORESECT + 1, - XML_ENTITYREF = XML_COMMENT + 1, - XML_WHITESPACE = XML_ENTITYREF + 1, - XML_NAME = XML_WHITESPACE + 1, - XML_NMTOKEN = XML_NAME + 1, - XML_STRING = XML_NMTOKEN + 1, - XML_PEREF = XML_STRING + 1, - XML_MODEL = XML_PEREF + 1, - XML_ATTDEF = XML_MODEL + 1, - XML_ATTTYPE = XML_ATTDEF + 1, - XML_ATTPRESENCE = XML_ATTTYPE + 1, - XML_DTDSUBSET = XML_ATTPRESENCE + 1, - XML_LASTNODETYPE = XML_DTDSUBSET + 1 - } XML_NODE_TYPE; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_xmlparser_0000_0002 - { XML_VERSION = XML_LASTNODETYPE, - XML_ENCODING = XML_VERSION + 1, - XML_STANDALONE = XML_ENCODING + 1, - XML_NS = XML_STANDALONE + 1, - XML_XMLSPACE = XML_NS + 1, - XML_XMLLANG = XML_XMLSPACE + 1, - XML_SYSTEM = XML_XMLLANG + 1, - XML_PUBLIC = XML_SYSTEM + 1, - XML_NDATA = XML_PUBLIC + 1, - XML_AT_CDATA = XML_NDATA + 1, - XML_AT_ID = XML_AT_CDATA + 1, - XML_AT_IDREF = XML_AT_ID + 1, - XML_AT_IDREFS = XML_AT_IDREF + 1, - XML_AT_ENTITY = XML_AT_IDREFS + 1, - XML_AT_ENTITIES = XML_AT_ENTITY + 1, - XML_AT_NMTOKEN = XML_AT_ENTITIES + 1, - XML_AT_NMTOKENS = XML_AT_NMTOKEN + 1, - XML_AT_NOTATION = XML_AT_NMTOKENS + 1, - XML_AT_REQUIRED = XML_AT_NOTATION + 1, - XML_AT_IMPLIED = XML_AT_REQUIRED + 1, - XML_AT_FIXED = XML_AT_IMPLIED + 1, - XML_PENTITYDECL = XML_AT_FIXED + 1, - XML_EMPTY = XML_PENTITYDECL + 1, - XML_ANY = XML_EMPTY + 1, - XML_MIXED = XML_ANY + 1, - XML_SEQUENCE = XML_MIXED + 1, - XML_CHOICE = XML_SEQUENCE + 1, - XML_STAR = XML_CHOICE + 1, - XML_PLUS = XML_STAR + 1, - XML_QUESTIONMARK = XML_PLUS + 1, - XML_LASTSUBNODETYPE = XML_QUESTIONMARK + 1 - } XML_NODE_SUBTYPE; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_xmlparser_0000_0003 - { XML_E_PARSEERRORBASE = 0xc00ce500L, - XML_E_ENDOFINPUT = XML_E_PARSEERRORBASE, - XML_E_MISSINGEQUALS = XML_E_ENDOFINPUT + 1, - XML_E_MISSINGQUOTE = XML_E_MISSINGEQUALS + 1, - XML_E_COMMENTSYNTAX = XML_E_MISSINGQUOTE + 1, - XML_E_BADSTARTNAMECHAR = XML_E_COMMENTSYNTAX + 1, - XML_E_BADNAMECHAR = XML_E_BADSTARTNAMECHAR + 1, - XML_E_BADCHARINSTRING = XML_E_BADNAMECHAR + 1, - XML_E_XMLDECLSYNTAX = XML_E_BADCHARINSTRING + 1, - XML_E_BADCHARDATA = XML_E_XMLDECLSYNTAX + 1, - XML_E_MISSINGWHITESPACE = XML_E_BADCHARDATA + 1, - XML_E_EXPECTINGTAGEND = XML_E_MISSINGWHITESPACE + 1, - XML_E_BADCHARINDTD = XML_E_EXPECTINGTAGEND + 1, - XML_E_BADCHARINDECL = XML_E_BADCHARINDTD + 1, - XML_E_MISSINGSEMICOLON = XML_E_BADCHARINDECL + 1, - XML_E_BADCHARINENTREF = XML_E_MISSINGSEMICOLON + 1, - XML_E_UNBALANCEDPAREN = XML_E_BADCHARINENTREF + 1, - XML_E_EXPECTINGOPENBRACKET = XML_E_UNBALANCEDPAREN + 1, - XML_E_BADENDCONDSECT = XML_E_EXPECTINGOPENBRACKET + 1, - XML_E_INTERNALERROR = XML_E_BADENDCONDSECT + 1, - XML_E_UNEXPECTED_WHITESPACE = XML_E_INTERNALERROR + 1, - XML_E_INCOMPLETE_ENCODING = XML_E_UNEXPECTED_WHITESPACE + 1, - XML_E_BADCHARINMIXEDMODEL = XML_E_INCOMPLETE_ENCODING + 1, - XML_E_MISSING_STAR = XML_E_BADCHARINMIXEDMODEL + 1, - XML_E_BADCHARINMODEL = XML_E_MISSING_STAR + 1, - XML_E_MISSING_PAREN = XML_E_BADCHARINMODEL + 1, - XML_E_BADCHARINENUMERATION = XML_E_MISSING_PAREN + 1, - XML_E_PIDECLSYNTAX = XML_E_BADCHARINENUMERATION + 1, - XML_E_EXPECTINGCLOSEQUOTE = XML_E_PIDECLSYNTAX + 1, - XML_E_MULTIPLE_COLONS = XML_E_EXPECTINGCLOSEQUOTE + 1, - XML_E_INVALID_DECIMAL = XML_E_MULTIPLE_COLONS + 1, - XML_E_INVALID_HEXIDECIMAL = XML_E_INVALID_DECIMAL + 1, - XML_E_INVALID_UNICODE = XML_E_INVALID_HEXIDECIMAL + 1, - XML_E_WHITESPACEORQUESTIONMARK = XML_E_INVALID_UNICODE + 1, - XML_E_TOKEN_ERROR = XML_E_PARSEERRORBASE + 0x50, - XML_E_SUSPENDED = XML_E_TOKEN_ERROR, - XML_E_STOPPED = XML_E_SUSPENDED + 1, - XML_E_UNEXPECTEDENDTAG = XML_E_STOPPED + 1, - XML_E_UNCLOSEDTAG = XML_E_UNEXPECTEDENDTAG + 1, - XML_E_DUPLICATEATTRIBUTE = XML_E_UNCLOSEDTAG + 1, - XML_E_MULTIPLEROOTS = XML_E_DUPLICATEATTRIBUTE + 1, - XML_E_INVALIDATROOTLEVEL = XML_E_MULTIPLEROOTS + 1, - XML_E_BADXMLDECL = XML_E_INVALIDATROOTLEVEL + 1, - XML_E_MISSINGROOT = XML_E_BADXMLDECL + 1, - XML_E_UNEXPECTEDEOF = XML_E_MISSINGROOT + 1, - XML_E_BADPEREFINSUBSET = XML_E_UNEXPECTEDEOF + 1, - XML_E_PE_NESTING = XML_E_BADPEREFINSUBSET + 1, - XML_E_INVALID_CDATACLOSINGTAG = XML_E_PE_NESTING + 1, - XML_E_UNCLOSEDPI = XML_E_INVALID_CDATACLOSINGTAG + 1, - XML_E_UNCLOSEDSTARTTAG = XML_E_UNCLOSEDPI + 1, - XML_E_UNCLOSEDENDTAG = XML_E_UNCLOSEDSTARTTAG + 1, - XML_E_UNCLOSEDSTRING = XML_E_UNCLOSEDENDTAG + 1, - XML_E_UNCLOSEDCOMMENT = XML_E_UNCLOSEDSTRING + 1, - XML_E_UNCLOSEDDECL = XML_E_UNCLOSEDCOMMENT + 1, - XML_E_UNCLOSEDMARKUPDECL = XML_E_UNCLOSEDDECL + 1, - XML_E_UNCLOSEDCDATA = XML_E_UNCLOSEDMARKUPDECL + 1, - XML_E_BADDECLNAME = XML_E_UNCLOSEDCDATA + 1, - XML_E_BADEXTERNALID = XML_E_BADDECLNAME + 1, - XML_E_BADELEMENTINDTD = XML_E_BADEXTERNALID + 1, - XML_E_RESERVEDNAMESPACE = XML_E_BADELEMENTINDTD + 1, - XML_E_EXPECTING_VERSION = XML_E_RESERVEDNAMESPACE + 1, - XML_E_EXPECTING_ENCODING = XML_E_EXPECTING_VERSION + 1, - XML_E_EXPECTING_NAME = XML_E_EXPECTING_ENCODING + 1, - XML_E_UNEXPECTED_ATTRIBUTE = XML_E_EXPECTING_NAME + 1, - XML_E_ENDTAGMISMATCH = XML_E_UNEXPECTED_ATTRIBUTE + 1, - XML_E_INVALIDENCODING = XML_E_ENDTAGMISMATCH + 1, - XML_E_INVALIDSWITCH = XML_E_INVALIDENCODING + 1, - XML_E_EXPECTING_NDATA = XML_E_INVALIDSWITCH + 1, - XML_E_INVALID_MODEL = XML_E_EXPECTING_NDATA + 1, - XML_E_INVALID_TYPE = XML_E_INVALID_MODEL + 1, - XML_E_INVALIDXMLSPACE = XML_E_INVALID_TYPE + 1, - XML_E_MULTI_ATTR_VALUE = XML_E_INVALIDXMLSPACE + 1, - XML_E_INVALID_PRESENCE = XML_E_MULTI_ATTR_VALUE + 1, - XML_E_BADXMLCASE = XML_E_INVALID_PRESENCE + 1, - XML_E_CONDSECTINSUBSET = XML_E_BADXMLCASE + 1, - XML_E_CDATAINVALID = XML_E_CONDSECTINSUBSET + 1, - XML_E_INVALID_STANDALONE = XML_E_CDATAINVALID + 1, - XML_E_UNEXPECTED_STANDALONE = XML_E_INVALID_STANDALONE + 1, - XML_E_DOCTYPE_IN_DTD = XML_E_UNEXPECTED_STANDALONE + 1, - XML_E_MISSING_ENTITY = XML_E_DOCTYPE_IN_DTD + 1, - XML_E_ENTITYREF_INNAME = XML_E_MISSING_ENTITY + 1, - XML_E_DOCTYPE_OUTSIDE_PROLOG = XML_E_ENTITYREF_INNAME + 1, - XML_E_INVALID_VERSION = XML_E_DOCTYPE_OUTSIDE_PROLOG + 1, - XML_E_DTDELEMENT_OUTSIDE_DTD = XML_E_INVALID_VERSION + 1, - XML_E_DUPLICATEDOCTYPE = XML_E_DTDELEMENT_OUTSIDE_DTD + 1, - XML_E_RESOURCE = XML_E_DUPLICATEDOCTYPE + 1, - XML_E_LASTERROR = XML_E_RESOURCE + 1 - } XML_ERROR_CODE; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_xmlparser_0000_0004 - { XMLPARSER_IDLE = 0, - XMLPARSER_WAITING = XMLPARSER_IDLE + 1, - XMLPARSER_BUSY = XMLPARSER_WAITING + 1, - XMLPARSER_ERROR = XMLPARSER_BUSY + 1, - XMLPARSER_STOPPED = XMLPARSER_ERROR + 1, - XMLPARSER_SUSPENDED = XMLPARSER_STOPPED + 1 - } XML_PARSER_STATE; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_xmlparser_0000_0005 - { XMLFLAG_FLOATINGAMP = 1, - XMLFLAG_SHORTENDTAGS = 2, - XMLFLAG_CASEINSENSITIVE = 4, - XMLFLAG_NONAMESPACES = 8, - XMLFLAG_NOWHITESPACE = 16, - XMLFLAG_IE4QUIRKS = 32, - XMLFLAG_NODTDNODES = 64, - XMLFLAG_IE4COMPATIBILITY = 255 - } XML_PARSER_FLAGS; - -typedef /* [public][public] */ -enum __MIDL___MIDL_itf_xmlparser_0000_0006 - { XMLNF_STARTDOCUMENT = 0, - XMLNF_STARTDTD = XMLNF_STARTDOCUMENT + 1, - XMLNF_ENDDTD = XMLNF_STARTDTD + 1, - XMLNF_STARTDTDSUBSET = XMLNF_ENDDTD + 1, - XMLNF_ENDDTDSUBSET = XMLNF_STARTDTDSUBSET + 1, - XMLNF_ENDPROLOG = XMLNF_ENDDTDSUBSET + 1, - XMLNF_STARTENTITY = XMLNF_ENDPROLOG + 1, - XMLNF_ENDENTITY = XMLNF_STARTENTITY + 1, - XMLNF_ENDDOCUMENT = XMLNF_ENDENTITY + 1, - XMLNF_DATAAVAILABLE = XMLNF_ENDDOCUMENT + 1, - XMLNF_LASTEVENT = XMLNF_DATAAVAILABLE - } XML_NODEFACTORY_EVENT; - -typedef struct _XML_NODE_INFO - { - DWORD dwSize; - DWORD dwType; - DWORD dwSubType; - BOOL fTerminal; - const WCHAR __RPC_FAR *pwcText; - ULONG ulLen; - ULONG ulNsPrefixLen; - PVOID pNode; - PVOID pReserved; - } XML_NODE_INFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_xmlparser_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_xmlparser_0000_v0_0_s_ifspec; - - -#ifndef __XMLPSR_LIBRARY_DEFINED__ -#define __XMLPSR_LIBRARY_DEFINED__ - -/* library XMLPSR */ -/* [version][lcid][helpstring][uuid] */ - - -EXTERN_C const IID LIBID_XMLPSR; - -#ifndef __IXMLNodeSource_INTERFACE_DEFINED__ -#define __IXMLNodeSource_INTERFACE_DEFINED__ - -/* interface IXMLNodeSource */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IXMLNodeSource; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d242361d-51a0-11d2-9caf-0060b0ec3d39") - IXMLNodeSource : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetFactory( - /* [in] */ IXMLNodeFactory __RPC_FAR *pNodeFactory) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFactory( - /* [out] */ IXMLNodeFactory __RPC_FAR *__RPC_FAR *ppNodeFactory) = 0; - - virtual HRESULT STDMETHODCALLTYPE Abort( - /* [in] */ BSTR bstrErrorInfo) = 0; - - virtual ULONG STDMETHODCALLTYPE GetLineNumber( void) = 0; - - virtual ULONG STDMETHODCALLTYPE GetLinePosition( void) = 0; - - virtual ULONG STDMETHODCALLTYPE GetAbsolutePosition( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetLineBuffer( - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf, - /* [out] */ ULONG __RPC_FAR *pulLen, - /* [out] */ ULONG __RPC_FAR *pulStartPos) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetLastError( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetErrorInfo( - /* [out] */ BSTR __RPC_FAR *pbstrErrorInfo) = 0; - - virtual ULONG STDMETHODCALLTYPE GetFlags( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetURL( - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLNodeSourceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( - IXMLNodeSource __RPC_FAR * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( - IXMLNodeSource __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( - IXMLNodeSource __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetFactory )( - IXMLNodeSource __RPC_FAR * This, - /* [in] */ IXMLNodeFactory __RPC_FAR *pNodeFactory); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFactory )( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ IXMLNodeFactory __RPC_FAR *__RPC_FAR *ppNodeFactory); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Abort )( - IXMLNodeSource __RPC_FAR * This, - /* [in] */ BSTR bstrErrorInfo); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetLineNumber )( - IXMLNodeSource __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetLinePosition )( - IXMLNodeSource __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetAbsolutePosition )( - IXMLNodeSource __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLineBuffer )( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf, - /* [out] */ ULONG __RPC_FAR *pulLen, - /* [out] */ ULONG __RPC_FAR *pulStartPos); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLastError )( - IXMLNodeSource __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetErrorInfo )( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ BSTR __RPC_FAR *pbstrErrorInfo); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetFlags )( - IXMLNodeSource __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetURL )( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf); - - END_INTERFACE - } IXMLNodeSourceVtbl; - - interface IXMLNodeSource - { - CONST_VTBL struct IXMLNodeSourceVtbl __RPC_FAR *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLNodeSource_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLNodeSource_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLNodeSource_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLNodeSource_SetFactory(This,pNodeFactory) \ - (This)->lpVtbl -> SetFactory(This,pNodeFactory) - -#define IXMLNodeSource_GetFactory(This,ppNodeFactory) \ - (This)->lpVtbl -> GetFactory(This,ppNodeFactory) - -#define IXMLNodeSource_Abort(This,bstrErrorInfo) \ - (This)->lpVtbl -> Abort(This,bstrErrorInfo) - -#define IXMLNodeSource_GetLineNumber(This) \ - (This)->lpVtbl -> GetLineNumber(This) - -#define IXMLNodeSource_GetLinePosition(This) \ - (This)->lpVtbl -> GetLinePosition(This) - -#define IXMLNodeSource_GetAbsolutePosition(This) \ - (This)->lpVtbl -> GetAbsolutePosition(This) - -#define IXMLNodeSource_GetLineBuffer(This,ppwcBuf,pulLen,pulStartPos) \ - (This)->lpVtbl -> GetLineBuffer(This,ppwcBuf,pulLen,pulStartPos) - -#define IXMLNodeSource_GetLastError(This) \ - (This)->lpVtbl -> GetLastError(This) - -#define IXMLNodeSource_GetErrorInfo(This,pbstrErrorInfo) \ - (This)->lpVtbl -> GetErrorInfo(This,pbstrErrorInfo) - -#define IXMLNodeSource_GetFlags(This) \ - (This)->lpVtbl -> GetFlags(This) - -#define IXMLNodeSource_GetURL(This,ppwcBuf) \ - (This)->lpVtbl -> GetURL(This,ppwcBuf) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IXMLNodeSource_SetFactory_Proxy( - IXMLNodeSource __RPC_FAR * This, - /* [in] */ IXMLNodeFactory __RPC_FAR *pNodeFactory); - - -void __RPC_STUB IXMLNodeSource_SetFactory_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeSource_GetFactory_Proxy( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ IXMLNodeFactory __RPC_FAR *__RPC_FAR *ppNodeFactory); - - -void __RPC_STUB IXMLNodeSource_GetFactory_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeSource_Abort_Proxy( - IXMLNodeSource __RPC_FAR * This, - /* [in] */ BSTR bstrErrorInfo); - - -void __RPC_STUB IXMLNodeSource_Abort_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -ULONG STDMETHODCALLTYPE IXMLNodeSource_GetLineNumber_Proxy( - IXMLNodeSource __RPC_FAR * This); - - -void __RPC_STUB IXMLNodeSource_GetLineNumber_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -ULONG STDMETHODCALLTYPE IXMLNodeSource_GetLinePosition_Proxy( - IXMLNodeSource __RPC_FAR * This); - - -void __RPC_STUB IXMLNodeSource_GetLinePosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -ULONG STDMETHODCALLTYPE IXMLNodeSource_GetAbsolutePosition_Proxy( - IXMLNodeSource __RPC_FAR * This); - - -void __RPC_STUB IXMLNodeSource_GetAbsolutePosition_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeSource_GetLineBuffer_Proxy( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf, - /* [out] */ ULONG __RPC_FAR *pulLen, - /* [out] */ ULONG __RPC_FAR *pulStartPos); - - -void __RPC_STUB IXMLNodeSource_GetLineBuffer_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeSource_GetLastError_Proxy( - IXMLNodeSource __RPC_FAR * This); - - -void __RPC_STUB IXMLNodeSource_GetLastError_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeSource_GetErrorInfo_Proxy( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ BSTR __RPC_FAR *pbstrErrorInfo); - - -void __RPC_STUB IXMLNodeSource_GetErrorInfo_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -ULONG STDMETHODCALLTYPE IXMLNodeSource_GetFlags_Proxy( - IXMLNodeSource __RPC_FAR * This); - - -void __RPC_STUB IXMLNodeSource_GetFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeSource_GetURL_Proxy( - IXMLNodeSource __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf); - - -void __RPC_STUB IXMLNodeSource_GetURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLNodeSource_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLParser_INTERFACE_DEFINED__ -#define __IXMLParser_INTERFACE_DEFINED__ - -/* interface IXMLParser */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IXMLParser; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d242361e-51a0-11d2-9caf-0060b0ec3d39") - IXMLParser : public IXMLNodeSource - { - public: - virtual HRESULT STDMETHODCALLTYPE SetURL( - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl, - /* [in] */ BOOL fAsync) = 0; - - virtual HRESULT STDMETHODCALLTYPE Load( - /* [in] */ BOOL fFullyAvailable, - /* [in] */ IMoniker __RPC_FAR *pimkName, - /* [in] */ LPBC pibc, - /* [in] */ DWORD grfMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInput( - /* [in] */ IUnknown __RPC_FAR *pStm) = 0; - - virtual HRESULT STDMETHODCALLTYPE PushData( - /* [in] */ const char __RPC_FAR *pData, - /* [in] */ ULONG ulChars, - /* [in] */ BOOL fLastBuffer) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadDTD( - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl) = 0; - - virtual HRESULT STDMETHODCALLTYPE LoadEntity( - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl, - /* [in] */ BOOL fpe) = 0; - - virtual HRESULT STDMETHODCALLTYPE ParseEntity( - /* [in] */ const WCHAR __RPC_FAR *pwcText, - /* [in] */ ULONG ulLen, - /* [in] */ BOOL fpe) = 0; - - virtual HRESULT STDMETHODCALLTYPE ExpandEntity( - /* [in] */ const WCHAR __RPC_FAR *pwcText, - /* [in] */ ULONG ulLen) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetRoot( - /* [in] */ PVOID pRoot) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetRoot( - /* [in] */ PVOID __RPC_FAR *ppRoot) = 0; - - virtual HRESULT STDMETHODCALLTYPE Run( - /* [in] */ long lChars) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetParserState( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Suspend( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFlags( - /* [in] */ ULONG iFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSecureBaseURL( - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSecureBaseURL( - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLParserVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( - IXMLParser __RPC_FAR * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( - IXMLParser __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( - IXMLParser __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetFactory )( - IXMLParser __RPC_FAR * This, - /* [in] */ IXMLNodeFactory __RPC_FAR *pNodeFactory); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFactory )( - IXMLParser __RPC_FAR * This, - /* [out] */ IXMLNodeFactory __RPC_FAR *__RPC_FAR *ppNodeFactory); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Abort )( - IXMLParser __RPC_FAR * This, - /* [in] */ BSTR bstrErrorInfo); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetLineNumber )( - IXMLParser __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetLinePosition )( - IXMLParser __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetAbsolutePosition )( - IXMLParser __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLineBuffer )( - IXMLParser __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf, - /* [out] */ ULONG __RPC_FAR *pulLen, - /* [out] */ ULONG __RPC_FAR *pulStartPos); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLastError )( - IXMLParser __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetErrorInfo )( - IXMLParser __RPC_FAR * This, - /* [out] */ BSTR __RPC_FAR *pbstrErrorInfo); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *GetFlags )( - IXMLParser __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetURL )( - IXMLParser __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetURL )( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl, - /* [in] */ BOOL fAsync); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Load )( - IXMLParser __RPC_FAR * This, - /* [in] */ BOOL fFullyAvailable, - /* [in] */ IMoniker __RPC_FAR *pimkName, - /* [in] */ LPBC pibc, - /* [in] */ DWORD grfMode); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetInput )( - IXMLParser __RPC_FAR * This, - /* [in] */ IUnknown __RPC_FAR *pStm); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PushData )( - IXMLParser __RPC_FAR * This, - /* [in] */ const char __RPC_FAR *pData, - /* [in] */ ULONG ulChars, - /* [in] */ BOOL fLastBuffer); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *LoadDTD )( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *LoadEntity )( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl, - /* [in] */ BOOL fpe); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ParseEntity )( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pwcText, - /* [in] */ ULONG ulLen, - /* [in] */ BOOL fpe); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ExpandEntity )( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pwcText, - /* [in] */ ULONG ulLen); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetRoot )( - IXMLParser __RPC_FAR * This, - /* [in] */ PVOID pRoot); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetRoot )( - IXMLParser __RPC_FAR * This, - /* [in] */ PVOID __RPC_FAR *ppRoot); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Run )( - IXMLParser __RPC_FAR * This, - /* [in] */ long lChars); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetParserState )( - IXMLParser __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Suspend )( - IXMLParser __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Reset )( - IXMLParser __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetFlags )( - IXMLParser __RPC_FAR * This, - /* [in] */ ULONG iFlags); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetSecureBaseURL )( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetSecureBaseURL )( - IXMLParser __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf); - - END_INTERFACE - } IXMLParserVtbl; - - interface IXMLParser - { - CONST_VTBL struct IXMLParserVtbl __RPC_FAR *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLParser_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLParser_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLParser_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLParser_SetFactory(This,pNodeFactory) \ - (This)->lpVtbl -> SetFactory(This,pNodeFactory) - -#define IXMLParser_GetFactory(This,ppNodeFactory) \ - (This)->lpVtbl -> GetFactory(This,ppNodeFactory) - -#define IXMLParser_Abort(This,bstrErrorInfo) \ - (This)->lpVtbl -> Abort(This,bstrErrorInfo) - -#define IXMLParser_GetLineNumber(This) \ - (This)->lpVtbl -> GetLineNumber(This) - -#define IXMLParser_GetLinePosition(This) \ - (This)->lpVtbl -> GetLinePosition(This) - -#define IXMLParser_GetAbsolutePosition(This) \ - (This)->lpVtbl -> GetAbsolutePosition(This) - -#define IXMLParser_GetLineBuffer(This,ppwcBuf,pulLen,pulStartPos) \ - (This)->lpVtbl -> GetLineBuffer(This,ppwcBuf,pulLen,pulStartPos) - -#define IXMLParser_GetLastError(This) \ - (This)->lpVtbl -> GetLastError(This) - -#define IXMLParser_GetErrorInfo(This,pbstrErrorInfo) \ - (This)->lpVtbl -> GetErrorInfo(This,pbstrErrorInfo) - -#define IXMLParser_GetFlags(This) \ - (This)->lpVtbl -> GetFlags(This) - -#define IXMLParser_GetURL(This,ppwcBuf) \ - (This)->lpVtbl -> GetURL(This,ppwcBuf) - - -#define IXMLParser_SetURL(This,pszBaseUrl,pszRelativeUrl,fAsync) \ - (This)->lpVtbl -> SetURL(This,pszBaseUrl,pszRelativeUrl,fAsync) - -#define IXMLParser_Load(This,fFullyAvailable,pimkName,pibc,grfMode) \ - (This)->lpVtbl -> Load(This,fFullyAvailable,pimkName,pibc,grfMode) - -#define IXMLParser_SetInput(This,pStm) \ - (This)->lpVtbl -> SetInput(This,pStm) - -#define IXMLParser_PushData(This,pData,ulChars,fLastBuffer) \ - (This)->lpVtbl -> PushData(This,pData,ulChars,fLastBuffer) - -#define IXMLParser_LoadDTD(This,pszBaseUrl,pszRelativeUrl) \ - (This)->lpVtbl -> LoadDTD(This,pszBaseUrl,pszRelativeUrl) - -#define IXMLParser_LoadEntity(This,pszBaseUrl,pszRelativeUrl,fpe) \ - (This)->lpVtbl -> LoadEntity(This,pszBaseUrl,pszRelativeUrl,fpe) - -#define IXMLParser_ParseEntity(This,pwcText,ulLen,fpe) \ - (This)->lpVtbl -> ParseEntity(This,pwcText,ulLen,fpe) - -#define IXMLParser_ExpandEntity(This,pwcText,ulLen) \ - (This)->lpVtbl -> ExpandEntity(This,pwcText,ulLen) - -#define IXMLParser_SetRoot(This,pRoot) \ - (This)->lpVtbl -> SetRoot(This,pRoot) - -#define IXMLParser_GetRoot(This,ppRoot) \ - (This)->lpVtbl -> GetRoot(This,ppRoot) - -#define IXMLParser_Run(This,lChars) \ - (This)->lpVtbl -> Run(This,lChars) - -#define IXMLParser_GetParserState(This) \ - (This)->lpVtbl -> GetParserState(This) - -#define IXMLParser_Suspend(This) \ - (This)->lpVtbl -> Suspend(This) - -#define IXMLParser_Reset(This) \ - (This)->lpVtbl -> Reset(This) - -#define IXMLParser_SetFlags(This,iFlags) \ - (This)->lpVtbl -> SetFlags(This,iFlags) - -#define IXMLParser_SetSecureBaseURL(This,pszBaseUrl) \ - (This)->lpVtbl -> SetSecureBaseURL(This,pszBaseUrl) - -#define IXMLParser_GetSecureBaseURL(This,ppwcBuf) \ - (This)->lpVtbl -> GetSecureBaseURL(This,ppwcBuf) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IXMLParser_SetURL_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl, - /* [in] */ BOOL fAsync); - - -void __RPC_STUB IXMLParser_SetURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_Load_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ BOOL fFullyAvailable, - /* [in] */ IMoniker __RPC_FAR *pimkName, - /* [in] */ LPBC pibc, - /* [in] */ DWORD grfMode); - - -void __RPC_STUB IXMLParser_Load_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_SetInput_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ IUnknown __RPC_FAR *pStm); - - -void __RPC_STUB IXMLParser_SetInput_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_PushData_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ const char __RPC_FAR *pData, - /* [in] */ ULONG ulChars, - /* [in] */ BOOL fLastBuffer); - - -void __RPC_STUB IXMLParser_PushData_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_LoadDTD_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl); - - -void __RPC_STUB IXMLParser_LoadDTD_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_LoadEntity_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl, - /* [in] */ const WCHAR __RPC_FAR *pszRelativeUrl, - /* [in] */ BOOL fpe); - - -void __RPC_STUB IXMLParser_LoadEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_ParseEntity_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pwcText, - /* [in] */ ULONG ulLen, - /* [in] */ BOOL fpe); - - -void __RPC_STUB IXMLParser_ParseEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_ExpandEntity_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pwcText, - /* [in] */ ULONG ulLen); - - -void __RPC_STUB IXMLParser_ExpandEntity_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_SetRoot_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ PVOID pRoot); - - -void __RPC_STUB IXMLParser_SetRoot_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_GetRoot_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ PVOID __RPC_FAR *ppRoot); - - -void __RPC_STUB IXMLParser_GetRoot_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_Run_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ long lChars); - - -void __RPC_STUB IXMLParser_Run_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_GetParserState_Proxy( - IXMLParser __RPC_FAR * This); - - -void __RPC_STUB IXMLParser_GetParserState_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_Suspend_Proxy( - IXMLParser __RPC_FAR * This); - - -void __RPC_STUB IXMLParser_Suspend_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_Reset_Proxy( - IXMLParser __RPC_FAR * This); - - -void __RPC_STUB IXMLParser_Reset_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_SetFlags_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ ULONG iFlags); - - -void __RPC_STUB IXMLParser_SetFlags_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_SetSecureBaseURL_Proxy( - IXMLParser __RPC_FAR * This, - /* [in] */ const WCHAR __RPC_FAR *pszBaseUrl); - - -void __RPC_STUB IXMLParser_SetSecureBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLParser_GetSecureBaseURL_Proxy( - IXMLParser __RPC_FAR * This, - /* [out] */ const WCHAR __RPC_FAR *__RPC_FAR *ppwcBuf); - - -void __RPC_STUB IXMLParser_GetSecureBaseURL_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLParser_INTERFACE_DEFINED__ */ - - -#ifndef __IXMLNodeFactory_INTERFACE_DEFINED__ -#define __IXMLNodeFactory_INTERFACE_DEFINED__ - -/* interface IXMLNodeFactory */ -/* [unique][helpstring][uuid][local][object] */ - - -EXTERN_C const IID IID_IXMLNodeFactory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d242361f-51a0-11d2-9caf-0060b0ec3d39") - IXMLNodeFactory : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE NotifyEvent( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODEFACTORY_EVENT iEvt) = 0; - - virtual HRESULT STDMETHODCALLTYPE BeginChildren( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODE_INFO __RPC_FAR *pNodeInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE EndChildren( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ BOOL fEmpty, - /* [in] */ XML_NODE_INFO __RPC_FAR *pNodeInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE Error( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ HRESULT hrErrorCode, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO __RPC_FAR *__RPC_FAR *apNodeInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateNode( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ PVOID pNodeParent, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO __RPC_FAR *__RPC_FAR *apNodeInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXMLNodeFactoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( - IXMLNodeFactory __RPC_FAR * This); - - ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( - IXMLNodeFactory __RPC_FAR * This); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *NotifyEvent )( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODEFACTORY_EVENT iEvt); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *BeginChildren )( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODE_INFO __RPC_FAR *pNodeInfo); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *EndChildren )( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ BOOL fEmpty, - /* [in] */ XML_NODE_INFO __RPC_FAR *pNodeInfo); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Error )( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ HRESULT hrErrorCode, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO __RPC_FAR *__RPC_FAR *apNodeInfo); - - HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreateNode )( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ PVOID pNodeParent, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO __RPC_FAR *__RPC_FAR *apNodeInfo); - - END_INTERFACE - } IXMLNodeFactoryVtbl; - - interface IXMLNodeFactory - { - CONST_VTBL struct IXMLNodeFactoryVtbl __RPC_FAR *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXMLNodeFactory_QueryInterface(This,riid,ppvObject) \ - (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) - -#define IXMLNodeFactory_AddRef(This) \ - (This)->lpVtbl -> AddRef(This) - -#define IXMLNodeFactory_Release(This) \ - (This)->lpVtbl -> Release(This) - - -#define IXMLNodeFactory_NotifyEvent(This,pSource,iEvt) \ - (This)->lpVtbl -> NotifyEvent(This,pSource,iEvt) - -#define IXMLNodeFactory_BeginChildren(This,pSource,pNodeInfo) \ - (This)->lpVtbl -> BeginChildren(This,pSource,pNodeInfo) - -#define IXMLNodeFactory_EndChildren(This,pSource,fEmpty,pNodeInfo) \ - (This)->lpVtbl -> EndChildren(This,pSource,fEmpty,pNodeInfo) - -#define IXMLNodeFactory_Error(This,pSource,hrErrorCode,cNumRecs,apNodeInfo) \ - (This)->lpVtbl -> Error(This,pSource,hrErrorCode,cNumRecs,apNodeInfo) - -#define IXMLNodeFactory_CreateNode(This,pSource,pNodeParent,cNumRecs,apNodeInfo) \ - (This)->lpVtbl -> CreateNode(This,pSource,pNodeParent,cNumRecs,apNodeInfo) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -HRESULT STDMETHODCALLTYPE IXMLNodeFactory_NotifyEvent_Proxy( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODEFACTORY_EVENT iEvt); - - -void __RPC_STUB IXMLNodeFactory_NotifyEvent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeFactory_BeginChildren_Proxy( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODE_INFO __RPC_FAR *pNodeInfo); - - -void __RPC_STUB IXMLNodeFactory_BeginChildren_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeFactory_EndChildren_Proxy( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ BOOL fEmpty, - /* [in] */ XML_NODE_INFO __RPC_FAR *pNodeInfo); - - -void __RPC_STUB IXMLNodeFactory_EndChildren_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeFactory_Error_Proxy( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ HRESULT hrErrorCode, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO __RPC_FAR *__RPC_FAR *apNodeInfo); - - -void __RPC_STUB IXMLNodeFactory_Error_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -HRESULT STDMETHODCALLTYPE IXMLNodeFactory_CreateNode_Proxy( - IXMLNodeFactory __RPC_FAR * This, - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ PVOID pNodeParent, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO __RPC_FAR *__RPC_FAR *apNodeInfo); - - -void __RPC_STUB IXMLNodeFactory_CreateNode_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IXMLNodeFactory_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_XMLParser; - -#ifdef __cplusplus - -class DECLSPEC_UUID("d2423620-51a0-11d2-9caf-0060b0ec3d39") -XMLParser; -#endif -#endif /* __XMLPSR_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/src/inc/xmlparser_i.cpp b/src/inc/xmlparser_i.cpp deleted file mode 100644 index 33927f651f..0000000000 --- a/src/inc/xmlparser_i.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/* This was a created file from a newer version of xmlparser.idl than - what made xmlparser.h in ndp/clr/src/inc, and then with extra - GUIDs expurgated. */ - -/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ - -/* link this file in with the server and any clients */ - - - /* File created by MIDL compiler version 8.00.0571 */ -/* @@MIDL_FILE_HEADING( ) */ - -#ifdef _MSC_VER -#pragma warning( disable: 4049 ) /* more than 64k source lines */ -#endif - - -#ifdef __cplusplus -extern "C"{ -#endif - - -#include <rpc.h> -#include <rpcndr.h> - -#ifdef _MIDL_USE_GUIDDEF_ - -#ifndef INITGUID -#define INITGUID -#include <guiddef.h> -#undef INITGUID -#else -#include <guiddef.h> -#endif - -#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ - DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) - -#else // !_MIDL_USE_GUIDDEF_ - -#ifndef __IID_DEFINED__ -#define __IID_DEFINED__ - -typedef struct _IID -{ - unsigned long x; - unsigned short s1; - unsigned short s2; - unsigned char c[8]; -} IID; - -#endif // __IID_DEFINED__ - -#ifndef CLSID_DEFINED -#define CLSID_DEFINED -typedef IID CLSID; -#endif // CLSID_DEFINED - -#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ - const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} - -#endif // !_MIDL_USE_GUIDDEF_ - -MIDL_DEFINE_GUID(IID, LIBID_XMLPSR,0xd242361c,0x51a0,0x11d2,0x9c,0xaf,0x00,0x60,0xb0,0xec,0x3d,0x39); - - -MIDL_DEFINE_GUID(IID, IID_IXMLNodeSource,0xd242361d,0x51a0,0x11d2,0x9c,0xaf,0x00,0x60,0xb0,0xec,0x3d,0x39); - - -MIDL_DEFINE_GUID(IID, IID_IXMLParser,0xd242361e,0x51a0,0x11d2,0x9c,0xaf,0x00,0x60,0xb0,0xec,0x3d,0x39); - - -MIDL_DEFINE_GUID(IID, IID_IXMLNodeFactory,0xd242361f,0x51a0,0x11d2,0x9c,0xaf,0x00,0x60,0xb0,0xec,0x3d,0x39); - -#undef MIDL_DEFINE_GUID - -#ifdef __cplusplus -} -#endif - - - diff --git a/src/jit/codegen.h b/src/jit/codegen.h index 6261e42a14..879ee7bfa6 100644 --- a/src/jit/codegen.h +++ b/src/jit/codegen.h @@ -141,6 +141,7 @@ private: } #endif // REG_OPT_RSVD +#ifdef LEGACY_BACKEND regNumber findStkLclInReg(unsigned lclNum) { #ifdef DEBUG @@ -148,6 +149,7 @@ private: #endif return regTracker.rsLclIsInReg(lclNum); } +#endif //------------------------------------------------------------------------- @@ -817,7 +819,9 @@ protected: public: void instInit(); +#ifdef LEGACY_BACKEND regNumber genGetZeroRegister(); +#endif void instGen(instruction ins); #ifdef _TARGET_XARCH_ diff --git a/src/jit/codegenarm.cpp b/src/jit/codegenarm.cpp index fdba145dc5..69640b739d 100644 --- a/src/jit/codegenarm.cpp +++ b/src/jit/codegenarm.cpp @@ -1720,7 +1720,6 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, } regTracker.rsTrashRegSet(RBM_CALLEE_TRASH); - regTracker.rsTrashRegsForGCInterruptability(); } //------------------------------------------------------------------------ diff --git a/src/jit/codegenarm64.cpp b/src/jit/codegenarm64.cpp index aabb151561..4aa741558e 100644 --- a/src/jit/codegenarm64.cpp +++ b/src/jit/codegenarm64.cpp @@ -3689,7 +3689,6 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, regMaskTP killMask = compiler->compHelperCallKillSet((CorInfoHelpFunc)helper); regTracker.rsTrashRegSet(killMask); - regTracker.rsTrashRegsForGCInterruptability(); } /***************************************************************************** diff --git a/src/jit/codegenarmarch.cpp b/src/jit/codegenarmarch.cpp index 38803054b9..56cad32bf0 100644 --- a/src/jit/codegenarmarch.cpp +++ b/src/jit/codegenarmarch.cpp @@ -2265,7 +2265,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) // the GC pointer state before the callsite. // We can't utilize the typical lazy killing of GC pointers // at (or inside) the callsite. - if (call->IsUnmanaged()) + if (compiler->killGCRefs(call)) { genDefineTempLabel(genCreateTempLabel()); } diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp index 64f38ae080..d557d42f5e 100644 --- a/src/jit/codegencommon.cpp +++ b/src/jit/codegencommon.cpp @@ -1609,10 +1609,12 @@ void CodeGen::genDefineTempLabel(BasicBlock* label) label->bbEmitCookie = getEmitter()->emitAddLabel(gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur); +#ifdef LEGACY_BACKEND /* gcInfo.gcRegGCrefSetCur does not account for redundant load-suppression of GC vars, and the emitter will not know about */ regTracker.rsTrackRegClrPtr(); +#endif } /***************************************************************************** diff --git a/src/jit/codegeninterface.h b/src/jit/codegeninterface.h index a993ddb629..c1c912ad6a 100644 --- a/src/jit/codegeninterface.h +++ b/src/jit/codegeninterface.h @@ -105,10 +105,12 @@ public: RegTracker regTracker; public: +#ifdef LEGACY_BACKEND void trashReg(regNumber reg) { regTracker.rsTrackRegTrash(reg); } +#endif protected: Compiler* compiler; diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp index 7da42ce7e5..aff57d98fa 100644 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -5283,7 +5283,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) // the GC pointer state before the callsite. // We can't utilize the typical lazy killing of GC pointers // at (or inside) the callsite. - if (call->IsUnmanaged()) + if (compiler->killGCRefs(call)) { genDefineTempLabel(genCreateTempLabel()); } @@ -8606,7 +8606,6 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, // clang-format on regTracker.rsTrashRegSet(killMask); - regTracker.rsTrashRegsForGCInterruptability(); } #if !defined(_TARGET_64BIT_) diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp index b8877f22f5..5c20a87e5f 100644 --- a/src/jit/compiler.cpp +++ b/src/jit/compiler.cpp @@ -11391,3 +11391,33 @@ HelperCallProperties Compiler::s_helperCallProperties; /*****************************************************************************/ /*****************************************************************************/ + +//------------------------------------------------------------------------ +// killGCRefs: +// Given some tree node return does it need all GC refs to be spilled from +// callee save registers. +// +// Arguments: +// tree - the tree for which we ask about gc refs. +// +// Return Value: +// true - tree kills GC refs on callee save registers +// false - tree doesn't affect GC refs on callee save registers +bool Compiler::killGCRefs(GenTreePtr tree) +{ + if (tree->IsCall()) + { + GenTreeCall* call = tree->AsCall(); + if (call->IsUnmanaged()) + { + return true; + } + + if (call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_JIT_PINVOKE_BEGIN)) + { + assert(opts.ShouldUsePInvokeHelpers()); + return true; + } + } + return false; +} diff --git a/src/jit/compiler.h b/src/jit/compiler.h index 3ff6375a57..6a64a7b648 100644 --- a/src/jit/compiler.h +++ b/src/jit/compiler.h @@ -9564,6 +9564,8 @@ public: void fgMorphMultiregStructArgs(GenTreeCall* call); GenTreePtr fgMorphMultiregStructArg(GenTreePtr arg, fgArgTabEntryPtr fgEntryPtr); + bool killGCRefs(GenTreePtr tree); + }; // end of class Compiler // Inline methods of CompAllocator. diff --git a/src/jit/ee_il_dll.cpp b/src/jit/ee_il_dll.cpp index 822a2b9286..73e6cd6459 100644 --- a/src/jit/ee_il_dll.cpp +++ b/src/jit/ee_il_dll.cpp @@ -327,8 +327,6 @@ void CILJit::clearCache(void) */ BOOL CILJit::isCacheCleanupRequired(void) { - BOOL doCleanup; - if (g_realJitCompiler != nullptr) { if (g_realJitCompiler->isCacheCleanupRequired()) diff --git a/src/jit/eeinterface.cpp b/src/jit/eeinterface.cpp index d8db947f02..5783037f22 100644 --- a/src/jit/eeinterface.cpp +++ b/src/jit/eeinterface.cpp @@ -103,8 +103,6 @@ const char* Compiler::eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd) /* figure out the signature */ - EXCEPTION_POINTERS exceptionPointers; - PAL_TRY(FilterSuperPMIExceptionsParam_eeinterface*, pParam, ¶m) { unsigned i; diff --git a/src/jit/emit.cpp b/src/jit/emit.cpp index 432d16deea..f9f3d855c9 100644 --- a/src/jit/emit.cpp +++ b/src/jit/emit.cpp @@ -1337,7 +1337,7 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz) emitInsCount++; -#if defined(DEBUG) || defined(LATE_DISASM) +#if defined(DEBUG) /* In debug mode we clear/set some additional fields */ instrDescDebugInfo* info = (instrDescDebugInfo*)emitGetMem(sizeof(*info)); @@ -1346,7 +1346,6 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz) info->idSize = sz; info->idVarRefOffs = 0; info->idMemCookie = 0; - info->idClsCookie = nullptr; #ifdef TRANSLATE_PDB info->idilStart = emitInstrDescILBase; #endif @@ -1356,7 +1355,7 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz) id->idDebugOnlyInfo(info); -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // defined(DEBUG) /* Store the size and handle the two special values that indicate GCref and ByRef */ @@ -1522,10 +1521,6 @@ void emitter::emitEndProlog() { assert(emitComp->compGeneratingProlog); - size_t prolSz; - - insGroup* tempIG; - emitNoGCIG = false; /* Save the prolog IG if non-empty or if only one block */ @@ -7195,7 +7190,6 @@ const char* emitter::emitOffsetToLabel(unsigned offs) char* retbuf; insGroup* ig; - UNATIVE_OFFSET of; UNATIVE_OFFSET nextof = 0; for (ig = emitIGlist; ig != nullptr; ig = ig->igNext) diff --git a/src/jit/emit.h b/src/jit/emit.h index 63243f4d0a..c2b5281861 100644 --- a/src/jit/emit.h +++ b/src/jit/emit.h @@ -530,7 +530,7 @@ protected: int amDisp : AM_DISP_BITS; }; -#if defined(DEBUG) || defined(LATE_DISASM) // LATE_DISASM needs the idMemCookie on calls to display the call target name +#ifdef DEBUG // This information is used in DEBUG builds to display the method name for call instructions struct instrDesc; @@ -539,8 +539,7 @@ protected: unsigned idNum; size_t idSize; // size of the instruction descriptor unsigned idVarRefOffs; // IL offset for LclVar reference - size_t idMemCookie; // for display of member names in addr modes - void* idClsCookie; // for display of member names in addr modes + size_t idMemCookie; // for display of method name (also used by switch table) #ifdef TRANSLATE_PDB unsigned int idilStart; // instruction descriptor source information for PDB translation #endif @@ -549,7 +548,7 @@ protected: CORINFO_SIG_INFO* idCallSig; // Used to report native call site signatures to the EE }; -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // DEBUG #ifdef _TARGET_ARM_ unsigned insEncodeSetFlags(insFlags sf); @@ -777,7 +776,7 @@ protected: #endif // !HAS_TINY_DESC -#if defined(DEBUG) || defined(LATE_DISASM) +#ifdef DEBUG instrDescDebugInfo* _idDebugOnlyInfo; @@ -792,7 +791,7 @@ protected: } private: -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // DEBUG // // This is the end of the smallest instrDesc we can allocate for all @@ -869,7 +868,7 @@ protected: emitter::emitAllocInstr() to clear them. */ -#if defined(DEBUG) || defined(LATE_DISASM) +#if DEBUG #define TINY_IDSC_DEBUG_EXTRA (sizeof(void*)) #else #define TINY_IDSC_DEBUG_EXTRA (0) diff --git a/src/jit/emitarm.cpp b/src/jit/emitarm.cpp index c65d799d50..ae98d31868 100644 --- a/src/jit/emitarm.cpp +++ b/src/jit/emitarm.cpp @@ -3808,19 +3808,12 @@ void emitter::emitIns_C_I(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE f * The following adds instructions referencing address modes. */ -void emitter::emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie, void* clsCookie) +void emitter::emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs) { NYI("emitIns_I_AR"); } -void emitter::emitIns_R_AR(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { if (ins == INS_mov) { @@ -3890,13 +3883,7 @@ void emitter::emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize NYI("emitIns_R_AI"); } -void emitter::emitIns_AR_R(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { if (ins == INS_mov) { @@ -4652,20 +4639,17 @@ void emitter::emitIns_Call(EmitCallType callType, VarSetOps::ToString(emitComp, ((instrDescCGCA*)id)->idcGCvars)); } } -#endif -#if defined(DEBUG) || defined(LATE_DISASM) id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token - id->idDebugOnlyInfo()->idClsCookie = 0; id->idDebugOnlyInfo()->idCallSig = sigInfo; -#endif +#endif // DEBUG -#if defined(LATE_DISASM) +#ifdef LATE_DISASM if (addr != nullptr) { codeGen->getDisAssembler().disSetMethod((size_t)addr, methHnd); } -#endif // defined(LATE_DISASM) +#endif // LATE_DISASM dispIns(id); appendToCurIG(id); diff --git a/src/jit/emitarm.h b/src/jit/emitarm.h index 62d9af6569..5ba76fe226 100644 --- a/src/jit/emitarm.h +++ b/src/jit/emitarm.h @@ -325,16 +325,13 @@ void emitIns_R_D(instruction ins, emitAttr attr, unsigned offs, regNumber reg); void emitIns_J_R(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg); -void emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs); -void emitIns_R_AR( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); -void emitIns_AR_R( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_ARR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, regNumber rg2, int disp); diff --git a/src/jit/emitarm64.cpp b/src/jit/emitarm64.cpp index b5cc06e5f2..3f11cc4f9b 100644 --- a/src/jit/emitarm64.cpp +++ b/src/jit/emitarm64.cpp @@ -6793,13 +6793,7 @@ void emitter::emitIns_C_R(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE f assert(!"emitIns_C_R not supported for RyuJIT backend"); } -void emitter::emitIns_R_AR(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { NYI("emitIns_R_AR"); } @@ -6858,13 +6852,7 @@ void emitter::emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize } } -void emitter::emitIns_AR_R(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { NYI("emitIns_AR_R"); } @@ -7408,20 +7396,17 @@ void emitter::emitIns_Call(EmitCallType callType, VarSetOps::ToString(emitComp, ((instrDescCGCA*)id)->idcGCvars)); } } -#endif -#if defined(DEBUG) || defined(LATE_DISASM) id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token - id->idDebugOnlyInfo()->idClsCookie = 0; id->idDebugOnlyInfo()->idCallSig = sigInfo; -#endif +#endif // DEBUG -#if defined(LATE_DISASM) +#ifdef LATE_DISASM if (addr != nullptr) { codeGen->getDisAssembler().disSetMethod((size_t)addr, methHnd); } -#endif // defined(LATE_DISASM) +#endif // LATE_DISASM dispIns(id); appendToCurIG(id); diff --git a/src/jit/emitarm64.h b/src/jit/emitarm64.h index 87d99952cf..0838d6e336 100644 --- a/src/jit/emitarm64.h +++ b/src/jit/emitarm64.h @@ -783,16 +783,13 @@ void emitIns_J_R(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg) void emitIns_J_R_I(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg, int imm); -void emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs); -void emitIns_R_AR( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); -void emitIns_AR_R( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_ARR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, regNumber rg2, int disp); diff --git a/src/jit/emitxarch.cpp b/src/jit/emitxarch.cpp index 09fdb1bd08..ee0afd0f7f 100644 --- a/src/jit/emitxarch.cpp +++ b/src/jit/emitxarch.cpp @@ -4229,8 +4229,7 @@ void emitter::emitIns_R_L(instruction ins, emitAttr attr, BasicBlock* dst, regNu * The following adds instructions referencing address modes. */ -void emitter::emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int disp, int memCookie, void* clsCookie) +void emitter::emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int disp) { assert((CodeGen::instIsFP(ins) == false) && (EA_SIZE(attr) <= EA_8BYTE)); @@ -4274,13 +4273,6 @@ void emitter::emitIns_I_AR( id->idIns(ins); id->idInsFmt(fmt); - assert((memCookie == NULL) == (clsCookie == nullptr)); - -#ifdef DEBUG - id->idDebugOnlyInfo()->idMemCookie = memCookie; - id->idDebugOnlyInfo()->idClsCookie = clsCookie; -#endif - id->idAddr()->iiaAddrMode.amBaseReg = reg; id->idAddr()->iiaAddrMode.amIndxReg = REG_NA; @@ -4349,8 +4341,7 @@ void emitter::emitIns_I_AI(instruction ins, emitAttr attr, int val, ssize_t disp emitCurIGsize += sz; } -void emitter::emitIns_R_AR( - instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp, int memCookie, void* clsCookie) +void emitter::emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp) { assert((CodeGen::instIsFP(ins) == false) && (EA_SIZE(attr) <= EA_32BYTE) && (ireg != REG_NA)); noway_assert(emitVerifyEncodable(ins, EA_SIZE(attr), ireg)); @@ -4374,13 +4365,6 @@ void emitter::emitIns_R_AR( id->idInsFmt(fmt); id->idReg1(ireg); - assert((memCookie == NULL) == (clsCookie == nullptr)); - -#ifdef DEBUG - id->idDebugOnlyInfo()->idMemCookie = memCookie; - id->idDebugOnlyInfo()->idClsCookie = clsCookie; -#endif - id->idAddr()->iiaAddrMode.amBaseReg = base; id->idAddr()->iiaAddrMode.amIndxReg = REG_NA; @@ -4418,8 +4402,7 @@ void emitter::emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize emitCurIGsize += sz; } -void emitter::emitIns_AR_R( - instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp, int memCookie, void* clsCookie) +void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp) { UNATIVE_OFFSET sz; instrDesc* id = emitNewInstrAmd(attr, disp); @@ -4446,13 +4429,6 @@ void emitter::emitIns_AR_R( id->idIns(ins); id->idInsFmt(fmt); - assert((memCookie == NULL) == (clsCookie == nullptr)); - -#ifdef DEBUG - id->idDebugOnlyInfo()->idMemCookie = memCookie; - id->idDebugOnlyInfo()->idClsCookie = clsCookie; -#endif - id->idAddr()->iiaAddrMode.amBaseReg = base; id->idAddr()->iiaAddrMode.amIndxReg = REG_NA; @@ -5662,20 +5638,17 @@ void emitter::emitIns_Call(EmitCallType callType, } } } -#endif -#if defined(DEBUG) || defined(LATE_DISASM) id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token - id->idDebugOnlyInfo()->idClsCookie = nullptr; id->idDebugOnlyInfo()->idCallSig = sigInfo; -#endif +#endif // DEBUG -#if defined(LATE_DISASM) +#ifdef LATE_DISASM if (addr != nullptr) { codeGen->getDisAssembler().disSetMethod((size_t)addr, methHnd); } -#endif // defined(LATE_DISASM) +#endif // LATE_DISASM id->idCodeSize(sz); @@ -6434,19 +6407,8 @@ void emitter::emitDispAddrMode(instrDesc* id, bool noDetail) printf("]"); - if (id->idDebugOnlyInfo()->idClsCookie) - { - if (id->idIns() == INS_call) - { - printf("%s", emitFncName((CORINFO_METHOD_HANDLE)id->idDebugOnlyInfo()->idMemCookie)); - } - else - { - printf("%s", emitFldName((CORINFO_FIELD_HANDLE)id->idDebugOnlyInfo()->idMemCookie)); - } - } // pretty print string if it looks like one - else if (id->idGCref() == GCT_GCREF && id->idIns() == INS_mov && id->idAddr()->iiaAddrMode.amBaseReg == REG_NA) + if ((id->idGCref() == GCT_GCREF) && (id->idIns() == INS_mov) && (id->idAddr()->iiaAddrMode.amBaseReg == REG_NA)) { const wchar_t* str = emitComp->eeGetCPString(disp); if (str != nullptr) diff --git a/src/jit/emitxarch.h b/src/jit/emitxarch.h index de8e81faa1..25053b3e49 100644 --- a/src/jit/emitxarch.h +++ b/src/jit/emitxarch.h @@ -391,28 +391,15 @@ void emitIns_R_L(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg) void emitIns_R_D(instruction ins, emitAttr attr, unsigned offs, regNumber reg); -void emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie = 0, void* clsCookie = nullptr); +void emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs); void emitIns_I_AI(instruction ins, emitAttr attr, int val, ssize_t disp); -void emitIns_R_AR(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie = 0, - void* clsCookie = nullptr); +void emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); -void emitIns_AR_R(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie = 0, - void* clsCookie = nullptr); +void emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_AI_R(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index 9efd95bd1e..18ef525fd3 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -21539,7 +21539,6 @@ void Compiler::fgDebugCheckNodeLinks(BasicBlock* block, GenTree* node) if (tree->OperIsUnary() && tree->gtOp.gtOp1) { - GenTreePtr lclVarTree; expectedPrevTree = tree->gtOp.gtOp1; } else if (tree->OperIsBinary() && tree->gtOp.gtOp1) diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp index 04e0c9cd89..4cd4221bdd 100644 --- a/src/jit/gentree.cpp +++ b/src/jit/gentree.cpp @@ -3088,8 +3088,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) /* Is this a FP value? */ - bool isflt = varTypeIsFloating(tree->TypeGet()); - unsigned FPlvlSave; + bool isflt = varTypeIsFloating(tree->TypeGet()); /* Figure out what kind of a node we have */ @@ -3103,8 +3102,6 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) int costEx; int costSz; - bool bRngChk; - #ifdef DEBUG costEx = -1; costSz = -1; @@ -3943,7 +3940,6 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) (op2->gtOp.gtOp1->gtOper == GT_MUL && op2->gtOp.gtOp1->gtOp.gtOp1->gtOper == GT_NOP)) { - // assert(bRngChk); op2->gtFlags |= GTF_ADDRMODE_NO_CSE; if (op2->gtOp.gtOp1->gtOper == GT_MUL) { @@ -4609,7 +4605,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) if (tree->gtCall.gtCallArgs) { #if FEATURE_STACK_FP_X87 - FPlvlSave = codeGen->genGetFPstkLevel(); + unsigned FPlvlSave = codeGen->genGetFPstkLevel(); #endif // FEATURE_STACK_FP_X87 const bool isListCallArgs = true; const bool callArgsInRegs = false; @@ -4633,7 +4629,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) if (tree->gtCall.gtCallLateArgs) { #if FEATURE_STACK_FP_X87 - FPlvlSave = codeGen->genGetFPstkLevel(); + unsigned FPlvlSave = codeGen->genGetFPstkLevel(); #endif // FEATURE_STACK_FP_X87 const bool isListCallArgs = true; const bool callArgsInRegs = true; @@ -10988,7 +10984,6 @@ void Compiler::gtDispChild(GenTreePtr child, __in_opt const char* msg, /* = nullptr */ bool topOnly) /* = false */ { - IndentInfo info; indentStack->Push(arcType); gtDispTree(child, indentStack, msg, topOnly); indentStack->Pop(); diff --git a/src/jit/hashbv.cpp b/src/jit/hashbv.cpp index fa06ec7b1e..db8dda1a7b 100644 --- a/src/jit/hashbv.cpp +++ b/src/jit/hashbv.cpp @@ -549,7 +549,6 @@ void hashBv::Resize(int newSize) int oldSizeLog2 = log2_hashSize; int log2_newSize = genLog2((unsigned)newSize); - int size; hashBvNode** newNodes = this->getNewVector(newSize); diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 6429978a10..58273691de 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -876,7 +876,6 @@ GenTreeArgList* Compiler::impPopList(unsigned count, CORINFO_SIG_INFO* sig, GenT CORINFO_CLASS_HANDLE argClass; CORINFO_CLASS_HANDLE argRealClass; GenTreeArgList* args; - unsigned sigSize; for (args = treeList, count = sig->numArgs; count > 0; args = args->Rest(), count--) { @@ -5771,7 +5770,6 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI if (!opts.IsReadyToRun() || IsTargetAbi(CORINFO_CORERT_ABI)) { - LclVarDsc* newObjArrayArgsVar; // Reuse the temp used to pass the array dimensions to avoid bloating // the stack frame in case there are multiple calls to multi-dim array @@ -10354,7 +10352,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) int val; CORINFO_SIG_INFO sig; - unsigned flags; IL_OFFSET jmpAddr; bool ovfl, unordered, callNode; bool ldstruct; diff --git a/src/jit/instr.cpp b/src/jit/instr.cpp index f654455b78..f83bd45719 100644 --- a/src/jit/instr.cpp +++ b/src/jit/instr.cpp @@ -1870,18 +1870,13 @@ AGAIN: } } +#ifdef LEGACY_BACKEND regNumber CodeGen::genGetZeroRegister() { - regNumber zeroReg = REG_NA; - -#if REDUNDANT_LOAD - // Is the constant already in some register? - zeroReg = regTracker.rsIconIsInReg(0); -#endif + regNumber zeroReg = regTracker.rsIconIsInReg(0); -#ifdef LEGACY_BACKEND if (zeroReg == REG_NA) { regMaskTP freeMask = regSet.rsRegMaskFree(); @@ -1906,7 +1901,6 @@ regNumber CodeGen::genGetZeroRegister() genSetRegToIcon(zeroReg, 0, TYP_INT); } } -#endif // !LEGACY_BACKEND return zeroReg; } @@ -1916,7 +1910,6 @@ regNumber CodeGen::genGetZeroRegister() * Generate an instruction that has one operand given by a tree (which has * been made addressable) and another that is an integer constant. */ -#ifdef LEGACY_BACKEND void CodeGen::inst_TT_IV(instruction ins, GenTreePtr tree, ssize_t val, unsigned offs, emitAttr size, insFlags flags) { bool sizeInferred = false; @@ -2247,9 +2240,7 @@ AGAIN: assert(!"invalid address"); } } -#endif // LEGACY_BACKEND -#ifdef LEGACY_BACKEND /***************************************************************************** * * Generate an instruction that has one operand given by a register and the diff --git a/src/jit/lclvars.cpp b/src/jit/lclvars.cpp index 8ac57da52d..c7f15d8908 100644 --- a/src/jit/lclvars.cpp +++ b/src/jit/lclvars.cpp @@ -7331,11 +7331,10 @@ Compiler::fgWalkResult Compiler::lvaStressLclFldCB(GenTreePtr* pTree, fgWalkData /* Change addr(lclVar) to addr(lclVar)+padding */ noway_assert(oper == GT_ADDR); - GenTreePtr newAddr = new (pComp, GT_NONE) GenTreeOp(*tree->AsOp()); + GenTreePtr paddingTree = pComp->gtNewIconNode(padding); + GenTreePtr newAddr = pComp->gtNewOperNode(GT_ADD, tree->gtType, tree, paddingTree); - tree->ChangeOper(GT_ADD); - tree->gtOp.gtOp1 = newAddr; - tree->gtOp.gtOp2 = pComp->gtNewIconNode(padding); + *pTree = newAddr; lcl->gtType = TYP_BLK; } diff --git a/src/jit/liveness.cpp b/src/jit/liveness.cpp index 028fdc9dfa..3f4d3a18ca 100644 --- a/src/jit/liveness.cpp +++ b/src/jit/liveness.cpp @@ -1935,7 +1935,6 @@ void Compiler::fgComputeLife(VARSET_TP& life, bool* pStmtInfoDirty DEBUGARG(bool* treeModf)) { GenTreePtr tree; - unsigned lclNum; // Don't kill vars in scope VARSET_TP keepAliveVars(VarSetOps::Union(this, volatileVars, compCurBB->bbScope)); diff --git a/src/jit/lower.cpp b/src/jit/lower.cpp index b37cf373f9..d818088b25 100644 --- a/src/jit/lower.cpp +++ b/src/jit/lower.cpp @@ -5296,7 +5296,6 @@ bool Lowering::IndirsAreEquivalent(GenTreePtr candidate, GenTreePtr storeInd) pTreeB = pTreeB->gtSkipReloadOrCopy(); genTreeOps oper; - unsigned kind; if (pTreeA->OperGet() != pTreeB->OperGet()) { diff --git a/src/jit/lsra.cpp b/src/jit/lsra.cpp index c6a999fc95..3c5366ada4 100644 --- a/src/jit/lsra.cpp +++ b/src/jit/lsra.cpp @@ -3083,7 +3083,7 @@ bool LinearScan::buildKillPositionsForNode(GenTree* tree, LsraLocation currentLo } } - if (killGCRefs(tree)) + if (compiler->killGCRefs(tree)) { RefPosition* pos = newRefPosition((Interval*)nullptr, currentLoc, RefTypeKillGCRefs, tree, (allRegs(TYP_REF) & ~RBM_ARG_REGS)); @@ -3094,35 +3094,6 @@ bool LinearScan::buildKillPositionsForNode(GenTree* tree, LsraLocation currentLo return false; } -//------------------------------------------------------------------------ -// killGCRefs: -// Given some tree node return does it need all GC refs to be spilled from -// callee save registers. -// -// Arguments: -// tree - the tree for which we ask about gc refs. -// -// Return Value: -// true - tree kills GC refs on callee save registers -// false - tree doesn't affect GC refs on callee save registers -bool LinearScan::killGCRefs(GenTree* tree) -{ - if (tree->IsCall()) - { - if ((tree->gtFlags & GTF_CALL_UNMANAGED) != 0) - { - return true; - } - - if (tree->AsCall()->gtCallMethHnd == compiler->eeFindHelper(CORINFO_HELP_JIT_PINVOKE_BEGIN)) - { - assert(compiler->opts.ShouldUsePInvokeHelpers()); - return true; - } - } - return false; -} - //---------------------------------------------------------------------------- // defineNewInternalTemp: Defines a ref position for an internal temp. // @@ -10038,7 +10009,21 @@ regNumber LinearScan::getTempRegForResolution(BasicBlock* fromBlock, BasicBlock* VarToRegMap fromVarToRegMap = getOutVarToRegMap(fromBlock->bbNum); VarToRegMap toVarToRegMap = getInVarToRegMap(toBlock->bbNum); +#ifdef _TARGET_ARM_ + regMaskTP freeRegs; + if (type == TYP_DOUBLE) + { + // We have to consider all float registers for TYP_DOUBLE + freeRegs = allRegs(TYP_FLOAT); + } + else + { + freeRegs = allRegs(type); + } +#else // !_TARGET_ARM_ regMaskTP freeRegs = allRegs(type); +#endif // !_TARGET_ARM_ + #ifdef DEBUG if (getStressLimitRegs() == LSRA_LIMIT_SMALL_SET) { @@ -10057,13 +10042,22 @@ regNumber LinearScan::getTempRegForResolution(BasicBlock* fromBlock, BasicBlock* assert(fromReg != REG_NA && toReg != REG_NA); if (fromReg != REG_STK) { - freeRegs &= ~genRegMask(fromReg); + freeRegs &= ~genRegMask(fromReg, getIntervalForLocalVar(varIndex)->registerType); } if (toReg != REG_STK) { - freeRegs &= ~genRegMask(toReg); + freeRegs &= ~genRegMask(toReg, getIntervalForLocalVar(varIndex)->registerType); } } + +#ifdef _TARGET_ARM_ + if (type == TYP_DOUBLE) + { + // Exclude any doubles for which the odd half isn't in freeRegs. + freeRegs = freeRegs & ((freeRegs << 1) & RBM_ALLDOUBLE); + } +#endif + if (freeRegs == RBM_NONE) { return REG_NA; @@ -10683,7 +10677,7 @@ void LinearScan::resolveEdge(BasicBlock* fromBlock, tempRegFlt = getTempRegForResolution(fromBlock, toBlock, TYP_FLOAT); } #else - tempRegFlt = getTempRegForResolution(fromBlock, toBlock, TYP_FLOAT); + tempRegFlt = getTempRegForResolution(fromBlock, toBlock, TYP_FLOAT); #endif } @@ -11488,8 +11482,6 @@ void TreeNodeInfo::dump(LinearScan* lsra) void LinearScan::lsraDumpIntervals(const char* msg) { - Interval* interval; - printf("\nLinear scan intervals %s:\n", msg); for (auto& interval : intervals) { diff --git a/src/jit/lsra.h b/src/jit/lsra.h index fed5d6ea86..55ebe5e8d5 100644 --- a/src/jit/lsra.h +++ b/src/jit/lsra.h @@ -772,8 +772,6 @@ private: // Given some tree node add refpositions for all the registers this node kills bool buildKillPositionsForNode(GenTree* tree, LsraLocation currentLoc); - bool killGCRefs(GenTree* tree); - regMaskTP allRegs(RegisterType rt); regMaskTP allRegs(GenTree* tree); regMaskTP allMultiRegCallNodeRegs(GenTreeCall* tree); diff --git a/src/jit/lsraxarch.cpp b/src/jit/lsraxarch.cpp index 53aebe00bf..6203afb744 100644 --- a/src/jit/lsraxarch.cpp +++ b/src/jit/lsraxarch.cpp @@ -137,9 +137,6 @@ void LinearScan::TreeNodeInfoInit(GenTree* tree) SetContainsAVXFlags(varTypeIsFloating(tree->TypeGet())); switch (tree->OperGet()) { - GenTree* op1; - GenTree* op2; - default: TreeNodeInfoInitSimple(tree); break; @@ -456,10 +453,12 @@ void LinearScan::TreeNodeInfoInit(GenTree* tree) break; case GT_LOCKADD: - op2 = tree->gtOp.gtOp2; + { + GenTreePtr op2 = tree->gtOp.gtOp2; info->srcCount = op2->isContained() ? 1 : 2; assert(info->dstCount == (tree->TypeGet() == TYP_VOID) ? 0 : 1); - break; + } + break; case GT_PUTARG_REG: TreeNodeInfoInitPutArgReg(tree->AsUnOp()); diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index 42c5a2a164..e763d160ab 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -4735,8 +4735,6 @@ void Compiler::fgMorphSystemVStructArgs(GenTreeCall* call, bool hasStructArgumen // void Compiler::fgMorphMultiregStructArgs(GenTreeCall* call) { - GenTreePtr args; - GenTreePtr argx; bool foundStructArg = false; unsigned initialFlags = call->gtFlags; unsigned flagsSummary = 0; @@ -4757,7 +4755,7 @@ void Compiler::fgMorphMultiregStructArgs(GenTreeCall* call) #endif // !UNIX_AMD64_ABI #endif - for (args = call->gtCallArgs; args != nullptr; args = args->gtOp.gtOp2) + for (GenTreePtr args = call->gtCallArgs; args != nullptr; args = args->gtOp.gtOp2) { // For late arguments the arg tree that is overridden is in the gtCallLateArgs list. // For such late args the gtCallArgList contains the setup arg node (evaluating the arg.) @@ -7295,7 +7293,7 @@ bool Compiler::fgCanFastTailCall(GenTreeCall* callee) if (callee->HasRetBufArg()) // RetBuf { - ++calleeArgRegCount; + // We don't increment calleeArgRegCount here, since it is already in callee->gtCallArgs. // If callee has RetBuf param, caller too must have it. // Otherwise go the slow route. @@ -12471,14 +12469,11 @@ DONE_MORPHING_CHILDREN: * Perform the required oper-specific postorder morphing */ - GenTreePtr temp; - GenTreePtr cns1, cns2; - GenTreePtr thenNode; - GenTreePtr elseNode; - size_t ival1, ival2; - GenTreePtr lclVarTree; - GenTreeLclVarCommon* lclVarCmnTree; - FieldSeqNode* fieldSeq = nullptr; + GenTreePtr temp; + GenTreePtr cns1, cns2; + size_t ival1, ival2; + GenTreePtr lclVarTree; + FieldSeqNode* fieldSeq = nullptr; switch (oper) { @@ -13080,7 +13075,7 @@ DONE_MORPHING_CHILDREN: #ifdef LEGACY_BACKEND case GT_QMARK: - + { /* If op1 is a comma throw node then we won't be keeping op2 */ if (fgIsCommaThrow(op1)) { @@ -13090,8 +13085,8 @@ DONE_MORPHING_CHILDREN: /* Get hold of the two branches */ noway_assert(op2->OperGet() == GT_COLON); - elseNode = op2->AsColon()->ElseNode(); - thenNode = op2->AsColon()->ThenNode(); + GenTreePtr thenNode = op2->AsColon()->ThenNode(); + GenTreePtr elseNode = op2->AsColon()->ElseNode(); /* Try to hoist assignments out of qmark colon constructs. ie. replace (cond?(x=a):(x=b)) with (x=(cond?a:b)). */ @@ -13197,9 +13192,9 @@ DONE_MORPHING_CHILDREN: } } #endif // !_TARGET_ARM_ - - break; // end case GT_QMARK -#endif // LEGACY_BACKEND + } + break; // end case GT_QMARK +#endif // LEGACY_BACKEND case GT_MUL: @@ -16698,9 +16693,7 @@ void Compiler::fgMorphBlocks() } #endif - /* Process all statement trees in the basic block */ - - GenTreePtr tree; +/* Process all statement trees in the basic block */ #ifndef LEGACY_BACKEND fgMorphStmts(block, &lnot, &loadw); @@ -16709,7 +16702,7 @@ void Compiler::fgMorphBlocks() if (mult && (opts.compFlags & CLFLG_TREETRANS) && !opts.compDbgCode && !opts.MinOpts()) { - for (tree = block->bbTreeList; tree; tree = tree->gtNext) + for (GenTreePtr tree = block->bbTreeList; tree; tree = tree->gtNext) { assert(tree->gtOper == GT_STMT); GenTreePtr last = tree->gtStmt.gtStmtExpr; @@ -19581,7 +19574,6 @@ bool Compiler::fgMorphCombineSIMDFieldAssignments(BasicBlock* block, GenTreePtr setLclRelatedToSIMDIntrinsic(localDst); } - GenTree* simdStructAddr; if (simdStructNode->TypeGet() == TYP_BYREF) { assert(simdStructNode->OperIsLocal()); diff --git a/src/jit/optcse.cpp b/src/jit/optcse.cpp index bcb5a4c2a8..7c42852cec 100644 --- a/src/jit/optcse.cpp +++ b/src/jit/optcse.cpp @@ -871,9 +871,6 @@ void Compiler::optValnumCSE_InitDataFlow() { for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) { - GenTreePtr stmt; - GenTreePtr tree; - /* Initialize the blocks's bbCseIn set */ bool init_to_zero = false; diff --git a/src/jit/optimizer.cpp b/src/jit/optimizer.cpp index 77b201fc7f..04285916ff 100644 --- a/src/jit/optimizer.cpp +++ b/src/jit/optimizer.cpp @@ -6503,7 +6503,6 @@ void Compiler::optHoistThisLoop(unsigned lnum, LoopHoistContext* hoistCtxt) BasicBlock* head = pLoopDsc->lpHead; BasicBlock* tail = pLoopDsc->lpBottom; BasicBlock* lbeg = pLoopDsc->lpEntry; - BasicBlock* block; // We must have a do-while loop if ((pLoopDsc->lpFlags & LPFLG_DO_WHILE) == 0) diff --git a/src/jit/regset.cpp b/src/jit/regset.cpp index 44312dab42..a42a6cede3 100644 --- a/src/jit/regset.cpp +++ b/src/jit/regset.cpp @@ -407,6 +407,7 @@ void RegSet::rsUnlockReg(regMaskTP regMask, regMaskTP usedMask) } #endif // LEGACY_BACKEND +#ifdef LEGACY_BACKEND /***************************************************************************** * * Assume all registers contain garbage (called at start of codegen and when @@ -419,6 +420,7 @@ void RegTracker::rsTrackRegClr() assert(RV_TRASH == 0); memset(rsRegValues, 0, sizeof(rsRegValues)); } +#endif // LEGACY_BACKEND /***************************************************************************** * @@ -432,11 +434,14 @@ void RegTracker::rsTrackRegTrash(regNumber reg) regSet->rsSetRegsModified(genRegMask(reg)); +#ifdef LEGACY_BACKEND /* Record the new value for the register */ rsRegValues[reg].rvdKind = RV_TRASH; +#endif // LEGACY_BACKEND } +#ifdef LEGACY_BACKEND /***************************************************************************** * * calls rsTrackRegTrash on the set of registers in regmask @@ -460,6 +465,7 @@ void RegTracker::rsTrackRegMaskTrash(regMaskTP regMask) } } } +#endif // LEGACY_BACKEND /*****************************************************************************/ @@ -472,12 +478,15 @@ void RegTracker::rsTrackRegIntCns(regNumber reg, ssize_t val) regSet->rsSetRegsModified(genRegMask(reg)); +#ifdef LEGACY_BACKEND /* Record the new value for the register */ rsRegValues[reg].rvdKind = RV_INT_CNS; rsRegValues[reg].rvdIntCnsVal = val; +#endif } +#ifdef LEGACY_BACKEND /*****************************************************************************/ // inline @@ -557,8 +566,6 @@ void RegTracker::rsTrackRegAssign(GenTree* op1, GenTree* op2) } } -#ifdef LEGACY_BACKEND - /***************************************************************************** * * Given a regmask, find the best regPairNo that can be formed @@ -1371,9 +1378,11 @@ void RegTracker::rsTrackRegLclVar(regNumber reg, unsigned var) #if CPU_HAS_FP_SUPPORT assert(varTypeIsFloating(varDsc->TypeGet()) == false); #endif +#ifdef LEGACY_BACKEND // Kill the register before doing anything in case we take a // shortcut out of here rsRegValues[reg].rvdKind = RV_TRASH; +#endif if (compiler->lvaTable[var].lvAddrExposed) { @@ -1384,7 +1393,7 @@ void RegTracker::rsTrackRegLclVar(regNumber reg, unsigned var) regSet->rsSetRegsModified(genRegMask(reg)); -#if REDUNDANT_LOAD +#ifdef LEGACY_BACKEND /* Is the variable a pointer? */ @@ -1409,8 +1418,6 @@ void RegTracker::rsTrackRegLclVar(regNumber reg, unsigned var) return; } -#endif - #ifdef DEBUG if (compiler->verbose) { @@ -1431,10 +1438,12 @@ void RegTracker::rsTrackRegLclVar(regNumber reg, unsigned var) } rsRegValues[reg].rvdLclVarNum = var; +#endif // LEGACY_BACKEND } /*****************************************************************************/ +#ifdef LEGACY_BACKEND void RegTracker::rsTrackRegSwap(regNumber reg1, regNumber reg2) { RegValDsc tmp; @@ -1443,6 +1452,7 @@ void RegTracker::rsTrackRegSwap(regNumber reg1, regNumber reg2) rsRegValues[reg1] = rsRegValues[reg2]; rsRegValues[reg2] = tmp; } +#endif // LEGACY_BACKEND void RegTracker::rsTrackRegCopy(regNumber reg1, regNumber reg2) { @@ -1453,7 +1463,9 @@ void RegTracker::rsTrackRegCopy(regNumber reg1, regNumber reg2) regSet->rsSetRegsModified(genRegMask(reg1)); +#ifdef LEGACY_BACKEND rsRegValues[reg1] = rsRegValues[reg2]; +#endif // LEGACY_BACKEND } #ifdef LEGACY_BACKEND @@ -2904,10 +2916,7 @@ var_types RegSet::rsRmvMultiReg(regNumber reg) SpillDsc::freeDsc(this, dsc); return type; } -#endif // LEGACY_BACKEND - /*****************************************************************************/ -#if REDUNDANT_LOAD /***************************************************************************** * * Search for a register which contains the given constant value. @@ -3173,6 +3182,7 @@ void RegTracker::rsTrashLcl(unsigned var) } } } +#endif // LEGACY_BACKEND /***************************************************************************** * @@ -3197,6 +3207,7 @@ void RegTracker::rsTrashRegSet(regMaskTP regMask) } } +#ifdef LEGACY_BACKEND /***************************************************************************** * * Return a mask of registers that hold no useful value. @@ -3222,7 +3233,7 @@ regMaskTP RegTracker::rsUselessRegs() } /*****************************************************************************/ -#endif // REDUNDANT_LOAD +#endif // LEGACY_BACKEND /*****************************************************************************/ /* @@ -3845,7 +3856,7 @@ void RegSet::rsSpillChk() #endif /*****************************************************************************/ -#if REDUNDANT_LOAD +#ifdef LEGACY_BACKEND // inline bool RegTracker::rsIconIsInReg(ssize_t val, regNumber reg) @@ -3862,5 +3873,5 @@ bool RegTracker::rsIconIsInReg(ssize_t val, regNumber reg) return false; } -#endif // REDUNDANT_LOAD +#endif // LEGACY_BACKEND /*****************************************************************************/ diff --git a/src/jit/regset.h b/src/jit/regset.h index 9af5200290..d16cd95502 100644 --- a/src/jit/regset.h +++ b/src/jit/regset.h @@ -30,6 +30,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ +#ifdef LEGACY_BACKEND /***************************************************************************** * * Keep track of the current state of each register. This is intended to be @@ -45,6 +46,7 @@ enum regValKind RV_LCL_VAR_LNG_LO, // lower half of long local variable RV_LCL_VAR_LNG_HI, }; +#endif // LEGACY_BACKEND /*****************************************************************************/ @@ -403,6 +405,7 @@ private: // Only integer registers are tracked. // +#ifdef LEGACY_BACKEND struct RegValDsc { regValKind rvdKind; @@ -411,32 +414,44 @@ struct RegValDsc unsigned rvdLclVarNum; // for rvdKind == RV_LCL_VAR, RV_LCL_VAR_LNG_LO, RV_LCL_VAR_LNG_HI }; }; +#endif // LEGACY_BACKEND class RegTracker { Compiler* compiler; RegSet* regSet; +#ifdef LEGACY_BACKEND RegValDsc rsRegValues[REG_COUNT]; +#endif public: void rsTrackInit(Compiler* comp, RegSet* rs) { compiler = comp; regSet = rs; +#ifdef LEGACY_BACKEND rsTrackRegClr(); +#endif } +#ifdef LEGACY_BACKEND void rsTrackRegClr(); void rsTrackRegClrPtr(); +#endif // LEGACY_BACKEND void rsTrackRegTrash(regNumber reg); +#ifdef LEGACY_BACKEND void rsTrackRegMaskTrash(regMaskTP regMask); regMaskTP rsTrashRegsForGCInterruptability(); +#endif // LEGACY_BACKEND void rsTrackRegIntCns(regNumber reg, ssize_t val); void rsTrackRegLclVar(regNumber reg, unsigned var); +#ifdef LEGACY_BACKEND void rsTrackRegLclVarLng(regNumber reg, unsigned var, bool low); bool rsTrackIsLclVarLng(regValKind rvKind); void rsTrackRegClsVar(regNumber reg, GenTreePtr clsVar); +#endif // LEGACY_BACKEND void rsTrackRegCopy(regNumber reg1, regNumber reg2); +#ifdef LEGACY_BACKEND void rsTrackRegSwap(regNumber reg1, regNumber reg2); void rsTrackRegAssign(GenTree* op1, GenTree* op2); @@ -445,16 +460,14 @@ public: regNumber rsLclIsInReg(unsigned var); regPairNo rsLclIsInRegPair(unsigned var); -//---------------------- Load suppression --------------------------------- - -#if REDUNDANT_LOAD + //---------------------- Load suppression --------------------------------- void rsTrashLclLong(unsigned var); void rsTrashLcl(unsigned var); +#endif // LEGACY_BACKEND void rsTrashRegSet(regMaskTP regMask); - +#ifdef LEGACY_BACKEND regMaskTP rsUselessRegs(); - -#endif // REDUNDANT_LOAD +#endif // LEGACY_BACKEND }; #endif // _REGSET_H diff --git a/src/jit/utils.cpp b/src/jit/utils.cpp index 4e061fa15e..a72de57d57 100644 --- a/src/jit/utils.cpp +++ b/src/jit/utils.cpp @@ -2113,7 +2113,6 @@ T GetSignedMagic(T denom, int* shift /*out*/) UT q2; UT t; T result_magic; - int result_shift; int iters = 0; absDenom = abs(denom); diff --git a/src/mscorlib/Common/System/SR.cs b/src/mscorlib/Common/System/SR.cs index 29f3970633..0b6db1298e 100644 --- a/src/mscorlib/Common/System/SR.cs +++ b/src/mscorlib/Common/System/SR.cs @@ -56,7 +56,7 @@ namespace System { if (key == null || key.Length == 0) { - Debug.Assert(false, "SR::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); + Debug.Fail("SR::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); return key; } @@ -100,7 +100,6 @@ namespace System // Note: our infrastructure for reporting this exception will again cause resource lookup. // This is the most direct way of dealing with that problem. string message = $"Infinite recursion during resource lookup within {System.CoreLib.Name}. This may be a bug in {System.CoreLib.Name}, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: {key}"; - Assert.Fail("[Recursive resource lookup bug]", message, Assert.COR_E_FAILFAST, System.Diagnostics.StackTrace.TraceFormat.NoResourceLookup); Environment.FailFast(message); } if (_currentlyLoading == null) diff --git a/src/mscorlib/Resources/Strings.resx b/src/mscorlib/Resources/Strings.resx index bbe3636170..0ded8ea294 100644 --- a/src/mscorlib/Resources/Strings.resx +++ b/src/mscorlib/Resources/Strings.resx @@ -2086,6 +2086,9 @@ <data name="EventSource_AddScalarOutOfRange" xml:space="preserve"> <value>Getting out of bounds during scalar addition.</value> </data> + <data name="EventSource_BadHexDigit" xml:space="preserve"> + <value>Bad Hexidecimal digit "{0}".</value> + </data> <data name="EventSource_ChannelTypeDoesNotMatchEventChannelValue" xml:space="preserve"> <value>Channel {0} does not match event channel value {1}.</value> </data> @@ -2098,6 +2101,9 @@ <data name="EventSource_EnumKindMismatch" xml:space="preserve"> <value>The type of {0} is not expected in {1}.</value> </data> + <data name="EventSource_EvenHexDigits" xml:space="preserve"> + <value>Must have an even number of Hexidecimal digits.</value> + </data> <data name="EventSource_EventChannelOutOfRange" xml:space="preserve"> <value>Channel {0} has a value of {1} which is outside the legal range (16-254).</value> </data> @@ -2122,6 +2128,9 @@ <data name="EventSource_EventSourceGuidInUse" xml:space="preserve"> <value>An instance of EventSource with Guid {0} already exists.</value> </data> + <data name="EventSource_EventTooBig" xml:space="preserve"> + <value>The payload for a single event is too large.</value> + </data> <data name="EventSource_EventWithAdminChannelMustHaveMessage" xml:space="preserve"> <value>Event {0} specifies an Admin channel {1}. It must specify a Message property.</value> </data> @@ -2134,6 +2143,9 @@ <data name="EventSource_IllegalTaskValue" xml:space="preserve"> <value>Task {0} has a value of {1} which is outside the legal range (1-65535).</value> </data> + <data name="EventSource_IllegalValue" xml:space="preserve"> + <value>Illegal value "{0}" (prefix strings with @ to indicate a literal string).</value> + </data> <data name="EventSource_IncorrentlyAuthoredTypeInfo" xml:space="preserve"> <value>Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group</value> </data> @@ -2230,6 +2242,9 @@ <data name="EventSource_ToString" xml:space="preserve"> <value>EventSource({0}, {1})</value> </data> + <data name="EventSource_TraitEven" xml:space="preserve"> + <value>There must be an even number of trait strings (they are key-value pairs).</value> + </data> <data name="EventSource_TypeMustBeSealedOrAbstract" xml:space="preserve"> <value>Event source types must be sealed or abstract.</value> </data> @@ -2245,6 +2260,9 @@ <data name="EventSource_UndefinedOpcode" xml:space="preserve"> <value>Use of undefined opcode value {0} for event {1}.</value> </data> + <data name="EventSource_UnknownEtwTrait" xml:space="preserve"> + <value>Unknown ETW trait "{0}".</value> + </data> <data name="EventSource_UnsupportedEventTypeInManifest" xml:space="preserve"> <value>Unsupported type {0} in event source.</value> </data> diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index 25f605ce63..5e8b28f6d8 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -74,7 +74,7 @@ <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Debug'">false</Optimize> <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Checked'">true</Optimize> <DebugType Condition="'$(DebugType)' == ''">full</DebugType> - <DefineConstants>DBG;_DEBUG;_LOGGING;DEBUG;TRACE;$(DefineConstants)</DefineConstants> + <DefineConstants>_LOGGING;DEBUG;TRACE;$(DefineConstants)</DefineConstants> <DefineConstants Condition="'$(Platform)' == 'x86' or '$(Platform)' == 'amd64'">CODE_ANALYSIS;$(DefineConstants)</DefineConstants> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)' == 'Release'"> diff --git a/src/mscorlib/shared/System/Convert.cs b/src/mscorlib/shared/System/Convert.cs index b6637b13fc..6c592a4923 100644 --- a/src/mscorlib/shared/System/Convert.cs +++ b/src/mscorlib/shared/System/Convert.cs @@ -134,7 +134,7 @@ namespace System private const Int32 base64LineBreakPosition = 76; -#if _DEBUG +#if DEBUG private static bool TriggerAsserts = DoAsserts(); private static bool DoAsserts() { @@ -2902,7 +2902,7 @@ namespace System } // unchecked while // 'd be nice to have an assert that we never get here, but CS0162: Unreachable code detected. - // Debug.Assert(false, "We only leave the above loop by jumping; should never get here."); + // Debug.Fail("We only leave the above loop by jumping; should never get here."); // We jump here out of the loop if we hit an '=': _EqualityCharEncountered: diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/ActivityTracker.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/ActivityTracker.cs index cb0526c1cc..bb52a9bb94 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/ActivityTracker.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/ActivityTracker.cs @@ -5,6 +5,12 @@ using System; using System.Diagnostics; using System.Threading; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else @@ -37,6 +43,7 @@ namespace System.Diagnostics.Tracing /// </summary> internal class ActivityTracker { + /// <summary> /// Called on work item begins. The activity name = providerName + activityName without 'Start' suffix. /// It updates CurrentActivityId to track. diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs index 6dce32ce99..b036b28b4b 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventDescriptor.cs @@ -9,6 +9,12 @@ using System.Runtime.InteropServices; using Environment = Microsoft.Diagnostics.Tracing.Internal.Environment; #endif +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else @@ -83,12 +89,12 @@ namespace System.Diagnostics.Tracing { if (id < 0) { - throw new ArgumentOutOfRangeException(nameof(id), Resources.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); + throw new ArgumentOutOfRangeException(nameof(id), SR.ArgumentOutOfRange_NeedNonNegNum); } if (id > ushort.MaxValue) { - throw new ArgumentOutOfRangeException(nameof(id), Resources.GetResourceString("ArgumentOutOfRange_NeedValidId", 1, ushort.MaxValue)); + throw new ArgumentOutOfRangeException(nameof(id), SR.Format(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } m_traceloggingId = 0; @@ -101,12 +107,12 @@ namespace System.Diagnostics.Tracing if (task < 0) { - throw new ArgumentOutOfRangeException(nameof(task), Resources.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); + throw new ArgumentOutOfRangeException(nameof(task), SR.ArgumentOutOfRange_NeedNonNegNum); } if (task > ushort.MaxValue) { - throw new ArgumentOutOfRangeException(nameof(task), Resources.GetResourceString("ArgumentOutOfRange_NeedValidId", 1, ushort.MaxValue)); + throw new ArgumentOutOfRangeException(nameof(task), SR.Format(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } m_task = (ushort)task; diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs index d9f1747131..a74125a35a 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs @@ -14,6 +14,12 @@ using System.Security.Permissions; using System.Threading; using System; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_AGAINST_DOTNET_V35 using Microsoft.Internal; // for Tuple (can't define alias for open generic types so we "use" the whole namespace) #endif @@ -628,6 +634,7 @@ namespace System.Diagnostics.Tracing if ((level <= m_level) || (m_level == 0)) { + // // Check if Keyword is enabled // diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs index fb15213984..89f3f239e2 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -197,6 +197,12 @@ using System.Threading.Tasks; using Microsoft.Reflection; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if CORECLR || ES_BUILD_PN using Internal.Runtime.Augments; #endif @@ -244,6 +250,7 @@ namespace System.Diagnostics.Tracing /// </remarks> public partial class EventSource : IDisposable { + #if FEATURE_EVENTSOURCE_XPLAT private static readonly EventListener persistent_Xplat_Listener = XplatEventLogger.InitializePersistentListener(); #endif //FEATURE_EVENTSOURCE_XPLAT @@ -421,7 +428,7 @@ namespace System.Diagnostics.Tracing if (name == null) { - throw new ArgumentException(Resources.GetResourceString("Argument_InvalidTypeName"), nameof(eventSourceType)); + throw new ArgumentException(SR.Argument_InvalidTypeName, nameof(eventSourceType)); } return GenerateGuidFromName(name.ToUpperInvariant()); // Make it case insensitive. } @@ -507,7 +514,7 @@ namespace System.Diagnostics.Tracing // User-defined EventCommands should not conflict with the reserved commands. if ((int)command <= (int)EventCommand.Update && (int)command != (int)EventCommand.SendManifest) { - throw new ArgumentException(Resources.GetResourceString("EventSource_InvalidCommand"), nameof(command)); + throw new ArgumentException(SR.EventSource_InvalidCommand, nameof(command)); } eventSource.SendCommand(null, 0, 0, command, true, EventLevel.LogAlways, EventKeywords.None, commandArguments); @@ -586,7 +593,7 @@ namespace System.Diagnostics.Tracing /// </summary> public override string ToString() { - return Resources.GetResourceString("EventSource_ToString", Name, Guid); + return SR.Format(SR.EventSource_ToString, Name, Guid); } /// <summary> @@ -1250,6 +1257,7 @@ namespace System.Diagnostics.Tracing #if FEATURE_MANAGED_ETW if (m_eventData[eventId].EnabledForETW) { + #if FEATURE_ACTIVITYSAMPLING // this code should be kept in sync with WriteEventVarargs(). SessionMask etwSessions = SessionMask.All; @@ -1520,17 +1528,17 @@ namespace System.Diagnostics.Tracing m_traits = traits; if (m_traits != null && m_traits.Length % 2 != 0) { - throw new ArgumentException(Resources.GetResourceString("TraitEven"), nameof(traits)); + throw new ArgumentException(SR.EventSource_TraitEven, nameof(traits)); } if (eventSourceGuid == Guid.Empty) { - throw new ArgumentException(Resources.GetResourceString("EventSource_NeedGuid")); + throw new ArgumentException(SR.EventSource_NeedGuid); } if (eventSourceName == null) { - throw new ArgumentException(Resources.GetResourceString("EventSource_NeedName")); + throw new ArgumentException(SR.EventSource_NeedName); } m_name = eventSourceName; @@ -1983,7 +1991,7 @@ namespace System.Diagnostics.Tracing // which would cause a cryptic IndexOutOfRangeException later if we don't catch it here. if (!m_eventData[eventId].HasRelatedActivityID) { - throw new ArgumentException(Resources.GetResourceString("EventSource_NoRelatedActivityId")); + throw new ArgumentException(SR.EventSource_NoRelatedActivityId); } } @@ -2184,7 +2192,7 @@ namespace System.Diagnostics.Tracing if (!typesMatch) { - System.Diagnostics.Debugger.Log(0, null, Resources.GetResourceString("EventSource_VarArgsParameterMismatch") + "\r\n"); + System.Diagnostics.Debugger.Log(0, null, SR.EventSource_VarArgsParameterMismatch + "\r\n"); } #endif //!ES_BUILD_PCL } @@ -2211,7 +2219,7 @@ namespace System.Diagnostics.Tracing } if (eventDataCount != modifiedParamCount) { - ReportOutOfBandMessage(Resources.GetResourceString("EventSource_EventParametersMismatch", eventId, eventDataCount, paramCount), true); + ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventId, eventDataCount, paramCount), true); paramCount = Math.Min(paramCount, eventDataCount); } @@ -2501,20 +2509,20 @@ namespace System.Diagnostics.Tracing switch (EventProvider.GetLastWriteEventError()) { case EventProvider.WriteEventErrorCode.EventTooBig: - ReportOutOfBandMessage(errorPrefix + ": " + Resources.GetResourceString("EventSource_EventTooBig"), true); - if (ThrowOnEventWriteErrors) throw new EventSourceException(Resources.GetResourceString("EventSource_EventTooBig"), innerEx); + ReportOutOfBandMessage(errorPrefix + ": " + SR.EventSource_EventTooBig, true); + if (ThrowOnEventWriteErrors) throw new EventSourceException(SR.EventSource_EventTooBig, innerEx); break; case EventProvider.WriteEventErrorCode.NoFreeBuffers: - ReportOutOfBandMessage(errorPrefix + ": " + Resources.GetResourceString("EventSource_NoFreeBuffers"), true); - if (ThrowOnEventWriteErrors) throw new EventSourceException(Resources.GetResourceString("EventSource_NoFreeBuffers"), innerEx); + ReportOutOfBandMessage(errorPrefix + ": " + SR.EventSource_NoFreeBuffers, true); + if (ThrowOnEventWriteErrors) throw new EventSourceException(SR.EventSource_NoFreeBuffers, innerEx); break; case EventProvider.WriteEventErrorCode.NullInput: - ReportOutOfBandMessage(errorPrefix + ": " + Resources.GetResourceString("EventSource_NullInput"), true); - if (ThrowOnEventWriteErrors) throw new EventSourceException(Resources.GetResourceString("EventSource_NullInput"), innerEx); + ReportOutOfBandMessage(errorPrefix + ": " + SR.EventSource_NullInput, true); + if (ThrowOnEventWriteErrors) throw new EventSourceException(SR.EventSource_NullInput, innerEx); break; case EventProvider.WriteEventErrorCode.TooManyArgs: - ReportOutOfBandMessage(errorPrefix + ": " + Resources.GetResourceString("EventSource_TooManyArgs"), true); - if (ThrowOnEventWriteErrors) throw new EventSourceException(Resources.GetResourceString("EventSource_TooManyArgs"), innerEx); + ReportOutOfBandMessage(errorPrefix + ": " + SR.EventSource_TooManyArgs, true); + if (ThrowOnEventWriteErrors) throw new EventSourceException(SR.EventSource_TooManyArgs, innerEx); break; default: if (innerEx != null) @@ -2705,7 +2713,7 @@ namespace System.Diagnostics.Tracing commandArgs.dispatcher = GetDispatcher(commandArgs.listener); if (commandArgs.dispatcher == null && commandArgs.listener != null) // dispatcher == null means ETW dispatcher { - throw new ArgumentException(Resources.GetResourceString("EventSource_ListenerNotFound")); + throw new ArgumentException(SR.EventSource_ListenerNotFound); } if (commandArgs.Arguments == null) @@ -2786,7 +2794,7 @@ namespace System.Diagnostics.Tracing if (commandArgs.listener == null && commandArgs.Arguments.Count > 0 && commandArgs.perEventSourceSessionId != sessionIdBit) { - throw new ArgumentException(Resources.GetResourceString("EventSource_SessionIdError", + throw new ArgumentException(SR.Format(SR.EventSource_SessionIdError, commandArgs.perEventSourceSessionId + SessionMask.SHIFT_SESSION_TO_KEYWORD, sessionIdBit + SessionMask.SHIFT_SESSION_TO_KEYWORD)); } @@ -3143,7 +3151,7 @@ namespace System.Diagnostics.Tracing { if (eventSource != this) { - throw new ArgumentException(Resources.GetResourceString("EventSource_EventSourceGuidInUse", m_guid)); + throw new ArgumentException(SR.Format(SR.EventSource_EventSourceGuidInUse, m_guid)); } } } @@ -3241,7 +3249,11 @@ namespace System.Diagnostics.Tracing // 5 chunks, so only the largest manifests will hit the pause. if ((envelope.ChunkNumber % 5) == 0) { +#if ES_BUILD_STANDALONE + Thread.Sleep(15); +#else RuntimeThread.Sleep(15); +#endif } } } @@ -3326,7 +3338,7 @@ namespace System.Diagnostics.Tracing return null; #else // ES_BUILD_PCL && ES_BUILD_PN // Don't use nameof here because the resource doesn't exist on some platforms, which results in a compilation error. - throw new ArgumentException(Resources.GetResourceString("EventSource", "EventSource_PCLPlatformNotSupportedReflection")); + throw new ArgumentException("EventSource_PCLPlatformNotSupportedReflection", "EventSource"); #endif } @@ -3402,7 +3414,7 @@ namespace System.Diagnostics.Tracing if (eventSourceType.IsAbstract() && (flags & EventManifestOptions.Strict) == 0) return null; -#if DEBUG && ES_BUILD_STANDALONE +#if DEBUG && ES_BUILD_STANDALONE && TEST_SUPPORT TestSupport.TestHooks.MaybeThrow(eventSourceType, TestSupport.Category.ManifestError, "EventSource_CreateManifestAndDescriptors", @@ -3443,11 +3455,11 @@ namespace System.Diagnostics.Tracing if (!typeMatch) { - manifest.ManifestError(Resources.GetResourceString("EventSource_TypeMustDeriveFromEventSource")); + manifest.ManifestError(SR.EventSource_TypeMustDeriveFromEventSource); } if (!eventSourceType.IsAbstract() && !eventSourceType.IsSealed()) { - manifest.ManifestError(Resources.GetResourceString("EventSource_TypeMustBeSealedOrAbstract")); + manifest.ManifestError(SR.EventSource_TypeMustBeSealedOrAbstract); } } @@ -3463,7 +3475,7 @@ namespace System.Diagnostics.Tracing { if (eventSourceType.IsAbstract()) { - manifest.ManifestError(Resources.GetResourceString("EventSource_AbstractMustNotDeclareKTOC", nestedType.Name)); + manifest.ManifestError(SR.Format(SR.EventSource_AbstractMustNotDeclareKTOC, nestedType.Name)); } else { @@ -3506,7 +3518,7 @@ namespace System.Diagnostics.Tracing { if (eventAttribute != null) { - manifest.ManifestError(Resources.GetResourceString("EventSource_AbstractMustNotDeclareEventMethods", method.Name, eventAttribute.EventId)); + manifest.ManifestError(SR.Format(SR.EventSource_AbstractMustNotDeclareEventMethods, method.Name, eventAttribute.EventId)); } continue; } @@ -3535,12 +3547,12 @@ namespace System.Diagnostics.Tracing } else if (eventAttribute.EventId <= 0) { - manifest.ManifestError(Resources.GetResourceString("EventSource_NeedPositiveId", method.Name), true); + manifest.ManifestError(SR.Format(SR.EventSource_NeedPositiveId, method.Name), true); continue; // don't validate anything else for this event } if (method.Name.LastIndexOf('.') >= 0) { - manifest.ManifestError(Resources.GetResourceString("EventSource_EventMustNotBeExplicitImplementation", method.Name, eventAttribute.EventId)); + manifest.ManifestError(SR.Format(SR.EventSource_EventMustNotBeExplicitImplementation, method.Name, eventAttribute.EventId)); } eventId++; @@ -3588,6 +3600,7 @@ namespace System.Diagnostics.Tracing string.Compare(startEventMetadata.Name, 0, taskName, 0, taskName.Length) == 0 && string.Compare(startEventMetadata.Name, taskName.Length, s_ActivityStartSuffix, 0, Math.Max(startEventMetadata.Name.Length - taskName.Length, s_ActivityStartSuffix.Length)) == 0) { + // Make the stop event match the start event eventAttribute.Task = (EventTask)startEventMetadata.Descriptor.Task; noTask = false; @@ -3595,7 +3608,7 @@ namespace System.Diagnostics.Tracing } if (noTask && (flags & EventManifestOptions.Strict) != 0) // Throw an error if we can compatibly. { - throw new ArgumentException(Resources.GetResourceString("EventSource_StopsFollowStarts")); + throw new ArgumentException(SR.EventSource_StopsFollowStarts); } } } @@ -3748,7 +3761,7 @@ namespace System.Diagnostics.Tracing #endif return; Error: - manifest.ManifestError(Resources.GetResourceString("EventSource_EnumKindMismatch", staticField.Name, staticField.FieldType.Name, providerEnumKind)); + manifest.ManifestError(SR.Format(SR.EventSource_EnumKindMismatch, staticField.Name, staticField.FieldType.Name, providerEnumKind)); } // Helper used by code:CreateManifestAndDescriptors to add a code:EventData descriptor for a method @@ -3831,12 +3844,12 @@ namespace System.Diagnostics.Tracing int eventArg = GetHelperCallFirstArg(method); if (eventArg >= 0 && evtId != eventArg) { - manifest.ManifestError(Resources.GetResourceString("EventSource_MismatchIdToWriteEvent", evtName, evtId, eventArg), true); + manifest.ManifestError(SR.Format(SR.EventSource_MismatchIdToWriteEvent, evtName, evtId, eventArg), true); } if (evtId < eventData.Length && eventData[evtId].Descriptor.EventId != 0) { - manifest.ManifestError(Resources.GetResourceString("EventSource_EventIdReused", evtName, evtId, eventData[evtId].Name), true); + manifest.ManifestError(SR.Format(SR.EventSource_EventIdReused, evtName, evtId, eventData[evtId].Name), true); } // We give a task to things if they don't have one. @@ -3850,7 +3863,7 @@ namespace System.Diagnostics.Tracing if (eventData[idx].Descriptor.Task == (int)eventAttribute.Task && eventData[idx].Descriptor.Opcode == (int)eventAttribute.Opcode) { - manifest.ManifestError(Resources.GetResourceString("EventSource_TaskOpcodePairReused", + manifest.ManifestError(SR.Format(SR.EventSource_TaskOpcodePairReused, evtName, evtId, eventData[idx].Name, idx)); // If we are not strict stop on first error. We have had problems with really large providers taking forever. because of many errors. if ((options & EventManifestOptions.Strict) == 0) @@ -3875,7 +3888,7 @@ namespace System.Diagnostics.Tracing } if (failure) { - manifest.ManifestError(Resources.GetResourceString("EventSource_EventMustHaveTaskIfNonDefaultOpcode", evtName, evtId)); + manifest.ManifestError(SR.Format(SR.EventSource_EventMustHaveTaskIfNonDefaultOpcode, evtName, evtId)); } } @@ -3885,7 +3898,7 @@ namespace System.Diagnostics.Tracing // taskName & opcodeName could be passed in by the caller which has opTab & taskTab handy // if (!(((int)eventAttribute.Opcode == 0 && evtName == taskName) || (evtName == taskName+opcodeName))) // { - // throw new WarningException(Resources.GetResourceString("EventSource_EventNameDoesNotEqualTaskPlusOpcode")); + // throw new WarningException(SR.EventSource_EventNameDoesNotEqualTaskPlusOpcode); // } if (eventsByName == null) @@ -3893,7 +3906,7 @@ namespace System.Diagnostics.Tracing if (eventsByName.ContainsKey(evtName)) { - manifest.ManifestError(Resources.GetResourceString("EventSource_EventNameReused", evtName), true); + manifest.ManifestError(SR.Format(SR.EventSource_EventNameReused, evtName), true); } eventsByName[evtName] = evtName; @@ -4025,7 +4038,7 @@ namespace System.Diagnostics.Tracing goto default; break; default: - /* Debug.Assert(false, "Warning: User validation code sub-optimial: Unsuported opcode " + instrs[idx] + + /* Debug.Fail("Warning: User validation code sub-optimial: Unsuported opcode " + instrs[idx] + " at " + idx + " in method " + method.Name); */ return -1; } @@ -4085,7 +4098,7 @@ namespace System.Diagnostics.Tracing EventSourceSettings.EtwSelfDescribingEventFormat; if ((settings & evtFormatMask) == evtFormatMask) { - throw new ArgumentException(Resources.GetResourceString("EventSource_InvalidEventFormat"), nameof(settings)); + throw new ArgumentException(SR.EventSource_InvalidEventFormat, nameof(settings)); } // If you did not explicitly ask for manifest, you get self-describing. @@ -4232,7 +4245,7 @@ namespace System.Diagnostics.Tracing 0x87, 0xF8, 0x1A, 0x15, 0xBF, 0xC1, 0x30, 0xFB, }; - #endregion +#endregion } /// <summary> @@ -4509,7 +4522,7 @@ namespace System.Diagnostics.Tracing } - #region private +#region private /// <summary> /// This routine adds newEventSource to the global list of eventSources, it also assigns the /// ID to the eventSource (which is simply the ordinal in the global list). @@ -4617,7 +4630,7 @@ namespace System.Diagnostics.Tracing EventDispatcher cur = prev.m_Next; if (cur == null) { - Debug.Assert(false, "EventSource did not have a registered EventListener!"); + Debug.Fail("EventSource did not have a registered EventListener!"); break; } if (cur.m_Listener == listenerToRemove) @@ -4705,7 +4718,7 @@ namespace System.Diagnostics.Tracing // Disallow creating EventListener reentrancy. if (s_CreatingListener) { - throw new InvalidOperationException(Resources.GetResourceString("EventSource_ListenerCreatedInsideCallback")); + throw new InvalidOperationException(SR.EventSource_ListenerCreatedInsideCallback); } try @@ -4779,7 +4792,7 @@ namespace System.Diagnostics.Tracing /// Used to register AD/Process shutdown callbacks. /// </summary> private static bool s_EventSourceShutdownRegistered = false; - #endregion +#endregion } /// <summary> @@ -4821,7 +4834,7 @@ namespace System.Diagnostics.Tracing return eventSource.EnableEventForDispatcher(dispatcher, eventId, false); } - #region private +#region private internal EventCommandEventArgs(EventCommand command, IDictionary<string, string> arguments, EventSource eventSource, EventListener listener, int perEventSourceSessionId, int etwSessionId, bool enable, EventLevel level, EventKeywords matchAnyKeyword) @@ -4849,7 +4862,7 @@ namespace System.Diagnostics.Tracing internal EventKeywords matchAnyKeyword; internal EventCommandEventArgs nextCommand; // We form a linked list of these deferred commands. - #endregion +#endregion } /// <summary> @@ -4932,6 +4945,7 @@ namespace System.Diagnostics.Tracing // do the lazy init if you know it is contract based (EventID >= 0) if (EventId >= 0 && m_payloadNames == null) { + var names = new List<string>(); foreach (var parameter in m_eventSource.m_eventData[EventId].Parameters) { @@ -5068,7 +5082,7 @@ namespace System.Diagnostics.Tracing } } - #region private +#region private internal EventWrittenEventArgs(EventSource eventSource) { m_eventSource = eventSource; @@ -5081,7 +5095,7 @@ namespace System.Diagnostics.Tracing internal EventOpcode m_opcode; internal EventLevel m_level; internal EventKeywords m_keywords; - #endregion +#endregion } /// <summary> @@ -5193,10 +5207,10 @@ namespace System.Diagnostics.Tracing /// </summary> public EventActivityOptions ActivityOptions { get; set; } - #region private +#region private EventOpcode m_opcode; private bool m_opcodeSet; - #endregion +#endregion } /// <summary> @@ -5336,7 +5350,7 @@ namespace System.Diagnostics.Tracing }; - #region private classes +#region private classes #if FEATURE_ACTIVITYSAMPLING @@ -5684,7 +5698,7 @@ namespace System.Diagnostics.Tracing } } - #region private +#region private /// <summary> /// Creates a new ActivityFilter that is triggered by 'eventId' from 'source' ever @@ -5853,7 +5867,7 @@ namespace System.Diagnostics.Tracing ActivityFilter m_next; // We create a linked list of these Action<Guid> m_myActivityDelegate; - #endregion +#endregion }; @@ -6161,12 +6175,12 @@ namespace System.Diagnostics.Tracing { if (value <= 10 || value >= 239) { - ManifestError(Resources.GetResourceString("EventSource_IllegalOpcodeValue", name, value)); + ManifestError(SR.Format(SR.EventSource_IllegalOpcodeValue, name, value)); } string prevName; if (opcodeTab.TryGetValue(value, out prevName) && !name.Equals(prevName, StringComparison.Ordinal)) { - ManifestError(Resources.GetResourceString("EventSource_OpcodeCollision", name, prevName, value)); + ManifestError(SR.Format(SR.EventSource_OpcodeCollision, name, prevName, value)); } } opcodeTab[value] = name; @@ -6177,12 +6191,12 @@ namespace System.Diagnostics.Tracing { if (value <= 0 || value >= 65535) { - ManifestError(Resources.GetResourceString("EventSource_IllegalTaskValue", name, value)); + ManifestError(SR.Format(SR.EventSource_IllegalTaskValue, name, value)); } string prevName; if (taskTab != null && taskTab.TryGetValue(value, out prevName) && !name.Equals(prevName, StringComparison.Ordinal)) { - ManifestError(Resources.GetResourceString("EventSource_TaskCollision", name, prevName, value)); + ManifestError(SR.Format(SR.EventSource_TaskCollision, name, prevName, value)); } } if (taskTab == null) @@ -6193,18 +6207,18 @@ namespace System.Diagnostics.Tracing { if ((value & (value - 1)) != 0) // Is it a power of 2? { - ManifestError(Resources.GetResourceString("EventSource_KeywordNeedPowerOfTwo", "0x" + value.ToString("x", CultureInfo.CurrentCulture), name), true); + ManifestError(SR.Format(SR.EventSource_KeywordNeedPowerOfTwo, "0x" + value.ToString("x", CultureInfo.CurrentCulture), name), true); } if ((flags & EventManifestOptions.Strict) != 0) { if (value >= 0x0000100000000000UL && !name.StartsWith("Session", StringComparison.Ordinal)) { - ManifestError(Resources.GetResourceString("EventSource_IllegalKeywordsValue", name, "0x" + value.ToString("x", CultureInfo.CurrentCulture))); + ManifestError(SR.Format(SR.EventSource_IllegalKeywordsValue, name, "0x" + value.ToString("x", CultureInfo.CurrentCulture))); } string prevName; if (keywordTab != null && keywordTab.TryGetValue(value, out prevName) && !name.Equals(prevName, StringComparison.Ordinal)) { - ManifestError(Resources.GetResourceString("EventSource_KeywordCollision", name, prevName, "0x" + value.ToString("x", CultureInfo.CurrentCulture))); + ManifestError(SR.Format(SR.EventSource_KeywordCollision, name, prevName, "0x" + value.ToString("x", CultureInfo.CurrentCulture))); } } if (keywordTab == null) @@ -6220,13 +6234,13 @@ namespace System.Diagnostics.Tracing { EventChannel chValue = (EventChannel)value; if (value < (int)EventChannel.Admin || value > 255) - ManifestError(Resources.GetResourceString("EventSource_EventChannelOutOfRange", name, value)); + ManifestError(SR.Format(SR.EventSource_EventChannelOutOfRange, name, value)); else if (chValue >= EventChannel.Admin && chValue <= EventChannel.Debug && channelAttribute != null && EventChannelToChannelType(chValue) != channelAttribute.EventChannelType) { // we want to ensure developers do not define EventChannels that conflict with the builtin ones, // but we want to allow them to override the default ones... - ManifestError(Resources.GetResourceString("EventSource_ChannelTypeDoesNotMatchEventChannelValue", + ManifestError(SR.Format(SR.EventSource_ChannelTypeDoesNotMatchEventChannelValue, name, ((EventChannel)value).ToString())); } @@ -6400,7 +6414,7 @@ namespace System.Diagnostics.Tracing } if (channelTab.Count == MaxCountChannels) - ManifestError(Resources.GetResourceString("EventSource_MaxChannelExceeded")); + ManifestError(SR.EventSource_MaxChannelExceeded); ChannelInfo info; if (!channelTab.TryGetValue((int)channel, out info)) @@ -6446,6 +6460,7 @@ namespace System.Diagnostics.Tracing private string CreateManifestString() { + #if FEATURE_MANAGED_ETW_CHANNELS // Write out the channels if (channelTab != null) @@ -6513,6 +6528,7 @@ namespace System.Diagnostics.Tracing // Write out the tasks if (taskTab != null) { + sb.Append(" <tasks>").AppendLine(); var sortedTasks = new List<int>(taskTab.Keys); sortedTasks.Sort(); @@ -6657,7 +6673,7 @@ namespace System.Diagnostics.Tracing return sb.ToString(); } - #region private +#region private private void WriteNameAndMessageAttribs(StringBuilder stringBuilder, string elementName, string name) { stringBuilder.Append(" name=\"").Append(name).Append("\""); @@ -6681,7 +6697,7 @@ namespace System.Diagnostics.Tracing string prevValue; if (stringTab.TryGetValue(key, out prevValue) && !prevValue.Equals(value)) { - ManifestError(Resources.GetResourceString("EventSource_DuplicateStringKey", key), true); + ManifestError(SR.Format(SR.EventSource_DuplicateStringKey, key), true); return; } @@ -6737,7 +6753,7 @@ namespace System.Diagnostics.Tracing if (channelTab == null || !channelTab.TryGetValue((int)channel, out info)) { if (channel < EventChannel.Admin) // || channel > EventChannel.Debug) - ManifestError(Resources.GetResourceString("EventSource_UndefinedChannel", channel, eventName)); + ManifestError(SR.Format(SR.EventSource_UndefinedChannel, channel, eventName)); // allow channels to be auto-defined. The well known ones get their well known names, and the // rest get names Channel<N>. This allows users to modify the Manifest if they want more advanced features. @@ -6750,13 +6766,13 @@ namespace System.Diagnostics.Tracing AddChannel(channelName, (int)channel, GetDefaultChannelAttribute(channel)); if (!channelTab.TryGetValue((int)channel, out info)) - ManifestError(Resources.GetResourceString("EventSource_UndefinedChannel", channel, eventName)); + ManifestError(SR.Format(SR.EventSource_UndefinedChannel, channel, eventName)); } // events that specify admin channels *must* have non-null "Message" attributes if (resources != null && eventMessage == null) eventMessage = resources.GetString("event_" + eventName, CultureInfo.InvariantCulture); if (info.Attribs.EventChannelType == EventChannelType.Admin && eventMessage == null) - ManifestError(Resources.GetResourceString("EventSource_EventWithAdminChannelMustHaveMessage", eventName, info.Name)); + ManifestError(SR.Format(SR.EventSource_EventWithAdminChannelMustHaveMessage, eventName, info.Name)); return info.Name; } #endif @@ -6804,7 +6820,7 @@ namespace System.Diagnostics.Tracing string ret; if (opcodeTab == null || !opcodeTab.TryGetValue((int)opcode, out ret)) { - ManifestError(Resources.GetResourceString("EventSource_UndefinedOpcode", opcode, eventName), true); + ManifestError(SR.Format(SR.EventSource_UndefinedOpcode, opcode, eventName), true); ret = null; } return ret; @@ -6833,7 +6849,7 @@ namespace System.Diagnostics.Tracing } if (keyword == null) { - ManifestError(Resources.GetResourceString("EventSource_UndefinedKeyword", "0x" + bit.ToString("x", CultureInfo.CurrentCulture), eventName), true); + ManifestError(SR.Format(SR.EventSource_UndefinedKeyword, "0x" + bit.ToString("x", CultureInfo.CurrentCulture), eventName), true); keyword = string.Empty; } if (ret.Length != 0 && keyword.Length != 0) @@ -6926,7 +6942,7 @@ namespace System.Diagnostics.Tracing } else { - ManifestError(Resources.GetResourceString("EventSource_UnsupportedMessageProperty", evtName, eventMessage)); + ManifestError(SR.Format(SR.EventSource_UnsupportedMessageProperty, evtName, eventMessage)); } } else if ((chIdx = "&<>'\"\r\n\t".IndexOf(eventMessage[i])) >= 0) @@ -7003,7 +7019,7 @@ namespace System.Diagnostics.Tracing string eventName; // Name of the event currently being processed. int numParams; // keeps track of the number of args the event has. List<int> byteArrArgIndices; // keeps track of the index of each byte[] argument - #endregion +#endregion } /// <summary> @@ -7027,6 +7043,6 @@ namespace System.Diagnostics.Tracing #endif }; - #endregion +#endregion } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs index 6761c06762..be1bf3940a 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSourceException.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Resources; using System.Runtime.Serialization; #if ES_BUILD_STANDALONE @@ -18,7 +19,7 @@ namespace System.Diagnostics.Tracing /// <summary> /// Exception that is thrown when an error occurs during EventSource operation. /// </summary> -#if !ES_BUILD_PN && !ES_BUILD_PCL +#if !ES_BUILD_PCL [Serializable] #endif public class EventSourceException : Exception @@ -27,7 +28,7 @@ namespace System.Diagnostics.Tracing /// Initializes a new instance of the EventSourceException class. /// </summary> public EventSourceException() : - base(Resources.GetResourceString("EventSource_ListenerWriteFailure")) { } + base(SR.EventSource_ListenerWriteFailure) { } /// <summary> /// Initializes a new instance of the EventSourceException class with a specified error message. @@ -48,6 +49,6 @@ namespace System.Diagnostics.Tracing #endif internal EventSourceException(Exception innerException) : - base(Resources.GetResourceString("EventSource_ListenerWriteFailure"), innerException) { } + base(SR.EventSource_ListenerWriteFailure, innerException) { } } } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs index 966dac2fef..d34f80eb51 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/IEventProvider.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using Microsoft.Win32; #if ES_BUILD_STANDALONE diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs index 5797d4d09c..1b3ca8004c 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/StubEnvironment.cs @@ -356,3 +356,18 @@ namespace System } } #endif + +#if ES_BUILD_STANDALONE +namespace Microsoft.Win32 +{ + using System.Runtime.InteropServices; + using System.Security; + + [SuppressUnmanagedCodeSecurityAttribute()] + internal static class Win32Native + { + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + internal static extern uint GetCurrentProcessId(); + } +} +#endif diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs index 87df2d37a7..1444c267cb 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Resources; using System.Runtime.InteropServices; using System.Security; @@ -85,7 +86,7 @@ namespace System.Diagnostics.Tracing var scratchNew = scratchOld + size; if (this.scratchEnd < scratchNew) { - throw new IndexOutOfRangeException(Resources.GetResourceString("EventSource_AddScalarOutOfRange")); + throw new IndexOutOfRangeException(SR.EventSource_AddScalarOutOfRange); } this.ScalarsBegin(); @@ -272,13 +273,13 @@ namespace System.Diagnostics.Tracing var pinsTemp = this.pins; if (this.pinsEnd <= pinsTemp) { - throw new IndexOutOfRangeException(Resources.GetResourceString("EventSource_PinArrayOutOfRange")); + throw new IndexOutOfRangeException(SR.EventSource_PinArrayOutOfRange); } var datasTemp = this.datas; if (this.datasEnd <= datasTemp) { - throw new IndexOutOfRangeException(Resources.GetResourceString("EventSource_DataDescriptorsOutOfRange")); + throw new IndexOutOfRangeException(SR.EventSource_DataDescriptorsOutOfRange); } this.pins = pinsTemp + 1; @@ -296,7 +297,7 @@ namespace System.Diagnostics.Tracing var datasTemp = this.datas; if (this.datasEnd <= datasTemp) { - throw new IndexOutOfRangeException(Resources.GetResourceString("EventSource_DataDescriptorsOutOfRange")); + throw new IndexOutOfRangeException(SR.EventSource_DataDescriptorsOutOfRange); } datasTemp->DataPointer = (IntPtr) this.scratch; diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventPayload.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventPayload.cs index abe9ece13c..5967ad6ab5 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventPayload.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventPayload.cs @@ -6,6 +6,12 @@ using System.Collections.Generic; using System.Collections; using System.Diagnostics; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs index ef2ec4715c..865082f767 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs @@ -4,6 +4,12 @@ using System; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/FieldMetadata.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/FieldMetadata.cs index 309226b84d..9c7c6369ec 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/FieldMetadata.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/FieldMetadata.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Resources; using Encoding = System.Text.Encoding; #if ES_BUILD_STANDALONE @@ -128,17 +129,17 @@ namespace System.Diagnostics.Tracing { if (coreType == (int)TraceLoggingDataType.Nil) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfNil")); + throw new NotSupportedException(SR.EventSource_NotSupportedArrayOfNil); } if (coreType == (int)TraceLoggingDataType.Binary) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfBinary")); + throw new NotSupportedException(SR.EventSource_NotSupportedArrayOfBinary); } #if !BROKEN_UNTIL_M3 if (coreType == (int)TraceLoggingDataType.Utf16String || coreType == (int)TraceLoggingDataType.MbcsString) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedArrayOfNullTerminatedString")); + throw new NotSupportedException(SR.EventSource_NotSupportedArrayOfNullTerminatedString); } #endif } @@ -160,7 +161,7 @@ namespace System.Diagnostics.Tracing this.outType++; if ((this.outType & Statics.OutTypeMask) == 0) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_TooManyFields")); + throw new NotSupportedException(SR.EventSource_TooManyFields); } } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/PropertyValue.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/PropertyValue.cs index d74494bc85..854bc06bb6 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/PropertyValue.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/PropertyValue.cs @@ -1,8 +1,19 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.InteropServices; using System.Diagnostics; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + +#if ES_BUILD_STANDALONE +namespace Microsoft.Diagnostics.Tracing +#else namespace System.Diagnostics.Tracing +#endif { /// <summary> /// Holds property values of any type. For common value types, we have inline storage so that we don't need diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs index 61cb92ffad..901a0ed1a2 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs @@ -7,6 +7,12 @@ using System.Collections.Generic; using System.Reflection; using System.Diagnostics; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs index 9fa776753d..05539ab4fd 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/Statics.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Reflection; +using System.Resources; using System.Runtime.CompilerServices; using Encoding = System.Text.Encoding; @@ -531,7 +532,7 @@ namespace System.Diagnostics.Tracing if (recursionCheck.Contains(dataType)) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_RecursiveTypeDefinition")); + throw new NotSupportedException(SR.EventSource_RecursiveTypeDefinition); } recursionCheck.Add(dataType); @@ -714,7 +715,7 @@ namespace System.Diagnostics.Tracing } else { - throw new ArgumentException(Resources.GetResourceString("EventSource_NonCompliantTypeError", dataType.Name)); + throw new ArgumentException(SR.Format(SR.EventSource_NonCompliantTypeError, dataType.Name)); } } } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs index 8d12b64a08..bf29d71844 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs @@ -24,14 +24,17 @@ using EventDescriptor = Microsoft.Diagnostics.Tracing.EventDescriptor; #endif using System; +using System.Resources; using System.Runtime.InteropServices; using System.Security; using System.Collections.ObjectModel; #if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; using System.Collections.Generic; using System.Text; #else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; using System.Collections.Generic; using System.Text; #endif @@ -114,7 +117,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(eventName)); } - if (!this.IsEnabled()) { return; @@ -140,7 +142,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(eventName)); } - if (!this.IsEnabled()) { return; @@ -774,7 +775,7 @@ namespace System.Diagnostics.Tracing } else { - throw new ArgumentException(Resources.GetResourceString("UnknownEtwTrait", etwTrait), "traits"); + throw new ArgumentException(SR.Format(SR.EventSource_UnknownEtwTrait, etwTrait), "traits"); } } string value = m_traits[i + 1]; @@ -817,7 +818,7 @@ namespace System.Diagnostics.Tracing { if (!(i + 1 < value.Length)) { - throw new ArgumentException(Resources.GetResourceString("EvenHexDigits"), "traits"); + throw new ArgumentException(SR.EventSource_EvenHexDigits, "traits"); } metaData.Add((byte)(HexDigit(value[i]) * 16 + HexDigit(value[i + 1]))); i++; @@ -830,7 +831,7 @@ namespace System.Diagnostics.Tracing } else { - throw new ArgumentException(Resources.GetResourceString("IllegalValue", value), "traits"); + throw new ArgumentException(SR.Format(SR.EventSource_IllegalValue, value), "traits"); } return metaData.Count - startPos; @@ -854,7 +855,7 @@ namespace System.Diagnostics.Tracing return (c - 'A' + 10); } - throw new ArgumentException(Resources.GetResourceString("BadHexDigit", c), "traits"); + throw new ArgumentException(SR.Format(SR.EventSource_BadHexDigit, c), "traits"); } private NameInfo UpdateDescriptor( diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs index d024b218d8..3c775a3cef 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs @@ -6,6 +6,12 @@ using System; using System.Collections.Generic; using Interlocked = System.Threading.Interlocked; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else @@ -91,7 +97,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(name)); } - this.typeInfos = MakeArray(paramInfos); this.name = name; this.tags = tags; @@ -128,7 +133,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(defaultName)); } - this.typeInfos = typeInfos; this.name = defaultName; this.tags = tags; @@ -207,7 +211,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(paramInfos)); } - var recursionCheck = new List<Type>(paramInfos.Length); var result = new TraceLoggingTypeInfo[paramInfos.Length]; for (int i = 0; i < paramInfos.Length; ++i) @@ -225,7 +228,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(types)); } - var recursionCheck = new List<Type>(types.Length); var result = new TraceLoggingTypeInfo[types.Length]; for (int i = 0; i < types.Length; i++) @@ -244,7 +246,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(typeInfos)); } - return (TraceLoggingTypeInfo[])typeInfos.Clone(); ; } } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingMetadataCollector.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingMetadataCollector.cs index 41225c8626..1db1a28c9d 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingMetadataCollector.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingMetadataCollector.cs @@ -232,7 +232,7 @@ namespace System.Diagnostics.Tracing if (this.BeginningBufferedArray) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedNestedArraysEnums")); + throw new NotSupportedException(SR.EventSource_NotSupportedNestedArraysEnums); } this.impl.AddScalar(2); @@ -244,7 +244,7 @@ namespace System.Diagnostics.Tracing { if (this.bufferedArrayFieldCount >= 0) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedNestedArraysEnums")); + throw new NotSupportedException(SR.EventSource_NotSupportedNestedArraysEnums); } this.bufferedArrayFieldCount = 0; @@ -255,7 +255,7 @@ namespace System.Diagnostics.Tracing { if (this.bufferedArrayFieldCount != 1) { - throw new InvalidOperationException(Resources.GetResourceString("EventSource_IncorrentlyAuthoredTypeInfo")); + throw new InvalidOperationException(SR.EventSource_IncorrentlyAuthoredTypeInfo); } this.bufferedArrayFieldCount = int.MinValue; @@ -274,7 +274,7 @@ namespace System.Diagnostics.Tracing { if (this.BeginningBufferedArray) { - throw new NotSupportedException(Resources.GetResourceString("EventSource_NotSupportedCustomSerializedData")); + throw new NotSupportedException(SR.EventSource_NotSupportedCustomSerializedData); } this.impl.AddScalar(2); diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingTypeInfo.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingTypeInfo.cs index 81f80c63f7..511a4fe480 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingTypeInfo.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingTypeInfo.cs @@ -5,6 +5,12 @@ using System; using System.Collections.Generic; +#if !ES_BUILD_AGAINST_DOTNET_V35 +using Contract = System.Diagnostics.Contracts.Contract; +#else +using Contract = Microsoft.Diagnostics.Contracts.Internal.Contract; +#endif + #if ES_BUILD_STANDALONE namespace Microsoft.Diagnostics.Tracing #else @@ -33,7 +39,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(dataType)); } - this.name = dataType.Name; this.dataType = dataType; this.propertyValueFactory = PropertyValue.GetFactory(dataType); @@ -57,7 +62,6 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(name)); } - Statics.CheckName(name); this.name = name; diff --git a/src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs b/src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs index 35ee82d3cb..3a8029d9a0 100644 --- a/src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs +++ b/src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs @@ -325,7 +325,7 @@ namespace System.Globalization } catch (Exception e) { - Debug.Assert(false, e.ToString()); + Debug.Fail(e.ToString()); // we ignore the managed exceptions here because EnumCalendarInfoCallback will get called from the native code. // If we don't ignore the exception here that can cause the runtime to fail fast. } diff --git a/src/mscorlib/shared/System/Globalization/CalendarData.cs b/src/mscorlib/shared/System/Globalization/CalendarData.cs index 0991149e07..ea70a1ce9a 100644 --- a/src/mscorlib/shared/System/Globalization/CalendarData.cs +++ b/src/mscorlib/shared/System/Globalization/CalendarData.cs @@ -105,7 +105,7 @@ namespace System.Globalization if (!LoadCalendarDataFromSystem(localeName, calendarId)) { - Debug.Assert(false, "[CalendarData] LoadCalendarDataFromSystem call isn't expected to fail for calendar " + calendarId + " locale " + localeName); + Debug.Fail("[CalendarData] LoadCalendarDataFromSystem call isn't expected to fail for calendar " + calendarId + " locale " + localeName); // Something failed, try invariant for missing parts // This is really not good, but we don't want the callers to crash. diff --git a/src/mscorlib/shared/System/Globalization/CalendricalCalculationsHelper.cs b/src/mscorlib/shared/System/Globalization/CalendricalCalculationsHelper.cs index 7de75d6aee..e0a3072b22 100644 --- a/src/mscorlib/shared/System/Globalization/CalendricalCalculationsHelper.cs +++ b/src/mscorlib/shared/System/Globalization/CalendricalCalculationsHelper.cs @@ -215,7 +215,7 @@ namespace System.Globalization } } - Debug.Assert(false, "Not expected to come here"); + Debug.Fail("Not expected to come here"); return DefaultEphemerisCorrection(year); } diff --git a/src/mscorlib/shared/System/Globalization/CultureData.Unix.cs b/src/mscorlib/shared/System/Globalization/CultureData.Unix.cs index c21d8c3f22..3b4b60fc8a 100644 --- a/src/mscorlib/shared/System/Globalization/CultureData.Unix.cs +++ b/src/mscorlib/shared/System/Globalization/CultureData.Unix.cs @@ -148,7 +148,7 @@ namespace System.Globalization { // Failed, just use empty string StringBuilderCache.Release(sb); - Debug.Assert(false, "[CultureData.GetLocaleInfo(LocaleStringData)] Failed"); + Debug.Fail("[CultureData.GetLocaleInfo(LocaleStringData)] Failed"); return String.Empty; } return StringBuilderCache.GetStringAndRelease(sb); @@ -173,7 +173,7 @@ namespace System.Globalization if (!result) { // Failed, just use 0 - Debug.Assert(false, "[CultureData.GetLocaleInfo(LocaleNumberData)] failed"); + Debug.Fail("[CultureData.GetLocaleInfo(LocaleNumberData)] failed"); } return value; @@ -188,7 +188,7 @@ namespace System.Globalization bool result = Interop.GlobalizationInterop.GetLocaleInfoGroupingSizes(_sWindowsName, (uint)type, ref primaryGroupingSize, ref secondaryGroupingSize); if (!result) { - Debug.Assert(false, "[CultureData.GetLocaleInfo(LocaleGroupingData type)] failed"); + Debug.Fail("[CultureData.GetLocaleInfo(LocaleGroupingData type)] failed"); } if (secondaryGroupingSize == 0) @@ -215,7 +215,7 @@ namespace System.Globalization { // Failed, just use empty string StringBuilderCache.Release(sb); - Debug.Assert(false, "[CultureData.GetTimeFormatString(bool shortFormat)] Failed"); + Debug.Fail("[CultureData.GetTimeFormatString(bool shortFormat)] Failed"); return String.Empty; } diff --git a/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs b/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs index 297b556f75..9dbfeb2d55 100644 --- a/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs +++ b/src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs @@ -2839,7 +2839,7 @@ namespace System.Globalization } previousNode = temp; }; - Debug.Assert(false, "The hashtable is full. This should not happen."); + Debug.Fail("The hashtable is full. This should not happen."); } private void InsertHash(TokenHashValue[] hashTable, String str, TokenType tokenType, int tokenValue) @@ -2927,7 +2927,7 @@ namespace System.Globalization hashcode += hashProbe; if (hashcode >= TOKEN_HASH_SIZE) hashcode -= TOKEN_HASH_SIZE; } while (i < TOKEN_HASH_SIZE); - Debug.Assert(false, "The hashtable is full. This should not happen."); + Debug.Fail("The hashtable is full. This should not happen."); } private bool CompareStringIgnoreCaseOptimized(string string1, int offset1, int length1, string string2, int offset2, int length2) diff --git a/src/mscorlib/shared/System/Globalization/DateTimeParse.cs b/src/mscorlib/shared/System/Globalization/DateTimeParse.cs index 2b0f41ae6b..ca6fe635b8 100644 --- a/src/mscorlib/shared/System/Globalization/DateTimeParse.cs +++ b/src/mscorlib/shared/System/Globalization/DateTimeParse.cs @@ -4647,7 +4647,7 @@ new DS[] { DS.ERROR, DS.TX_NNN, DS.TX_NNN, DS.TX_NNN, DS.ERROR, DS.ERROR, case ParseFailureKind.FormatBadDateTimeCalendar: return new FormatException(SR.Format(SR.GetResourceString(result.failureMessageID), result.calendar)); default: - Debug.Assert(false, "Unkown DateTimeParseFailure: " + result); + Debug.Fail("Unkown DateTimeParseFailure: " + result); return null; } } diff --git a/src/mscorlib/shared/System/Globalization/PersianCalendar.cs b/src/mscorlib/shared/System/Globalization/PersianCalendar.cs index a80c6ece5b..10912f85b1 100644 --- a/src/mscorlib/shared/System/Globalization/PersianCalendar.cs +++ b/src/mscorlib/shared/System/Globalization/PersianCalendar.cs @@ -519,7 +519,6 @@ namespace System.Globalization int daysInMonth = GetDaysInMonth(year, month, era); if (day < 1 || day > daysInMonth) { - // BCLDebug.Log("year = " + year + ", month = " + month + ", day = " + day); throw new ArgumentOutOfRangeException( nameof(day), String.Format( diff --git a/src/mscorlib/shared/System/Lazy.cs b/src/mscorlib/shared/System/Lazy.cs index e71a37dd9e..4a56b1881f 100644 --- a/src/mscorlib/shared/System/Lazy.cs +++ b/src/mscorlib/shared/System/Lazy.cs @@ -84,7 +84,7 @@ namespace System break; default: - Debug.Assert(false, "internal constructor, this should never occur"); + Debug.Fail("internal constructor, this should never occur"); break; } @@ -119,7 +119,7 @@ namespace System return LazyThreadSafetyMode.ExecutionAndPublication; default: - Debug.Assert(false, "Invalid logic; State should always have a valid value"); + Debug.Fail("Invalid logic; State should always have a valid value"); return default(LazyThreadSafetyMode); } } diff --git a/src/mscorlib/shared/System/Memory.cs b/src/mscorlib/shared/System/Memory.cs index 5011510bca..ecb33e8918 100644 --- a/src/mscorlib/shared/System/Memory.cs +++ b/src/mscorlib/shared/System/Memory.cs @@ -14,7 +14,7 @@ namespace System { [DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerTypeProxy(typeof(MemoryDebugView<>))] - public struct Memory<T> + public readonly struct Memory<T> { // NOTE: With the current implementation, Memory<T> and ReadOnlyMemory<T> must have the same layout, // as code uses Unsafe.As to cast between them. diff --git a/src/mscorlib/shared/System/ReadOnlyMemory.cs b/src/mscorlib/shared/System/ReadOnlyMemory.cs index 2216902f66..c2ba4ab41d 100644 --- a/src/mscorlib/shared/System/ReadOnlyMemory.cs +++ b/src/mscorlib/shared/System/ReadOnlyMemory.cs @@ -14,7 +14,7 @@ namespace System { [DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerTypeProxy(typeof(MemoryDebugView<>))] - public struct ReadOnlyMemory<T> + public readonly struct ReadOnlyMemory<T> { // NOTE: With the current implementation, Memory<T> and ReadOnlyMemory<T> must have the same layout, // as code uses Unsafe.As to cast between them. diff --git a/src/mscorlib/shared/System/Text/StringBuilder.cs b/src/mscorlib/shared/System/Text/StringBuilder.cs index f5003d8124..e5a894dfed 100644 --- a/src/mscorlib/shared/System/Text/StringBuilder.cs +++ b/src/mscorlib/shared/System/Text/StringBuilder.cs @@ -270,7 +270,7 @@ namespace System.Text info.AddValue(ThreadIDField, 0); } - [System.Diagnostics.Conditional("_DEBUG")] + [System.Diagnostics.Conditional("DEBUG")] private void AssertInvariants() { Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); diff --git a/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs b/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs index 52224637b0..053507b2d4 100644 --- a/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs +++ b/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs @@ -100,9 +100,7 @@ namespace Microsoft.Win32 private static int GetCVTypeFromClass(Type ctype) { Debug.Assert(ctype != null); -#if _DEBUG - BCLDebug.Assert(ClassTypes[CV_OBJECT] == typeof(Object), "OAVariantLib::ClassTypes[CV_OBJECT] == Object.class"); -#endif + Debug.Assert(ClassTypes[CV_OBJECT] == typeof(Object), "OAVariantLib::ClassTypes[CV_OBJECT] == Object.class"); int cvtype = -1; for (int i = 0; i < ClassTypes.Length; i++) diff --git a/src/mscorlib/src/Microsoft/Win32/Registry.cs b/src/mscorlib/src/Microsoft/Win32/Registry.cs index d0dbb0ff7f..11f95903af 100644 --- a/src/mscorlib/src/Microsoft/Win32/Registry.cs +++ b/src/mscorlib/src/Microsoft/Win32/Registry.cs @@ -4,6 +4,7 @@ using System; +using System.Diagnostics; using System.Runtime.InteropServices; using System.Runtime.Versioning; @@ -123,7 +124,7 @@ namespace Microsoft.Win32 { string subKeyName; RegistryKey basekey = GetBaseKeyFromKeyName(keyName, out subKeyName); - BCLDebug.Assert(basekey != null, "basekey can't be null."); + Debug.Assert(basekey != null, "basekey can't be null."); RegistryKey key = basekey.OpenSubKey(subKeyName); if (key == null) { // if the key doesn't exist, do nothing diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs index e314c48167..350880e52f 100644 --- a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs +++ b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs @@ -216,7 +216,7 @@ namespace Microsoft.Win32 } // We really should throw an exception here if errorCode was bad, // but we can't for compatibility reasons. - BCLDebug.Correctness(errorCode == 0, "RegDeleteValue failed. Here's your error code: " + errorCode); + Debug.Assert(errorCode == 0, "RegDeleteValue failed. Here's your error code: " + errorCode); } /** @@ -243,8 +243,8 @@ namespace Microsoft.Win32 internal static RegistryKey GetBaseKey(IntPtr hKey, RegistryView view) { int index = ((int)hKey) & 0x0FFFFFFF; - BCLDebug.Assert(index >= 0 && index < hkeyNames.Length, "index is out of range!"); - BCLDebug.Assert((((int)hKey) & 0xFFFFFFF0) == 0x80000000, "Invalid hkey value!"); + Debug.Assert(index >= 0 && index < hkeyNames.Length, "index is out of range!"); + Debug.Assert((((int)hKey) & 0xFFFFFFF0) == 0x80000000, "Invalid hkey value!"); bool isPerf = hKey == HKEY_PERFORMANCE_DATA; // only mark the SafeHandle as ownsHandle if the key is HKEY_PERFORMANCE_DATA. @@ -539,7 +539,7 @@ namespace Microsoft.Win32 if (datasize < 0) { // unexpected code path - BCLDebug.Assert(false, "[InternalGetValue] RegQueryValue returned ERROR_SUCCESS but gave a negative datasize"); + Debug.Fail("[InternalGetValue] RegQueryValue returned ERROR_SUCCESS but gave a negative datasize"); datasize = 0; } @@ -563,7 +563,7 @@ namespace Microsoft.Win32 goto case Win32Native.REG_BINARY; } long blob = 0; - BCLDebug.Assert(datasize == 8, "datasize==8"); + Debug.Assert(datasize == 8, "datasize==8"); // Here, datasize must be 8 when calling this ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, ref blob, ref datasize); @@ -578,7 +578,7 @@ namespace Microsoft.Win32 goto case Win32Native.REG_QWORD; } int blob = 0; - BCLDebug.Assert(datasize == 4, "datasize==4"); + Debug.Assert(datasize == 4, "datasize==4"); // Here, datasize must be four when calling this ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, ref blob, ref datasize); @@ -702,7 +702,7 @@ namespace Microsoft.Win32 if (nextNull < len) { - BCLDebug.Assert(blob[nextNull] == (char)0, "blob[nextNull] should be 0"); + Debug.Assert(blob[nextNull] == (char)0, "blob[nextNull] should be 0"); if (nextNull - cur > 0) { strings.Add(new String(blob, cur, nextNull - cur)); @@ -996,7 +996,7 @@ namespace Microsoft.Win32 internal static String FixupName(String name) { - BCLDebug.Assert(name != null, "[FixupName]name!=null"); + Debug.Assert(name != null, "[FixupName]name!=null"); if (name.IndexOf('\\') == -1) return name; diff --git a/src/mscorlib/src/System/Array.cs b/src/mscorlib/src/System/Array.cs index 0841d7ac63..7be16c40e4 100644 --- a/src/mscorlib/src/System/Array.cs +++ b/src/mscorlib/src/System/Array.cs @@ -2455,7 +2455,7 @@ namespace System // It is never legal to instantiate this class. private SZArrayHelper() { - Debug.Assert(false, "Hey! How'd I get here?"); + Debug.Fail("Hey! How'd I get here?"); } // ----------------------------------------------------------- diff --git a/src/mscorlib/src/System/Attribute.cs b/src/mscorlib/src/System/Attribute.cs index 37445cc23b..5934284c0f 100644 --- a/src/mscorlib/src/System/Attribute.cs +++ b/src/mscorlib/src/System/Attribute.cs @@ -627,7 +627,7 @@ namespace System return element.IsDefined(attributeType, false); default: - Debug.Assert(false, "Invalid type for ParameterInfo member in Attribute class"); + Debug.Fail("Invalid type for ParameterInfo member in Attribute class"); throw new ArgumentException(SR.Argument_InvalidParamInfo); } } diff --git a/src/mscorlib/src/System/BCLDebug.cs b/src/mscorlib/src/System/BCLDebug.cs index 9170a55c38..e9435aff2f 100644 --- a/src/mscorlib/src/System/BCLDebug.cs +++ b/src/mscorlib/src/System/BCLDebug.cs @@ -48,12 +48,6 @@ namespace System { internal static volatile bool m_registryChecked = false; internal static volatile bool m_loggingNotEnabled = false; - internal static bool m_perfWarnings; - internal static bool m_correctnessWarnings; - internal static bool m_safeHandleStackTraces; -#if _DEBUG - internal static volatile bool m_domainUnloadAdded; -#endif private static readonly SwitchStructure[] switches = { new SwitchStructure("NLS", 0x00000001), @@ -86,40 +80,6 @@ namespace System LogLevel.Trace }; - -#if _DEBUG - internal static void WaitForFinalizers(Object sender, EventArgs e) - { - if (!m_registryChecked) - { - CheckRegistry(); - } - if (m_correctnessWarnings) - { - GC.GetTotalMemory(true); - GC.WaitForPendingFinalizers(); - } - } -#endif - [Conditional("_DEBUG")] - static public void Assert(bool condition) - { -#if _DEBUG - Assert(condition, "Assert failed."); -#endif - } - - [Conditional("_DEBUG")] - static public void Assert(bool condition, String message) - { -#if _DEBUG - // Speed up debug builds marginally by avoiding the garbage from - // concatinating "BCL Assert: " and the message. - if (!condition) - System.Diagnostics.Assert.Check(condition, "BCL Assert", message); -#endif - } - [Conditional("_LOGGING")] static public void Log(String message) { @@ -165,7 +125,7 @@ namespace System // just a small helper in native code instead of that. // [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static int GetRegistryLoggingValues(out bool loggingEnabled, out bool logToConsole, out int logLevel, out bool perfWarnings, out bool correctnessWarnings, out bool safeHandleStackTraces); + private extern static int GetRegistryLoggingValues(out bool loggingEnabled, out bool logToConsole, out int logLevel); private static void CheckRegistry() { @@ -182,7 +142,7 @@ namespace System bool logToConsole; int logLevel; int facilityValue; - facilityValue = GetRegistryLoggingValues(out loggingEnabled, out logToConsole, out logLevel, out m_perfWarnings, out m_correctnessWarnings, out m_safeHandleStackTraces); + facilityValue = GetRegistryLoggingValues(out loggingEnabled, out logToConsole, out logLevel); // Note we can get into some recursive situations where we call // ourseves recursively through the .cctor. That's why we have the @@ -198,7 +158,7 @@ namespace System //The values returned for the logging levels in the registry don't map nicely onto the //values which we support internally (which are an approximation of the ones that //the System.Diagnostics namespace uses) so we have a quick map. - Assert(logLevel >= 0 && logLevel <= 10, "logLevel>=0 && logLevel<=10"); + Debug.Assert(logLevel >= 0 && logLevel <= 10, "logLevel>=0 && logLevel<=10"); logLevel = (int)levelConversions[logLevel]; if (facilityValue > 0) @@ -314,70 +274,6 @@ namespace System System.Diagnostics.Log.LogMessage(LoggingLevels.TraceLevel0, logSwitch, StringBuilderCache.GetStringAndRelease(sb)); } - - // For perf-related asserts. On a debug build, set the registry key - // BCLPerfWarnings to non-zero. - [Conditional("_DEBUG")] - internal static void Perf(bool expr, String msg) - { - if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) - return; - if (!m_registryChecked) - CheckRegistry(); - if (!m_perfWarnings) - return; - - if (!expr) - { - Log("PERF", "BCL Perf Warning: " + msg); - } - System.Diagnostics.Assert.Check(expr, "BCL Perf Warning: Your perf may be less than perfect because...", msg); - } - - // For correctness-related asserts. On a debug build, set the registry key - // BCLCorrectnessWarnings to non-zero. - [Conditional("_DEBUG")] -#if _DEBUG -#endif - internal static void Correctness(bool expr, String msg) - { -#if _DEBUG - if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) - return; - if (!m_registryChecked) - CheckRegistry(); - if (!m_correctnessWarnings) - return; - - if (!m_domainUnloadAdded) - { - m_domainUnloadAdded = true; - AppDomain.CurrentDomain.DomainUnload += new EventHandler(WaitForFinalizers); - } - - if (!expr) - { - Log("CORRECTNESS", "BCL Correctness Warning: " + msg); - } - System.Diagnostics.Assert.Check(expr, "BCL Correctness Warning: Your program may not work because...", msg); -#endif - } - - // Whether SafeHandles include a stack trace showing where they - // were allocated. Only useful in checked & debug builds. - internal static bool SafeHandleStackTracesEnabled - { - get - { -#if _DEBUG - if (!m_registryChecked) - CheckRegistry(); - return m_safeHandleStackTraces; -#else - return false; -#endif - } - } } } diff --git a/src/mscorlib/src/System/Buffer.cs b/src/mscorlib/src/System/Buffer.cs index 1a5a4b6ad9..b21ee7132f 100644 --- a/src/mscorlib/src/System/Buffer.cs +++ b/src/mscorlib/src/System/Buffer.cs @@ -263,9 +263,9 @@ namespace System const nuint CopyThreshold = 2048; #elif ARM64 #if PLATFORM_WINDOWS - // TODO-ARM64-WINDOWS-OPT determine optimal value for Windows + // Determined optimal value for Windows. // https://github.com/dotnet/coreclr/issues/13843 - const nuint CopyThreshold = 2048; + const nuint CopyThreshold = UInt64.MaxValue; #else // PLATFORM_WINDOWS // Managed code is currently faster than glibc unoptimized memmove // TODO-ARM64-UNIX-OPT revisit when glibc optimized memmove is in Linux distros diff --git a/src/mscorlib/src/System/Collections/Hashtable.cs b/src/mscorlib/src/System/Collections/Hashtable.cs index 0550030e7c..0907429f44 100644 --- a/src/mscorlib/src/System/Collections/Hashtable.cs +++ b/src/mscorlib/src/System/Collections/Hashtable.cs @@ -797,7 +797,7 @@ namespace System.Collections // If you see this assert, make sure load factor & count are reasonable. // Then verify that our double hash function (h2, described at top of file) // meets the requirements described above. You should never see this assert. - Debug.Assert(false, "hash table insert failed! Load factor too high, or our double hashing function is incorrect."); + Debug.Fail("hash table insert failed! Load factor too high, or our double hashing function is incorrect."); throw new InvalidOperationException(SR.InvalidOperation_HashInsertFailed); } diff --git a/src/mscorlib/src/System/Delegate.cs b/src/mscorlib/src/System/Delegate.cs index 188657aa7a..72586143dc 100644 --- a/src/mscorlib/src/System/Delegate.cs +++ b/src/mscorlib/src/System/Delegate.cs @@ -257,7 +257,7 @@ namespace System // RCWs don't need to be "strongly-typed" in which case we don't find a base type // that matches the declaring type of the method. This is fine because interop needs // to work with exact methods anyway so declaringType is never shared at this point. - BCLDebug.Assert(currentType != null || _target.GetType().IsCOMObject, "The class hierarchy should declare the method"); + Debug.Assert(currentType != null || _target.GetType().IsCOMObject, "The class hierarchy should declare the method"); } else { diff --git a/src/mscorlib/src/System/Enum.cs b/src/mscorlib/src/System/Enum.cs index 96bf31c889..af6cc9c148 100644 --- a/src/mscorlib/src/System/Enum.cs +++ b/src/mscorlib/src/System/Enum.cs @@ -340,7 +340,7 @@ namespace System return m_innerException; default: - Debug.Assert(false, "Unknown EnumParseFailure: " + m_failure); + Debug.Fail("Unknown EnumParseFailure: " + m_failure); return new ArgumentException(SR.Arg_EnumValueNotFound); } } @@ -757,7 +757,7 @@ namespace System case CorElementType.U: return *(UIntPtr*)pValue; default: - Debug.Assert(false, "Invalid primitive type"); + Debug.Fail("Invalid primitive type"); return null; } } @@ -809,7 +809,7 @@ namespace System return *(uint*)pValue; } default: - Debug.Assert(false, "Invalid primitive type"); + Debug.Fail("Invalid primitive type"); return 0; } } @@ -866,7 +866,7 @@ namespace System case CorElementType.U: return (*(UIntPtr*)pValue).GetHashCode(); default: - Debug.Assert(false, "Invalid primitive type"); + Debug.Fail("Invalid primitive type"); return 0; } } diff --git a/src/mscorlib/src/System/Environment.cs b/src/mscorlib/src/System/Environment.cs index ec9f043487..f230577fac 100644 --- a/src/mscorlib/src/System/Environment.cs +++ b/src/mscorlib/src/System/Environment.cs @@ -773,7 +773,7 @@ namespace System IntPtr r = Interop.User32.SendMessageTimeout(new IntPtr(Interop.User32.HWND_BROADCAST), Interop.User32.WM_SETTINGCHANGE, IntPtr.Zero, "Environment", 0, 1000, IntPtr.Zero); - if (r == IntPtr.Zero) Debug.Assert(false, "SetEnvironmentVariable failed: " + Marshal.GetLastWin32Error()); + Debug.Assert(r != IntPtr.Zero, "SetEnvironmentVariable failed: " + Marshal.GetLastWin32Error()); #endif // FEATURE_WIN32_REGISTRY } } diff --git a/src/mscorlib/src/System/IO/File.cs b/src/mscorlib/src/System/IO/File.cs index b393feac3f..6754baae16 100644 --- a/src/mscorlib/src/System/IO/File.cs +++ b/src/mscorlib/src/System/IO/File.cs @@ -193,7 +193,7 @@ namespace System.IO // if we're already returning an error, don't throw another one. if (!error) { - Debug.Assert(false, "File::FillAttributeInfo - FindClose failed!"); + Debug.Fail("File::FillAttributeInfo - FindClose failed!"); throw Win32Marshal.GetExceptionForLastWin32Error(); } } diff --git a/src/mscorlib/src/System/IO/MemoryStream.cs b/src/mscorlib/src/System/IO/MemoryStream.cs index 330efcc1e7..d2fd83d2c3 100644 --- a/src/mscorlib/src/System/IO/MemoryStream.cs +++ b/src/mscorlib/src/System/IO/MemoryStream.cs @@ -634,7 +634,6 @@ namespace System.IO public virtual byte[] ToArray() { - BCLDebug.Perf(_exposable, "MemoryStream::GetBuffer will let you avoid a copy."); byte[] copy = new byte[_length - _origin]; Buffer.InternalBlockCopy(_buffer, _origin, copy, 0, _length - _origin); return copy; diff --git a/src/mscorlib/src/System/Reflection/CustomAttribute.cs b/src/mscorlib/src/System/Reflection/CustomAttribute.cs index 7f50286996..f394b0100f 100644 --- a/src/mscorlib/src/System/Reflection/CustomAttribute.cs +++ b/src/mscorlib/src/System/Reflection/CustomAttribute.cs @@ -1912,7 +1912,7 @@ namespace System.Reflection s_pca = temp_pca; } - [Conditional("_DEBUG")] + [Conditional("DEBUG")] private static void VerifyPseudoCustomAttribute(RuntimeType pca) { // If any of these are invariants are no longer true will have to diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs index bcd70c3b87..b483738213 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs @@ -375,8 +375,6 @@ namespace System.Reflection.Emit if (name[0] == '\0') throw new ArgumentException(SR.Argument_InvalidName, nameof(name)); - BCLDebug.Log("DYNIL", "## DYNIL LOGGING: AssemblyBuilder.DefineDynamicModule( " + name + " )"); - Debug.Assert(m_assemblyData != null, "m_assemblyData is null in DefineDynamicModuleInternal"); ModuleBuilder dynModule; @@ -672,7 +670,6 @@ namespace System.Reflection.Emit if (name.Length == 0) throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); - BCLDebug.Log("DYNIL", "## DYNIL LOGGING: AssemblyBuilder.GetDynamicModule( " + name + " )"); int size = m_assemblyData.m_moduleBuilderList.Count; for (int i = 0; i < size; i++) { diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs index 99c055a991..ea1f6994e9 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs @@ -97,7 +97,6 @@ namespace System.Reflection.Emit // Helper to ensure the type name is unique underneath assemblyBuilder internal void CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType) { - BCLDebug.Log("DYNIL", "## DYNIL LOGGING: AssemblyBuilderData.CheckTypeNameConflict( " + strTypeName + " )"); for (int i = 0; i < m_moduleBuilderList.Count; i++) { ModuleBuilder curModule = m_moduleBuilderList[i]; diff --git a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs index cdc9f469b3..94a9becf98 100644 --- a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs @@ -348,7 +348,7 @@ namespace System.Reflection.Emit writer.Write((byte)CustomAttributeEncoding.Double); break; default: - Debug.Assert(false, "Invalid primitive type"); + Debug.Fail("Invalid primitive type"); break; } } @@ -432,7 +432,7 @@ namespace System.Reflection.Emit writer.Write((ulong)value); break; default: - Debug.Assert(false, "Invalid enum base type"); + Debug.Fail("Invalid enum base type"); break; } } @@ -509,7 +509,7 @@ namespace System.Reflection.Emit writer.Write((double)value); break; default: - Debug.Assert(false, "Invalid primitive type"); + Debug.Fail("Invalid primitive type"); break; } } diff --git a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs index 53566c16b1..28c7074d06 100644 --- a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs @@ -33,8 +33,6 @@ namespace System.Reflection.Emit public FieldBuilder DefineLiteral(String literalName, Object literalValue) { - BCLDebug.Log("DYNIL", "## DYNIL LOGGING: EnumBuilder.DefineLiteral( " + literalName + " )"); - // Define the underlying field for the enum. It will be a non-static, private field with special name bit set. FieldBuilder fieldBuilder = m_typeBuilder.DefineField( literalName, @@ -46,14 +44,12 @@ namespace System.Reflection.Emit public TypeInfo CreateTypeInfo() { - BCLDebug.Log("DYNIL", "## DYNIL LOGGING: EnumBuilder.CreateType() "); return m_typeBuilder.CreateTypeInfo(); } // CreateType cause EnumBuilder to be baked. public Type CreateType() { - BCLDebug.Log("DYNIL", "## DYNIL LOGGING: EnumBuilder.CreateType() "); return m_typeBuilder.CreateType(); } diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs index fda22ab1d6..928b2e3084 100644 --- a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs @@ -352,7 +352,7 @@ namespace System.Reflection.Emit } else { - Debug.Assert(false, "We should never get here!"); + Debug.Fail("We should never get here!"); return null; } } diff --git a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs index 5048af3950..e9d27ef7ae 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs @@ -403,7 +403,7 @@ namespace System.Reflection if (namedArgument.MemberInfo.Name.Equals("Value")) { // This is not possible because Decimal cannot be represented directly in the metadata. - Debug.Assert(false, "Decimal cannot be represented directly in the metadata."); + Debug.Fail("Decimal cannot be represented directly in the metadata."); return (Decimal)namedArgument.TypedValue.Value; } } diff --git a/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs b/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs index 58c99242a8..cb091f1c14 100644 --- a/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs +++ b/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs @@ -89,27 +89,13 @@ namespace System.Resources // qualified name, append path to that. if (_mediator.ModuleDir != null) { -#if _DEBUG - if (ResourceManager.DEBUG >= 3) - BCLDebug.Log("FindResourceFile: checking module dir: \"" + _mediator.ModuleDir + '\"'); -#endif - String path = Path.Combine(_mediator.ModuleDir, fileName); if (File.Exists(path)) { -#if _DEBUG - if (ResourceManager.DEBUG >= 3) - BCLDebug.Log("Found resource file in module dir! " + path); -#endif return path; } } -#if _DEBUG - if (ResourceManager.DEBUG >= 3) - BCLDebug.Log("Couldn't find resource file in module dir, checking .\\" + fileName); -#endif - // look in . if (File.Exists(fileName)) return fileName; diff --git a/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs b/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs index 4548b93dd4..83d5b6c8e8 100644 --- a/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs +++ b/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs @@ -180,7 +180,7 @@ namespace System.Resources // fires, please fix the build process for the BCL directory. if (a == typeof(Object).Assembly) { - Debug.Assert(false, System.CoreLib.Name + "'s NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + cultureName + "\" Exception: " + e); + Debug.Fail(System.CoreLib.Name + "'s NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + cultureName + "\" Exception: " + e); return CultureInfo.InvariantCulture; } @@ -417,14 +417,14 @@ namespace System.Resources int hr = fle._HResult; if (hr != Win32Marshal.MakeHRFromErrorCode(Win32Native.ERROR_ACCESS_DENIED)) { - Debug.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + " with error code 0x" + hr.ToString("X", CultureInfo.InvariantCulture) + Environment.NewLine + "Exception: " + fle); + Debug.Fail("[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + " with error code 0x" + hr.ToString("X", CultureInfo.InvariantCulture) + Environment.NewLine + "Exception: " + fle); } } // Don't throw for zero-length satellite assemblies, for compat with v1 catch (BadImageFormatException bife) { - Debug.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + Environment.NewLine + "Exception: " + bife); + Debug.Fail("[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + Environment.NewLine + "Exception: " + bife); } return satellite; @@ -505,7 +505,7 @@ namespace System.Resources if (_mediator.MainAssembly == typeof(Object).Assembly && _mediator.BaseName.Equals(System.CoreLib.Name)) { // This would break CultureInfo & all our exceptions. - Debug.Assert(false, "Couldn't get " + System.CoreLib.Name + ResourceManager.ResFileExtension + " from " + System.CoreLib.Name + "'s assembly" + Environment.NewLine + Environment.NewLine + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug."); + Debug.Fail("Couldn't get " + System.CoreLib.Name + ResourceManager.ResFileExtension + " from " + System.CoreLib.Name + "'s assembly" + Environment.NewLine + Environment.NewLine + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug."); // We cannot continue further - simply FailFast. string mesgFailFast = System.CoreLib.Name + ResourceManager.ResFileExtension + " couldn't be found! Large parts of the BCL won't work!"; diff --git a/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/mscorlib/src/System/Resources/ResourceManager.cs index 0e9780169a..490a322c14 100644 --- a/src/mscorlib/src/System/Resources/ResourceManager.cs +++ b/src/mscorlib/src/System/Resources/ResourceManager.cs @@ -243,10 +243,6 @@ namespace System.Resources internal const String ResFileExtension = ".resources"; internal const int ResFileExtensionLength = 10; - // My private debugging aid. Set to 5 or 6 for verbose output. Set to 3 - // for summary level information. - internal static readonly int DEBUG = 0; //Making this const causes C# to consider all of the code that it guards unreachable. - private static volatile bool s_IsAppXModel; [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod diff --git a/src/mscorlib/src/System/Resources/ResourceReader.cs b/src/mscorlib/src/System/Resources/ResourceReader.cs index 0658032f7d..75c17686b3 100644 --- a/src/mscorlib/src/System/Resources/ResourceReader.cs +++ b/src/mscorlib/src/System/Resources/ResourceReader.cs @@ -106,16 +106,11 @@ namespace System.Resources // Version number of .resources file, for compatibility private int _version; -#if RESOURCE_FILE_FORMAT_DEBUG - private bool _debug; // Whether this file has debugging stuff in it. -#endif - public ResourceReader(String fileName) { _resCache = new Dictionary<String, ResourceLocator>(FastResourceComparer.Default); _store = new BinaryReader(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read, DefaultFileStreamBufferSize, FileOptions.RandomAccess), Encoding.UTF8); - BCLDebug.Log("RESMGRFILEFORMAT", "ResourceReader .ctor(String). UnmanagedMemoryStream: " + (_ums != null)); try { @@ -140,7 +135,6 @@ namespace System.Resources // We have a faster code path for reading resource files from an assembly. _ums = stream as UnmanagedMemoryStream; - BCLDebug.Log("RESMGRFILEFORMAT", "ResourceReader .ctor(Stream). UnmanagedMemoryStream: " + (_ums != null)); ReadResources(); } @@ -159,7 +153,6 @@ namespace System.Resources _ums = stream as UnmanagedMemoryStream; - BCLDebug.Log("RESMGRFILEFORMAT", "ResourceReader .ctor(Stream, Hashtable). UnmanagedMemoryStream: " + (_ums != null)); ReadResources(); } @@ -268,7 +261,7 @@ namespace System.Resources { Debug.Assert(_store != null, "ResourceReader is closed!"); int hash = FastResourceComparer.HashFunction(name); - BCLDebug.Log("RESMGRFILEFORMAT", "FindPosForResource for " + name + " hash: " + hash.ToString("x", CultureInfo.InvariantCulture)); + // Binary search over the hashes. Use the _namePositions array to // determine where they exist in the underlying stream. int lo = 0; @@ -288,7 +281,7 @@ namespace System.Resources c = -1; else c = 1; - //BCLDebug.Log("RESMGRFILEFORMAT", " Probing index "+index+" lo: "+lo+" hi: "+hi+" c: "+c); + if (c == 0) { success = true; @@ -301,14 +294,6 @@ namespace System.Resources } if (!success) { -#if RESOURCE_FILE_FORMAT_DEBUG - String lastReadString; - lock(this) { - _store.BaseStream.Seek(_nameSectionOffset + GetNamePosition(index), SeekOrigin.Begin); - lastReadString = _store.ReadString(); - } - BCLDebug.Log("RESMGRFILEFORMAT", LogLevel.Status, "FindPosForResource for ", name, " failed. i: ", index, " lo: ", lo, " hi: ", hi, " last read string: \"", lastReadString, '\''); -#endif return -1; } @@ -346,7 +331,6 @@ namespace System.Resources } } } - BCLDebug.Log("RESMGRFILEFORMAT", "FindPosForResource for " + name + ": Found a hash collision, HOWEVER, neither of these collided values equaled the given string."); return -1; } @@ -463,13 +447,13 @@ namespace System.Resources { _store.BaseStream.Seek(nameVA + _nameSectionOffset, SeekOrigin.Begin); SkipString(); - //BCLDebug.Log("RESMGRFILEFORMAT", "GetValueForNameIndex for index: "+index+" skip (name length): "+skip); + int dataPos = _store.ReadInt32(); if (dataPos < 0 || dataPos >= _store.BaseStream.Length - _dataSectionOffset) { throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataPos)); } - BCLDebug.Log("RESMGRFILEFORMAT", "GetValueForNameIndex: dataPos: " + dataPos); + ResourceTypeCode junk; if (_version == 1) return LoadObjectV1(dataPos); @@ -511,7 +495,7 @@ namespace System.Resources if (typeCode == ResourceTypeCode.String) // ignore Null s = _store.ReadString(); } - BCLDebug.Log("RESMGRFILEFORMAT", "LoadString(" + pos.ToString("x", CultureInfo.InvariantCulture) + " returned " + (s == null ? "[a null string]" : s)); + return s; } @@ -567,7 +551,6 @@ namespace System.Resources if (typeIndex == -1) return null; RuntimeType type = FindType(typeIndex); - BCLDebug.Log("RESMGRFILEFORMAT", "LoadObject type: " + type.Name + " pos: 0x" + _store.BaseStream.Position.ToString("x", CultureInfo.InvariantCulture)); // Consider putting in logic to see if this type is a // primitive or a value type first, so we can reach the // deserialization code faster for arbitrary objects. @@ -641,8 +624,6 @@ namespace System.Resources _store.BaseStream.Seek(_dataSectionOffset + pos, SeekOrigin.Begin); typeCode = (ResourceTypeCode)_store.Read7BitEncodedInt(); - BCLDebug.Log("RESMGRFILEFORMAT", "LoadObjectV2 type: " + typeCode + " pos: 0x" + _store.BaseStream.Position.ToString("x", CultureInfo.InvariantCulture)); - switch (typeCode) { case ResourceTypeCode.Null: @@ -812,12 +793,10 @@ namespace System.Resources } if (resMgrHeaderVersion > 1) { - BCLDebug.Log("RESMGRFILEFORMAT", LogLevel.Status, "ReadResources: Unexpected ResMgr header version: {0} Skipping ahead {1} bytes.", resMgrHeaderVersion, numBytesToSkip); _store.BaseStream.Seek(numBytesToSkip, SeekOrigin.Current); } else { - BCLDebug.Log("RESMGRFILEFORMAT", "ReadResources: Parsing ResMgr header v1."); // We don't care about numBytesToSkip; read the rest of the header // Read in type name for a suitable ResourceReader @@ -840,36 +819,11 @@ namespace System.Resources throw new ArgumentException(SR.Format(SR.Arg_ResourceFileUnsupportedVersion, RuntimeResourceSet.Version, version)); _version = version; -#if RESOURCE_FILE_FORMAT_DEBUG - // Look for ***DEBUG*** to see if this is a debuggable file. - long oldPos = _store.BaseStream.Position; - _debug = false; - try { - String debugString = _store.ReadString(); - _debug = String.Equals("***DEBUG***", debugString); - } - catch(IOException) { - } - catch(OutOfMemoryException) { - } - if (_debug) { - Console.WriteLine("ResourceReader is looking at a debuggable .resources file, version {0}", _version); - } - else { - _store.BaseStream.Position = oldPos; - } -#endif - _numResources = _store.ReadInt32(); if (_numResources < 0) { throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); } - BCLDebug.Log("RESMGRFILEFORMAT", "ReadResources: Expecting " + _numResources + " resources."); -#if RESOURCE_FILE_FORMAT_DEBUG - if (ResourceManager.DEBUG >= 4) - Console.WriteLine("ResourceReader::ReadResources - Reading in "+_numResources+" resources"); -#endif // Read type positions into type positions array. // But delay initialize the type table. @@ -888,11 +842,6 @@ namespace System.Resources SkipString(); } -#if RESOURCE_FILE_FORMAT_DEBUG - if (ResourceManager.DEBUG >= 5) - Console.WriteLine("ResourceReader::ReadResources - Reading in "+numTypes+" type table entries"); -#endif - // Prepare to read in the array of name hashes // Note that the name hashes array is aligned to 8 bytes so // we can use pointers into it on 64 bit machines. (4 bytes @@ -910,13 +859,6 @@ namespace System.Resources } // Read in the array of name hashes -#if RESOURCE_FILE_FORMAT_DEBUG - // Skip over "HASHES->" - if (_debug) { - _store.BaseStream.Position += 8; - } -#endif - if (_ums == null) { _nameHashes = new int[_numResources]; @@ -943,12 +885,6 @@ namespace System.Resources } // Read in the array of relative positions for all the names. -#if RESOURCE_FILE_FORMAT_DEBUG - // Skip over "POS---->" - if (_debug) { - _store.BaseStream.Position += 8; - } -#endif if (_ums == null) { _namePositions = new int[_numResources]; @@ -995,8 +931,6 @@ namespace System.Resources { throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); } - - BCLDebug.Log("RESMGRFILEFORMAT", String.Format(CultureInfo.InvariantCulture, "ReadResources: _nameOffset = 0x{0:x} _dataOffset = 0x{1:x}", _nameSectionOffset, _dataSectionOffset)); } // This allows us to delay-initialize the Type[]. This might be a diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs index e5bc0c5293..141cb166e8 100644 --- a/src/mscorlib/src/System/RtType.cs +++ b/src/mscorlib/src/System/RtType.cs @@ -46,7 +46,7 @@ namespace System FormatAssembly = 0x00000004, // Include assembly display name in type names FormatSignature = 0x00000008, // Include signature in method names FormatNoVersion = 0x00000010, // Suppress version and culture information in all assembly names -#if _DEBUG +#if DEBUG FormatDebug = 0x00000020, // For debug printing of types only #endif FormatAngleBrackets = 0x00000040, // Whether generic types are C<T> or C[T] @@ -389,7 +389,7 @@ namespace System list = PopulateInterfaces(filter); break; default: - BCLDebug.Assert(false, "Invalid CacheType"); + Debug.Fail("Invalid CacheType"); break; } diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs b/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs index 197de23c70..01b803b697 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs @@ -173,7 +173,7 @@ namespace System.Runtime.CompilerServices if (oceEdi != null) { oceEdi.Throw(); - Debug.Assert(false, "Throw() should have thrown"); + Debug.Fail("Throw() should have thrown"); } throw new TaskCanceledException(task); @@ -184,12 +184,12 @@ namespace System.Runtime.CompilerServices if (edis.Count > 0) { edis[0].Throw(); - Debug.Assert(false, "Throw() should have thrown"); + Debug.Fail("Throw() should have thrown"); break; // Necessary to compile: non-reachable, but compiler can't determine that } else { - Debug.Assert(false, "There should be exceptions if we're Faulted."); + Debug.Fail("There should be exceptions if we're Faulted."); throw task.Exception; } } diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs b/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs index ef217d153f..f89f201c79 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs @@ -93,7 +93,7 @@ namespace System.Runtime.CompilerServices return new StackCrawlMarkHandle(UnsafeCastToStackPointer(ref stackMark)); } -#if _DEBUG +#if DEBUG static internal int UnsafeEnumCast<T>(T val) where T : struct // Actually T must be 4 byte (or less) enum { Debug.Assert(typeof(T).IsEnum @@ -145,7 +145,7 @@ namespace System.Runtime.CompilerServices // See getILIntrinsicImplementation for how this happens. throw new InvalidOperationException(); } -#else // _DEBUG +#else // DEBUG static internal int UnsafeEnumCast<T>(T val) where T : struct // Actually T must be 4 byte (or less) enum { @@ -167,7 +167,7 @@ namespace System.Runtime.CompilerServices // See getILIntrinsicImplementation for how this happens. throw new InvalidOperationException(); } -#endif // _DEBUG +#endif // DEBUG // Set the given element in the array without any type or range checks [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -179,7 +179,7 @@ namespace System.Runtime.CompilerServices return Unsafe.As<PinningHelper>(o); } -#if _DEBUG +#if DEBUG [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern static bool IsAddressInStack(IntPtr ptr); #endif diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsSink.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsSink.cs index 08f27dc038..b9f10bc5cb 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsSink.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsSink.cs @@ -73,8 +73,8 @@ namespace System.Runtime.InteropServices internal static ComEventsSink Remove(ComEventsSink sinks, ComEventsSink sink) { - BCLDebug.Assert(sinks != null, "removing event sink from empty sinks collection"); - BCLDebug.Assert(sink != null, "specify event sink is null"); + Debug.Assert(sinks != null, "removing event sink from empty sinks collection"); + Debug.Assert(sink != null, "specify event sink is null"); if (sink == sinks) { @@ -145,7 +145,7 @@ namespace System.Runtime.InteropServices private void Advise(object rcw) { - BCLDebug.Assert(_connectionPoint == null, "comevent sink is already advised"); + Debug.Assert(_connectionPoint == null, "comevent sink is already advised"); ComTypes.IConnectionPointContainer cpc = (ComTypes.IConnectionPointContainer)rcw; ComTypes.IConnectionPoint cp; @@ -160,7 +160,7 @@ namespace System.Runtime.InteropServices private void Unadvise() { - BCLDebug.Assert(_connectionPoint != null, "can not unadvise from empty connection point"); + Debug.Assert(_connectionPoint != null, "can not unadvise from empty connection point"); try { diff --git a/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs index cc3462275e..2bce2ec6f4 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs @@ -135,9 +135,6 @@ namespace System.Runtime.InteropServices { // ! Do not add or rearrange fields as the EE depends on this layout. //------------------------------------------------------------------ -#if DEBUG - private String _stackTrace; // Where we allocated this CriticalHandle. -#endif protected IntPtr handle; // This must be protected so derived classes can use out params. private bool _isClosed; // Set by SetHandleAsInvalid or Close/Dispose/finalization. @@ -146,13 +143,6 @@ namespace System.Runtime.InteropServices { handle = invalidHandleValue; _isClosed = false; - -#if DEBUG - if (BCLDebug.SafeHandleStackTracesEnabled) - _stackTrace = Environment.GetStackTrace(null, false); - else - _stackTrace = "For a stack trace showing who allocated this CriticalHandle, set SafeHandleStackTraces to 1 and rerun your app."; -#endif } // Adding an empty default constructor for annotation purposes diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs index 6654ec9b00..7970324fef 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs @@ -17,6 +17,7 @@ namespace System.Runtime.InteropServices { using System; + using System.Diagnostics; using System.Reflection; using System.Threading; using System.Runtime; @@ -137,12 +138,6 @@ namespace System.Runtime.InteropServices { // ! Do not add or rearrange fields as the EE depends on this layout. //------------------------------------------------------------------ -#if DEBUG - // FxCop thinks this field is marshaled and so it raises a CA2101 error unless - // we specify this. In practice this is never presented to Win32. - [MarshalAs(UnmanagedType.LPWStr)] - private String _stackTrace; // Where we allocated this SafeHandle. -#endif protected IntPtr handle; // this must be protected so derived classes can use out params. private int _state; // Combined ref count and closed/disposed flags (so we can atomically modify them). private bool _ownsHandle; // Whether we can release this handle. @@ -162,13 +157,6 @@ namespace System.Runtime.InteropServices if (!ownsHandle) GC.SuppressFinalize(this); -#if DEBUG - if (BCLDebug.SafeHandleStackTracesEnabled) - _stackTrace = Environment.GetStackTrace(null, false); - else - _stackTrace = "For a stack trace showing who allocated this SafeHandle, set SafeHandleStackTraces to 1 and rerun your app."; -#endif - // Set this last to prevent SafeHandle's finalizer from freeing an // invalid handle. This means we don't have to worry about // ThreadAbortExceptions interrupting this constructor or the managed @@ -179,7 +167,7 @@ namespace System.Runtime.InteropServices // Migrating InheritanceDemands requires this default ctor, so we can mark it critical protected SafeHandle() { - BCLDebug.Assert(false, "SafeHandle's protected default ctor should never be used!"); + Debug.Fail("SafeHandle's protected default ctor should never be used!"); throw new NotImplementedException(); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs index 014e63e89d..60686a8705 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs @@ -27,7 +27,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private BindableVectorToCollectionAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // int Count { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs index 122c7a1b13..aa270a2aee 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs @@ -27,7 +27,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private BindableVectorToListAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // object this[int index] { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs index 12c77a2254..2d15e31c26 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs @@ -315,7 +315,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // Array types are 1024 larger than their equivilent scalar counterpart - BCLDebug.Assert((int)Type > 1024, "Unexpected array PropertyType value"); + Debug.Assert((int)Type > 1024, "Unexpected array PropertyType value"); PropertyType scalarType = Type - 1024; // If we do not have the correct array type, then we need to convert the array element-by-element @@ -439,7 +439,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } else { - BCLDebug.Assert(false, "T in coersion function wasn't understood as a type that can be coerced - make sure that CoerceScalarValue and NumericScalarTypes are in sync"); + Debug.Fail("T in coersion function wasn't understood as a type that can be coerced - make sure that CoerceScalarValue and NumericScalarTypes are in sync"); } } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs index d8fa4b3cae..97473856ba 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs @@ -19,7 +19,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public CLRIReferenceImpl(PropertyType type, T obj) : base(type, obj) { - BCLDebug.Assert(obj != null, "Must not be null"); + Debug.Assert(obj != null, "Must not be null"); _value = obj; } @@ -73,7 +73,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public CLRIReferenceArrayImpl(PropertyType type, T[] obj) : base(type, obj) { - BCLDebug.Assert(obj != null, "Must not be null"); + Debug.Assert(obj != null, "Must not be null"); _value = obj; @@ -303,7 +303,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime return Activator.CreateInstance(specificType, new Object[] { propType.Value, obj }); } - Debug.Assert(false, "We should not see non-WinRT type here"); + Debug.Fail("We should not see non-WinRT type here"); return null; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs index 5d9f332a61..0a6f6e0c23 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs @@ -28,7 +28,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private DictionaryToMapAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // V Lookup(K key) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EnumeratorToIteratorAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EnumeratorToIteratorAdapter.cs index 95158b093d..d39516d117 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EnumeratorToIteratorAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EnumeratorToIteratorAdapter.cs @@ -25,7 +25,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private EnumerableToIterableAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // This method is invoked when First is called on a managed implementation of IIterable<T>. @@ -40,7 +40,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private EnumerableToBindableIterableAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } internal sealed class NonGenericToGenericEnumerator : IEnumerator<object> diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IClosable.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IClosable.cs index 564b86e685..17624dfd1f 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IClosable.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IClosable.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private IDisposableToIClosableAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } public void Close() @@ -41,7 +41,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private IClosableToIDisposableAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } private void Dispose() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs index aa7bf76750..4fbcd9975d 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs @@ -27,7 +27,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private IMapViewToIReadOnlyDictionaryAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // V this[K key] { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs index f5bc58a7e5..64d16abe65 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs @@ -27,7 +27,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private IReadOnlyDictionaryToIMapViewAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // V Lookup(K key) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs index c69115d1eb..cd41ea0e69 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs @@ -27,7 +27,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private IReadOnlyListToIVectorViewAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // T GetAt(uint index) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVectorViewToIReadOnlyListAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVectorViewToIReadOnlyListAdapter.cs index 1445670680..50149799e0 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVectorViewToIReadOnlyListAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVectorViewToIReadOnlyListAdapter.cs @@ -29,7 +29,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private IVectorViewToIReadOnlyListAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // T this[int index] { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IteratorToEnumeratorAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IteratorToEnumeratorAdapter.cs index 7bc2fa06a9..e681533f6b 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IteratorToEnumeratorAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IteratorToEnumeratorAdapter.cs @@ -28,7 +28,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private IterableToEnumerableAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // This method is invoked when GetEnumerator is called on a WinRT-backed implementation of IEnumerable<T>. @@ -68,7 +68,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private BindableIterableToEnumerableAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } private sealed class NonGenericToGenericIterator : IIterator<object> diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs index c0c8769b5a..2465908a2a 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs @@ -28,7 +28,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private ListToBindableVectorAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // object GetAt(uint index) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs index 4f23f639f2..8c7dfcaf04 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs @@ -28,7 +28,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private ListToVectorAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // T GetAt(uint index) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs index 8cc189b162..50e5f5e337 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs @@ -29,7 +29,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private MapToCollectionAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // int Count { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs index a69acb7eeb..b8c4de8fb2 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private MapToDictionaryAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // V this[K key] { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs index 16e21e21a1..1e2a5f09c1 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs @@ -29,7 +29,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private MapViewToReadOnlyCollectionAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // int Count { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs index ff10971f91..07617929c8 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private VectorToCollectionAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // int Count { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs index 3e4e5ad67d..2c94129cd4 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private VectorToListAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // T this[int index] { get } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs index 679060bf4d..dcaa97fddb 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { private VectorViewToReadOnlyCollectionAdapter() { - Debug.Assert(false, "This class is never instantiated"); + Debug.Fail("This class is never instantiated"); } // int Count { get } diff --git a/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs b/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs index 899bd44d96..660b0f30be 100644 --- a/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs +++ b/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs @@ -261,7 +261,7 @@ namespace System.Runtime if (needPageFile || needAddressSpace) { InsufficientMemoryException e = new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint); -#if _DEBUG +#if DEBUG e.Data["MemFailPointState"] = new MemoryFailPointState(sizeInMegabytes, segmentSize, needPageFile, needAddressSpace, needContiguousVASpace, availPageFile >> 20, totalAddressSpaceFree >> 20, @@ -273,7 +273,7 @@ namespace System.Runtime if (needContiguousVASpace) { InsufficientMemoryException e = new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint_VAFrag); -#if _DEBUG +#if DEBUG e.Data["MemFailPointState"] = new MemoryFailPointState(sizeInMegabytes, segmentSize, needPageFile, needAddressSpace, needContiguousVASpace, availPageFile >> 20, totalAddressSpaceFree >> 20, @@ -285,7 +285,7 @@ namespace System.Runtime break; default: - Debug.Assert(false, "Fell through switch statement!"); + Debug.Fail("Fell through switch statement!"); break; } } @@ -422,7 +422,7 @@ namespace System.Runtime */ } -#if _DEBUG +#if DEBUG [Serializable] internal sealed class MemoryFailPointState { diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs index 694a382148..979d5fee2a 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs @@ -323,7 +323,6 @@ namespace System.Runtime.Serialization { if (m_nameToIndex.ContainsKey(name)) { - BCLDebug.Trace("SER", "[SerializationInfo.AddValue]Tried to add ", name, " twice to the SI."); throw new SerializationException(SR.Serialization_SameNameTwice); } m_nameToIndex.Add(name, m_currMember); @@ -383,7 +382,6 @@ namespace System.Runtime.Serialization { throw new ArgumentNullException(nameof(name)); } - BCLDebug.Trace("SER", "[SerializationInfo.FindElement]Looking for ", name, " CurrMember is: ", m_currMember); int index; if (m_nameToIndex.TryGetValue(name, out index)) { diff --git a/src/mscorlib/src/System/SharedStatics.cs b/src/mscorlib/src/System/SharedStatics.cs index dd9c63b334..8111b9b1d1 100644 --- a/src/mscorlib/src/System/SharedStatics.cs +++ b/src/mscorlib/src/System/SharedStatics.cs @@ -29,7 +29,7 @@ namespace System // when we set up _sharedStatics via AppDomain::SetupSharedStatics private SharedStatics() { - BCLDebug.Assert(false, "SharedStatics..ctor() is never called."); + Debug.Fail("SharedStatics..ctor() is never called."); } // This is the total amount of memory currently "reserved" via diff --git a/src/mscorlib/src/System/String.cs b/src/mscorlib/src/System/String.cs index cd9689978e..fecbd7176f 100644 --- a/src/mscorlib/src/System/String.cs +++ b/src/mscorlib/src/System/String.cs @@ -858,19 +858,16 @@ namespace System public CharEnumerator GetEnumerator() { - BCLDebug.Perf(false, "Avoid using String's CharEnumerator until C# special cases foreach on String - use the indexed property on String instead."); return new CharEnumerator(this); } IEnumerator<char> IEnumerable<char>.GetEnumerator() { - BCLDebug.Perf(false, "Avoid using String's CharEnumerator until C# special cases foreach on String - use the indexed property on String instead."); return new CharEnumerator(this); } IEnumerator IEnumerable.GetEnumerator() { - BCLDebug.Perf(false, "Avoid using String's CharEnumerator until C# special cases foreach on String - use the indexed property on String instead."); return new CharEnumerator(this); } diff --git a/src/mscorlib/src/System/StubHelpers.cs b/src/mscorlib/src/System/StubHelpers.cs index ff74d4c3c5..8bdcb76330 100644 --- a/src/mscorlib/src/System/StubHelpers.cs +++ b/src/mscorlib/src/System/StubHelpers.cs @@ -25,7 +25,7 @@ namespace System.StubHelpers unsafe static internal byte[] DoAnsiConversion(string str, bool fBestFit, bool fThrowOnUnmappableChar, out int cbLength) { byte[] buffer = new byte[(str.Length + 1) * Marshal.SystemMaxDBCSCharSize]; - BCLDebug.Assert(buffer.Length != 0); + Debug.Assert(buffer.Length != 0); fixed (byte* bufferPtr = &buffer[0]) { cbLength = str.ConvertToAnsi(bufferPtr, buffer.Length, fBestFit, fThrowOnUnmappableChar); @@ -40,7 +40,7 @@ namespace System.StubHelpers int cbLength = managedChar.ToString().ConvertToAnsi(bufferPtr, cbAllocLength, fBestFit, fThrowOnUnmappableChar); - BCLDebug.Assert(cbLength > 0, "Zero bytes returned from DoAnsiConversion in AnsiCharMarshaler.ConvertToNative"); + Debug.Assert(cbLength > 0, "Zero bytes returned from DoAnsiConversion in AnsiCharMarshaler.ConvertToNative"); return bufferPtr[0]; } @@ -254,10 +254,10 @@ namespace System.StubHelpers { // If caller provided a buffer, construct the BSTR manually. The size // of the buffer must be at least (lengthInBytes + 6) bytes. -#if _DEBUG +#if DEBUG uint length = *((uint*)pNativeBuffer.ToPointer()); - BCLDebug.Assert(length >= lengthInBytes + 6, "BSTR localloc'ed buffer is too small"); -#endif // _DEBUG + Debug.Assert(length >= lengthInBytes + 6, "BSTR localloc'ed buffer is too small"); +#endif // set length *((uint*)pNativeBuffer.ToPointer()) = lengthInBytes; @@ -385,7 +385,7 @@ namespace System.StubHelpers int nbytesused; byte[] bytes = AnsiCharMarshaler.DoAnsiConversion(strManaged, fBestFit, fThrowOnUnmappableChar, out nbytesused); - BCLDebug.Assert(nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); + Debug.Assert(nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); Buffer.Memcpy(pNative, 0, bytes, 0, nbytesused); pNative[nbytesused] = 0; @@ -472,19 +472,19 @@ namespace System.StubHelpers { static internal IntPtr ConvertToNative(string strManaged) { - Debug.Assert(false, "NYI"); + Debug.Fail("NYI"); return IntPtr.Zero; } static internal unsafe string ConvertToManaged(IntPtr bstr) { - Debug.Assert(false, "NYI"); + Debug.Fail("NYI"); return null; } static internal void ClearNative(IntPtr pNative) { - Debug.Assert(false, "NYI"); + Debug.Fail("NYI"); } } // class WSTRBufferMarshaler @@ -978,7 +978,7 @@ namespace System.StubHelpers internal AsAnyMarshaler(IntPtr pvArrayMarshaler) { // we need this in case the value being marshaled turns out to be array - BCLDebug.Assert(pvArrayMarshaler != IntPtr.Zero, "pvArrayMarshaler must not be null"); + Debug.Assert(pvArrayMarshaler != IntPtr.Zero, "pvArrayMarshaler must not be null"); this.pvArrayMarshaler = pvArrayMarshaler; backPropAction = BackPropAction.None; @@ -1533,7 +1533,7 @@ namespace System.StubHelpers public void Add(CleanupWorkListElement elem) { - BCLDebug.Assert(elem.m_owned == false, "m_owned is supposed to be false and set later by DangerousAddRef"); + Debug.Assert(elem.m_owned == false, "m_owned is supposed to be false and set later by DangerousAddRef"); m_list.Add(elem); } diff --git a/src/mscorlib/src/System/Threading/Tasks/Task.cs b/src/mscorlib/src/System/Threading/Tasks/Task.cs index 4fdad9fa19..37ae347649 100644 --- a/src/mscorlib/src/System/Threading/Tasks/Task.cs +++ b/src/mscorlib/src/System/Threading/Tasks/Task.cs @@ -2498,7 +2498,7 @@ namespace System.Threading.Tasks actionWithState(m_stateObject); return; } - Debug.Assert(false, "Invalid m_action in Task"); + Debug.Fail("Invalid m_action in Task"); } /// <summary> @@ -6606,7 +6606,7 @@ namespace System.Threading.Tasks Debug.Assert(result, "Expected TrySetFromTask from inner task to succeed"); break; default: - Debug.Assert(false, "UnwrapPromise in illegal state"); + Debug.Fail("UnwrapPromise in illegal state"); break; } } diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs b/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs index 06539f956c..8835eb542d 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @@ -65,7 +65,7 @@ namespace System.Threading.Tasks actionWithState(antecedent, m_stateObject); return; } - Debug.Assert(false, "Invalid m_action in ContinuationTaskFromTask"); + Debug.Fail("Invalid m_action in ContinuationTaskFromTask"); } } @@ -112,7 +112,7 @@ namespace System.Threading.Tasks m_result = funcWithState(antecedent, m_stateObject); return; } - Debug.Assert(false, "Invalid m_action in ContinuationResultTaskFromTask"); + Debug.Fail("Invalid m_action in ContinuationResultTaskFromTask"); } } @@ -159,7 +159,7 @@ namespace System.Threading.Tasks actionWithState(antecedent, m_stateObject); return; } - Debug.Assert(false, "Invalid m_action in ContinuationTaskFromResultTask"); + Debug.Fail("Invalid m_action in ContinuationTaskFromResultTask"); } } @@ -206,7 +206,7 @@ namespace System.Threading.Tasks m_result = funcWithState(antecedent, m_stateObject); return; } - Debug.Assert(false, "Invalid m_action in ContinuationResultTaskFromResultTask"); + Debug.Fail("Invalid m_action in ContinuationResultTaskFromResultTask"); } } diff --git a/src/mscorlib/src/System/Threading/Tasks/future.cs b/src/mscorlib/src/System/Threading/Tasks/future.cs index d114f892f0..f9199d35cc 100644 --- a/src/mscorlib/src/System/Threading/Tasks/future.cs +++ b/src/mscorlib/src/System/Threading/Tasks/future.cs @@ -616,7 +616,7 @@ namespace System.Threading.Tasks m_result = funcWithState(m_stateObject); return; } - Debug.Assert(false, "Invalid m_action in Task<TResult>"); + Debug.Fail("Invalid m_action in Task<TResult>"); } #region Await Support diff --git a/src/mscorlib/src/System/Threading/WaitHandle.cs b/src/mscorlib/src/System/Threading/WaitHandle.cs index 125a29ed6c..69c34456cb 100644 --- a/src/mscorlib/src/System/Threading/WaitHandle.cs +++ b/src/mscorlib/src/System/Threading/WaitHandle.cs @@ -273,7 +273,7 @@ namespace System.Threading internalWaitHandles[i] = waitHandle; } -#if _DEBUG +#if DEBUG // make sure we do not use waitHandles any more. waitHandles = null; #endif @@ -362,7 +362,7 @@ namespace System.Threading internalWaitHandles[i] = waitHandle; } -#if _DEBUG +#if DEBUG // make sure we do not use waitHandles any more. waitHandles = null; #endif diff --git a/src/mscorlib/src/System/Tuple.cs b/src/mscorlib/src/System/Tuple.cs index 3381c750d0..dce9a53c0e 100644 --- a/src/mscorlib/src/System/Tuple.cs +++ b/src/mscorlib/src/System/Tuple.cs @@ -1195,7 +1195,7 @@ namespace System case 7: return Tuple.CombineHashCodes(comparer.GetHashCode(m_Item1), comparer.GetHashCode(m_Item2), comparer.GetHashCode(m_Item3), comparer.GetHashCode(m_Item4), comparer.GetHashCode(m_Item5), comparer.GetHashCode(m_Item6), comparer.GetHashCode(m_Item7), t.GetHashCode(comparer)); } - Debug.Assert(false, "Missed all cases for computing Tuple hash code"); + Debug.Fail("Missed all cases for computing Tuple hash code"); return -1; } diff --git a/src/mscorlib/src/System/ValueType.cs b/src/mscorlib/src/System/ValueType.cs index e5b5528314..cd8d0e05aa 100644 --- a/src/mscorlib/src/System/ValueType.cs +++ b/src/mscorlib/src/System/ValueType.cs @@ -24,7 +24,6 @@ namespace System { public override bool Equals(Object obj) { - BCLDebug.Perf(false, "ValueType::Equals is not fast. " + this.GetType().FullName + " should override Equals(Object)"); if (null == obj) { return false; diff --git a/src/mscorlib/src/System/WeakReference.cs b/src/mscorlib/src/System/WeakReference.cs index bde7586590..b99e3683a6 100644 --- a/src/mscorlib/src/System/WeakReference.cs +++ b/src/mscorlib/src/System/WeakReference.cs @@ -30,7 +30,7 @@ namespace System // Migrating InheritanceDemands requires this default ctor, so we can mark it SafeCritical protected WeakReference() { - Debug.Assert(false, "WeakReference's protected default ctor should never be used!"); + Debug.Fail("WeakReference's protected default ctor should never be used!"); throw new NotImplementedException(); } diff --git a/src/pal/prebuilt/idl/corprof_i.cpp b/src/pal/prebuilt/idl/corprof_i.cpp index 090f84452c..065be3dd4a 100644 --- a/src/pal/prebuilt/idl/corprof_i.cpp +++ b/src/pal/prebuilt/idl/corprof_i.cpp @@ -125,6 +125,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo7,0x9AEECC0D,0x63E0,0x4187,0x8C,0x00,0 MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo8,0xC5AC80A6,0x782E,0x4716,0x80,0x44,0x39,0x59,0x8C,0x60,0xCF,0xBF); +MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo9,0X008170DB,0XF8CC,0X4796,0X9A,0X51,0XDC,0X8A,0XA0,0XB4,0X70,0x12); + + MIDL_DEFINE_GUID(IID, IID_ICorProfilerMethodEnum,0xFCCEE788,0x0088,0x454B,0xA8,0x11,0xC9,0x9F,0x29,0x8D,0x19,0x42); diff --git a/src/pal/prebuilt/inc/corprof.h b/src/pal/prebuilt/inc/corprof.h index 46e3bb72cb..5a4f8c37d6 100644 --- a/src/pal/prebuilt/inc/corprof.h +++ b/src/pal/prebuilt/inc/corprof.h @@ -191,6 +191,13 @@ typedef interface ICorProfilerInfo8 ICorProfilerInfo8; #endif /* __ICorProfilerInfo8_FWD_DEFINED__ */ +#ifndef __ICorProfilerInfo9_FWD_DEFINED__ +#define __ICorProfilerInfo9_FWD_DEFINED__ +typedef interface ICorProfilerInfo9 ICorProfilerInfo9; + +#endif /* __ICorProfilerInfo9_FWD_DEFINED__ */ + + #ifndef __ICorProfilerMethodEnum_FWD_DEFINED__ #define __ICorProfilerMethodEnum_FWD_DEFINED__ typedef interface ICorProfilerMethodEnum ICorProfilerMethodEnum; @@ -14207,6 +14214,937 @@ EXTERN_C const IID IID_ICorProfilerInfo8; #endif /* __ICorProfilerInfo8_INTERFACE_DEFINED__ */ +#ifndef __ICorProfilerInfo9_INTERFACE_DEFINED__ +#define __ICorProfilerInfo9_INTERFACE_DEFINED__ + +/* interface ICorProfilerInfo9 */ +/* [local][unique][uuid][object] */ + + +EXTERN_C const IID IID_ICorProfilerInfo9; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("008170db-f8cc-4796-9a51-dc8aa0b47012") + ICorProfilerInfo9 : public ICorProfilerInfo8 + { + public: + virtual HRESULT STDMETHODCALLTYPE GetNativeCodeStartAddresses( + FunctionID functionID, + ReJITID reJitId, + ULONG32 cCodeStartAddresses, + ULONG32 *pcCodeStartAddresses, + UINT_PTR codeStartAddresses[ ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetILToNativeMapping3( + UINT_PTR pNativeCodeStartAddress, + ULONG32 cMap, + ULONG32 *pcMap, + COR_DEBUG_IL_TO_NATIVE_MAP map[ ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodeInfo4( + UINT_PTR pNativeCodeStartAddress, + ULONG32 cCodeInfos, + ULONG32 *pcCodeInfos, + COR_PRF_CODE_INFO codeInfos[ ]) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorProfilerInfo9Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorProfilerInfo9 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorProfilerInfo9 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICorProfilerInfo9 * This); + + HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( + ICorProfilerInfo9 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ClassID *pClassId); + + HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdTypeDef typeDef, + /* [out] */ ClassID *pClassId); + + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [out] */ LPCBYTE *pStart, + /* [out] */ ULONG *pcSize); + + HRESULT ( STDMETHODCALLTYPE *GetEventMask )( + ICorProfilerInfo9 * This, + /* [out] */ DWORD *pdwEvents); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( + ICorProfilerInfo9 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdToken token, + /* [out] */ FunctionID *pFunctionId); + + HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( + ICorProfilerInfo9 * This, + /* [in] */ ThreadID threadId, + /* [out] */ HANDLE *phThread); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + ICorProfilerInfo9 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ULONG *pcSize); + + HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [out] */ CorElementType *pBaseElemType, + /* [out] */ ClassID *pBaseClassId, + /* [out] */ ULONG *pcRank); + + HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( + ICorProfilerInfo9 * This, + /* [in] */ ThreadID threadId, + /* [out] */ DWORD *pdwWin32ThreadId); + + HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( + ICorProfilerInfo9 * This, + /* [out] */ ThreadID *pThreadId); + + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken); + + HRESULT ( STDMETHODCALLTYPE *SetEventMask )( + ICorProfilerInfo9 * This, + /* [in] */ DWORD dwEvents); + + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionEnter *pFuncEnter, + /* [in] */ FunctionLeave *pFuncLeave, + /* [in] */ FunctionTailcall *pFuncTailcall); + + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionIDMapper *pFunc); + + HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppImport, + /* [out] */ mdToken *pToken); + + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId); + + HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD dwOpenFlags, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppOut); + + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodId, + /* [out] */ LPCBYTE *ppMethodHeader, + /* [out] */ ULONG *pcbMethodSize); + + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ IMethodMalloc **ppMalloc); + + HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodid, + /* [in] */ LPCBYTE pbNewILMethodHeader); + + HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( + ICorProfilerInfo9 * This, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ ProcessID *pProcessId); + + HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( + ICorProfilerInfo9 * This, + /* [in] */ AssemblyID assemblyId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AppDomainID *pAppDomainId, + /* [out] */ ModuleID *pModuleId); + + HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId); + + HRESULT ( STDMETHODCALLTYPE *ForceGC )( + ICorProfilerInfo9 * This); + + HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ BOOL fStartJit, + /* [in] */ ULONG cILMapEntries, + /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( + ICorProfilerInfo9 * This, + /* [out] */ IUnknown **ppicd); + + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( + ICorProfilerInfo9 * This, + /* [out] */ IUnknown **ppicd); + + HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( + ICorProfilerInfo9 * This, + /* [in] */ ThreadID threadId, + /* [out] */ ContextID *pContextId); + + HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( + ICorProfilerInfo9 * This, + /* [in] */ BOOL fThisThreadOnly, + /* [out] */ DWORD *pdwProfilerContext); + + HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( + ICorProfilerInfo9 * This, + /* [in] */ DWORD dwProfilerContext); + + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( + ICorProfilerInfo9 * This, + /* [in] */ ThreadID thread, + /* [in] */ StackSnapshotCallback *callback, + /* [in] */ ULONG32 infoFlags, + /* [in] */ void *clientData, + /* [size_is][in] */ BYTE context[ ], + /* [in] */ ULONG32 contextSize); + + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionEnter2 *pFuncEnter, + /* [in] */ FunctionLeave2 *pFuncLeave, + /* [in] */ FunctionTailcall2 *pFuncTailcall); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID funcId, + /* [in] */ COR_PRF_FRAME_INFO frameInfo, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken, + /* [in] */ ULONG32 cTypeArgs, + /* [out] */ ULONG32 *pcTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( + ICorProfilerInfo9 * This, + /* [out] */ ULONG *pBufferLengthOffset, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classID, + /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[ ], + /* [in] */ ULONG cFieldOffset, + /* [out] */ ULONG *pcFieldOffset, + /* [out] */ ULONG *pulClassSize); + + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken, + /* [out] */ ClassID *pParentClassId, + /* [in] */ ULONG32 cNumTypeArgs, + /* [out] */ ULONG32 *pcNumTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdTypeDef typeDef, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ ClassID *pClassID); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdMethodDef funcDef, + /* [in] */ ClassID classId, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ FunctionID *pFunctionID); + + HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleID, + /* [out] */ ICorProfilerObjectEnum **ppEnum); + + HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( + ICorProfilerInfo9 * This, + /* [in] */ ObjectID objectId, + /* [in] */ ULONG32 cDimensions, + /* [size_is][out] */ ULONG32 pDimensionSizes[ ], + /* [size_is][out] */ int pDimensionLowerBounds[ ], + /* [out] */ BYTE **ppData); + + HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [out] */ ULONG32 *pBufferOffset); + + HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( + ICorProfilerInfo9 * This, + /* [in] */ ThreadID threadId, + /* [out] */ AppDomainID *pAppDomainId); + + HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ void **ppAddress); + + HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [out] */ void **ppAddress); + + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ContextID contextId, + /* [out] */ void **ppAddress); + + HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( + ICorProfilerInfo9 * This, + /* [in] */ ULONG cObjectRanges, + /* [out] */ ULONG *pcObjectRanges, + /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( + ICorProfilerInfo9 * This, + /* [in] */ ObjectID objectId, + /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + + HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( + ICorProfilerInfo9 * This, + /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( + ICorProfilerInfo9 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( + ICorProfilerInfo9 * This, + /* [in] */ DWORD dwExpectedCompletionMilliseconds); + + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionIDMapper2 *pFunc, + /* [in] */ void *clientData); + + HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( + ICorProfilerInfo9 * This, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionEnter3 *pFuncEnter3, + /* [in] */ FunctionLeave3 *pFuncLeave3, + /* [in] */ FunctionTailcall3 *pFuncTailcall3); + + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, + /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, + /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out][in] */ ULONG *pcbArgumentInfo, + /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + + HRESULT ( STDMETHODCALLTYPE *EnumModules )( + ICorProfilerInfo9 * This, + /* [out] */ ICorProfilerModuleEnum **ppEnum); + + HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( + ICorProfilerInfo9 * This, + /* [out] */ USHORT *pClrInstanceId, + /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType, + /* [out] */ USHORT *pMajorVersion, + /* [out] */ USHORT *pMinorVersion, + /* [out] */ USHORT *pBuildNumber, + /* [out] */ USHORT *pQFEVersion, + /* [in] */ ULONG cchVersionString, + /* [out] */ ULONG *pcchVersionString, + /* [annotation][out] */ + _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( + ICorProfilerInfo9 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ ULONG32 cAppDomainIds, + /* [out] */ ULONG32 *pcAppDomainIds, + /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId, + /* [out] */ DWORD *pdwModuleFlags); + + HRESULT ( STDMETHODCALLTYPE *EnumThreads )( + ICorProfilerInfo9 * This, + /* [out] */ ICorProfilerThreadEnum **ppEnum); + + HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( + ICorProfilerInfo9 * This); + + HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( + ICorProfilerInfo9 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ]); + + HRESULT ( STDMETHODCALLTYPE *RequestRevert )( + ICorProfilerInfo9 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ], + /* [size_is][out] */ HRESULT status[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( + ICorProfilerInfo9 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId, + /* [out] */ ReJITID *pReJitId); + + HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG cReJitIds, + /* [out] */ ULONG *pcReJitIds, + /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( + ICorProfilerInfo9 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( + ICorProfilerInfo9 * This, + /* [in] */ ObjectID objectId, + /* [out] */ SIZE_T *pcSize); + + HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( + ICorProfilerInfo9 * This, + /* [out] */ DWORD *pdwEventsLow, + /* [out] */ DWORD *pdwEventsHigh); + + HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( + ICorProfilerInfo9 * This, + /* [in] */ DWORD dwEventsLow, + /* [in] */ DWORD dwEventsHigh); + + HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID inlinersModuleId, + /* [in] */ ModuleID inlineeModuleId, + /* [in] */ mdMethodDef inlineeMethodId, + /* [out] */ BOOL *incompleteData, + /* [out] */ ICorProfilerMethodEnum **ppEnum); + + HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId); + + HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ DWORD *pCountSymbolBytes); + + HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( + ICorProfilerInfo9 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD symbolsReadOffset, + /* [out] */ BYTE *pSymbolBytes, + /* [in] */ DWORD countSymbolBytes, + /* [out] */ DWORD *pCountSymbolBytesRead); + + HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [out] */ BOOL *isDynamic); + + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( + ICorProfilerInfo9 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *functionId, + /* [out] */ ReJITID *pReJitId); + + HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( + ICorProfilerInfo9 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ModuleID *moduleId, + /* [out] */ PCCOR_SIGNATURE *ppvSig, + /* [out] */ ULONG *pbSig, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [out] */ WCHAR wszName[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( + ICorProfilerInfo9 * This, + FunctionID functionID, + ReJITID reJitId, + ULONG32 cCodeStartAddresses, + ULONG32 *pcCodeStartAddresses, + UINT_PTR codeStartAddresses[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( + ICorProfilerInfo9 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cMap, + ULONG32 *pcMap, + COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( + ICorProfilerInfo9 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cCodeInfos, + ULONG32 *pcCodeInfos, + COR_PRF_CODE_INFO codeInfos[ ]); + + END_INTERFACE + } ICorProfilerInfo9Vtbl; + + interface ICorProfilerInfo9 + { + CONST_VTBL struct ICorProfilerInfo9Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorProfilerInfo9_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorProfilerInfo9_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorProfilerInfo9_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorProfilerInfo9_GetClassFromObject(This,objectId,pClassId) \ + ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) + +#define ICorProfilerInfo9_GetClassFromToken(This,moduleId,typeDef,pClassId) \ + ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) + +#define ICorProfilerInfo9_GetCodeInfo(This,functionId,pStart,pcSize) \ + ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) + +#define ICorProfilerInfo9_GetEventMask(This,pdwEvents) \ + ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) + +#define ICorProfilerInfo9_GetFunctionFromIP(This,ip,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) + +#define ICorProfilerInfo9_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) + +#define ICorProfilerInfo9_GetHandleFromThread(This,threadId,phThread) \ + ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) + +#define ICorProfilerInfo9_GetObjectSize(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) + +#define ICorProfilerInfo9_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ + ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) + +#define ICorProfilerInfo9_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ + ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) + +#define ICorProfilerInfo9_GetCurrentThreadID(This,pThreadId) \ + ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) + +#define ICorProfilerInfo9_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ + ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) + +#define ICorProfilerInfo9_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ + ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) + +#define ICorProfilerInfo9_SetEventMask(This,dwEvents) \ + ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) + +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo9_SetFunctionIDMapper(This,pFunc) \ + ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) + +#define ICorProfilerInfo9_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ + ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) + +#define ICorProfilerInfo9_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ + ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) + +#define ICorProfilerInfo9_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ + ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) + +#define ICorProfilerInfo9_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ + ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) + +#define ICorProfilerInfo9_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ + ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) + +#define ICorProfilerInfo9_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ + ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) + +#define ICorProfilerInfo9_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ + ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) + +#define ICorProfilerInfo9_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ + ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) + +#define ICorProfilerInfo9_SetFunctionReJIT(This,functionId) \ + ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) + +#define ICorProfilerInfo9_ForceGC(This) \ + ( (This)->lpVtbl -> ForceGC(This) ) + +#define ICorProfilerInfo9_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ + ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) + +#define ICorProfilerInfo9_GetInprocInspectionInterface(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) + +#define ICorProfilerInfo9_GetInprocInspectionIThisThread(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) + +#define ICorProfilerInfo9_GetThreadContext(This,threadId,pContextId) \ + ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) + +#define ICorProfilerInfo9_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ + ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) + +#define ICorProfilerInfo9_EndInprocDebugging(This,dwProfilerContext) \ + ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) + +#define ICorProfilerInfo9_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) + + +#define ICorProfilerInfo9_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ + ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) + +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo9_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) + +#define ICorProfilerInfo9_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo9_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ + ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) + +#define ICorProfilerInfo9_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) + +#define ICorProfilerInfo9_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo9_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ + ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) + +#define ICorProfilerInfo9_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ + ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) + +#define ICorProfilerInfo9_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ + ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) + +#define ICorProfilerInfo9_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ + ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) + +#define ICorProfilerInfo9_GetBoxClassLayout(This,classId,pBufferOffset) \ + ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) + +#define ICorProfilerInfo9_GetThreadAppDomain(This,threadId,pAppDomainId) \ + ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) + +#define ICorProfilerInfo9_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ + ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) + +#define ICorProfilerInfo9_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ + ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) + +#define ICorProfilerInfo9_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) + +#define ICorProfilerInfo9_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ + ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) + +#define ICorProfilerInfo9_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ + ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) + +#define ICorProfilerInfo9_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ + ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) + +#define ICorProfilerInfo9_GetObjectGeneration(This,objectId,range) \ + ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) + +#define ICorProfilerInfo9_GetNotifiedExceptionClauseInfo(This,pinfo) \ + ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) + + +#define ICorProfilerInfo9_EnumJITedFunctions(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) + +#define ICorProfilerInfo9_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ + ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) + +#define ICorProfilerInfo9_SetFunctionIDMapper2(This,pFunc,clientData) \ + ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) + +#define ICorProfilerInfo9_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) + +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) + +#define ICorProfilerInfo9_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ + ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) + +#define ICorProfilerInfo9_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ + ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) + +#define ICorProfilerInfo9_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ + ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) + +#define ICorProfilerInfo9_EnumModules(This,ppEnum) \ + ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) + +#define ICorProfilerInfo9_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ + ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) + +#define ICorProfilerInfo9_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) + +#define ICorProfilerInfo9_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ + ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) + +#define ICorProfilerInfo9_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ + ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) + + +#define ICorProfilerInfo9_EnumThreads(This,ppEnum) \ + ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) + +#define ICorProfilerInfo9_InitializeCurrentThread(This) \ + ( (This)->lpVtbl -> InitializeCurrentThread(This) ) + +#define ICorProfilerInfo9_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ + ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) + +#define ICorProfilerInfo9_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ + ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) + +#define ICorProfilerInfo9_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo9_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) + +#define ICorProfilerInfo9_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ + ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) + +#define ICorProfilerInfo9_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) + +#define ICorProfilerInfo9_EnumJITedFunctions2(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) + +#define ICorProfilerInfo9_GetObjectSize2(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) + + +#define ICorProfilerInfo9_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ + ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) + +#define ICorProfilerInfo9_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ + ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) + + +#define ICorProfilerInfo9_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ + ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) + + +#define ICorProfilerInfo9_ApplyMetaData(This,moduleId) \ + ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) + +#define ICorProfilerInfo9_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ + ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) + +#define ICorProfilerInfo9_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ + ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) + + +#define ICorProfilerInfo9_IsFunctionDynamic(This,functionId,isDynamic) \ + ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) + +#define ICorProfilerInfo9_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) + +#define ICorProfilerInfo9_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ + ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) + + +#define ICorProfilerInfo9_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ + ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) + +#define ICorProfilerInfo9_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) + +#define ICorProfilerInfo9_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICorProfilerInfo9_INTERFACE_DEFINED__ */ + + #ifndef __ICorProfilerMethodEnum_INTERFACE_DEFINED__ #define __ICorProfilerMethodEnum_INTERFACE_DEFINED__ diff --git a/src/publish.proj b/src/publish.proj index 9def32ab0c..81ac12df7c 100644 --- a/src/publish.proj +++ b/src/publish.proj @@ -2,12 +2,7 @@ <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> - <PropertyGroup> - <FeedsDir Condition="'$(RunningOnCore)' != 'true'">$(ToolsDir)Microsoft.Dotnet.Build.Tasks.Feed/net46/</FeedsDir> - <FeedsDir Condition="'$(RunningOnCore)' == 'true'">$(ToolsDir)microsoft.dotnet.build.tasks.feed/netstandard1.5/</FeedsDir> - </PropertyGroup> - - <UsingTask TaskName="PushToBlobFeed" AssemblyFile="$(FeedsDir)Microsoft.DotNet.Build.Tasks.Feed.dll"/> + <Import Project="$(PackagesDir)/$(FeedTasksPackage.ToLower())/$(FeedTasksPackageVersion)/build/$(FeedTasksPackage).targets" /> <PropertyGroup> <PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesBinDir)pkg\*.nupkg</PackagesPattern> diff --git a/src/strongname/api/common.h b/src/strongname/api/common.h index 92fb5b49d5..7cea2ec795 100644 --- a/src/strongname/api/common.h +++ b/src/strongname/api/common.h @@ -72,10 +72,6 @@ #include "lazycow.h" -#include "compatibilityflags.h" -extern BOOL GetCompatibilityFlag(CompatibilityFlag flag); -extern DWORD* GetGlobalCompatibilityFlags(); - #include "strongname.h" #include "stdmacros.h" diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp index 1fe8a96b80..9a7c652c56 100644 --- a/src/vm/appdomain.cpp +++ b/src/vm/appdomain.cpp @@ -64,8 +64,6 @@ #include "nativeoverlapped.h" -#include "compatibilityflags.h" - #ifndef FEATURE_PAL #include "dwreport.h" #endif // !FEATURE_PAL @@ -2062,8 +2060,6 @@ BOOL AppDomain::GetPreferComInsteadOfManagedRemoting() return (GetComOrRemotingFlag() == COMorRemoting_COM); } -STDAPI GetXMLObjectEx(IXMLParser **ppv); - COMorRemotingFlag AppDomain::GetPreferComInsteadOfManagedRemotingFromConfigFile() { CONTRACTL @@ -10938,22 +10934,6 @@ PTR_MethodTable BaseDomain::LookupType(UINT32 id) { return pMT; } -#ifndef DACCESS_COMPILE - - -//------------------------------------------------------------------------ -BOOL GetCompatibilityFlag(CompatibilityFlag flag) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - SO_TOLERANT; - } CONTRACTL_END; - - return FALSE; -} -#endif // !DACCESS_COMPILE - //--------------------------------------------------------------------------------------- // BOOL diff --git a/src/vm/appdomainconfigfactory.hpp b/src/vm/appdomainconfigfactory.hpp deleted file mode 100644 index b443797c0d..0000000000 --- a/src/vm/appdomainconfigfactory.hpp +++ /dev/null @@ -1,240 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - - -#ifndef APPDOMAINCONFIGFACTORY_H -#define APPDOMAINCONFIGFACTORY_H - -#include <xmlparser.h> -#include <objbase.h> -#include "unknwn.h" -#include "../xmlparser/_reference.h" -#include "../xmlparser/_unknown.h" - -#include "appdomain.hpp" - -#define ISWHITE(ch) ((ch) >= 0x09 && (ch) <= 0x0D || (ch) == 0x20) - -#define CONST_STRING_AND_LEN(str) str, NumItems(str)-1 - - -extern int EEXMLStringCompare(const WCHAR *pStr1, - DWORD cchStr1, - const WCHAR *pStr2, - DWORD cchStr2); - - -enum APPDOMAINPARSESTATE -{ - APPDOMAINPARSESTATE_INITIALIZED, - APPDOMAINPARSESTATE_RUNTIME, - APPDOMAINPARSESTATE_PREFERCOMINSTEADOFREMOTING, - APPDOMAINPARSESTATE_ENABLED, - APPDOMAINPARSESTATE_LEGACYMODE -}; - - - -class AppDomainConfigFactory : public _unknown<IXMLNodeFactory, &IID_IXMLNodeFactory> -{ - -public: - AppDomainConfigFactory() : m_dwDepth(0), comorRemotingFlag(COMorRemoting_NotInitialized), m_appdomainParseState(APPDOMAINPARSESTATE_INITIALIZED) - { - LIMITED_METHOD_CONTRACT; - } - - ~AppDomainConfigFactory() - { - LIMITED_METHOD_CONTRACT; - } - - HRESULT STDMETHODCALLTYPE NotifyEvent( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODEFACTORY_EVENT iEvt) - { - LIMITED_METHOD_CONTRACT; - return S_OK; - } - - HRESULT STDMETHODCALLTYPE BeginChildren( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ XML_NODE_INFO* __RPC_FAR pNodeInfo) - { - LIMITED_METHOD_CONTRACT; - - m_dwDepth++; - return S_OK; - } - - HRESULT STDMETHODCALLTYPE EndChildren( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ BOOL fEmptyNode, - /* [in] */ XML_NODE_INFO* __RPC_FAR pNodeInfo) - { - LIMITED_METHOD_CONTRACT; - - if (!fEmptyNode) - m_dwDepth--; - return S_OK; - } - - HRESULT STDMETHODCALLTYPE Error( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ HRESULT hrErrorCode, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO* __RPC_FAR * __RPC_FAR apNodeInfo) - { - LIMITED_METHOD_CONTRACT; - /* - UNUSED(pSource); - UNUSED(hrErrorCode); - UNUSED(cNumRecs); - UNUSED(apNodeInfo); - */ - return hrErrorCode; - } - - HRESULT STDMETHODCALLTYPE CreateNode( - /* [in] */ IXMLNodeSource __RPC_FAR *pSource, - /* [in] */ PVOID pNodeParent, - /* [in] */ USHORT cNumRecs, - /* [in] */ XML_NODE_INFO* __RPC_FAR * __RPC_FAR apNodeInfo) - { - CONTRACTL - { - NOTHROW; - GC_TRIGGERS; - MODE_ANY; - INJECT_FAULT(return E_OUTOFMEMORY;); - } - CONTRACTL_END; - - if(m_dwDepth > 2) - { - return S_OK; - } - - HRESULT hr = S_OK; - DWORD dwStringSize = 0; - WCHAR* pszString = NULL; - DWORD i; - BOOL fRuntimeKey = FALSE; - BOOL fVersion = FALSE; - - for( i = 0; i < cNumRecs; i++) { - - if(apNodeInfo[i]->dwType == XML_ELEMENT || - apNodeInfo[i]->dwType == XML_ATTRIBUTE || - apNodeInfo[i]->dwType == XML_PCDATA) { - - dwStringSize = apNodeInfo[i]->ulLen; - pszString = (WCHAR*) apNodeInfo[i]->pwcText; - // Trim the value - - // we should never decrement lgth if it's 0, because it's unsigned - - for(;*pszString && ISWHITE(*pszString) && dwStringSize>0; pszString++, dwStringSize--); - while( dwStringSize > 0 && ISWHITE(pszString[dwStringSize-1])) - dwStringSize--; - - if (m_appdomainParseState == APPDOMAINPARSESTATE_INITIALIZED) - { - //look forward to <runtime> - if (m_dwDepth == 1 && - apNodeInfo[i]->dwType == XML_ELEMENT && - EEXMLStringCompare(pszString, dwStringSize, CONST_STRING_AND_LEN(W("runtime"))) == 0) - { - m_appdomainParseState = APPDOMAINPARSESTATE_RUNTIME; - } - return S_OK; - } - else if (m_appdomainParseState == APPDOMAINPARSESTATE_RUNTIME) - { - // look forward to <PreferComInsteadOfManagedRemoting enabled="true"/> - if (m_dwDepth == 2 && - apNodeInfo[i]->dwType == XML_ELEMENT && - EEXMLStringCompare(pszString, dwStringSize, CONST_STRING_AND_LEN(W("PreferComInsteadOfManagedRemoting"))) == 0) - { - m_appdomainParseState = APPDOMAINPARSESTATE_PREFERCOMINSTEADOFREMOTING; - continue; - } - // if we ended parsing <Runtime>, we abort it - if (m_dwDepth <= 1) - pSource->Abort(NULL); - return S_OK; - } - else if (m_appdomainParseState == APPDOMAINPARSESTATE_PREFERCOMINSTEADOFREMOTING) - { - // require enabled="true"/> or legacyMode="true"/> - if (m_dwDepth == 2 && - apNodeInfo[i]->dwType == XML_ATTRIBUTE) - { - if (EEXMLStringCompare(pszString, dwStringSize, CONST_STRING_AND_LEN(W("enabled"))) == 0) - { - m_appdomainParseState = APPDOMAINPARSESTATE_ENABLED; - } - if (EEXMLStringCompare(pszString, dwStringSize, CONST_STRING_AND_LEN(W("legacyMode"))) == 0) - { - m_appdomainParseState = APPDOMAINPARSESTATE_LEGACYMODE; - } - } - - // ignore unrecognized attributes (forward compat) - continue; - } - else if (m_appdomainParseState == APPDOMAINPARSESTATE_ENABLED || m_appdomainParseState == APPDOMAINPARSESTATE_LEGACYMODE) - { - // require "true" /> or "false" /> - if (m_dwDepth == 2 && - apNodeInfo[i]->dwType == XML_PCDATA) - { - if (EEXMLStringCompare(pszString, dwStringSize, CONST_STRING_AND_LEN(W("true"))) == 0) - { - if (m_appdomainParseState == APPDOMAINPARSESTATE_LEGACYMODE) - { - // LegacyMode does not override the "master switch" - if (comorRemotingFlag != COMorRemoting_COM) - comorRemotingFlag = COMorRemoting_LegacyMode; - } - else - { - comorRemotingFlag = COMorRemoting_COM; - } - } - else if (EEXMLStringCompare(pszString, dwStringSize, CONST_STRING_AND_LEN(W("false"))) == 0) - { - if (m_appdomainParseState == APPDOMAINPARSESTATE_ENABLED) - { - // we do report that the "master switch" is explictly false - if (comorRemotingFlag == COMorRemoting_NotInitialized) - comorRemotingFlag = COMorRemoting_Remoting; - } - } - - m_appdomainParseState = APPDOMAINPARSESTATE_PREFERCOMINSTEADOFREMOTING; - continue; - } - pSource->Abort(NULL); - return S_OK; - } - } - } - return hr; - } - - COMorRemotingFlag GetCOMorRemotingFlag() - { - LIMITED_METHOD_CONTRACT; - return comorRemotingFlag; - } - -private: - DWORD m_dwDepth; - COMorRemotingFlag comorRemotingFlag; - APPDOMAINPARSESTATE m_appdomainParseState; - -}; - -#endif APPDOMAINCONFIGFACTORY_H diff --git a/src/vm/arm/asmhelpers.S b/src/vm/arm/asmhelpers.S index 36933f5ea6..40faf9c3bc 100644 --- a/src/vm/arm/asmhelpers.S +++ b/src/vm/arm/asmhelpers.S @@ -662,11 +662,11 @@ NESTED_ENTRY ProfileEnterNaked, _TEXT, NoHandler PROLOG_PUSH "{r4, r5, r7, r11, lr}" PROLOG_STACK_SAVE_OFFSET r7, #8 - // fields of PLATFORM_SPECIFIC_DATA, in reverse order + // fields of PROFILE_PLATFORM_SPECIFIC_DATA, in reverse order // UINT32 r0; // Keep r0 & r1 contiguous to make returning 64-bit results easier // UINT32 r1; - // void *R11; + // void *r11; // void *Pc; // union // Float arg registers as 32-bit (s0-s15) and 64-bit (d0-d7) // { @@ -705,11 +705,11 @@ NESTED_ENTRY ProfileLeaveNaked, _TEXT, NoHandler PROLOG_PUSH "{r1, r2, r4, r5, r7, r11, lr}" PROLOG_STACK_SAVE_OFFSET r7, #16 - // fields of PLATFORM_SPECIFIC_DATA, in reverse order + // fields of PROFILE_PLATFORM_SPECIFIC_DATA, in reverse order // UINT32 r0; // Keep r0 & r1 contiguous to make returning 64-bit results easier // UINT32 r1; - // void *R11; + // void *r11; // void *Pc; // union // Float arg registers as 32-bit (s0-s15) and 64-bit (d0-d7) // { @@ -734,13 +734,56 @@ NESTED_ENTRY ProfileLeaveNaked, _TEXT, NoHandler push { lr } push { r11 } push { r1 } - push { r2 } + push { r0 } mov r1, sp bl C_FUNC(ProfileLeave) EPILOG_STACK_RESTORE_OFFSET r7, #16 EPILOG_POP "{r1, r2, r4, r5, r7, r11, pc}" NESTED_END ProfileLeaveNaked, _TEXT +// +// EXTERN_C void ProfileTailcallNaked(FunctionIDOrClientID functionIDOrClientID); +// +NESTED_ENTRY ProfileTailcallNaked, _TEXT, NoHandler + PROLOG_PUSH "{r1, r2, r4, r5, r7, r11, lr}" + PROLOG_STACK_SAVE_OFFSET r7, #16 + + // fields of PROFILE_PLATFORM_SPECIFIC_DATA, in reverse order + + // UINT32 r0; // Keep r0 & r1 contiguous to make returning 64-bit results easier + // UINT32 r1; + // void *r11; + // void *Pc; + // union // Float arg registers as 32-bit (s0-s15) and 64-bit (d0-d7) + // { + // UINT32 s[16]; + // UINT64 d[8]; + // }; + // FunctionID functionId; + // void *probeSp; // stack pointer of managed function + // void *profiledSp; // location of arguments on stack + // LPVOID hiddenArg; + // UINT32 flags; + movw r4, #2 + push { /* flags */ r4 } + movw r4, #0 + push { /* hiddenArg */ r4 } + add r5, r11, #8 + push { /* profiledSp */ r5 } + add r5, sp, #40 + push { /* probeSp */ r5 } + push { /* functionId */ r0 } + vpush.64 { d0 - d7 } + push { lr } + push { r11 } + push { r1 } + push { r0 } + mov r1, sp + bl C_FUNC(ProfileTailcall) + EPILOG_STACK_RESTORE_OFFSET r7, #16 + EPILOG_POP "{r1, r2, r4, r5, r7, r11, pc}" +NESTED_END ProfileTailcallNaked, _TEXT + // EXTERN_C int __fastcall HelperMethodFrameRestoreState( // INDEBUG_COMMA(HelperMethodFrame *pFrame) // MachState *pState diff --git a/src/vm/arm/unixstubs.cpp b/src/vm/arm/unixstubs.cpp index 62f60473ab..b1462fab3a 100644 --- a/src/vm/arm/unixstubs.cpp +++ b/src/vm/arm/unixstubs.cpp @@ -15,9 +15,4 @@ extern "C" { PORTABILITY_ASSERT("Implement for PAL"); } - - void ProfileTailcallNaked(FunctionIDOrClientID functionIDOrClientID) - { - PORTABILITY_ASSERT("Implement for PAL"); - } }; diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp index f5173196e3..504bf799ac 100644 --- a/src/vm/ceeload.cpp +++ b/src/vm/ceeload.cpp @@ -3796,27 +3796,31 @@ ISymUnmanagedReader *Module::GetISymUnmanagedReader(void) // We've got in-memory ILDB symbols, create the ILDB symbol binder // Note that in this case, we must be very careful not to use diasymreader.dll // at all - we don't trust it, and shouldn't run any code in it - IfFailThrow(IldbSymbolsCreateInstance(CLSID_CorSymBinder_SxS, - IID_ISymUnmanagedBinder, - (void**)&pBinder)); + IfFailThrow(IldbSymbolsCreateInstance(CLSID_CorSymBinder_SxS, IID_ISymUnmanagedBinder, (void**)&pBinder)); } else { - // We're going to be working with PDB format symbols - // Attempt to coCreate the symbol binder. - // CoreCLR supports not having a symbol reader installed, so this is expected there. + // We're going to be working with Windows PDB format symbols. Attempt to CoCreate the symbol binder. + // CoreCLR supports not having a symbol reader installed, so CoCreate searches the PATH env var + // and then tries coreclr dll location. // On desktop, the framework installer is supposed to install diasymreader.dll as well // and so this shouldn't happen. - hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, - NATIVE_SYMBOL_READER_DLL, - IID_ISymUnmanagedBinder, - (void**)&pBinder, - NULL); + hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, NATIVE_SYMBOL_READER_DLL, IID_ISymUnmanagedBinder, (void**)&pBinder, NULL); if (FAILED(hr)) { - RETURN (NULL); + PathString symbolReaderPath; + hr = GetHModuleDirectory(GetModuleInst(), symbolReaderPath); + if (FAILED(hr)) + { + RETURN (NULL); + } + symbolReaderPath.Append(NATIVE_SYMBOL_READER_DLL); + hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, symbolReaderPath.GetUnicode(), IID_ISymUnmanagedBinder, (void**)&pBinder, NULL); + if (FAILED(hr)) + { + RETURN (NULL); + } } - } LOG((LF_CORDB, LL_INFO10, "M::GISUR: Created binder\n")); diff --git a/src/vm/common.h b/src/vm/common.h index a52566d55e..8f37574027 100644 --- a/src/vm/common.h +++ b/src/vm/common.h @@ -97,9 +97,6 @@ //----------------------------------------------------------------------------------------------------------- -#include "compatibilityflags.h" -extern BOOL GetCompatibilityFlag(CompatibilityFlag flag); - #include "strongname.h" #include "stdmacros.h" @@ -475,34 +472,11 @@ extern DummyGlobalContract ___contract; #include "syncblk.inl" #include "threads.inl" #include "eehash.inl" -#include "mscorcfg.h" #ifdef FEATURE_COMINTEROP #include "WinRTRedirector.h" #include "winrtredirector.inl" #endif // FEATURE_COMINTEROP -inline HRESULT CreateConfigStreamHelper(LPCWSTR filename, IStream** pOutStream) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END - - HRESULT hr =S_OK; - - EX_TRY - { - hr = CreateConfigStream( filename, pOutStream); - } - EX_CATCH_HRESULT(hr); - - return hr; -} - - #if defined(COMMON_TURNED_FPO_ON) #pragma optimize("", on) // Go back to command line default optimizations #undef COMMON_TURNED_FPO_ON diff --git a/src/vm/comutilnative.cpp b/src/vm/comutilnative.cpp index 5c5a1e9eaa..c6c3138e07 100644 --- a/src/vm/comutilnative.cpp +++ b/src/vm/comutilnative.cpp @@ -1957,7 +1957,7 @@ void QCALLTYPE COMInterlocked::MemoryBarrierProcessWide() FlushProcessWriteBuffers(); } -FCIMPL6(INT32, ManagedLoggingHelper::GetRegistryLoggingValues, CLR_BOOL* bLoggingEnabled, CLR_BOOL* bLogToConsole, INT32 *iLogLevel, CLR_BOOL* bPerfWarnings, CLR_BOOL* bCorrectnessWarnings, CLR_BOOL* bSafeHandleStackTraces) +FCIMPL3(INT32, ManagedLoggingHelper::GetRegistryLoggingValues, CLR_BOOL* bLoggingEnabled, CLR_BOOL* bLogToConsole, INT32 *iLogLevel) { FCALL_CONTRACT; @@ -1969,11 +1969,8 @@ FCIMPL6(INT32, ManagedLoggingHelper::GetRegistryLoggingValues, CLR_BOOL* bLoggin *bLogToConsole = (bool)(g_pConfig->GetConfigDWORD_DontUse_(CLRConfig::INTERNAL_LogToConsole, 0)!=0); *iLogLevel = (INT32)(g_pConfig->GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_LogLevel, 0)); logFacility = (INT32)(g_pConfig->GetConfigDWORD_DontUse_(CLRConfig::INTERNAL_ManagedLogFacility, 0)); - *bPerfWarnings = (bool)(g_pConfig->GetConfigDWORD_DontUse_(CLRConfig::INTERNAL_BCLPerfWarnings, 0)!=0); - *bCorrectnessWarnings = (bool)(g_pConfig->GetConfigDWORD_DontUse_(CLRConfig::INTERNAL_BCLCorrectnessWarnings, 0)!=0); - *bSafeHandleStackTraces = (bool)(g_pConfig->GetConfigDWORD_DontUse_(CLRConfig::INTERNAL_SafeHandleStackTraces, 0)!=0); - HELPER_METHOD_FRAME_END(); \ + HELPER_METHOD_FRAME_END(); return logFacility; } diff --git a/src/vm/comutilnative.h b/src/vm/comutilnative.h index 07c57c1312..b9737cedb7 100644 --- a/src/vm/comutilnative.h +++ b/src/vm/comutilnative.h @@ -204,7 +204,7 @@ public: class ManagedLoggingHelper { public: - static FCDECL6(INT32, GetRegistryLoggingValues, CLR_BOOL* bLoggingEnabled, CLR_BOOL* bLogToConsole, INT32 *bLogLevel, CLR_BOOL* bPerfWarnings, CLR_BOOL* bCorrectnessWarnings, CLR_BOOL* bSafeHandleStackTraces); + static FCDECL3(INT32, GetRegistryLoggingValues, CLR_BOOL* bLoggingEnabled, CLR_BOOL* bLogToConsole, INT32 *bLogLevel); }; class ValueTypeHelper { diff --git a/src/vm/dbginterface.h b/src/vm/dbginterface.h index 6378b7022d..9d2c4c9bdf 100644 --- a/src/vm/dbginterface.h +++ b/src/vm/dbginterface.h @@ -279,7 +279,7 @@ public: DWORD nativeOffset, DWORD *ilOffset) = 0; - virtual HRESULT GetILToNativeMapping(MethodDesc *pMD, + virtual HRESULT GetILToNativeMapping(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[]) = 0; diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp index af2554e324..17ad686c81 100644 --- a/src/vm/excep.cpp +++ b/src/vm/excep.cpp @@ -3462,8 +3462,7 @@ DWORD MapWin32FaultToCOMPlusException(EXCEPTION_RECORD *pExceptionRecord) { // We have a config key, InsecurelyTreatAVsAsNullReference, that ensures we always translate to // NullReferenceException instead of doing the new AV translation logic. - if ((g_pConfig != NULL) && !g_pConfig->LegacyNullReferenceExceptionPolicy() && - !GetCompatibilityFlag(compatNullReferenceExceptionOnAV) ) + if ((g_pConfig != NULL) && !g_pConfig->LegacyNullReferenceExceptionPolicy()) { #if defined(FEATURE_HIJACK) && !defined(PLATFORM_UNIX) // If we got the exception on a redirect function it means the original exception happened in managed code: diff --git a/src/vm/excep.h b/src/vm/excep.h index 4c752932fd..4261c3cff3 100644 --- a/src/vm/excep.h +++ b/src/vm/excep.h @@ -55,8 +55,7 @@ BOOL IsWin32IOError(SCODE scode); inline bool SwallowUnhandledExceptions() { return (eHostDeterminedPolicy == GetEEPolicy()->GetUnhandledExceptionPolicy()) || - g_pConfig->LegacyUnhandledExceptionPolicy() || - GetCompatibilityFlag(compatSwallowUnhandledExceptions); + g_pConfig->LegacyUnhandledExceptionPolicy(); } // Enums diff --git a/src/vm/gcenv.ee.cpp b/src/vm/gcenv.ee.cpp index 83935c378f..959687b7b8 100644 --- a/src/vm/gcenv.ee.cpp +++ b/src/vm/gcenv.ee.cpp @@ -1169,3 +1169,13 @@ void GCToEEInterface::FreeStringConfigValue(const char* value) { delete [] value; } + +bool GCToEEInterface::IsGCThread() +{ + return !!::IsGCThread(); +} + +bool GCToEEInterface::IsGCSpecialThread() +{ + return !!::IsGCSpecialThread(); +} diff --git a/src/vm/gcenv.ee.h b/src/vm/gcenv.ee.h index c9000b2485..063fa2554e 100644 --- a/src/vm/gcenv.ee.h +++ b/src/vm/gcenv.ee.h @@ -58,6 +58,8 @@ public: bool GetIntConfigValue(const char* key, int64_t* value); bool GetStringConfigValue(const char* key, const char** value); void FreeStringConfigValue(const char* value); + bool IsGCThread(); + bool IsGCSpecialThread(); }; } // namespace standalone diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h index 10456e484b..e757624be3 100644 --- a/src/vm/mscorlib.h +++ b/src/vm/mscorlib.h @@ -224,9 +224,6 @@ DEFINE_CLASS(RUNTIME_CLASS, WinRT, RuntimeClass) #endif // FEATURE_COMINTEROP DEFINE_CLASS_U(Interop, CriticalHandle, CriticalHandle) -#ifdef _DEBUG -DEFINE_FIELD_U(_stackTrace, CriticalHandle, m_debugStackTrace) -#endif DEFINE_FIELD_U(handle, CriticalHandle, m_handle) DEFINE_FIELD_U(_isClosed, CriticalHandle, m_isClosed) DEFINE_CLASS(CRITICAL_HANDLE, Interop, CriticalHandle) diff --git a/src/vm/object.h b/src/vm/object.h index 7de739ab61..84ed0a5f1b 100644 --- a/src/vm/object.h +++ b/src/vm/object.h @@ -2875,9 +2875,6 @@ class SafeHandle : public Object // Modifying the order or fields of this object may require // other changes to the classlib class definition of this // object or special handling when loading this system class. -#ifdef _DEBUG - STRINGREF m_debugStackTrace; // Where we allocated this SafeHandle -#endif Volatile<LPVOID> m_handle; Volatile<INT32> m_state; // Combined ref count and closed/disposed state (for atomicity) Volatile<CLR_BOOL> m_ownsHandle; @@ -2945,9 +2942,6 @@ class CriticalHandle : public Object // Modifying the order or fields of this object may require // other changes to the classlib class definition of this // object or special handling when loading this system class. -#ifdef _DEBUG - STRINGREF m_debugStackTrace; // Where we allocated this CriticalHandle -#endif Volatile<LPVOID> m_handle; Volatile<CLR_BOOL> m_isClosed; diff --git a/src/vm/proftoeeinterfaceimpl.cpp b/src/vm/proftoeeinterfaceimpl.cpp index 3958bdf354..b9e5481e0f 100644 --- a/src/vm/proftoeeinterfaceimpl.cpp +++ b/src/vm/proftoeeinterfaceimpl.cpp @@ -589,6 +589,10 @@ COM_METHOD ProfToEEInterfaceImpl::QueryInterface(REFIID id, void ** pInterface) { *pInterface = static_cast<ICorProfilerInfo8 *>(this); } + else if (id == IID_ICorProfilerInfo9) + { + *pInterface = static_cast<ICorProfilerInfo9 *>(this); + } else if (id == IID_IUnknown) { *pInterface = static_cast<IUnknown *>(static_cast<ICorProfilerInfo *>(this)); @@ -2592,24 +2596,28 @@ HRESULT ProfToEEInterfaceImpl::GetCodeInfo3(FunctionID functionId, hr = ValidateParametersForGetCodeInfo(pMethodDesc, cCodeInfos, codeInfos); if (SUCCEEDED(hr)) { + PCODE pCodeStart = NULL; CodeVersionManager* pCodeVersionManager = pMethodDesc->GetCodeVersionManager(); - ILCodeVersion ilCodeVersion = pCodeVersionManager->GetILCodeVersion(pMethodDesc, reJitId); - - // Now that tiered compilation can create more than one jitted code version for the same rejit id - // we are arbitrarily choosing the first one to return. To return all of them we'd presumably need - // a new profiler API. - NativeCodeVersionCollection nativeCodeVersions = ilCodeVersion.GetNativeCodeVersions(pMethodDesc); - for (NativeCodeVersionIterator iter = nativeCodeVersions.Begin(); iter != nativeCodeVersions.End(); iter++) { - PCODE pCodeStart = iter->GetNativeCode(); - hr = GetCodeInfoFromCodeStart( - pCodeStart, - cCodeInfos, - pcCodeInfos, - codeInfos); - break; + CodeVersionManager::TableLockHolder lockHolder(pCodeVersionManager); + + ILCodeVersion ilCodeVersion = pCodeVersionManager->GetILCodeVersion(pMethodDesc, reJitId); + + NativeCodeVersionCollection nativeCodeVersions = ilCodeVersion.GetNativeCodeVersions(pMethodDesc); + for (NativeCodeVersionIterator iter = nativeCodeVersions.Begin(); iter != nativeCodeVersions.End(); iter++) + { + // Now that tiered compilation can create more than one jitted code version for the same rejit id + // we are arbitrarily choosing the first one to return. To address a specific version of native code + // use GetCodeInfo4. + pCodeStart = iter->GetNativeCode(); + break; + } } + hr = GetCodeInfoFromCodeStart(pCodeStart, + cCodeInfos, + pcCodeInfos, + codeInfos); } } EX_CATCH_HRESULT(hr); @@ -5042,7 +5050,7 @@ HRESULT ProfToEEInterfaceImpl::GetILToNativeMapping2(FunctionID functionId, ULONG32 cMap, ULONG32 * pcMap, // [out] COR_DEBUG_IL_TO_NATIVE_MAP map[]) // [out] - { +{ CONTRACTL { // MethodDesc::FindOrCreateTypicalSharedInstantiation throws @@ -5070,7 +5078,7 @@ HRESULT ProfToEEInterfaceImpl::GetILToNativeMapping2(FunctionID functionId, LL_INFO1000, "**PROF: GetILToNativeMapping2 0x%p 0x%p.\n", functionId, reJitId)); - + if (functionId == NULL) { return E_INVALIDARG; @@ -5082,36 +5090,51 @@ HRESULT ProfToEEInterfaceImpl::GetILToNativeMapping2(FunctionID functionId, return E_INVALIDARG; } - if (reJitId != 0) + HRESULT hr = S_OK; + + EX_TRY { - return E_NOTIMPL; - } + // Cast to proper type + MethodDesc * pMD = FunctionIdToMethodDesc(functionId); -#ifdef DEBUGGING_SUPPORTED - // Cast to proper type - MethodDesc * pMD = FunctionIdToMethodDesc(functionId); + if (pMD->HasClassOrMethodInstantiation() && pMD->IsTypicalMethodDefinition()) + { + // In this case, we used to replace pMD with its canonical instantiation + // (FindOrCreateTypicalSharedInstantiation). However, a profiler should never be able + // to get to this point anyway, since any MethodDesc a profiler gets from us + // cannot be typical (i.e., cannot be a generic with types still left uninstantiated). + // We assert here just in case a test proves me wrong, but generally we will + // disallow this code path. + _ASSERTE(!"Profiler passed a typical method desc (a generic with types still left uninstantiated) to GetILToNativeMapping2"); + hr = E_INVALIDARG; + } + else + { + PCODE pCodeStart = NULL; + CodeVersionManager *pCodeVersionManager = pMD->GetCodeVersionManager(); + ILCodeVersion ilCodeVersion = NULL; + { + CodeVersionManager::TableLockHolder lockHolder(pCodeVersionManager); - if (pMD->HasClassOrMethodInstantiation() && pMD->IsTypicalMethodDefinition()) - { - // In this case, we used to replace pMD with its canonical instantiation - // (FindOrCreateTypicalSharedInstantiation). However, a profiler should never be able - // to get to this point anyway, since any MethodDesc a profiler gets from us - // cannot be typical (i.e., cannot be a generic with types still left uninstantiated). - // We assert here just in case a test proves me wrong, but generally we will - // disallow this code path. - _ASSERTE(!"Profiler passed a typical method desc (a generic with types still left uninstantiated) to GetILToNativeMapping2"); - return E_INVALIDARG; - } + pCodeVersionManager->GetILCodeVersion(pMD, reJitId); + + NativeCodeVersionCollection nativeCodeVersions = ilCodeVersion.GetNativeCodeVersions(pMD); + for (NativeCodeVersionIterator iter = nativeCodeVersions.Begin(); iter != nativeCodeVersions.End(); iter++) + { + // Now that tiered compilation can create more than one jitted code version for the same rejit id + // we are arbitrarily choosing the first one to return. To address a specific version of native code + // use GetILToNativeMapping3. + pCodeStart = iter->GetNativeCode(); + break; + } + } - if (g_pDebugInterface == NULL) - { - return CORPROF_E_DEBUGGING_DISABLED; + hr = GetILToNativeMapping3(pCodeStart, cMap, pcMap, map); + } } + EX_CATCH_HRESULT(hr); - return (g_pDebugInterface->GetILToNativeMapping(pMD, cMap, pcMap, map)); -#else - return E_NOTIMPL; -#endif + return hr; } @@ -6583,6 +6606,231 @@ HRESULT ProfToEEInterfaceImpl::GetDynamicFunctionInfo(FunctionID functionId, } /* + * GetNativeCodeStartAddresses + * + * Gets all of the native code addresses associated with a particular function. iered compilation + * potentially creates different native code versions for a method, and this function allows profilers + * to view all native versions of a method. + * + * Parameters: + * functionID - The function that is being requested. + * reJitId - The ReJIT id. + * cCodeStartAddresses - A parameter for indicating the size of buffer for the codeStartAddresses parameter. + * pcCodeStartAddresses - An optional parameter for returning the true size of the codeStartAddresses parameter. + * codeStartAddresses - The array to be filled up with native code addresses. + * + * Returns: + * S_OK if successful + * + */ +HRESULT ProfToEEInterfaceImpl::GetNativeCodeStartAddresses(FunctionID functionID, + ReJITID reJitId, + ULONG32 cCodeStartAddresses, + ULONG32 *pcCodeStartAddresses, + UINT_PTR codeStartAddresses[]) +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + MODE_ANY; + EE_THREAD_NOT_REQUIRED; + CAN_TAKE_LOCK; + + SO_NOT_MAINLINE; + + PRECONDITION(CheckPointer(pcCodeStartAddresses, NULL_OK)); + PRECONDITION(CheckPointer(codeStartAddresses, NULL_OK)); + } + CONTRACTL_END; + + if (functionID == NULL) + { + return E_INVALIDARG; + } + + PROFILER_TO_CLR_ENTRYPOINT_ASYNC_EX(kP2EEAllowableAfterAttach, + (LF_CORPROF, + LL_INFO1000, + "**PROF: GetNativeCodeStartAddresses 0x%p 0x%p.\n", + functionID, reJitId)); + + HRESULT hr = S_OK; + + EX_TRY + { + if (pcCodeStartAddresses != NULL) + { + *pcCodeStartAddresses = 0; + } + + MethodDesc * methodDesc = FunctionIdToMethodDesc(functionID); + PTR_MethodDesc pMD = PTR_MethodDesc(methodDesc); + ULONG32 trueLen = 0; + StackSArray<UINT_PTR> addresses; + + CodeVersionManager *pCodeVersionManager = pMD->GetCodeVersionManager(); + + ILCodeVersion ilCodeVersion = NULL; + { + CodeVersionManager::TableLockHolder lockHolder(pCodeVersionManager); + + ilCodeVersion = pCodeVersionManager->GetILCodeVersion(pMD, reJitId); + + NativeCodeVersionCollection nativeCodeVersions = ilCodeVersion.GetNativeCodeVersions(pMD); + for (NativeCodeVersionIterator iter = nativeCodeVersions.Begin(); iter != nativeCodeVersions.End(); iter++) + { + addresses.Append((*iter).GetNativeCode()); + + ++trueLen; + } + } + + if (pcCodeStartAddresses != NULL) + { + *pcCodeStartAddresses = trueLen; + } + + if (codeStartAddresses != NULL) + { + if (cCodeStartAddresses < trueLen) + { + hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + } + else + { + for(ULONG32 i = 0; i < trueLen; ++i) + { + codeStartAddresses[i] = addresses[i]; + } + } + } + } + EX_CATCH_HRESULT(hr); + + return hr; +} + +/* + * GetILToNativeMapping3 + * + * This overload behaves the same as GetILToNativeMapping2, except it allows the profiler + * to address specific native code versions instead of defaulting to the first one. + * + * Parameters: + * pNativeCodeStartAddress - start address of the native code version, returned by GetNativeCodeStartAddresses + * cMap - size of the map array + * pcMap - how many items are returned in the map array + * map - an array to store the il to native mappings in + * + * Returns: + * S_OK if successful + * + */ +HRESULT ProfToEEInterfaceImpl::GetILToNativeMapping3(UINT_PTR pNativeCodeStartAddress, + ULONG32 cMap, + ULONG32 *pcMap, + COR_DEBUG_IL_TO_NATIVE_MAP map[]) +{ + CONTRACTL + { + THROWS; + DISABLED(GC_NOTRIGGER); + MODE_ANY; + CAN_TAKE_LOCK; + + SO_NOT_MAINLINE; + + PRECONDITION(CheckPointer(pcMap, NULL_OK)); + PRECONDITION(CheckPointer(map, NULL_OK)); + } + CONTRACTL_END; + + PROFILER_TO_CLR_ENTRYPOINT_SYNC_EX(kP2EEAllowableAfterAttach, + (LF_CORPROF, + LL_INFO1000, + "**PROF: GetILToNativeMapping3 0x%p.\n", + pNativeCodeStartAddress)); + + if (pNativeCodeStartAddress == NULL) + { + return E_INVALIDARG; + } + + if ((cMap > 0) && + ((pcMap == NULL) || (map == NULL))) + { + return E_INVALIDARG; + } + +#ifdef DEBUGGING_SUPPORTED + if (g_pDebugInterface == NULL) + { + return CORPROF_E_DEBUGGING_DISABLED; + } + + return (g_pDebugInterface->GetILToNativeMapping(pNativeCodeStartAddress, cMap, pcMap, map)); +#else + return E_NOTIMPL; +#endif +} + +/* + * GetCodeInfo4 + * + * Gets the location and size of a jitted function. Tiered compilation potentially creates different native code + * versions for a method, and this overload allows profilers to specify which native version it would like the + * code info for. + * + * Parameters: + * pNativeCodeStartAddress - start address of the native code version, returned by GetNativeCodeStartAddresses + * cCodeInfos - size of the codeInfos array + * pcCodeInfos - how many items are returned in the codeInfos array + * codeInfos - an array to store the code infos in + * + * Returns: + * S_OK if successful + * + */ +HRESULT ProfToEEInterfaceImpl::GetCodeInfo4(UINT_PTR pNativeCodeStartAddress, + ULONG32 cCodeInfos, + ULONG32* pcCodeInfos, + COR_PRF_CODE_INFO codeInfos[]) +{ + CONTRACTL + { + NOTHROW; + GC_TRIGGERS; + MODE_ANY; + EE_THREAD_NOT_REQUIRED; + CAN_TAKE_LOCK; + + SO_NOT_MAINLINE; + + PRECONDITION(CheckPointer(pcCodeInfos, NULL_OK)); + PRECONDITION(CheckPointer(codeInfos, NULL_OK)); + } + CONTRACTL_END; + + PROFILER_TO_CLR_ENTRYPOINT_SYNC_EX( + kP2EEAllowableAfterAttach | kP2EETriggers, + (LF_CORPROF, + LL_INFO1000, + "**PROF: GetCodeInfo4 0x%p.\n", + pNativeCodeStartAddress)); + + if ((cCodeInfos != 0) && (codeInfos == NULL)) + { + return E_INVALIDARG; + } + + return GetCodeInfoFromCodeStart(pNativeCodeStartAddress, + cCodeInfos, + pcCodeInfos, + codeInfos); +} + +/* * GetStringLayout * * This function describes to a profiler the internal layout of a string. diff --git a/src/vm/proftoeeinterfaceimpl.h b/src/vm/proftoeeinterfaceimpl.h index ed53ae2192..7c3c88b439 100644 --- a/src/vm/proftoeeinterfaceimpl.h +++ b/src/vm/proftoeeinterfaceimpl.h @@ -133,7 +133,7 @@ typedef struct _PROFILER_STACK_WALK_DATA PROFILER_STACK_WALK_DATA; // from the profiler implementation. The profiler will call back on the v-table // to get at EE internals as required. -class ProfToEEInterfaceImpl : public ICorProfilerInfo8 +class ProfToEEInterfaceImpl : public ICorProfilerInfo9 { public: @@ -577,6 +577,29 @@ public: // end ICorProfilerInfo8 + // beging ICorProfilerInfo9 + + COM_METHOD GetNativeCodeStartAddresses( + FunctionID functionID, + ReJITID reJitId, + ULONG32 cCodeStartAddresses, + ULONG32 *pcCodeStartAddresses, + UINT_PTR codeStartAddresses[]); + + COM_METHOD GetILToNativeMapping3( + UINT_PTR pNativeCodeStartAddress, + ULONG32 cMap, + ULONG32 *pcMap, + COR_DEBUG_IL_TO_NATIVE_MAP map[]); + + COM_METHOD GetCodeInfo4( + UINT_PTR pNativeCodeStartAddress, + ULONG32 cCodeInfos, + ULONG32* pcCodeInfos, + COR_PRF_CODE_INFO codeInfos[]); + + // end ICorProfilerInfo9 + protected: // Internal Helper Functions diff --git a/src/vm/safehandle.cpp b/src/vm/safehandle.cpp index d79c5a749a..5e0626b9e7 100644 --- a/src/vm/safehandle.cpp +++ b/src/vm/safehandle.cpp @@ -62,9 +62,6 @@ void SafeHandle::AddRef() // Cannot use "this" after Release, which toggles the GC mode. SAFEHANDLEREF sh(this); -#ifdef _DEBUG - VALIDATEOBJECTREF(sh->m_debugStackTrace); -#endif _ASSERTE(sh->IsFullyInitialized()); // To prevent handle recycling security attacks we must enforce the @@ -137,9 +134,6 @@ void SafeHandle::Release(bool fDispose) // Cannot use "this" after RunReleaseMethod, which toggles the GC mode. SAFEHANDLEREF sh(this); -#ifdef _DEBUG - VALIDATEOBJECTREF(sh->m_debugStackTrace); -#endif _ASSERTE(sh->IsFullyInitialized()); // See AddRef above for the design of the synchronization here. Basically we @@ -236,9 +230,6 @@ void SafeHandle::Dispose() // Release may trigger a GC. SAFEHANDLEREF sh(this); -#ifdef _DEBUG - VALIDATEOBJECTREF(sh->m_debugStackTrace); -#endif _ASSERTE(sh->IsFullyInitialized()); GCPROTECT_BEGIN(sh); diff --git a/src/vm/vars.cpp b/src/vm/vars.cpp index 464560c3a6..343f1545c8 100644 --- a/src/vm/vars.cpp +++ b/src/vm/vars.cpp @@ -291,50 +291,5 @@ extern "C" RAW_KEYWORD(volatile) const GSCookie s_gsCookie = 0; __GlobalVal< GSCookie > s_gsCookie(&g_dacGlobals.dac__s_gsCookie); #endif //!DACCESS_COMPILE -BOOL IsCompilationProcess() -{ - LIMITED_METHOD_DAC_CONTRACT; -#if defined(FEATURE_NATIVE_IMAGE_GENERATION) && !defined(DACCESS_COMPILE) - return g_pCEECompileInfo != NULL; -#else - return FALSE; -#endif -} - //============================================================================== -enum NingenState -{ - kNotInitialized = 0, - kNingenEnabled = 1, - kNingenDisabled = 2, -}; - -extern int g_ningenState; -int g_ningenState = kNotInitialized; - -// Removes all execution of managed or third-party code in the ngen compilation process. -BOOL NingenEnabled() -{ - LIMITED_METHOD_CONTRACT; - -#ifdef CROSSGEN_COMPILE - // Always enable ningen for cross-compile - return TRUE; -#else // CROSSGEN_COMPILE - -#ifdef FEATURE_NATIVE_IMAGE_GENERATION - // Note that ningen is enabled by default to get byte-to-byte identical NGen images between native compile and cross-compile - if (g_ningenState == kNotInitialized) - { - // This code must be idempotent as we don't have a lock to prevent a race to initialize g_ningenState. - g_ningenState = (IsCompilationProcess() && (0 != CLRConfig::GetConfigValue(CLRConfig::INTERNAL_Ningen))) ? kNingenEnabled : kNingenDisabled; - } - - return g_ningenState == kNingenEnabled; -#else - return FALSE; -#endif - -#endif // CROSSGEN_COMPILE -} diff --git a/src/vm/vars.hpp b/src/vm/vars.hpp index a7b6fb6173..820260a0f2 100644 --- a/src/vm/vars.hpp +++ b/src/vm/vars.hpp @@ -97,7 +97,6 @@ class Crst; class RCWCleanupList; #endif // FEATURE_COMINTEROP class BBSweep; -struct IAssemblyUsageLog; // // loader handles are opaque types that track object pointers that have a lifetime @@ -843,10 +842,24 @@ extern bool g_fReadyToRunCompilation; // Returns true if this is NGen compilation process. // This is a superset of CompilationDomain::IsCompilationDomain() as there is more // than one AppDomain in ngen (the DefaultDomain) -BOOL IsCompilationProcess(); +inline BOOL IsCompilationProcess() +{ +#ifdef CROSSGEN_COMPILE + return TRUE; +#else + return FALSE; +#endif +} // Flag for cross-platform ngen: Removes all execution of managed or third-party code in the ngen compilation process. -BOOL NingenEnabled(); +inline BOOL NingenEnabled() +{ +#ifdef CROSSGEN_COMPILE + return TRUE; +#else + return FALSE; +#endif +} // Passed to JitManager APIs to determine whether to avoid calling into the host. // The profiling API stackwalking uses this to ensure to avoid re-entering the host diff --git a/tests/build.proj b/tests/build.proj index 9f11919923..43c4997763 100644 --- a/tests/build.proj +++ b/tests/build.proj @@ -40,7 +40,7 @@ <MSBuild Projects="$(MSBuildThisFileDirectory)\src\Common\external\external.depproj" /> </Target> - <Target Name="BatchRestorePackages" DependsOnTargets="VerifyDependencies"> + <Target Name="BatchRestorePackages"> <Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages..." /> <!-- restore all csproj's with PackageReferences in one pass --> diff --git a/tests/dir.props b/tests/dir.props index c17c9eff96..c234891bfd 100644 --- a/tests/dir.props +++ b/tests/dir.props @@ -90,6 +90,7 @@ <ItemGroup> <!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. --> <DotnetSourceList Include="$(IntermediateAzureFeed)" Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" /> + <DotnetSourceList Include="https:%2F%2Fdotnetfeed.blob.core.windows.net/dotnet-core/packages/index.json" /> <DotnetSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" /> <DotnetSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" /> <DotnetSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" /> |