Skip to content

Commit 037dda7

Browse files
committed
Merge branch 'main' into browser_all
2 parents 8e6ee35 + d3711c2 commit 037dda7

File tree

206 files changed

+5218
-4082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+5218
-4082
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-
8181
src/tests/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input.txt text eol=lf
8282
src/tests/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input-big.txt text eol=lf
8383
src/mono/browser/runtime/dotnet.d.ts text eol=lf
84+
src/native/corehost/browserhost/loader/dotnet.d.ts text eol=lf

eng/pipelines/performance/templates/build-perf-sample-apps.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,30 @@ steps:
199199
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
200200
displayName: Clean bindir
201201

202+
# CoreCLR R2R build
203+
- script: make build-appbundle TARGET_OS=ios TARGET_ARCH=arm64 USE_MONO_RUNTIME=false BUILD_CONFIG=Release AOT=false R2R=true DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=true
204+
env:
205+
DevTeamProvisioning: '-'
206+
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
207+
displayName: Build HelloiOS CoreCLR R2R sample app STRIP_SYMBOLS=True
208+
- task: PublishBuildArtifacts@1
209+
condition: succeededOrFailed()
210+
displayName: 'Publish binlog'
211+
inputs:
212+
pathtoPublish: $(Build.SourcesDirectory)/src/mono/sample/iOS/msbuild.binlog
213+
artifactName: iOSCoreCLRR2RArm64StripSymbolsBuildLog
214+
- template: /eng/pipelines/common/upload-artifact-step.yml
215+
parameters:
216+
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
217+
includeRootFolder: true
218+
displayName: iOS Sample App CoreCLR R2R NoSymbols
219+
artifactName: iOSSampleAppCoreCLRR2RNoSymbols
220+
archiveExtension: '.zip'
221+
archiveType: zip
222+
- script: rm -r -f $(Build.SourcesDirectory)/src/mono/sample/iOS/bin
223+
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
224+
displayName: Clean bindir
225+
202226
- ${{ if eq(parameters.nameSuffix, 'iOSNativeAOT') }}:
203227
# CoreCLR NativeAOT build
204228
- script: make hello-app TARGET_OS=ios TARGET_ARCH=arm64 BUILD_CONFIG=Release DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=true

