b277407152
For structs, we were already loading the size of the struct at runtime for the size of the memcopy. This CL makes that work for the `Array`s as well. TEST=pkg/vm/testcases/transformations/ffi/regress_62087.dart TEST=tests/ffi/native_assets/asset_absolute_test.dart Closes: https://github.com/dart-lang/sdk/issues/62087 Change-Id: I15a5796d713879a613971e080d18101111704b9b Cq-Include-Trybots: dart/try:vm-aot-linux-debug-arm64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-debug-arm64-try,vm-aot-mac-debug-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-x64-try,vm-aot-win-debug-x64c-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-asan-mac-release-arm64-try,vm-asan-win-release-x64-try,vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try,vm-ffi-dyn-mac-debug-simarm64_arm64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-tsan-mac-release-arm64-try,vm-ubsan-linux-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-ubsan-mac-release-arm64-try,vm-ubsan-win-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464706 Reviewed-by: Tess Strickland <sstrickl@google.com> Reviewed-by: Michael Goderbauer <goderbauer@google.com>
14 lines
651 B
C
14 lines
651 B
C
// Copyright (c) 2023, 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.
|
|
#include "ffi_test_fields.h"
|
|
|
|
DART_EXPORT_FIELD int32_t globalInt;
|
|
DART_EXPORT_FIELD struct Coord globalStruct;
|
|
DART_EXPORT_FIELD const char* globalString = "Hello Dart!";
|
|
DART_EXPORT_FIELD int globalArray[] = {1, 2, 3};
|
|
DART_EXPORT_FIELD double identity3x3[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
|
|
DART_EXPORT_FIELD struct Coord globalStructArray[] = {
|
|
{.x = 1.0, .y = 2.0, .next = 0x0},
|
|
{.x = 3.0, .y = 4.0, .next = 0x0}};
|