|
103 | 103 |
|
104 | 104 | #if RETURNS_CONSUMABLE_$ID$ |
105 | 105 |
|
106 | | - // Prevent inlining the method invoke. |
107 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 106 | + // NoOptimization to prevent inlining the method invoke. AggressiveInlining to remove the overhead of the wrapper function. |
| 107 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
108 | 108 | private $OverheadMethodReturnTypeName$ __OverheadWrapper($ArgumentsDefinition$) |
109 | 109 | { |
110 | 110 | return __Overhead($PassArguments$); |
111 | 111 | } |
112 | 112 |
|
113 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 113 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
114 | 114 | private $WorkloadMethodReturnType$ __WorkloadWrapper($ArgumentsDefinition$) |
115 | 115 | { |
116 | 116 | return $WorkloadMethodCall$; |
|
172 | 172 |
|
173 | 173 | #elif RETURNS_NON_CONSUMABLE_STRUCT_$ID$ |
174 | 174 |
|
175 | | - // Prevent inlining the method invoke. |
176 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 175 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
177 | 176 | private $OverheadMethodReturnTypeName$ __OverheadWrapper($ArgumentsDefinition$) |
178 | 177 | { |
179 | 178 | return __Overhead($PassArguments$); |
180 | 179 | } |
181 | 180 |
|
182 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 181 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
183 | 182 | private $WorkloadMethodReturnType$ __WorkloadWrapper($ArgumentsDefinition$) |
184 | 183 | { |
185 | 184 | return $WorkloadMethodCall$; |
|
252 | 251 |
|
253 | 252 | #elif RETURNS_BYREF_$ID$ |
254 | 253 |
|
255 | | - // Prevent inlining the method invoke. |
256 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 254 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
257 | 255 | private $OverheadMethodReturnTypeName$ __OverheadWrapper($ArgumentsDefinition$) |
258 | 256 | { |
259 | 257 | return __Overhead($PassArguments$); |
260 | 258 | } |
261 | 259 |
|
262 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 260 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
263 | 261 | private ref $WorkloadMethodReturnType$ __WorkloadWrapper($ArgumentsDefinition$) |
264 | 262 | { |
265 | 263 | return ref $WorkloadMethodCall$; |
|
328 | 326 | } |
329 | 327 | #elif RETURNS_BYREF_READONLY_$ID$ |
330 | 328 |
|
331 | | - // Prevent inlining the method invoke. |
332 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 329 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
333 | 330 | private $OverheadMethodReturnTypeName$ __OverheadWrapper($ArgumentsDefinition$) |
334 | 331 | { |
335 | 332 | return __Overhead($PassArguments$); |
336 | 333 | } |
337 | 334 |
|
338 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 335 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
339 | 336 | private ref readonly $WorkloadMethodReturnType$ __WorkloadWrapper($ArgumentsDefinition$) |
340 | 337 | { |
341 | 338 | return ref $WorkloadMethodCall$; |
|
404 | 401 | } |
405 | 402 | #elif RETURNS_VOID_$ID$ |
406 | 403 |
|
407 | | - // Prevent inlining the method invoke. |
408 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 404 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
409 | 405 | private void __OverheadWrapper($ArgumentsDefinition$) |
410 | 406 | { |
411 | 407 | __Overhead($PassArguments$); |
412 | 408 | } |
413 | 409 |
|
414 | | - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
| 410 | + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining | System.Runtime.CompilerServices.MethodImplOptions.NoOptimization)] |
415 | 411 | private void __WorkloadWrapper($ArgumentsDefinition$) |
416 | 412 | { |
417 | 413 | $WorkloadMethodCall$; |
|
0 commit comments