summaryrefslogtreecommitdiffstats
path: root/runtime/arch/arm64/quick_entrypoints_arm64.S
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-04-25 15:47:13 -0700
committerAndreas Gampe <agampe@google.com>2014-04-29 11:15:23 -0700
commit00c1e6d5fa6c2c20f25c38591b9780114bf7ddbf (patch)
tree0f36643a48cf4dcfb629f83f0e730b254a04b6b7 /runtime/arch/arm64/quick_entrypoints_arm64.S
parentcb905718826da268d8d8e09296806256f202c9f4 (diff)
downloadart-00c1e6d5fa6c2c20f25c38591b9780114bf7ddbf.zip
art-00c1e6d5fa6c2c20f25c38591b9780114bf7ddbf.tar.gz
art-00c1e6d5fa6c2c20f25c38591b9780114bf7ddbf.tar.bz2
Add ARM64 & X86_64 Assembly, plus tests
This adds assembly code or removes UNTESTED annotation from TWO_ARG_DOWNCALLand THREE_ARG_DOWNCALL macros and supporting code, generating working allocation stubs. Some object and array allocation tests are added to the stub_test. Change-Id: I5e93b7543c1e6dbd33b0d4cf564c7cbd963e74ef
Diffstat (limited to 'runtime/arch/arm64/quick_entrypoints_arm64.S')
-rw-r--r--runtime/arch/arm64/quick_entrypoints_arm64.S63
1 files changed, 58 insertions, 5 deletions
diff --git a/runtime/arch/arm64/quick_entrypoints_arm64.S b/runtime/arch/arm64/quick_entrypoints_arm64.S
index 71f5bf7..2083051 100644
--- a/runtime/arch/arm64/quick_entrypoints_arm64.S
+++ b/runtime/arch/arm64/quick_entrypoints_arm64.S
@@ -158,7 +158,42 @@
.endm
.macro RESTORE_REF_ONLY_CALLEE_SAVE_FRAME
- brk 0
+ // FP callee saves
+ ldp d8, d9, [sp, #8]
+ ldp d10, d11, [sp, #24]
+ ldp d12, d13, [sp, #40]
+ ldp d14, d15, [sp, #56]
+
+ // Callee saved.
+ ldp xSELF, x19, [sp, #72]
+ .cfi_restore x18
+ .cfi_restore x19
+
+ ldp x20, x21, [sp, #88]
+ .cfi_restore x20
+ .cfi_restore x21
+
+ ldp x22, x23, [sp, #104]
+ .cfi_restore x22
+ .cfi_restore x23
+
+ ldp x24, x25, [sp, #120]
+ .cfi_restore x24
+ .cfi_restore x25
+
+ ldp x26, x27, [sp, #136]
+ .cfi_restore x26
+ .cfi_restore x27
+
+ ldp x28, xFP, [sp, #152] // Save FP.
+ .cfi_restore x28
+ .cfi_restore x29
+
+ ldr xLR, [sp, #168]
+ .cfi_restore x30
+
+ add sp, sp, #176
+ .cfi_adjust_cfa_offset -176
.endm
.macro RESTORE_REF_ONLY_CALLEE_SAVE_FRAME_AND_RETURN
@@ -359,11 +394,15 @@
.endm
.macro RETURN_IF_RESULT_IS_ZERO
- brk 0
+ cbnz x0, 1f // result non-zero branch over
+ ret // return
+1:
.endm
.macro RETURN_IF_RESULT_IS_NON_ZERO
- brk 0
+ cbz x0, 1f // result zero branch over
+ ret // return
+1:
.endm
/*
@@ -1008,18 +1047,32 @@ UNIMPLEMENTED art_quick_set_obj_instance
UNIMPLEMENTED art_quick_resolve_string
// Macro to facilitate adding new allocation entrypoints.
+// TODO: xSELF -> x19. Temporarily rely on xSELF being saved in REF_ONLY
.macro TWO_ARG_DOWNCALL name, entrypoint, return
.extern \entrypoint
ENTRY \name
- brk 0
+ SETUP_REF_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC
+ mov x2, xSELF // pass Thread::Current
+ mov x3, sp // pass SP
+ bl \entrypoint // (uint32_t type_idx, Method* method, Thread*, SP)
+ RESTORE_REF_ONLY_CALLEE_SAVE_FRAME
+ \return
+ DELIVER_PENDING_EXCEPTION
END \name
.endm
// Macro to facilitate adding new array allocation entrypoints.
+// TODO: xSELF -> x19. Temporarily rely on xSELF being saved in REF_ONLY
.macro THREE_ARG_DOWNCALL name, entrypoint, return
.extern \entrypoint
ENTRY \name
- brk 0
+ SETUP_REF_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC
+ mov x3, xSELF // pass Thread::Current
+ mov x4, sp // pass SP
+ bl \entrypoint
+ RESTORE_REF_ONLY_CALLEE_SAVE_FRAME
+ \return
+ DELIVER_PENDING_EXCEPTION
END \name
.endm