ObjFW  Check-in [9ce5b241e4]

Overview
Comment:Add forwardingTargetForSelector: for PowerPC/ELF.

Methods returning structs are not yet supported.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9ce5b241e4745f8a4ec3e4973d24c356105563377eef18a4fa7d0cf375483309
User & Date: js on 2013-07-30 21:41:31
Other Links: manifest | tags
Context
2013-07-30
21:46
Fix two typos. check-in: 1790183411 user: js tags: trunk
21:41
Add forwardingTargetForSelector: for PowerPC/ELF. check-in: 9ce5b241e4 user: js tags: trunk
18:19
Clean up and fix apple-forwarding-ppc.S. check-in: 89d2a3b231 user: js tags: trunk
Changes

Modified src/OFObject.h from [c0a893a0e3] to [a8241891a0].

102
103
104
105
106
107
108



109
110
111
112
113
114
115
#  if defined(__amd64__) || defined(__x86_64__) || defined(__i386__) || \
    defined(__arm__) || defined(__ARM__)
#   define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#   if __has_feature(objc_msg_lookup_stret)
#    define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET
#   endif
#  endif



#  if (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
    (defined(__mips_eabi) && _MIPS_SZPTR == 32)
#   define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#  endif
# endif
#endif








>
>
>







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#  if defined(__amd64__) || defined(__x86_64__) || defined(__i386__) || \
    defined(__arm__) || defined(__ARM__)
#   define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#   if __has_feature(objc_msg_lookup_stret)
#    define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET
#   endif
#  endif
#  if defined(__ppc__) || defined(__PPC__)
#   define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#  endif
#  if (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
    (defined(__mips_eabi) && _MIPS_SZPTR == 32)
#   define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#  endif
# endif
#endif

Added src/forwarding-ppc-elf.S version [6cfdfe7134].









































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

.globl of_forward
.globl of_forward_stret

.section .text
of_forward:
of_forward_stret: /* FIXME */
	stwu	%r1, -112(%r1)
	mflr	%r0
	stw	%r0, 116(%r1)

	/* Save all arguments */
	stw	%r3, 4(%r1)
	stw	%r4, 8(%r1)
	stw	%r5, 12(%r1)
	stw	%r6, 16(%r1)
	stw	%r7, 20(%r1)
	stw	%r8, 24(%r1)
	stw	%r9, 28(%r1)
	stw	%r10, 32(%r1)

	/* Save all floating point arguments */
	stfd	%f1, 40(%r1)
	stfd	%f2, 48(%r1)
	stfd	%f3, 56(%r1)
	stfd	%f4, 64(%r1)
	stfd	%f5, 72(%r1)
	stfd	%f6, 80(%r1)
	stfd	%f7, 88(%r1)
	stfd	%f8, 96(%r1)

	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	bl	objc_msg_lookup@plt
	mtctr	%r3

	lwz	%r3, 4(%r1)
	lis	%r4, sel_forwardingTargetForSelector_@ha
	la	%r4, sel_forwardingTargetForSelector_@l(%r4)
	lwz	%r5, 8(%r1)
	bctrl
	stw	%r3, 4(%r1)

	lwz	%r4, 8(%r1)
	bl	objc_msg_lookup@plt
	mtctr	%r3

	/* Restore all arguments */
	lwz	%r3, 4(%r1)
	lwz	%r4, 8(%r1)
	lwz	%r5, 12(%r1)
	lwz	%r6, 16(%r1)
	lwz	%r7, 20(%r1)
	lwz	%r8, 24(%r1)
	lwz	%r9, 28(%r1)
	lwz	%r10, 32(%r1)

	/* Restore all floating point arguments */
	lfd	%f1, 40(%r1)
	lfd	%f2, 48(%r1)
	lfd	%f3, 56(%r1)
	lfd	%f4, 64(%r1)
	lfd	%f5, 72(%r1)
	lfd	%f6, 80(%r1)
	lfd	%f7, 88(%r1)
	lfd	%f8, 96(%r1)

	lwz	%r0, 116(%r1)
	mtlr	%r0
	addi	%r1, %r1, 112
	bctr
.type of_forward, %function
.size of_forward, .-of_forward

init:
	lis	%r3, module@ha
	la	%r3, module@l(%r3)
	b	__objc_exec_class@plt

.section .ctors, "a", %progbits
	.long init

.section .rodata
str_forwardingTargetForSelector_:
	.asciz "forwardingTargetForSelector:"

.section .data
sel_forwardingTargetForSelector_:
	.long str_forwardingTargetForSelector_, 0
	.long 0, 0
