]> git.saurik.com Git - apple/objc4.git/blob - runtime/Auto.subproj/objc-auto-x86_64.s
objc4-532.tar.gz
[apple/objc4.git] / runtime / Auto.subproj / objc-auto-x86_64.s
1 /*
2 * Copyright (c) 2006-2007 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #error not currently used
25
26 #ifdef __x86_64__
27
28 /*
29 This file defines the non-GC variants of objc_assign_* on a dedicated
30 page in the (__DATA,__data) section. At load time under GC, each
31 routine is overwritten with a jump to its GC variant. It is necessary
32 for these routines to exist on a dedicated page for vm_protect to
33 work properly in the GC case. The page exists in the data segment to
34 reduce the kernel's page table overhead.
35
36 Note: To avoid wasting more space than necessary at runtime, this file
37 must not contain anything other than the objc_assign_* routines.
38 */
39
40 .data
41 .align 12 // align to page boundary
42
43 // id objc_assign_ivar(id value, id dest, ptrdiff_t offset);
44 .globl _objc_assign_ivar
45 _objc_assign_ivar:
46 pushq %rbp
47 movq %rsp,%rbp
48 movq %rdi,(%rsi,%rdx) // *(dest + offset) = value);
49 movq %rdi,%rax // return value;
50 leave
51 ret
52
53 // id objc_assign_global(id value, id *dest);
54 .globl _objc_assign_global
55 _objc_assign_global:
56 pushq %rbp
57 movq %rsp,%rbp
58 movq %rdi,(%rsi) // *(dest = value);
59 movq %rdi,%rax // return value;
60 leave
61 ret
62
63 // id objc_assign_threadlocal(id value, id *dest);
64 .globl _objc_assign_threadlocal
65 _objc_assign_threadlocal:
66 pushq %rbp
67 movq %rsp,%rbp
68 movq %rdi,(%rsi) // *(dest = value);
69 movq %rdi,%rax // return value;
70 leave
71 ret
72
73 // As of OS X 10.5, objc_assign_strongCast_non_gc is identical to
74 // objc_assign_global_non_gc.
75
76 // id objc_assign_strongCast(id value, id *dest);
77 .globl _objc_assign_strongCast
78 _objc_assign_strongCast:
79 pushq %rbp
80 movq %rsp,%rbp
81 movq %rdi,(%rsi) // *(dest = value);
82 movq %rdi,%rax // return value;
83 leave
84 ret
85
86 // Claim the remainder of the page.
87 .align 12, 0
88
89 #endif