src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4226,11 +4226,9 @@ private static void WrapArgsForInvokeCall(object[] aArgs, int[] aArgsWrapperType
42264226
case DispatchWrapperType.Error:
42274227
wrapperType = typeof(ErrorWrapper);
42284228
break;
4229-
#pragma warning disable 0618 // CurrencyWrapper is obsolete
42304229
case DispatchWrapperType.Currency:
42314230
wrapperType = typeof(CurrencyWrapper);
42324231
break;
4233-
#pragma warning restore 0618
42344232
case DispatchWrapperType.BStr:
42354233
wrapperType = typeof(BStrWrapper);
42364234
isString = true;
@@ -4287,11 +4285,9 @@ private static void WrapArgsForInvokeCall(object[] aArgs, int[] aArgsWrapperType
42874285
case DispatchWrapperType.Error:
42884286
aArgs[i] = new ErrorWrapper(aArgs[i]);
42894287
break;
4290-
#pragma warning disable 0618 // CurrencyWrapper is obsolete
42914288
case DispatchWrapperType.Currency:
42924289
aArgs[i] = new CurrencyWrapper(aArgs[i]);
42934290
break;
4294-
#pragma warning restore 0618
42954291
case DispatchWrapperType.BStr:
42964292
aArgs[i] = new BStrWrapper((string)aArgs[i]);
42974293
break;

src/coreclr/System.Private.CoreLib/src/System/Variant.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,9 @@ internal static void MarshalHelperConvertObjectToVariant(object? o, out ComVaria
140140
case ErrorWrapper wrapper:
141141
pOle = ComVariant.Create(wrapper);
142142
break;
143-
#pragma warning disable 0618 // CurrencyWrapper is obsolete
144143
case CurrencyWrapper wrapper:
145144
pOle = ComVariant.Create(wrapper);
146145
break;
147-
#pragma warning restore 0618
148146
case BStrWrapper wrapper:
149147
pOle = ComVariant.Create(wrapper);
150148
break;

src/coreclr/crossgen-corelib.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197

198198
<PropertyGroup>
199199
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(TargetOS)' == 'osx'">12.0</AppleMinOSVersion>
200-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(TargetOS)' == 'maccatalyst'">15.0</AppleMinOSVersion>
200+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(TargetOS)' == 'maccatalyst'">15.2</AppleMinOSVersion>
201201
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(TargetOS.StartsWith('ios')) or $(TargetOS.StartsWith('tvos')))">12.2</AppleMinOSVersion>
202202

203203
<_AppleSdkName Condition="'$(TargetOS)' == 'ios'">iphoneos</_AppleSdkName>

src/coreclr/debug/daccess/dacdbiimpl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,7 @@ void DacDbiInterfaceImpl::GetClassTypeInfo(TypeHandle typeH
23152315
DebuggerIPCE_ExpandedTypeData * pTypeInfo,
23162316
AppDomain * pAppDomain)
23172317
{
2318+
typeHandle = typeHandle.UpCastTypeIfNeeded();
23182319
Module * pModule = typeHandle.GetModule();
23192320

23202321
if (typeHandle.HasInstantiation()) // the type handle represents a generic instantiation
@@ -2402,9 +2403,10 @@ void DacDbiInterfaceImpl::TypeHandleToBasicTypeInfo(TypeHandle
24022403
case ELEMENT_TYPE_CLASS:
24032404
case ELEMENT_TYPE_VALUETYPE:
24042405
{
2405-
Module * pModule = typeHandle.GetModule();
2406+
typeHandle = typeHandle.UpCastTypeIfNeeded();
24062407

2407-
if (typeHandle.HasInstantiation()) // only set if instantiated
2408+
Module * pModule = typeHandle.GetModule();
2409+
if (typeHandle.HasInstantiation()) // only set if instantiated
24082410
{
24092411
pTypeInfo->vmTypeHandle.SetDacTargetPtr(typeHandle.AsTAddr());
24102412
}

src/coreclr/debug/ee/debugger.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11657,6 +11657,7 @@ void Debugger::TypeHandleToBasicTypeInfo(AppDomain *pAppDomain, TypeHandle th, D
1165711657
case ELEMENT_TYPE_CLASS:
1165811658
case ELEMENT_TYPE_VALUETYPE:
1165911659
{
11660+
th = th.UpCastTypeIfNeeded();
1166011661
res->vmTypeHandle = th.HasInstantiation() ? WrapTypeHandle(th) : VMPTR_TypeHandle::NullPtr();
1166111662
// only set if instantiated
1166211663
res->metadataToken = th.GetCl();
@@ -11739,6 +11740,7 @@ void Debugger::TypeHandleToExpandedTypeInfo(AreValueTypesBoxed boxed,
1173911740
case ELEMENT_TYPE_CLASS:
1174011741
{
1174111742
treatAllValuesAsBoxed:
11743+
th = th.UpCastTypeIfNeeded();
1174211744
res->ClassTypeData.typeHandle = th.HasInstantiation() ? WrapTypeHandle(th) : VMPTR_TypeHandle::NullPtr(); // only set if instantiated
1174311745
res->ClassTypeData.metadataToken = th.GetCl();
1174411746
DebuggerModule * pModule = LookupOrCreateModule(th.GetModule());

src/coreclr/ilasm/asmman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ void AsmMan::EndAssembly()
437437
// Read the file into the buffer.
438438
size_t dwBytesRead;
439439

440-
if ((dwBytesRead = fread(m_sStrongName.m_pbPublicKey, 1, m_sStrongName.m_cbPublicKey, fp)) <= m_sStrongName.m_cbPublicKey) {
440+
if ((dwBytesRead = fread(m_sStrongName.m_pbPublicKey, 1, m_sStrongName.m_cbPublicKey, fp)) < m_sStrongName.m_cbPublicKey) {
441441
HRESULT hr = HRESULTFromErrno();
442442
MAKE_UTF8PTR_FROMWIDE(keySourceNameUtf8, ((Assembler*)m_pAssembler)->m_wzKeySourceName);
443443
report->error("Failed to read key file '%s': 0x%d\n",keySourceNameUtf8,hr);

src/coreclr/inc/corinfo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,9 @@ enum class CorInfoReloc
902902
LOONGARCH64_JIR, // LoongArch64: pcaddu18i+jirl
903903

904904
// RISCV64 relocs
905-
RISCV64_PC, // RiscV64: auipc
905+
RISCV64_CALL_PLT, // RiscV64: auipc + jalr
906+
RISCV64_PCREL_I, // RiscV64: auipc + I-type
907+
RISCV64_PCREL_S, // RiscV64: auipc + S-type
906908
};
907909

908910
enum CorInfoGCType

src/coreclr/inc/utilcode.h

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3236,14 +3236,14 @@ void PutLoongArch64PC12(UINT32 * pCode, INT64 imm);
32363236
void PutLoongArch64JIR(UINT32 * pCode, INT64 imm);
32373237

32383238
//*****************************************************************************
3239-
// Extract the PC-Relative offset from auipc + I-type adder (addi/ld/jalr)
3239+
// Extract the PC-Relative offset from auipc + I-type or S-type adder (addi/load/store/jalr)
32403240
//*****************************************************************************
3241-
INT64 GetRiscV64AuipcItype(UINT32 * pCode);
3241+
INT64 GetRiscV64AuipcCombo(UINT32 * pCode, bool isStype);
32423242

32433243
//*****************************************************************************
3244-
// Deposit the PC-Relative offset into auipc + I-type adder (addi/ld/jalr)
3244+
// Deposit the PC-Relative offset into auipc + I-type or S-type adder (addi/load/store/jalr)
32453245
//*****************************************************************************
3246-
void PutRiscV64AuipcItype(UINT32 * pCode, INT64 offset);
3246+
void PutRiscV64AuipcCombo(UINT32 * pCode, INT64 offset, bool isStype);
32473247

32483248
//*****************************************************************************
32493249
// Returns whether the offset fits into bl instruction
@@ -3285,6 +3285,19 @@ inline bool FitsInRel28(INT64 val64)
32853285
return (val64 >= -0x08000000LL) && (val64 < 0x08000000LL);
32863286
}
32873287

3288+
//*****************************************************************************
3289+
// Returns whether the offset fits into a RISC-V auipc + I-type or S-type instruction combo
3290+
//*****************************************************************************
3291+
inline bool FitsInRiscV64AuipcCombo(INT64 val64)
3292+
{
3293+
// A PC relative load/store/jalr/addi is 2 instructions, e.g.:
3294+
// auipc reg, offset_hi20 # range: [0x80000000, 0x7FFFF000]
3295+
// ld reg, reg, offset_lo12 # range: [0xFFFFF800, 0x000007FF]
3296+
// Both hi20 and lo12 immediates are sign-extended and combined with a 64-bit adder,
3297+
// which shifts the total 32-bit range into the negative by half of the 12-bit immediate range.
3298+
return (val64 >= -(1ll << 31) - (1ll << 11)) && (val64 < (1ll << 31) - (1ll << 11));
3299+
}
3300+
32883301
//
32893302
// TEB access can be dangerous when using fibers because a fiber may
32903303
// run on multiple threads. If the TEB pointer is retrieved and saved

0 commit comments

Comments
 (0)