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

25 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 4e1114fde6
[tools] Use MONO_AOT_MODE_INTERP_ONLY instead of MONO_AOT_MODE_INTERP for x86_64. (#15429)
The 'MONO_AOT_MODE_INTERP' mode is based on full AOT, which requires infinite
trampoline code to not potentially run out of trampolines. However, that mode
isn't implemented for x86_64, so in that case use 'MONO_AOT_MODE_INTERP_ONLY',
which will use the JIT as a fallback.

Ref: https://github.com/dotnet/runtime/issues/68808

Fixes: https://github.com/xamarin/xamarin-macios/issues/14887
2022-07-12 09:56:51 +02:00
Rolf Bjarne Kvinge c8e854c151
[dotnet] Add support for generating a binary version of runtimeconfig.json. Fixes #11745. (#11887)
Use Mono's RuntimeConfigParserTask to parse the *.runtimeconfig.json file and
produce a binary version of it.

This also means implementing support for finding the on-disk location of the
file at runtime, and passing it to mono.

Ref: 01b7e73cd3/docs/design/mono/mobile-runtimeconfig-json.md

Fixes https://github.com/xamarin/xamarin-macios/issues/11745.
2021-06-16 15:22:02 +02:00
Rolf Bjarne Kvinge 751976a769
[CoreCLR] Stub out mono_runtime_set_pending_exception for CoreCLR. (#11521)
We need additional API in CoreCLR to support pending exception properly, and
this is in progress [1]. In the meantime, stub out parts of it, so that the
process doesn't abort. This way we'll have failing tests instead (and work in
other areas can progress, since the process doesn't abort).

[1]: https://github.com/dotnet/runtime/pull/52146
2021-05-13 07:12:17 +02:00
Rolf Bjarne Kvinge 6bc3d97908
[runtime] Implement functions for getting and setting array elements for CoreCLR. (#11519)
This is not the fastest implementation, but it's the simplest I could come up
with, with the target of sharing as much code as possible with MonoVM. It can
be improved later if we find out it's a slow path (these functions are not in
a common code path, very few API bindings end up here).
2021-05-13 07:11:49 +02:00
Rolf Bjarne Kvinge a09a7d2523
[runtime] Implement the mono_g_hash_table functions for CoreCLR. (#11495) 2021-05-11 22:16:41 +02:00
Rolf Bjarne Kvinge 8bb65492ec
[runtime] Implement mono_string_new and mono_string_to_utf8 for CoreCLR. (#11492)
* [runtime] Implement mono_string_to_utf8 for CoreCLR.

* [runtime] Implement mono_string_new for CoreCLR.
2021-05-11 15:16:01 +02:00
Rolf Bjarne Kvinge 3623a13ab2
[runtime] Implement a managed implementation of a mono_reference_queue for CoreCLR. (#11487)
Also remove the declaration of mono_gc_reference_queue_free, it's never called.
2021-05-10 23:09:39 +02:00
Rolf Bjarne Kvinge 8fc51f7e8e
[runtime] Implement mono_type_get_object for CoreCLR. (#11484) 2021-05-10 15:38:13 +02:00
Rolf Bjarne Kvinge 63db14ec7d
[runtime] Implement mono_method_signature and related signature methods for CoreCLR. (#11465) 2021-05-06 16:19:59 +02:00
Rolf Bjarne Kvinge 8e9f86aad8
[runtime] Implement mono_method_get_class for CoreCLR. (#11389) 2021-04-30 07:53:30 +02:00
Rolf Bjarne Kvinge 655f2f921f
[runtime] Implement xamarin_get_reflection_method_method for CoreCLR. (#11383) 2021-04-30 07:49:25 +02:00
Rolf Bjarne Kvinge 320527a29b
[CoreCLR] Implement mono_assembly_get_object. (#11254) 2021-04-21 15:00:10 +02:00
Rolf Bjarne Kvinge a82575189b [CoreCLR] Add support for mono_assembly_open.
This includes going through all uses of mono_assembly_open, and make sure the release
the returned assembly.
2021-03-25 07:32:32 +01:00
Rolf Bjarne Kvinge 3b2fa0d0b1
[runtime] Move the declaration of the MonoObject struct to MonoVM-specific code. (#10938)
The fields of the MonoObject struct is specific to MonoVM, so this makes sure
we don't accidentally poke into random memory on CoreCLR.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2021-03-24 14:55:03 +01:00
Rolf Bjarne Kvinge d778cc28c8
[runtime/dotnet] Call coreclr_initialize/monovm_initialize at startup. (#10909)
We need to call coreclr_initialize/monovm_initialize at startup, so do that.
This is a partial implementation, in that we're not setting all the properties
that we should, and also the PINVOKE_OVERRIDE callback is not doing everything
it should either yet.

Ref: #10504.
2021-03-22 08:04:56 +01:00
Rolf Bjarne Kvinge a392035fa7
[runtime] Move a few mono function declaration to the generated logic for mono function declarations instead of doing it manually. (#10849)
This makes things a little bit easier to when starting work with CoreCLR.
2021-03-12 07:37:27 +01:00
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 54bc2f1dfe [runtime] Add GCHandle pointer-sized API. 2020-05-04 11:31:19 +02:00
Manuel de la Pena 63ab48e679
[Runtime] Enable the -Wsign-conversion warnings flag and fix some of the warnings. (#7405)
The flag adds a lot (A LOT) of warnings. The diff would be huge and
dangerous to review. We enable the flag and fix file by file.
2019-11-12 15:10:16 -05:00
Rolf Bjarne Kvinge 18b13ac876
[runtime] Use mono_array_setref instead of mono_array_set. (#5782)
* [Foundation] Add an NSArray.FromNSObjects overload that can take an array of INativeObjects.

* [runtime] Use mono_array_setref instead of mono_array_set.

Otherwise the GC won't know about the assignment, and the assigned value can
be freed if it's no longer referenced anywhere else.
2019-03-18 15:00:32 +01:00
Bernhard Urban 394117885c
[runtime] add support for mono runtime interpreter (#3058)
* [runtime] build interp-, icalltable- and ilgen libraries so they can be consumed in interpreter configuration

* [mtouch] add --interpreter configuration support

* [xharness] Add support for removing defines from cloned project files.

* [xharness] Run monotouch-test, mscorlib and mini tests with the interpreter too.

They're ignored for now, which means we won't run them on the bots.

* [mtouch] We're using dlsym when using the interpreter.

* [xharness] enable mini regression tests with interpreter on CI
2018-05-04 23:59:31 +02:00
Rolf Bjarne Kvinge 4b597841ed [runtime] Use the native equivalent of Type.GetTypeCode to do fewer string comparisons. 2017-07-06 20:27:12 +02:00
Rolf Bjarne Kvinge fb463ed921 [registrar] Don't require private mono symbols for BindAs support.
The two functions mono_class_is_nullable and mono_class_get_nullable_param are
private mono symbols, which means we can't call them when using Xamarin.Mac
with libmono from a dynamic library.

Implement a fallback for this case, where we call a managed method when these
functions are not available (and restrict this workaround to Xamarin.Mac only,
since it's not needed for Xamarin.iOS).
2017-07-04 18:33:32 +02:00
Rolf Bjarne Kvinge 5e302f9719 [runtime] Catch and process managed exceptions that are thrown in reverse P/Invoke (delegate) callbacks. 2016-06-08 20:05:54 +02:00
Rolf Bjarne Kvinge ac418df815 Build our runtime. 2016-04-24 14:47:24 -04:00