[vm/concurrency] Move locks up from Isolate to IsolateGroup
In --enable-isolate group is
* turned off, then we have 1<->1 mapping between isolate and isolate
group, so moving the locks should have no impact
* turned on, then we have N<->1 mapping between isolates and isolate
group, mutators need to use the same locks to guarantee exclusive
access (e.g. to symbol table, type canonicalization, type arguments
canonicalization, ...)
This is a follow-up to share the program structure in AOT mode across
multiple isoltes.
In order to move the existing `Isolate::type_canonicalization_mutex_` to
`IsolateGroup` (and thereby make all mutators use the same lock), we need
to remove the `RunWithMutatorsStopped()` usage in the runtime entry.
=> Without this it can lead to deadlocks.
In order to remove usage of `RunWithMutatorsStopped()` we will change
access to the cached type arguments array to use load-acquire barriers
in generated code and store-release barriers in runtime code.
A nice side effect is that it reduces `sizeof(dart::Isolate)`.
Closes https://github.com/dart-lang/sdk/issues/41912
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: Ifd42691524fe41ffe8bb4e2623c5b8c1151de973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148539
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: RĂ©gis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
https://dart.googlesource.com/sdk/+/4cf584d4fed719c121c58a44df3b1cb77d5ce145
1 file changed