1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 11:37:04 +09:00
Commit graph

323 commits

Author SHA1 Message Date
github-actions[bot]
46adbbb3b2
[release/8.0-staging] GT_STORE_BLK - do not call memset for blocks containg gc pointers on heap (#96514)
* Loop-based impl

* Add asserts

* Add another test case

* Update StructWithGC_Zeroing.csproj

* Update StructWithGC_Zeroing.cs

* clean up

* Fix arm32

* Address feedback

* Add a small note

* Add RISC-V and LA64

* Address feedback

* fix build

* fix build

* CI test

* Fix build

* Clean up

* Apply suggestion

* Use REG_R0 on RISC-V and LA64, use ZR on ARM64

* fix build

* Clean up

* Update src/coreclr/jit/codegenloongarch64.cpp

Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>

* Apply suggestions for risc-v

---------

Co-authored-by: EgorBo <egorbo@gmail.com>
Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>
2024-01-13 08:27:20 -08:00
Egor Bogatov
9f24667d4e
Add NonGC documentation (#90206) 2023-08-14 10:01:24 +02:00
Jackson Schuster
191ec61d66
Cleanup caller allocated and callee allocated resources separately (#89982)
This PR separates cleaning up caller allocated resources and callee allocated resources into separate stages in the managed to unmanaged direction. Caller allocated parameters (anything except 'out') will clean up the same way. Callee allocated parameters ('out' parameters) will be cleaned up only if the invocation succeeded.
2023-08-08 14:47:45 -07:00
Meri Khamoyan
c83324d393
[iOS][non-icu] HybridGlobalization implement calendar data (#90004)
Implement calendar info for hybrid mode on iOS
2023-08-08 19:53:11 +04:00
Ilona Tomkowicz
a9363bf0b8
[browser][non-icu] HybridGlobalization calendar data (#89255)
* Calendar WIP.

* Genitive months.

* Short pattern.

* NativeCalendarName does not exist on WebAPI - use EnglishCalendarName.

* Fix failures in Locales caused by calendars data removal.

* Fix to previous commit.

* Whitespace.

* Implemented Eras.

* Populate NativeName with EnglishName.

* Fix tests.

* Typos + comments removal + block failing test.

* AM/PM designators are not in ICU anymore.

* ShortTimePattern is ready.

* Fix some failing tests.

* LongTimePatterns is ready.

* Ask about all culture info from JS at once.

* Fix remaining tests.

* Calendar Globalization tests fixed.

* Adding test files to projects.

* Build fix.

* Fix the fix.

* .

* Fix tests.

* Load locale info on request + fix Browser scenario tests.

* Fix test on v8.

* Forgotten clean-up.

* Small cleanup in ts.

* V8 11 is behaves more like browser.

* Fixed skipped failing tests.

* Syntax

* V8 returns the same as Browser.

* This API is not affected, no need to test. + Add documentation.

* Revert unintentional change.

* Feedback.

* @radical's feedback + fix after removing unnecessary set.

* Fix.

* Feedback.

* Fix tests.
2023-08-07 22:51:42 +02:00
Jan Kotas
4aa77dfb06
Add note about creating arrays using newobj (#90070)
Contributes to #90038
2023-08-06 08:05:28 -07:00
Mark Plesko
88c4b87221
Clarifications in botr gc section (#89888) 2023-08-02 17:16:34 -07:00
Michal Strehovský
1138b247ec
Remove AssemblyMetadata(".NETFrameworkAssembly", "") attributes (#89490)
* Remove `AssemblyMetadata(".NETFrameworkAssembly", "")` attributes

This is likely a .NET Native leftover that is currently (ironically) breaking .NET Native. This attribute indicates to the .NET Native compiler that the assembly can be trimmed.

We're currently setting this on assemblies that no longer carry RD.XML to make this safe. Without this attribute, the assembly will be treated like any other and not trimmed.

Fixes #44697.

* Delete mention of the attribute in docs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2023-07-27 07:55:19 -07:00
Jan Vorlicek
4fbd7c5827
Set the CORINFO_EH_CLAUSE_SAMETRY on CORINFO_EH_CLAUSE (#88072)
* Set the CORINFO_EH_CLAUSE_SAMETRY on CORINFO_EH_CLAUSE

This change makes setting the `CORINFO_EH_CLAUSE_SAMETRY` on
`CORINFO_EH_CLAUSE` to happen for coreclr to. It is a prerequisity for the
port of exception handling from nativeaot to coreclr and it is a noop on
coreclr with the old exception handling.

* Fix comments

* Add clr-abi note and r2rdump support for the flag

* Fix markdown LINT error

* Update docs/design/coreclr/botr/clr-abi.md

* Update docs/design/coreclr/botr/clr-abi.md

* Update the ABI doc

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2023-07-26 18:48:32 +02:00
Jeremy Koritzinsky
9efa9cd261
Update UserTypeMarshallingV2.md (#89222) 2023-07-19 16:49:40 -07:00
Jeremy Koritzinsky
1dedddef7b
Add opt-in support for GeneratedComInterface/ComImport RCW interop (#87583)
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2023-07-18 13:27:37 -07:00
Meri Khamoyan
f8cb3c7600
[OSX] HybridGlobalization Workaround for insufficiently sized destination buffer (#88184)
Workaround for insufficiently sized dest buffer
2023-07-04 10:20:43 +04:00
Pavel Savara
d388585aa4
[wasm] Introduce <InvariantTimezone> build flag (#87284) 2023-07-01 09:50:21 +02:00
Jeremy Koritzinsky
2eaa57c45c
Add NFloat as an interop intrinsic for the source generator (#88257) 2023-06-30 11:30:22 -07:00
Jeremy Koritzinsky
cdd7566751
Specially consider CLong, CULong and Guid strictly blittable (#88213) 2023-06-29 19:58:29 -07:00
Meri Khamoyan
67b1ede8cb
[OSX] HybridGlobalization Implement casing functions (#87919)
Implement GlobalizationNative_ChangeCaseNative , GlobalizationNative_ChangeCaseInvariantNative for OSX
2023-06-29 12:23:59 +04:00
Meri Khamoyan
eccc410253
Implement collation native functions functions (#86895)
Implemented IndexOf, LastIndexOf, IsSuffix, IsPrefix functions
2023-06-21 12:19:06 +04:00
Aaron Robinson
5649739953
UnsafeAccessorAttribute non-generic support (#86932)
* CoreCLR and NativeAOT

* Add UnsafeAccessorAttribute API

* Implement IL generation for all accessor paths

* Implement static/instance field lookup - non-generic

* Implement static/instance method lookup - non-generic

* Defined ambiguity logic with respect to
custom modifiers.
- First pass ignore custom modifiers
- If ambiguity detected, rerun algorithm but
  require precise matching of custom modifiers.
- If there is no clear match throw AmbiguousImplementationException.

* Cleanup memory management confusion
with ILStubResolver.

* Fix non-standard C++

* Remove CORINFO_MODULE_ALLACCESS scope

* Remove enum METHOD_TYPE.

* Update BOTR on TypeDesc
2023-06-15 06:59:49 -07:00
David Wrighton
8042facb42
Improve the performance of the type loader through various tweaks (#85743)
* Skip type validation by default in ReadyToRun images
- Technically, this is a breaking change, so I've provided a means for disabling the type validation skip
- The model is that the C# compile won't get these details wrong, so disable the checks when run through crossgen2. The idea is that we'll get these things checked during normal, non-R2R usage of the app, and publish won't check these details.

* Replace expensive lookups of generic parameter and nested class data with R2R optimized forms

* Store index of MethodDesc as well as ChunkIndex. Makes MethodDesc::GetTemporaryEntryPoint *much* faster

* Optimize the path for computing if a method is eligible for tiered compilation

* Remove CanShareVtableChunksFrom concept
- it was only needed to support NGen

* Fix up some more issues

* Bring back late virtual propagation in the presence of covariant overrides only

* Check correct flag on EEClass

* Drive by fix for GetRestoredSlot. We don't need the handling of unrestored slots anymore

* Fix composite build with new tables

* Uniquify the mangled names

* Add more __

* Initial pass at type skip verifation checker

* Fix logging and some correctness issues

* Enable the more of type checking
- Notably, the recursive stuff now works
- Also fix a bug in constraint checking involving open types in the type system

* Fix build breaks involving new feature of GenericParameterDesc

* Add documentation for R2R format changes
Fix command line parameter to be more reasonable, and allow logging on command
Fix the rest of issues noted in crossgen2 testing

* Fix implementation of CompareMethodContraints. instead of using IsGeneric map, check to see if the method is generic in the first place. It turns out we have an efficient way to check in every place that matters

* Fix nits noticed by Aaron

* Add some const correctness to the world

* Fix issues noted by Michal, as well as remaining constrain checking issues

* Code review details

* Code review from trylek
2023-06-13 15:25:50 -07:00
Alexander Soldatov
224927519c
[RISC-V] Fix Stubs for Generics (#87316)
Fix register saving before passing generic instantiation parameter.
2023-06-09 17:43:48 -07:00
t-mustafin
d88f9a0ed3
Fix typo in dac-notes.md (#87295) 2023-06-08 17:04:21 -07:00
Andrew Au
f20292493e
Documentation for the HotColdMap section (#87023) 2023-06-05 13:45:51 -07:00
Ilona Tomkowicz
71dd370b7e
[browser][non-icu] HybridGlobalization set flag in SDK (#85245)
* Initial change.

* Filename update.

* WBT for WASM.

* Updated docs.

* Run Hybrid wbt on CI.

* Feedback + hierarchy compatible with #86255.

* Feedback. Test program code to assets.
2023-06-05 16:02:32 +02:00
Ilona Tomkowicz
8154757175
[wasm][globalization] HybridGlobalization fix bug in change case (#86799)
* Fix + test.

* Fix surrogates problem, document final sigma.

* Update change-case.ts

* Fix NLS
2023-05-30 08:54:51 +02:00
Meri Khamoyan
f345a70611
[OSX] HybridGlobalization implement compare native function (#85965)
Implemented CompareStringNative for OSX platforms
Added changes done by @ilonatommy in #86305
2023-05-24 15:08:56 +04:00
Jan Kotas
c79d74897b
Add note about transient pointers to ECMA augments (#86622)
Fixes #62784
2023-05-22 22:04:38 -07:00
Tanner Gooding
d7a30ba1f1
Ensure Vector2/3/4, Quaternion, and Plane don't have a false dependency on Vector<T> (#86481)
* Ensure Vector2/3/4, Quaternion, and Plane don't have a false dependency on Vector<T>

* Apply JIT formatting patch

* Fixing a build issue

* Handle an SPMI assert
2023-05-19 18:59:50 -07:00
Jeremy Koritzinsky
fdb5ac7d45
Add marshallers for GeneratedComInterface-based types (#86177) 2023-05-19 18:59:29 -07:00
Tanner Gooding
2f49fcff6d
Remove getMaxIntrinsicSIMDVectorLength from the JIT/EE interface (#86479)
* Fixing a couple small typos

* Remove getMaxIntrinsicSIMDVectorLength from the JIT/EE interface

* Update src/coreclr/vm/methodtablebuilder.cpp

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2023-05-18 21:22:12 -07:00
Katelyn Gadd
309ffc8dfa
[wasm] Update jiterpreter documentation (#86461)
* Add missing line breaks

* Update jiterpreter documentation with a sample annotated trace

* I love github flavored markdown
2023-05-18 17:20:58 -05:00
Tanner Gooding
0f8afd209a
Add an undocumented switch to allow controlling the preferred vector width emitted implicitly by the JIT (#86457)
* Add an undocumented switch to allow controlling the preferred vector width emitted implicitly by the JIT

* Resolving issues and responding to PR feedback

* Simplifying the xarch cpu info check
2023-05-18 14:25:00 -07:00
Ilona Tomkowicz
6022b3e0c3
[browser][non-icu] HybridGlobalization indexing (#85254)
* A bit faster version of indexing. WIP

* Tiny speedup.

* Fixed IndexOf, ToDo: LastIndexOf.

* All tests pass.

* Updated docs.

* Update docs.

* Slicing + saving previous absolute index instead of pushing the iterator to the start position.

* Refactored.

* Fixed tests on browser.

* Str1 and str2 was confusing.

* Fix CI- correctly trimming Hybrid properties.

* Previous commit should target only Browser.

* Applied @mkhamoyan's suggestion to avoid code duplication.

* Applied @pavelsavara's review.

* Get rid of build errors.

* Revert.
2023-05-18 14:39:34 +02:00
Mark Plesko
0096ba52e8
Convert JIT/CodeGenBringUpTests to a merged test group (#85847)
See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool.  As usual, I recommend viewing the commit list since it partitions the changes in a more readable way and paying more attention to manual changes.

* [ILTransform -public] Make test entrypoints accessible
* [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe
* Manual fixes for xUnit1013 - internal methods
* Add merged group
* Update porting-ryujit.md with info on merged test groups
2023-05-17 23:36:40 -07:00
Aleksey Kliger (λgeek)
55c4e8c349
[wasm] Webcil-in-WebAssembly (#85932)
Define a WebAssembly module wrapper for Webcil assemblies.
Contributes to #80807 

### Why

In some settings serving `application/octet-stream` data, or files with weird extensions will trigger firewalls or AV tools.  But let's assume that if you're interested in deploying a .NET WebAssembly app, you're in an environment that can at least serve WebAssembly modules.

### How

Essentially we serve this WebAssembly module:

```wat
(module
  (data "\0f\00\00\00") ;; data segment 0: payload size
  (data "webcil Payload\cc")  ;; data segment 1: webcil payload
  (memory (import "webcil" "memory") 1)
  (global (export "webcilVersion") i32 (i32.const 0))
  (func (export "getWebcilSize") (param $destPtr i32) (result)
    local.get $destPtr
    i32.const 0
    i32.const 4
    memory.init 0)
  (func (export "getWebcilPayload") (param $d i32) (param $n i32) (result)
    local.get $d
    i32.const 0
    local.get $n
    memory.init 1))
```

The module exports two WebAssembly functions `getWebcilSize` and `getWebcilPayload` that write some bytes (being the size or payload of the webcil assembly) to the linear memory at a given offset.  The module also exports the constant `webcilVersion` to version the wrapper format.

So a runtime or tool that wants to consume the webcil module can do something like:

```js
const wasmModule = new WebAssembly.Module (...);
const wasmMemory = new WebAssembly.Memory ({initial: 1});
const wasmInstance =
      new WebAssembly.Instance(wasmModule, {webcil: {memory: wasmMemory}});
const { getWebcilPayload, webcilVersion, getWebcilSize } = wasmInstance.exports;
console.log (`Version ${webcilVersion.value}`);
getWebcilSize(0);
const size = new Int32Array (wasmMemory.buffer)[0]
console.log (`Size ${size}`);
console.log (new Uint8Array(wasmMemory.buffer).subarray(0, 20));
getWebcilPayload(4, size);
console.log (new Uint8Array(wasmMemory.buffer).subarray(0, 20));
```

### How (Part 2)

But actually, we will define the wrapper to consist of exactly 2 data segments in the WebAssembly data section: segment 0 is 4 bytes and encodes the webcil payload size; and segment 1 is of variable size and contains the webcil payload.

So to load a webcil-in-wasm module, the runtime gets the _raw bytes_ of the WebAssembly module (ie: without instantiating it), and parses it to find the data section, assert that there are 2 segments, ensure they're both passive, and get the data directly from segment 1.

---

* Add option to emit webcil inside a wasm module wrapper

* [mono][loader] implement a webcil-in-wasm reader

* reword WebcilWasmWrapper summary comment

* update the Webcil spec to include the WebAssembly wrapper module

* Adjust RVA map offsets to account for wasm prefix

   MonoImage:raw_data is used as a base when applying the RVA map to map virtual addresses to physical offsets in the assembly.  With webcil-in-wasm there's an extra wasm prefix before the webcil payload starts, so we need to account for this extra data when creating the mapping.

   An alternative is to compute the correct offsets as part of generating the webcil, but that would entangle the wasm module and the webcil payload.  The current (somewhat hacky approach) keeps them logically separate.

* Add a note about the rva mapping to the spec

* Serve webcil-in-wasm as .wasm

* remove old .webcil support from Sdk Pack Tasks

* Implement support for webcil in wasm in the managed WebcilReader

* align webcil payload to a 4-byte boundary within the wasm module

   Add padding to data segment 0 to ensure that data segment 1's payload (ie the webcil content itself) is 4-byte aligned

* assert that webcil raw data is 4-byte aligned

* add 4-byte alignment requirement to the webcil spec

* Don't modify MonoImageStorage:raw_data

   instead just keep track of the webcil offset in the MonoImageStorage.

   This introduces a situation where MonoImage:raw_data is different from MonoImageStorage:raw_data.  The one to use for accessing IL and metadata is MonoImage:raw_data.

   The storage pointer is just used by the image loading machinery

---------

Co-authored-by: Larry Ewing <lewing@microsoft.com>
2023-05-16 16:10:38 -04:00
David Wrighton
8a2aec1be7
Intrinsics analyzer and fixes (#85481)
* Implement analyzer for platform intrinsics use in System.Private.CoreLib

This analyzer detects the use of all platform intrinsics and checks to
ensure that they are all used either protected by an if statement OR
ternary operator which checks an appropriate IsSupported flag, or that
the intrinsic is used within a method where the behavior of platform
support for the intrinsic is not allowed to vary between compile time
and runtime. The analyzer attempts to be conservative about allowed patterns. 

All existing code in System.Private.CoreLib has been annotated to avoid producing
errors.

See the markdown document for details.

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
2023-05-15 19:20:01 -07:00
Katelyn Gadd
3b9b78cae0
Move jiterpreter tables to new file; Add draft jiterpreter overview document (#86270)
Add draft jiterpreter overview document
Move jiterpreter tables out of jiterpreter-trace-generator
2023-05-15 16:02:06 -07:00
Tanner Gooding
7bd4666671
Ensure getMaxSIMDStructBytes doesn't report compVerifyInstructionSetUnusable (#85370) 2023-05-06 09:09:26 -07:00
Jeremy Koritzinsky
5e0044f60c
Add new SafeHandleMarshaller type to provide out-of-generator marshalling support. (#85419)
Fixes #74035

We can't remove the built-in marshalling support from the generator yet, but once the out-of-band packages we ship don't support .NET 6. we can remove the built-in support that emits the marshalling code in the stub. I believe the .NET 9 packages won't support .NET 6, so once we snap for .NET 9 and update how we ship the packages, we can clean this up.

This PR also adds a requested feature to the SafeHandle marshaller: If the call to native code fails, we'll call Dispose() on the pre-allocated handle to avoid leaking it to the finalizer queue.
2023-05-03 11:28:53 -07:00
Egor Bogatov
0be256e710
Allocate Array.Empty<> on a frozen segment (NonGC heap) (#85559)
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
2023-05-03 11:41:34 +02:00
mikelle-rogers
afa9a930b8
EnC Support for Generics (#85269)
* EnC non-functional changes
- Update inappropriate naming
- Update many logging statements
- Remove unused code

* EnC support for fields on generic types

* EnC support for methods on generic types

* Fix use after free introduced in EnC breakpoint.
Fix off by one for string logging.

* update new feature capabilities, JIT GUID

* Fix non-enc build

* Fix EnCFieldIndex check

* Remove IsFdPrivate assert

---------

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Co-authored-by: Tom McDonald <tommcdon@microsoft.com>
2023-04-25 10:32:19 -07:00
Michal Strehovský
0219a1b8ba
Update ECMA-335 for function pointer changes (#84962)
#81006 changes the meaning of function pointer types.
2023-04-24 15:40:39 +09:00
Ilona Tomkowicz
fa5d12e583
[browser][non-icu] HybridGlobalization checking for prefix/suffix (#85093)
* Implementation.

* HG does not belong to legacy code.

* No need to create new instance when existing one is exported.

* TextEncoder's behavior varies between hosts.

* Nit

* Cutting prevents us from using IgnoreSymbols.

* Fixed asserts.

* Fix.

* Match platform with behavior.

* Missing changes to prev commit.
2023-04-22 15:30:57 +02:00
Ilona Tomkowicz
907cc1c1c0
[browser][non-icu] HybridGlobalization SortKey (#84621)
* Throw on SortKey.

* Fix NLS tests.

* Do not add these files for WASI.

* Removed WASI from targets.

* Run tests with HG only on browser, rename.

* Missing WASI removal.

* General docs fix.

* Storing exception text as resource string.
2023-04-18 09:32:31 +02:00
Ilona Tomkowicz
722e19b0ca
[browser][non-icu] HybridGlobalization not supported on WASI (#84629)
* Remove WASI targets from HybridGlobalization.

* Update docs.

* Run tests only on browser.

* Do not add these files for WASI.

* Tests run only on browser.

* Missing removal.
2023-04-12 08:21:10 +02:00
Andy Ayers
e641efb93d
JIT: scalable profile counter mode (#84427)
Add an config option to use a "scalable" profile helper for edge counters,
where we try and avoid contention by probablistic updates once the counter
value exceeds some threshold (currently 8192). Using the current xorshift
RNG this gives the counter a two-sigma accuracy of around +/- 2%.

The idea is loosely based on "Scalable Statistics Counters" by Dice, Lev,
and Moir (SPAA’13).

Also allow the scalable and interlocked profile modes to operate at the same
time, recording two sets of counts per probe, so we can verify that this new mode
is sufficiently accurate.
2023-04-09 14:22:58 -07:00
Jeremy Koritzinsky
35f5a561b8
Derived Interface support in ComInterfaceGenerator (#84271) 2023-04-07 14:12:04 -07:00
Ilona Tomkowicz
d34a2a29e9
[browser][non-icu] HybridGlobalization compare (#84249)
* Added support for hybrid globalization comparison.

* Clean-up. Added exception test cases to docs.

* Nit changes from @kg's review.

* Applied @kg's review.

* Revert unintentional change.

* Refactor: all hybrid globalization js methods in one file.

* Color the syntax.

* Undeline the fact that this PR is only for WASM.

* Move interop functions to proper location.
2023-04-07 09:04:32 +02:00
Ilona Tomkowicz
9afb7d4244
[browser][non-icu] HybridGlobalization change case (#84019)
* Enabled `HybridGlobalization` mode.

* Enabled non-icu change case.

* Tests.

* Revert not connected changes.

* Fix: Add the new file to the project.

* Fix: this PR is for Browser, so add it to condition.

* Fixed calls to js.

* Trying to fix CI.

* False is default, redundant lines.

* Trying to fix the CI.

* Remove redundant code.

* This PR is partial solution, this file will be added in a follow-up.

* Fix for EAT lib tests.

* We do not trim anything for Hybrid currently.

* Check if functions invoked only in specific modes.

* Change confusing name + move the common property to the main part of the class.

* Applied @mkhamoyan's suggestion.

* Fix previous commit: missing directive.

* Fix previous commit: missing directive.

* It's not IOS-connected.

* Move hybrid tests to correct dir + separate ios and wasm + update sln.

* Invariant and hybrid cannot be both true.

* Remove old version of hybrid tests proj.

* Applied @kg's review.
2023-04-04 09:07:04 +02:00
Tanner Gooding
db93e03226
Updating some places to cover xmm16-xmm31 (#84088)
* Updating some places to cover xmm16-xmm31

* Remove XMM0-XMM31 and K0-K7 from mapRegNumToDwarfReg
2023-03-29 16:19:44 -07:00
Ilona Tomkowicz
5b47cd7520
Documentation for loading custom files in Blazor. (#83925)
* How to load custom icu files in Blazor.

* Specify the path form.

Specify how the path should look like for both: Blazor and WASM app.

* Nit
2023-03-27 17:00:45 +02:00