Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6602cb4

Browse files
authored
Cache ROS constructed from arrays of constants (remaining types) (#69820)
1 parent462e180 commit6602cb4

File tree

10 files changed

+1273
-200
lines changed

10 files changed

+1273
-200
lines changed

‎src/Compilers/CSharp/Portable/CodeGen/EmitArrayInitializer.cs‎

Lines changed: 205 additions & 132 deletions
Large diffs are not rendered by default.

‎src/Compilers/CSharp/Portable/CodeGen/EmitConversion.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void EmitReadOnlySpanFromArrayExpression(BoundReadOnlySpanFromArray expr
7474
this._module.Compilation.IsReadOnlySpanType(typeTo),
7575
"only special kinds of conversions involving ReadOnlySpan may be handled in emit");
7676

77-
if(!TryEmitReadonlySpanAsBlobWrapper(typeTo,operand,used,inPlaceTarget:null,avoidInPlace:out_))
77+
if(!TryEmitOptimizedReadonlySpanCreation(typeTo,operand,used,inPlaceTarget:null,avoidInPlace:out_))
7878
{
7979
// there are several reasons that could prevent us from emitting a wrapper
8080
// in such case we just emit the operand and then invoke the conversion method

‎src/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,7 @@ private void EmitObjectCreationExpression(BoundObjectCreationExpression expressi
24172417
}
24182418

24192419
// ReadOnlySpan may just refer to the blob, if possible.
2420-
if(TryEmitReadonlySpanAsBlobWrapper(expression,used,inPlaceTarget:null,out_))
2420+
if(TryEmitOptimizedReadonlySpan(expression,used,inPlaceTarget:null,out_))
24212421
{
24222422
return;
24232423
}
@@ -2436,15 +2436,15 @@ private void EmitObjectCreationExpression(BoundObjectCreationExpression expressi
24362436
}
24372437
}
24382438

2439-
privateboolTryEmitReadonlySpanAsBlobWrapper(BoundObjectCreationExpressionexpression,boolused,BoundExpressioninPlaceTarget,outboolavoidInPlace)
2439+
privateboolTryEmitOptimizedReadonlySpan(BoundObjectCreationExpressionexpression,boolused,BoundExpressioninPlaceTarget,outboolavoidInPlace)
24402440
{
24412441
intargumentsLength=expression.Arguments.Length;
24422442
avoidInPlace=false;
24432443
return((argumentsLength==1&&
24442444
expression.Constructor.OriginalDefinition==(object)this._module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ReadOnlySpan_T__ctor_Array))||
24452445
(argumentsLength==3&&
24462446
expression.Constructor.OriginalDefinition==(object)this._module.Compilation.GetWellKnownTypeMember(WellKnownMember.System_ReadOnlySpan_T__ctor_Array_Start_Length)))&&
2447-
TryEmitReadonlySpanAsBlobWrapper((NamedTypeSymbol)expression.Type,expression.Arguments[0],used,inPlaceTarget,outavoidInPlace,
2447+
TryEmitOptimizedReadonlySpanCreation((NamedTypeSymbol)expression.Type,expression.Arguments[0],used,inPlaceTarget,outavoidInPlace,
24482448
start:argumentsLength==3?expression.Arguments[1]:null,
24492449
length:argumentsLength==3?expression.Arguments[2]:null);
24502450
}
@@ -2666,7 +2666,7 @@ private bool TryInPlaceCtorCall(BoundExpression target, BoundObjectCreationExpre
26662666
Debug.Assert(TargetIsNotOnHeap(target),"in-place construction target should not be on heap");
26672667

26682668
// ReadOnlySpan may just refer to the blob, if possible.
2669-
if(TryEmitReadonlySpanAsBlobWrapper(objCreation,used,target,outboolavoidInPlace))
2669+
if(TryEmitOptimizedReadonlySpan(objCreation,used,target,outboolavoidInPlace))
26702670
{
26712671
returntrue;
26722672
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp