[vm] Remove of old native syntax in VM corelib implementations

Issue https://github.com/dart-lang/sdk/issues/28791

TEST=ci

Change-Id: I37ff9eaada17484a5fef4f97ec3bdcf83edf6f36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229962
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Martin Kustermann 2022-10-28 12:45:35 +00:00 committed by Commit Queue
parent ae38d892b3
commit 3b2b126f60
4 changed files with 18 additions and 6 deletions

View file

@ -648,6 +648,13 @@ ObjectPtr KernelLoader::LoadProgram(bool process_pending_classes) {
}
}
// Ensure that `ExternalName` and `pragma` classes are looked up before we
// install the constants table: Once the constants table is installed
// finalization of classes will eagerly want to evaluate constants and doing
// so will require those two classes to be available.
EnsureExternalClassIsLookedUp();
EnsurePragmaClassIsLookedUp();
// Sets the constants array to an empty array with the length equal to
// the number of constants. The array gets filled lazily while reading
// constants.

View file

@ -2704,8 +2704,9 @@ class _ResourceHandleImpl implements ResourceHandle {
@patch
class SocketControlMessage {
factory SocketControlMessage.fromHandles(List<ResourceHandle> handles)
native "SocketControlMessage_fromHandles";
@pragma("vm:external-name", "SocketControlMessage_fromHandles")
external factory SocketControlMessage.fromHandles(
List<ResourceHandle> handles);
}
@pragma("vm:entry-point")

View file

@ -130,19 +130,21 @@ abstract class _HashVMImmutableBase extends _HashVMBase
@pragma("vm:recognized", "other")
@pragma("vm:exact-result-type", "dart:core#_ImmutableList")
@pragma("vm:prefer-inline")
List<Object?> get _data native "ImmutableLinkedHashBase_getData";
@pragma("vm:external-name", "ImmutableLinkedHashBase_getData")
external List<Object?> get _data;
// The index is nullable rather than not nullable.
@pragma("vm:recognized", "other")
@pragma("vm:prefer-inline")
Uint32List? get _indexNullable native "ImmutableLinkedHashBase_getIndex";
@pragma("vm:external-name", "ImmutableLinkedHashBase_getIndex")
external Uint32List? get _indexNullable;
Uint32List get _index => _indexNullable!;
// Uses store-release atomic.
@pragma("vm:recognized", "other")
@pragma("vm:prefer-inline")
void set _index(Uint32List value)
native "ImmutableLinkedHashBase_setIndexStoreRelease";
@pragma("vm:external-name", "ImmutableLinkedHashBase_setIndexStoreRelease")
external void set _index(Uint32List value);
}
// This mixin can be applied to _HashFieldBase or _HashVMBase (for

View file

@ -105,7 +105,9 @@ class CodeUnits extends UnmodifiableListBase<int> {
///
/// On a library, it provides a Uri that can be used to locate the native
/// library's implementation.
@pragma('vm:entry-point')
class ExternalName {
@pragma('vm:entry-point')
final String name;
const ExternalName(this.name);
}