Revert part of "[vm] Allow sharing of deeply immutable lists across isolates"

It did have noticable xx% performance regression on

  ListCopy.List.int.unmodifiable.100

TEST=ci

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

Change-Id: I160d7cc98aee2e064b1767519f4b5033656ee115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282400
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
Martin Kustermann 2023-02-10 20:25:59 +00:00 committed by Commit Queue
parent 1afb59f8ec
commit fae934c4b1
3 changed files with 0 additions and 71 deletions

View file

@ -90,17 +90,6 @@ DEFINE_NATIVE_ENTRY(Internal_makeListFixedLength, 0, 1) {
DEFINE_NATIVE_ENTRY(Internal_makeFixedListUnmodifiable, 0, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(Array, array, arguments->NativeArgAt(0));
array.MakeImmutable();
const intptr_t len = array.Length();
bool is_deeply_immutable = true;
for (intptr_t i = 0; i < len; ++i) {
if (!CanShareObjectAcrossIsolates(array.At(i))) {
is_deeply_immutable = false;
break;
}
}
if (is_deeply_immutable) {
array.SetImmutable();
}
return array.ptr();
}

View file

@ -111,7 +111,6 @@ class SendReceiveTest extends SendReceiveTestBase {
await testSharable2();
await testCopyableClosures();
await testSharableTypedData();
await testUnmodifiableList();
}
Future testSharable() async {
@ -177,35 +176,6 @@ class SendReceiveTest extends SendReceiveTestBase {
malloc.free(bytes);
}
Future testUnmodifiableList() async {
print('testUnmodifiableList');
// Sharable.
for (final sharable in [
1,
const Object(),
'foo',
List.unmodifiable([const Object()])
]) {
final list = List.unmodifiable([sharable]);
final listCopy = await sendReceive(list);
Expect.identical(list, listCopy);
}
// Non-Sharable.
for (final nonSharable in [
Object(),
[],
{},
List.unmodifiable([Object()])
]) {
final list = List.unmodifiable([nonSharable]);
final listCopy = await sendReceive(list);
Expect.notIdentical(list, listCopy);
Expect.notIdentical(list[0], listCopy[0]);
}
}
}
main() async {

View file

@ -111,7 +111,6 @@ class SendReceiveTest extends SendReceiveTestBase {
await testSharable();
await testSharable2();
await testCopyableClosures();
await testUnmodifiableList();
}
Future testSharable() async {
@ -159,35 +158,6 @@ class SendReceiveTest extends SendReceiveTestBase {
Expect.equals(copyableClosures[i].runtimeType, copy2[i].runtimeType);
}
}
Future testUnmodifiableList() async {
print('testUnmodifiableList');
// Sharable.
for (final sharable in [
1,
const Object(),
'foo',
List.unmodifiable([const Object()])
]) {
final list = List.unmodifiable([sharable]);
final listCopy = await sendReceive(list);
Expect.identical(list, listCopy);
}
// Non-Sharable.
for (final nonSharable in [
Object(),
[],
{},
List.unmodifiable([Object()])
]) {
final list = List.unmodifiable([nonSharable]);
final listCopy = await sendReceive(list);
Expect.notIdentical(list, listCopy);
Expect.notIdentical(list[0], listCopy[0]);
}
}
}
main() async {