Daniel Grunwald
f568123704
Add support for UTF8 string literals
2 years ago
ElektroKill
760a6a653e
Reduce allocations in TransformArrayInitializers
...
DecodeArrayInitializer - Instead of relying on the Add method of a list to expand the underlying array when necessary, the code now allocates a big enough array to fit all the elements removing the need for the Add method to expand the array several times.
BlockFromInitializer now reuses a single instance of List<ILInstruction> instead of reallocating a new one every time and clears it when necessary. The same pre-allocation approach mentioned above has been implemented here too.
3 years ago
Siegfried Pammer
6a3bb2bbf1
Fix #2655 : TranslateArrayInitializer crashes with out of order array init
3 years ago
Siegfried Pammer
d98ff730a0
Fix build.
3 years ago
Siegfried Pammer
4aa7f5fc38
Fix #2612 decompilation of newarr with int.MaxValue causes OOME in decompiler.
3 years ago
Daniel Grunwald
0414e7f8e9
Fix potential NRE in ILFunction.RegisterVariable()
4 years ago
Siegfried Pammer
67be41a998
#2294 : Fix potential NRE: finalStore is accessed before null check.
4 years ago
Daniel Grunwald
5bd8c69a48
Disable transform for Span<T> initialization from field with RVA if "ArrayInitializers" setting is disabled.
...
https://github.com/ashmind/SharpLab/issues/542
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
5 years ago
Siegfried Pammer
7ed4a736f3
Fix #2103 : Support for `Stackalloc initializers` not working for `byte`
5 years ago
Siegfried Pammer
68e4d7dfa6
Adapt TransformArrayInitializers to ILAst changes.
5 years ago
Daniel Grunwald
925a4e1e65
#2050 : Don't put ldflda/ldelema with immediate exceptions into StObj.TargetSlot.
...
The C# translation of StObj will always apply delayed exceptions in these two cases, so putting an instruction with delayed exceptions in that slot would change program semantics.
5 years ago
Siegfried Pammer
587f61be19
Fix #1280 : Transform RuntimeHelpersInitializeArray calls without receiving assignments.
6 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
6 years ago
Siegfried Pammer
b03aa488aa
Performance: Cache ChainedConstructorCallILOffset in ILFunction to avoid having to scan the method body in every inlining step. Take a shortcut for static ctors, as there cannot be chained ctor calls in static ctors.
6 years ago
Siegfried Pammer
94cd891609
Add support for ReadOnlySpan<T> initialization pattern.
6 years ago
Siegfried Pammer
3d5b300602
Improve TransformArrayInitializers: allow default entries at the end of a dimension > 0.
6 years ago
Siegfried Pammer
46b56f8482
Fix #1382 : Do not reuse index instructions in TransformArrayInitializers
6 years ago
Siegfried Pammer
37a8156dab
Fix #1383 : NRE in TransformArrayInitializers.
6 years ago
Siegfried Pammer
859872ba8c
Fix #1377 : Fix IndexOutOfRangeException in TransformArrayInitializers
6 years ago
Siegfried Pammer
64686b9547
Fix #1336 : multi-dimensional array initializers with custom objects not detected.
6 years ago
Siegfried Pammer
ab8c73b2f7
#1336 : Add limit in HandleSimpleArrayInitializer.
6 years ago
Siegfried Pammer
0dac55d584
Add transformation for stackalloc to Span<T>.
7 years ago
Siegfried Pammer
08af55aa57
Avoid ITypeDefinition.FullName. Use Name and Namespace separately to avoid string allocation. Reorder checks to improve performance on pattern mismatch.
7 years ago
Siegfried Pammer
ebbe25fba7
Apply suggested refactorings on TransformArrayInitializers.cs
7 years ago
Siegfried Pammer
772b529d16
Add support for stackalloc initializer pattern that uses initblk.
7 years ago
Siegfried Pammer
057ab82534
Add basic stackalloc initializer transforms.
7 years ago
Siegfried Pammer
2a537fcecb
Reorder code in TransformArrayInitializers.cs
7 years ago
Daniel Grunwald
1f3916d554
Use the resolve methods in MetadataModule, and remove the wrappers in DecompilerTypeSystem.
7 years ago
Siegfried Pammer
68123fc6b3
Fix build.
7 years ago
Daniel Grunwald
9a74f018b5
Decode metadata signatures directly into IType; without going through ITypeReference.
7 years ago
Siegfried Pammer
5e4b571a62
Add DynamicCallSiteTransform
7 years ago
Siegfried Pammer
bd15d69ada
Add test cases for #1138
7 years ago
Siegfried Pammer
5290677f80
Fix #1138 : Array-index out of bounds crash in TransformArrayInitializers.HandleSimpleArrayInitializer
7 years ago
Daniel Grunwald
469501210c
Add support for C# 7 tuple types:
...
* Use tuple literals instead of calling 'new ValueTuple<..>' constructor
* Where available, use element names for field access
* Make CallBuilder aware of tuple-name/dynamic type erasure, to avoid introducing casts when the types differ only in the tuple element names.
* Make CallBuilder provide a ResolveResult with the correct C# return type for the resulting expression.
Previously we were using the type-erased return type from the IL.
* Fix a bug that caused us to introduce returning casts when accessing an indexer.
7 years ago
Siegfried Pammer
b311ba5a44
Port DelegateConstruction and TransformArrayInitializers
7 years ago
Andrey Shchekin
6ba6b8c8f6
Added support for ArrayInitializers=false to suppress prettifier over array initializers (used by SharpLab).
7 years ago
Siegfried Pammer
701513fd00
Fix build.
8 years ago
Siegfried Pammer
7ad556e0bf
Do not detect array initializer if element type and store type do not match.
8 years ago
Siegfried Pammer
33c5e2d3ed
Add StackType.F4 and StackType.F8, and instructions LdcF4 and LdcF8.
8 years ago
Siegfried Pammer
349183544a
Rename BlockType to BlockKind
8 years ago
Siegfried Pammer
a9fd937099
Fix bug in TransformArrayInitializers.HandleJaggedArrayInitializer
8 years ago
Daniel Grunwald
7017c6f6e6
Replace LoopingBlockTransform with StatementTransform.
...
This transform interleaves statement-combining transforms so that nested structures can be detected better.
8 years ago
Siegfried Pammer
9a78b85576
Fix bug in TransformArrayInitializers: local storage was deleted.
8 years ago
Siegfried Pammer
ed6a2db37c
Add VariableKind.InitializerTarget to separate stack slots should be renamed from purely generated helper variables in initializer blocks.
8 years ago
Siegfried Pammer
53a9ed47f7
Fix second part of #547
8 years ago
Siegfried Pammer
07dd01eafc
First implementation of TransformCollectionAndObjectInitializers
8 years ago
Christoph Wille
1ce8349dd9
Adjust namespaces
9 years ago
Daniel Grunwald
760e02a511
Add step messages to all block transforms.
9 years ago
Daniel Grunwald
51a9786243
Change some transforms to block transforms.
9 years ago