diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-11-12 02:12:23 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-11-12 02:12:23 +0300 |
commit | e0416c0125d05331e444a8fa1db35eb32d82baa9 (patch) | |
tree | 52ad9b7dfa5e491fb02afb66ffa2c5f07a0305bf /src/System.Private.Reflection.Execution | |
parent | f2445930d6efbaebb10eeecc4c0a565c9fac90e3 (diff) |
Define CORERT for ProjectN builds
CoreRT is component of ProjectN (aka .NET Native for UWP), but our current defines do not reflect it because of CORERT is not defined in ProjectN builds. This creates confusion for folks outside the core runtime team, and conflicts with our documentation. For example, https://github.com/dotnet/corert/blob/master/Documentation/intro-to-corert.md says "CoreRT is the .NET Core runtime that is optimized for AOT scenarios, which .NET Native targets". It does not say "CoreRT is the .NET Core runtime optimized for AOT scenarios that uses RyuJIT backend" or anything like that.
- Before this change:
PROJECTN: defined in closed source ProjectN builds
CORERT: defined in open source CoreRT builds
CORECLR: defined in CoreCLR builds
- After this change:
PROJECTN: defined in closed source ProjectN builds (same)
CORERT: defined in both open source CoreRT builds and closed source ProjectN builds (different)
CORECLR: defined in CoreCLR builds (same)
[tfs-changeset: 1680901]
Diffstat (limited to 'src/System.Private.Reflection.Execution')
4 files changed, 12 insertions, 15 deletions
diff --git a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs index 540fff054..cd873da35 100644 --- a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs +++ b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs @@ -1313,7 +1313,12 @@ namespace Internal.Reflection.Execution else { Debug.Assert((fieldAccessMetadata.Flags & FieldTableFlags.IsUniversalCanonicalEntry) == 0); -#if CORERT +#if PROJECTN + // The fieldAccessMetadata.Offset value is not really a field offset, but a static field RVA. We'll use the + // field's address as a 'staticsBase', and just use a field offset of zero. + fieldOffset = 0; + staticsBase = TypeLoaderEnvironment.RvaToNonGenericStaticFieldAddress(fieldAccessMetadata.MappingTableModule, fieldAccessMetadata.Offset); +#else if (isGcStatic) { fieldOffset = fieldAccessMetadata.Offset; @@ -1326,11 +1331,6 @@ namespace Internal.Reflection.Execution fieldOffset = 0; staticsBase = fieldAccessMetadata.Cookie; } -#else - // The fieldAccessMetadata.Offset value is not really a field offset, but a static field RVA. We'll use the - // field's address as a 'staticsBase', and just use a field offset of zero. - fieldOffset = 0; - staticsBase = TypeLoaderEnvironment.RvaToNonGenericStaticFieldAddress(fieldAccessMetadata.MappingTableModule, fieldAccessMetadata.Offset); #endif } diff --git a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/PointerTypeFieldAccessorForStaticFields.cs b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/PointerTypeFieldAccessorForStaticFields.cs index 2ae40c768..7f1efc19f 100644 --- a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/PointerTypeFieldAccessorForStaticFields.cs +++ b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/PointerTypeFieldAccessorForStaticFields.cs @@ -16,7 +16,7 @@ namespace Internal.Reflection.Execution.FieldAccessors unsafe protected sealed override Object GetFieldBypassCctor() { -#if CORERT +#if !PROJECTN if (IsGcStatic) { // The _staticsBase variable points to a GC handle, which points at the GC statics base of the type. @@ -30,8 +30,7 @@ namespace Internal.Reflection.Execution.FieldAccessors unsafe protected sealed override void UncheckedSetFieldBypassCctor(Object value) { - -#if CORERT +#if !PROJECTN if (IsGcStatic) { // The _staticsBase variable points to a GC handle, which points at the GC statics base of the type. diff --git a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ReferenceTypeFieldAccessorForStaticFields.cs b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ReferenceTypeFieldAccessorForStaticFields.cs index 424f50578..5abb9ac7b 100644 --- a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ReferenceTypeFieldAccessorForStaticFields.cs +++ b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ReferenceTypeFieldAccessorForStaticFields.cs @@ -16,7 +16,7 @@ namespace Internal.Reflection.Execution.FieldAccessors unsafe protected sealed override Object GetFieldBypassCctor() { -#if CORERT +#if !PROJECTN if (IsGcStatic) { // The _staticsBase variable points to a GC handle, which points at the GC statics base of the type. @@ -30,8 +30,7 @@ namespace Internal.Reflection.Execution.FieldAccessors unsafe protected sealed override void UncheckedSetFieldBypassCctor(Object value) { - -#if CORERT +#if !PROJECTN if (IsGcStatic) { // The _staticsBase variable points to a GC handle, which points at the GC statics base of the type. diff --git a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ValueTypeFieldAccessorForStaticFields.cs b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ValueTypeFieldAccessorForStaticFields.cs index b54c6cb10..bb54d91f9 100644 --- a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ValueTypeFieldAccessorForStaticFields.cs +++ b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/ValueTypeFieldAccessorForStaticFields.cs @@ -16,7 +16,7 @@ namespace Internal.Reflection.Execution.FieldAccessors unsafe protected sealed override Object GetFieldBypassCctor() { -#if CORERT +#if !PROJECTN if (IsGcStatic) { // The _staticsBase variable points to a GC handle, which points at the GC statics base of the type. @@ -30,8 +30,7 @@ namespace Internal.Reflection.Execution.FieldAccessors unsafe protected sealed override void UncheckedSetFieldBypassCctor(Object value) { - -#if CORERT +#if !PROJECTN if (IsGcStatic) { // The _staticsBase variable points to a GC handle, which points at the GC statics base of the type. |