Files
sdk/runtime/tests/vm/dart/aot_patching_enabled_test.dart
T
Tony 08139af589 Add compact AOT patching support and related APIs
- Introduced Dart_SetObfuscationMap to restore obfuscation maps before AOT precompilation.
- Added Dart_AotPatchInstallOptions structure for AOT patch installation options.
- Implemented Dart_AotPatchingEnabled to check if compact AOT patching is supported.
- Created Dart_SetAotPatchKeyCallback for AES key resolution during AOT patch installation.
- Developed Dart_InstallAotPatch for validating and installing encrypted AOT patches.
- Added Dart_FreeAotPatchPayload to free memory allocated for patch payloads.
- Updated runtime_args.gni to include dart_enable_aot_patching flag.
- Added tests for AOT patching functionality and ensured exported symbols include new APIs.
- Refactored existing code to accommodate new AOT patching features and improve error handling.
2026-06-24 03:00:14 +08:00

25 lines
895 B
Dart

// Copyright (c) 2026, 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.
// Verifies that the compact AOT patching API is exported and callable without
// enabling DART_DYNAMIC_MODULES or the bytecode interpreter.
import 'dart:ffi';
import 'package:expect/expect.dart';
typedef DartAotPatchingEnabledNative = Bool Function();
typedef DartAotPatchingEnabled = bool Function();
void main() {
final enabled = DynamicLibrary.executable()
.lookupFunction<DartAotPatchingEnabledNative, DartAotPatchingEnabled>(
'Dart_AotPatchingEnabled',
)();
// The value depends on the build flag, but a successful call proves the API
// is present in both enabled and default builds.
Expect.isTrue(enabled == true || enabled == false);
}