Revert "Reland "[vm/ffi] SimDBC on Arm64 Android""

This reverts commit a515a0c256.

Reason for revert: There are still issues here, the flutter engine build for ios_debug again fails with this error:
ld: warning: arm64 function not 4-byte aligned: FfiTrampolineCall from obj/third_party/dart/runtime/vm/compiler/libdart_vm_jit.ffi_dbc_trampoline_arm64.o
ld: warning: arm64 function not 4-byte aligned: .loop from obj/third_party/dart/runtime/vm/compiler/libdart_vm_jit.ffi_dbc_trampoline_arm64.o
ld: warning: arm64 function not 4-byte aligned: .done from obj/third_party/dart/runtime/vm/compiler/libdart_vm_jit.ffi_dbc_trampoline_arm64.o
Undefined symbols for architecture arm64:
  "_FfiTrampolineCall", referenced from:
      dart::Simulator::Call(dart::Code const&, dart::Array const&, dart::Array const&, dart::Thread*) in libdart_vm_jit.simulator_dbc.o
ld: symbol(s) not found for architecture arm64

Original change's description:
> Reland "[vm/ffi] SimDBC on Arm64 Android"
> 
> This reverts commit 0abff7b2bb and fixes the assembly file.
> 
> Change-Id: Ibef58c932c843aebb4de227ac5fc7664d463173f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107746
> Auto-Submit: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TBR=sjindel@google.com,asiva@google.com,dacoharkes@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia5fd52180f7d9dfce588db361ce17dfb6f05254d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108206
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Siva Annamalai 2019-07-04 00:57:23 +00:00
parent 02fe07bbd3
commit b5aeaa6796
5 changed files with 6 additions and 76 deletions

View file

@ -152,12 +152,9 @@ compiler_sources = [
#
# Not that this diverges from our convention to build every file on every OS
# but have ifdef guards which make the files empty on some configurations.
if (!is_win) {
if (is_linux || is_mac) {
# MASM on Windows does not support c preproccesor style flags.
compiler_sources += [
"ffi_dbc_trampoline_arm64.S",
"ffi_dbc_trampoline_x64_linux_mac.S",
]
compiler_sources += [ "ffi_dbc_trampoline_x64_linux_mac.S" ]
}
compiler_sources_tests = [

View file

@ -9,8 +9,7 @@
namespace dart {
#if !defined(HOST_OS_WINDOWS) && \
(defined(HOST_ARCH_X64) || defined(HOST_ARCH_ARM64))
#if defined(HOST_ARCH_X64) && !defined(HOST_OS_WINDOWS)
// Generic Trampoline for DBC dart:ffi calls. Argument needs to be layed out as
// a FfiMarshalledArguments.

View file

@ -1,65 +0,0 @@
#if defined(__aarch64__) /* HOST_ARCH_ARM64 */
.text
.global FfiTrampolineCall
FfiTrampolineCall:
/* Save argument in scratch register. */
stp x19, x20, [sp, #-16]! /* Push x19 and x20, we use x19 as scratch. */
mov x19, x0 /* Save argument in scratch register. */
/* Enter frame. */
stp fp, lr, [sp, #-16]!
mov fp, sp
/* Reserve framespace for arguments. */
ldr x9, [x19, #(8*18)] /* Load number of stack arguments. */
lsl x9, x9, #3 /* Multiply by size (8 bytes). */
sub sp, sp, x9 /* Reserve num_stack_args stack slots. */
/* Stack alignment. */
ldr x10, [x19, #(8*17)] /* Load stack alignment mask. */
mov x11, sp
and x11, x11, x10 /* Align stack. */
mov sp, x11
/* Copy stack arguments. */
cmp x9, #0 /* Check if number of stack arguments is 0. */
beq .done /* Skip loop if no stack arguments. */
add x19, x19, #(8*19) /* Offset r19 to point to stack arguments. */
.loop: /* Copy stack arguments loop. */
sub x9, x9, #8 /* Decrement stack argument iterator. */
ldr x10, [x19, x9] /* Load value from ffi_marshalled_args. */
str x10, [sp, x9] /* Store value on stack. */
cmp x9, #0 /* Compare iterator with 0 */
bne .loop /* Loop while iterator is not 0 */
sub x19, x19, #(8*19) /* Restore r19 to original value. */
.done: /* End stack arguments loop. */
/* Copy registers and fpu registers. */
ldp x0, x1, [x19, #(8*1)] /* and #(8*2) */
ldp x2, x3, [x19, #(8*3)] /* and #(8*4) */
ldp x4, x5, [x19, #(8*5)] /* ... */
ldp x6, x7, [x19, #(8*7)]
ldp d0, d1, [x19, #(8*9)]
ldp d2, d3, [x19, #(8*11)]
ldp d4, d5, [x19, #(8*13)]
ldp d6, d7, [x19, #(8*15)]
/* Do call. */
ldr x9, [x19] /* Load function address. */
blr x9 /* Call the function. */
/* Copy results back. */
str x0, [x19, #(8*0)] /* Move integer result in kOffsetIntResult. */
str d0, [x19, #(8*1)] /* Move double result in kOffsetDoubleResult. */
/* Leave frame. */
mov sp, fp
ldp fp, lr, [sp], #16
/* Restore caller saved register. */
ldp x19, x20, [sp], #16 /* Pop x19 and x20. */
ret
#endif /* HOST_ARCH_ARM64 */

View file

@ -300,9 +300,8 @@ class Api : AllStatic {
#if defined(TARGET_ARCH_DBC) && !defined(ARCH_IS_64_BIT)
// TODO(36809): Support SimDBC32.
return false;
#elif defined(TARGET_ARCH_DBC) && \
!(defined(HOST_ARCH_X64) || defined(HOST_ARCH_ARM64))
// TODO(36809): Support ia32 and arm.
#elif defined(TARGET_ARCH_DBC) && !defined(HOST_ARCH_X64)
// TODO(35773): Support ia32, arm64, and arm.
return false;
#elif defined(TARGET_ARCH_DBC) && defined(HOST_ARCH_X64) && \
defined(HOST_OS_WINDOWS)

View file

@ -24,7 +24,7 @@ function_callbacks_test/03: Skip
[ $arch == arm && $system != android ]
*: Skip # "hardfp" calling convention is not yet supported (iOS is also supported but not tested): dartbug.com/36309
[ $arch == simdbc64 && $system != android && $system != linux && $system != macos ]
[ $arch == simdbc64 && $system != linux && $system != macos ]
*: Skip # FFI not yet supported outside x64 Linux: dartbug.com/36809
[ $runtime != dart_precompiled && $runtime != vm ]