Граф коммитов

645 Коммитов

Автор SHA1 Сообщение Дата
yowl 0d45438de0
Wasm: enable stack trace exceptions, simple exceptions test, upgrade emscripten (#8319) 2020-10-14 17:05:51 -07:00
yowl 4ce1c21ac0
Wasm: add support for most of the conv_ovf operations (#8350)
* wasm: add support for most of the conv_ovf operations

i and i_un still to do.

* correct comment

* remove masks, refactor

* address feedback.  Refactor to remove some conditions.  Change Dbl2ULngOvf to check for negative
2020-10-04 20:15:02 -07:00
yowl 145402e007
Wasm: RhpNewArrayAlign8 use non-padded size when going to the slow path (#8324)
* RhpNewArrayAlign8 use non-padded size when going to the slow path and RhpGcAlloc

* remove padding from slow path for RhpNewFastMisalign and RhpNewFastAlign8

* add overflow checks for 32bit host

* #if out align 8 methods for HOST_64BIT.  Change overflow check for padding to not use 64 bit arithmetic
2020-09-25 13:38:10 -07:00
yowl 79913f339d
wasm fix copying of generic struct return value - was putting the first element in all fields. (#8337) 2020-09-16 14:40:19 -07:00
Levi Broderick 440e28969f
Remove reference to old dumpling URL (#8338) 2020-09-16 14:39:46 -07:00
yowl 9fd573816a
wasm: do not sign extend bools (#8322) 2020-09-12 22:11:45 -07:00
yowl 5b20bfa00e
wasm avoid redirection for GetSystemArrayEEType for InPlaceRuntime (#8318) 2020-09-12 08:20:03 -07:00
yowl 2ca928f7c3
Wasm: create unboxes for struct ctor overloads (#8307)
* when creating the unqualified mangled name, special case ValueTypeInstanceMethodWithHiddenParameter

* Use IMethodNode to get the physical function name
2020-09-10 21:23:17 +02:00
yowl 34af164b2f
Wasm: add support for overflow checks on signed and unsigned ints multiply (#8259)
* wasm-ovf-unsigned-int

* refactor for stack kind tests and add signed check

* use llvm intrinsics
2020-08-26 14:21:53 -07:00
yowl 266ae09409
wasm add rethrow support (#8206) 2020-08-26 12:32:35 -07:00
yowl e185c47f99
Wasm: add support for new StackTrace().ToString() (#8201) 2020-08-26 12:26:17 -07:00
yowl d2a7a6d39f
Wasm: Add support for DefaultConstructorOf and hence Activator.CreateInstance<T> (#8279) 2020-08-25 15:16:41 -07:00
yowl 127405d0d7
Wasm: add support for ovf op with char type (#8257)
* add support for ovf op with char type

* use stack kind for 32/64 switching and for asserts
2020-08-10 17:32:41 -07:00
yowl b48a58e6fa
Wasm: call RhpAssignRef for stfld and stelem (#8171) 2020-07-24 14:02:16 -07:00
Michal Strehovský 982329c76b
Fix reflection access to thread static fields (#8219)
Reflection-accessing threadstatic fields didn't work.

I'm also deleting a bunch of .NET Native code that is not relevant to CoreRT.
The .NET Native approach to threadstatics (using TLS region) is Windows-specific
and not portable.

The type loader support is incomplete (the compiler side is ready but runtime side is
still going to fail with a MissingTemplateException). I got tired and this diff is already
too big.

Contributes to #5137.
2020-07-13 10:29:02 +02:00
yowl 3a61e44371
Add support for throw in catch block and inner try with same offset as outer (#8207) 2020-07-12 13:23:02 -07:00
Stephen Toub 9d8bd29a71
Update license headers (#8223) 2020-07-12 13:20:20 -07:00
Michal Strehovský fa19492693
Allow preinitializing delegates and reading initonly statics (#8204)
This extends the static constructor interpreter with support for preinitializing delegates and support for reading readonly static fields declared by other types.

The readonly static fields can be accessed after interpreting the static constructor of the containing type. This opens us up to recursive dependencies. The interpreter will bail if recursive dependency is hit (we already have a test).

This significantly improves the interpreter's ability to run static constructors at compile time:

|          | Eligible types | Preinitialized before | Preinitialized after |
| -------- | -------------- | --------------------- | -------------------- |
| WinForms | 1520           | 702                   | 967                  |
| WebApi   | 2005           | 746                   | 1278                 |

About 60% of types now have their static constructor executed at compile time.
2020-06-23 08:11:03 +02:00
Michal Strehovský 99952e0254
Fix CoreFX CI test legs (#8213)
Seems like a VS update broke the CoreFX legs. We reinitialize the VS environment a lot.
2020-06-22 22:43:26 +02:00
yowl 908ec0b3d6
Wasm: Example for JS interop and target change to allow custom emcc parameters (#8162) 2020-06-19 13:06:22 +02:00
yowl 269f25d8bf
clear shadow stack slots in case of call to RhCollect (#8195) 2020-06-13 15:37:24 +02:00
Michal Strehovský d429289d8d
Scan for typeof(X).GetProperty("Foo") (#8189)
This is used in LINQ expressions interpreter.
2020-06-06 13:16:39 -07:00
Michal Strehovský 35db90e6e1
Run static constructors at compile time (#8176)
When possible, run static constructors at compile time and store the produced data blob in the executable. This eliminates the need to keep the static constructor code around if the type was statically constructed at compile time.

This runs a small interpreter to interpret the static constructor at compile time.

* Besides the easy things (preinitializing primitive-typed fields), this can also preinitialize reference types (classes, arrays). This builds on top of the GC's ability to deal with "frozen objects" (reference type instances allocated within the data section of the executable instead of on the GC heap). There's some limitations of course (e.g no finalizers - these never get garbage collected).
* Can also do things like non-recursive inlining

Of course there's limitations (the static constructor cannot have side effects, cannot do things like p/invoke, etc.), but it works pretty well.

Some results:

|                      | Types eligible for preinitialization | Types preinitialized |
|----------------------|--------------------------------------|----------------------|
| ASP.NET SampleWebApi | 1991                                 | 754                  |
| Empty WinForms app   | 1510                                 | 709                  |
| Console Hello world  | 317                                  | 149                  |

Also results in about 0.2% size on disk improvement, but size improvement is not really the point of this optimization.

Current limitations that I want to lift eventually:
* No backwards branches - to avoids jokers putting `while (true) ;` in a static constructors (we can put an upper limit on number of instructions interpreted instead)
* Can't preinitialize delegates, but delegates to static methods should be doable and are pretty common in the ASP.NET codebase.
* Can't access static fields of types other than the one being preinitialized. We should be able to lift this limitations for readonly fields with some care (seems pretty common too).
* We might be able to model `typeof(Foo) == typeof(T)` that shows up sometimes.
2020-06-01 09:04:42 +02:00
yowl c783ad38ed
Move the NRE check higher for calls to catch non-virtual case (#8179) 2020-05-30 11:23:15 -07:00
yowl b9eaaf52ca
Wasm: Support for generic md array tests (#8168)
* add support for IsArrayAddressMethod

* remove unnecessary checks
2020-05-28 22:39:59 -07:00
yowl 83d7a512f8
Wasm: add overflow checks to sub_ovf and sub_ovf_un (#8165) 2020-05-24 10:45:52 -07:00
yowl 0185f4706a
Wasm: fix isinst for some generics test (#8166) 2020-05-22 15:33:24 -07:00
yowl 2ae4e8aeb7
add test for storing to a field on null (#8160) 2020-05-20 05:35:41 -07:00
Jan Kotas 06c964a218
Update libraries (#8155)
* Update libraries

* Fix library names on Unix

* CppCodeGen workaround

* Disabled outdated test
2020-05-16 08:08:32 -07:00
yowl 2c6a83fb55
Wasm: 2 fixes for handling returned generic structs (#8151)
* fix storing of generic struct returned through spilled expression

fix passing of generic struct not stored in local

* add reference
2020-05-12 13:50:42 -07:00
yowl 7c80d18007
Wasm: Move generic context to local for catch and filter funclets (#8149)
* Move generic context to local for catch and filter funclets

* Simply function for generic context in signature.
2020-05-11 16:25:35 -07:00
yowl 9549cd6aa6
Wasm: Fix 2 issues with the filters. (#8135)
* Fix 2 issues with the filters.  Applied in wrong order, region detection wrong

* add the same padding fix for finally funclets as exists for filters
2020-05-08 19:24:59 -07:00
Andrii Kurdiumov 3216e1aee8
Add simple marshaller which marshal only null COM interfaces (#8128) 2020-05-06 13:23:08 +02:00
yowl 57a9b92999
support filters (#8125) 2020-05-02 08:30:00 -07:00
Michal Strehovský 3a24954848
Update compiler from dotnet/runtime (#8122)
* Update compiler from dotnet/runtime

Contains breaking change: NativeCallableAttribute was renamed to UnmanagedCallersOnlyAttribute as part of making it a public attribute.

* Update tests/src/Simple/HelloWasm/Program.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2020-05-02 07:30:44 +02:00
yowl e4131da04c
add overflow checks for add.ovf on ints/uints (#8089) 2020-05-01 11:49:01 -07:00
yowl 63112bab1e
Wasm: Make offset used in unbox stub match RhUnbox/RhBox (#8113)
* move RawData

* Remove BoxedValue

* Remove RawData
2020-04-27 07:26:58 -07:00
Andrey Kurdyumov 5383d46c02
Remove ICastable (#8103)
Closes #8101
2020-04-21 09:25:10 -07:00
yowl 4f165631bf
Wasm: implement ckfinite (#8097)
* add support for ckfinite

* Using existing OverflowException helper.
2020-04-21 03:21:33 -07:00
yowl 191a3c183f
Wasm: change NRE handling from trap to exception (#8096) 2020-04-19 14:28:37 -07:00
yowl 931d373ed9
WASM: Add exception handling - emit EHInfo data (#7137)
* reset commits

* add test and initial handling switch for invoke for GVM calls.

* add support for exceptions in GVM calls, and a test

* move wasm specific code to .wasm.cs

* Exclude wasm files from non-wasm platforms
2020-04-18 08:58:50 -07:00
yowl ef44e58d37
Wasm: Update linux instructions for LLVM9 (#8082) 2020-04-16 14:50:52 +02:00
yowl af159a9e08
Wasm: Do not build wasm when running `build` (#8091) 2020-04-16 08:28:13 +02:00
Jan Kotas b7a502ef12
Disable bigvtbl test (#8088)
Fixes #8087
2020-04-13 10:13:10 -07:00
yowl e187bfb20a
remove assert for old version of emscripten (#8074)
add test
2020-04-05 12:18:28 -07:00
Michal Strehovský 41cfe60c9c
Wrap LINQ object array delegate thunk in a try/finally (#8072)
This ensures we copy back byref args. It wasn't possible when this code was originally witten because the IL generator couldn't generate finallys.

Closes #2910.
2020-04-05 08:14:18 +02:00
yowl 3c191894a1
Wasm: Reenable the CI for Wasm (#7998) 2020-03-30 10:11:43 +02:00
Andrey Kurdyumov ad96044959
Migrate links from CoreCLR to Runtime repository (#8057)
* Migrate link from CoreCLR to Runtime repository

* Drop suffix to messages, since it's small issue

* Replace mention of issue with proper link
2020-03-26 09:58:29 -07:00
yowl 592a2cae5a
Wasm: Add conservative garbage collection (#7992) 2020-03-24 11:05:08 +01:00
Michal Strehovský 57382c1d94
Do not overwrite metadataGenerationOptions (#8053)
Plus test coverage.

Fixes the issue reported in #7995.
2020-03-23 08:54:49 -07:00