eb50c2683c
This CL * adds a `kind` to `CheckWritableInstr`, * starts using `CheckWritableInstr` in JIT mode, and * adds support for `CheckWritableInstr` ia32. TEST=tests/ffi/vmspecific_native_finalizer_deeply_immutable_test.dart Closes: https://github.com/dart-lang/sdk/issues/55067 Change-Id: I0b397daba12cfc8b885401169889f7cd7c040166 Cq-Include-Trybots: dart-internal/g3.dart-internal.try:g3-cbuild-try Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64c-try,vm-aot-win-release-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359223 Auto-Submit: Daco Harkes <dacoharkes@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com>
30 lines
783 B
Dart
30 lines
783 B
Dart
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
//
|
|
// SharedObjects=ffi_test_functions
|
|
|
|
import 'dart:ffi';
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
import 'dylib_utils.dart';
|
|
import 'ffi_test_helpers.dart';
|
|
|
|
void main() {
|
|
testAttachDeeplyImmutableThrows();
|
|
}
|
|
|
|
DynamicLibrary ffiTestFunctions = dlopenPlatformSpecific("ffi_test_functions");
|
|
|
|
@pragma('vm:deeply-immutable')
|
|
final class MyFinalizable implements Finalizable {}
|
|
|
|
void testAttachDeeplyImmutableThrows() {
|
|
final myFinalizable = MyFinalizable();
|
|
|
|
Expect.throwsUnsupportedError(
|
|
() => setTokenFinalizer.attach(myFinalizable, nullptr.cast()),
|
|
);
|
|
}
|