symtab:
	.long 0, sel_forwardingTargetForSelector_
	.short 0, 0
	.long 0
	.long 0
module:
	.long 8, 16, 0, symtab

#ifdef __linux__
.section .note.GNU-stack, "", %progbits
#endif

Modified src/forwarding.S from [810ae34c05] to [4eb0272be1].

30
31
32
33
34
35
36


37
38
39
40
41
42
# ifdef __ELF__
#  if defined(__amd64__) || defined(__x86_64__)
#   include "forwarding-amd64-elf.S"
#  elif defined(__i386__)
#   include "forwarding-x86-elf.S"
#  elif defined(__arm__) || defined(__ARM__)
#   include "forwarding-arm-elf.S"


#  elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
    (defined(__mips_eabi) && _MIPS_SZPTR == 32)
#   include "forwarding-mips-elf.S"
#  endif
# endif
#endif







>
>






30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# ifdef __ELF__
#  if defined(__amd64__) || defined(__x86_64__)
#   include "forwarding-amd64-elf.S"
#  elif defined(__i386__)
#   include "forwarding-x86-elf.S"
#  elif defined(__arm__) || defined(__ARM__)
#   include "forwarding-arm-elf.S"
#  elif defined(__ppc__) || defined(__PPC__)
#   include "forwarding-ppc-elf.S"
#  elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
    (defined(__mips_eabi) && _MIPS_SZPTR == 32)
#   include "forwarding-mips-elf.S"
#  endif
# endif
#endif

Modified src/runtime/lookup-asm-amd64-elf.S from [fe840622a9] to [0076c67932].

70
71
72
73
74
75
76
77
78
79
80
81
82
generate_lookup_super objc_msg_lookup_super_stret objc_msg_lookup_stret

ret_nil:
	leaq	nil_method(%rip), %rax
	ret

nil_method:
	movq	%rdi, %rax
	ret

#ifdef __linux__
.section .note.GNU-stack, "", %progbits
#endif







|





70
71
72
73
74
75
76
77
78
79
80
81
82
generate_lookup_super objc_msg_lookup_super_stret objc_msg_lookup_stret

ret_nil:
	leaq	nil_method(%rip), %rax
	ret

nil_method:
	xorq	%rax, %rax
	ret

#ifdef __linux__
.section .note.GNU-stack, "", %progbits
#endif

Modified src/runtime/lookup-asm-x86-elf.S from [687ef6e3ff] to [483507fb77].

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
ret_nil:
	call	get_eip
.L0:
	addl	$nil_method-.L0, %eax
	ret

nil_method:
	movl	4(%esp), %eax
	ret

get_eip:
	movl	(%esp), %eax
	ret

#ifdef __linux__







|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
ret_nil:
	call	get_eip
.L0:
	addl	$nil_method-.L0, %eax
	ret

nil_method:
	xorl	%eax, %eax
	ret

get_eip:
	movl	(%esp), %eax
	ret

#ifdef __linux__

Modified src/runtime/lookup-asm.S from [07a7cb7488] to [4df371ebd5].

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "config.h"

#if defined(__ELF__)
# if defined(__amd64__) || defined(__x86_64__)
#  include "lookup-asm-amd64-elf.S"
# elif defined(__i386__)
#  include "lookup-asm-x86-elf.S"
# elif defined(__ppc__) || defined(__PPC__)
#  include "lookup-asm-ppc-elf.S"
# elif defined(__arm__) || defined(__ARM__)
#  include "lookup-asm-arm-elf.S"
# elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
    (defined(__mips_eabi) && _MIPS_SZPTR == 32)
#  include "lookup-asm-mips-elf.S"
# endif
#elif defined(__MACH__)
# if defined(__amd64__) || defined(__x86_64__)
#  include "lookup-asm-amd64-macho.S"







|
|
|
|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "config.h"

#if defined(__ELF__)
# if defined(__amd64__) || defined(__x86_64__)
#  include "lookup-asm-amd64-elf.S"
# elif defined(__i386__)
#  include "lookup-asm-x86-elf.S"
# elif defined(__arm__) || defined(__ARM__)
#  include "lookup-asm-arm-elf.S"
# elif defined(__ppc__) || defined(__PPC__)
#  include "lookup-asm-ppc-elf.S"
# elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
    (defined(__mips_eabi) && _MIPS_SZPTR == 32)
#  include "lookup-asm-mips-elf.S"
# endif
#elif defined(__MACH__)
# if defined(__amd64__) || defined(__x86_64__)
#  include "lookup-asm-amd64-macho.S"