OSDN Git Service

Last patch for running tests on ARM64
authorAndreas Gampe <agampe@google.com>
Wed, 26 Mar 2014 21:53:21 +0000 (14:53 -0700)
committerAndreas Gampe <agampe@google.com>
Thu, 27 Mar 2014 15:09:48 +0000 (08:09 -0700)
This allows all run-tests to succeed with the interpreter+GenJNI
setup.

Change-Id: I45734e7e57340439369a613ef4329e3be2c0c4c9

runtime/arch/arm64/quick_entrypoints_arm64.S
runtime/thread.h

index 447854f..3082273 100644 (file)
     .cfi_adjust_cfa_offset -304
 .endm
 
+.macro RESTORE_REF_AND_ARGS_CALLEE_SAVE_FRAME_NO_D0
+
+    ldr d1,   [sp, #24]
+    ldp d2, d3,   [sp, #32]
+    ldp d4, d5,   [sp, #48]
+    ldp d6, d7,   [sp, #64]
+    ldp d8, d9,   [sp, #80]
+    ldp d10, d11, [sp, #96]
+    ldp d12, d13, [sp, #112]
+    ldp d14, d15, [sp, #128]
+
+    // args.
+    ldp x1,  x2, [sp, #144]
+    ldp x3,  x4, [sp, #160]
+    ldp x5,  x6, [sp, #176]
+    ldp x7,  xSELF, [sp, #192]
+    ldp x19, x20, [sp, #208]
+    ldp x21, x22, [sp, #224]
+    ldp x23, x24, [sp, #240]
+    ldp x25, x26, [sp, #256]
+    ldp x27, x28, [sp, #272]
+    ldp xFP, xLR, [sp, #288]
+
+    add sp, sp, #304
+    .cfi_adjust_cfa_offset -304
+.endm
+
 .macro RETURN_IF_RESULT_IS_ZERO
     brk 0
 .endm
@@ -876,11 +903,27 @@ GENERATE_ALL_ALLOC_ENTRYPOINTS
 
 UNIMPLEMENTED art_quick_test_suspend
 
-/**
- * Returned by ClassLinker::GetOatCodeFor
- *
- */
-UNIMPLEMENTED art_quick_proxy_invoke_handler
+     /*
+     * Called by managed code that is attempting to call a method on a proxy class. On entry
+     * x0 holds the proxy method and x1 holds the receiver; The frame size of the invoked proxy
+     * method agrees with a ref and args callee save frame.
+     */
+     .extern artQuickProxyInvokeHandler
+ENTRY art_quick_proxy_invoke_handler
+    SETUP_REF_AND_ARGS_CALLEE_SAVE_FRAME
+    str     x0, [sp, #0]                // place proxy method at bottom of frame
+    mov     x2, xSELF                   // pass Thread::Current
+    mov     x3, sp                      // pass SP
+    bl      artQuickProxyInvokeHandler  // (Method* proxy method, receiver, Thread*, SP)
+    ldr  xSELF, [sp, #200]              // Restore self pointer.
+    ldr     x2, [xSELF, THREAD_EXCEPTION_OFFSET]
+    cbnz    x2, .Lexception_in_proxy    // success if no exception is pending
+    RESTORE_REF_AND_ARGS_CALLEE_SAVE_FRAME_NO_D0 // keep d0
+    ret                                 // return on success
+.Lexception_in_proxy:
+    RESTORE_REF_AND_ARGS_CALLEE_SAVE_FRAME
+    DELIVER_PENDING_EXCEPTION
+END art_quick_proxy_invoke_handler
 
 UNIMPLEMENTED art_quick_imt_conflict_trampoline
 
index b063b1e..32875e6 100644 (file)
@@ -95,9 +95,13 @@ enum ThreadFlag {
 class PACKED(4) Thread {
  public:
   // Space to throw a StackOverflowError in.
-#if __LP64__
   // TODO: shrink reserved space, in particular for 64bit.
+#if defined(__x86_64__)
   static constexpr size_t kStackOverflowReservedBytes = 24 * KB;
+#elif defined(__aarch64__)
+  // Worst-case, we would need about 2.6x the amount of x86_64 for many more registers.
+  // But this one works rather well.
+  static constexpr size_t kStackOverflowReservedBytes = 32 * KB;
 #else
   static constexpr size_t kStackOverflowReservedBytes = 16 * KB;
 #endif