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

12 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 598dbc8ae3
Use pointer-sized GCHandles everywhere. (#10597)
* Convert the GCHandles interface from 32-bit ints to pointer size types

This involves:

* Stop using some bits of the GCHandle to store extra flags, instead add an extra
  field to store those flags.
* Define a INVALID_GCHANDLE constant and use it instead of 0/NULL. This is not
  strictly required, but it makes the code more self-documenting.
* Define a GCHandle type (typedef'ed to void*) and change all variables and parameters
  to use it instead of guint32.
* Use our own xamarin_gchandle_* methods (with pointer-sized types) that wraps
  the mono_gchandle_* embedding API (which uses 32-bit types) everywhere.
* Update managed code (registrars, runtime code, etc) accordingly.

* [runtime] Make debug code compile.

* Fix typo.

* Fix signature of xamarin_create_gchandle.

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
2021-02-11 08:18:38 +01:00
Rolf Bjarne Kvinge 37a280d974
[runtime] Put LOGZ directive in a header to not duplicate it everywhere. (#6001) 2019-05-06 19:29:28 +02:00
Rolf Bjarne Kvinge 82f288a135
[runtime] Refactor a bit to share code between files. (#6000) 2019-05-06 16:19:56 +02:00
Rolf Bjarne Kvinge 4be637aa8e
[registrar] Fix marshalling of structs with a single member. (#5986) 2019-05-06 07:26:54 +02:00
Rolf Bjarne Kvinge c8ed014af7
[runtime] Improve exception creation. (#5944)
* [runtime] Add an inner exception parameter to Runtime.CreateProductException.

This allows us to simplify code by using inner (and outer) exceptions as
a means to provide information instead of passing extra information
around in order to create decent exceptions.

One example is how we pass the selector and method name to the method
that converts from a native id to a managed NSObject instance: passing
this information is not necessary anymore if we can use two exceptions,
one for the failure to convert from an id to a NSObject instance,
wrapped in a second that tells which method/selector call ran into this
conversion problem.

* [runtime] Throw better exceptions when the dynamic registrar can't marshal something.

* [runtime] Throw a better exception when something goes wrong when trying to marshal a return value.

* [runtime] Use inner exceptions to convey failure information instead of trying to create a single exception with all we know.

* Fix merge problem.
2019-04-26 11:16:23 +02:00
Rolf Bjarne Kvinge df85569d23
[runtime] Rename CallState to XamarinCallState to keep the public namespace cleaner. (#5940)
Also ignore the corresponding public symbols in the PublicSymbols test.

This was introduced in 464882d14a (changes to
the CallState struct made the compiler create public symbols).

Fixes these test failures:

    1) Failed : Xamarin.Tests.Misc.PublicSymbols(iOS)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196

    2) Failed : Xamarin.Tests.Misc.PublicSymbols(tvOS)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.AppleTVOS.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.AppleTVSimulator.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196

    3) Failed : Xamarin.Tests.Misc.PublicSymbols(watchOS)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchOS.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196

    4) Failed : Xamarin.Tests.Misc.PublicSymbols(macOSMobile)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac-system-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac-system.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196
2019-04-23 16:53:35 +01:00
Rolf Bjarne Kvinge 464882d14a
[runtime] Refactor a little bit to avoid code duplication. (#5924) 2019-04-23 06:29:20 +01:00
Rolf Bjarne Kvinge 7ecbc7abee [registrar] Add support for the BindAs attribute. 2017-07-04 07:35:29 +02:00
Rolf Bjarne Kvinge bf36860c1e [runtime] Make the clang's static analyzer happy. (#1722)
trampolines-i386.m:126:19: warning: Assigned value is garbage or undefined
                            it->state->edx = v[1];
                                           ^ ~~~~
    trampolines-x86_64.m:410:16: warning: Assigned value is garbage or undefined
                                                    *reg_ptr = v [stores];
                                                             ^ ~~~~~~~~~~
    trampolines-x86_64.m:447:14: warning: Assigned value is garbage or undefined
                                    *reg_ptr = v [stores++];
                                             ^ ~~~~~~~~~~~~
2017-02-20 17:20:13 +01:00
Rolf Bjarne Kvinge 9a40b22857 [runtime] Simplify stret check in the x86 trampolines. 2016-10-13 17:35:50 +02:00
Rolf Bjarne Kvinge 2d28e24837 [runtime] Handle any exceptions whenever we return from managed code. 2016-06-08 20:05:54 +02:00
Rolf Bjarne Kvinge ac418df815 Build our runtime. 2016-04-24 14:47:24 -04:00