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

Cache ROS constructed from arrays of constants (remaining types)#69820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jcouv merged 15 commits intodotnet:mainfromjcouv:cache-arrays
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
337 changes: 205 additions & 132 deletionssrc/Compilers/CSharp/Portable/CodeGen/EmitArrayInitializer.cs
View file
Open in desktop

Large diffs are not rendered by default.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -74,7 +74,7 @@ private void EmitReadOnlySpanFromArrayExpression(BoundReadOnlySpanFromArray expr
this._module.Compilation.IsReadOnlySpanType(typeTo),
"only special kinds of conversions involving ReadOnlySpan may be handled in emit");

if(!TryEmitReadonlySpanAsBlobWrapper(typeTo,operand,used,inPlaceTarget:null,avoidInPlace:out_))
if(!TryEmitOptimizedReadonlySpanCreation(typeTo,operand,used,inPlaceTarget:null,avoidInPlace:out_))
{
// there are several reasons that could prevent us from emitting a wrapper
// in such case we just emit the operand and then invoke the conversion method
Expand Down
8 changes: 4 additions & 4 deletionssrc/Compilers/CSharp/Portable/CodeGen/EmitExpression.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2417,7 +2417,7 @@ private void EmitObjectCreationExpression(BoundObjectCreationExpression expressi
}

// ReadOnlySpan may just refer to the blob, if possible.
if(TryEmitReadonlySpanAsBlobWrapper(expression,used,inPlaceTarget:null,out_))
if(TryEmitOptimizedReadonlySpan(expression,used,inPlaceTarget:null,out_))
{
return;
}
Expand All@@ -2436,15 +2436,15 @@ private void EmitObjectCreationExpression(BoundObjectCreationExpression expressi
}
}

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

// ReadOnlySpan may just refer to the blob, if possible.
if(TryEmitReadonlySpanAsBlobWrapper(objCreation,used,target,outboolavoidInPlace))
if(TryEmitOptimizedReadonlySpan(objCreation,used,target,outboolavoidInPlace))
{
returntrue;
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp