Skip to content

Commit 881b875

Browse files
Apple Open Sourceopensource-apple
Apple Open Source
authored andcommitted
1 parent 3c4d3f8 commit 881b875

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+9678
-4087
lines changed

objc.xcodeproj/project.pbxproj

+60-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
834EC0A411614167009B2563 /* objc-abi.h in Headers */ = {isa = PBXBuildFile; fileRef = 834EC0A311614167009B2563 /* objc-abi.h */; settings = {ATTRIBUTES = (Private, ); }; };
3030
83725F4A14CA5BFA0014370E /* objc-opt.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83725F4914CA5BFA0014370E /* objc-opt.mm */; };
3131
83725F4C14CA5C210014370E /* objc-opt.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83725F4914CA5BFA0014370E /* objc-opt.mm */; };
32+
8379996E13CBAF6F007C2B5F /* a1a2-blocktramps-arm64.s in Sources */ = {isa = PBXBuildFile; fileRef = 8379996D13CBAF6F007C2B5F /* a1a2-blocktramps-arm64.s */; };
3233
8383A3A3122600E9009290B8 /* a1a2-blocktramps-arm.s in Sources */ = {isa = PBXBuildFile; fileRef = 8383A3A1122600E9009290B8 /* a1a2-blocktramps-arm.s */; };
3334
8383A3A4122600E9009290B8 /* a2a3-blocktramps-arm.s in Sources */ = {isa = PBXBuildFile; fileRef = 8383A3A2122600E9009290B8 /* a2a3-blocktramps-arm.s */; };
3435
8383A3AC122600FB009290B8 /* a1a2-blocktramps-arm.s in Sources */ = {isa = PBXBuildFile; fileRef = 8383A3A1122600E9009290B8 /* a1a2-blocktramps-arm.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; };
@@ -121,6 +122,10 @@
121122
83BE02E80FCCB24D00661494 /* objc-file-old.h in Headers */ = {isa = PBXBuildFile; fileRef = 83BE02E50FCCB24D00661494 /* objc-file-old.h */; };
122123
83BE02E90FCCB24D00661494 /* objc-file.h in Headers */ = {isa = PBXBuildFile; fileRef = 83BE02E60FCCB24D00661494 /* objc-file.h */; };
123124
83BE02EA0FCCB24D00661494 /* objc-runtime-old.h in Headers */ = {isa = PBXBuildFile; fileRef = 83BE02E70FCCB24D00661494 /* objc-runtime-old.h */; };
125+
83C9C3391668B50E00F4E544 /* objc-msg-simulator-x86_64.s in Sources */ = {isa = PBXBuildFile; fileRef = 83C9C3381668B50E00F4E544 /* objc-msg-simulator-x86_64.s */; };
126+
83C9C33A1668B56300F4E544 /* objc-msg-simulator-x86_64.s in Sources */ = {isa = PBXBuildFile; fileRef = 83C9C3381668B50E00F4E544 /* objc-msg-simulator-x86_64.s */; };
127+
83D49E4F13C7C84F0057F1DD /* objc-msg-arm64.s in Sources */ = {isa = PBXBuildFile; fileRef = 83D49E4E13C7C84F0057F1DD /* objc-msg-arm64.s */; };
128+
83D49E5013C7C84F0057F1DD /* objc-msg-arm64.s in Sources */ = {isa = PBXBuildFile; fileRef = 83D49E4E13C7C84F0057F1DD /* objc-msg-arm64.s */; };
124129
83E50CDB0FF19E8200D74C19 /* hashtable2.h in Headers */ = {isa = PBXBuildFile; fileRef = 838485B70D6D687300CEA253 /* hashtable2.h */; settings = {ATTRIBUTES = (Public, ); }; };
125130
83E50CDC0FF19E8200D74C19 /* maptable.h in Headers */ = {isa = PBXBuildFile; fileRef = 838485BB0D6D687300CEA253 /* maptable.h */; settings = {ATTRIBUTES = (Private, ); }; };
126131
83E50CDD0FF19E8200D74C19 /* objc-api.h in Headers */ = {isa = PBXBuildFile; fileRef = 838485C80D6D68A200CEA253 /* objc-api.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -205,6 +210,7 @@
205210
834DF8B615993EE1002F2BC9 /* objc-sel-old.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "objc-sel-old.mm"; path = "runtime/objc-sel-old.mm"; sourceTree = "<group>"; };
206211
834EC0A311614167009B2563 /* objc-abi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objc-abi.h"; path = "runtime/objc-abi.h"; sourceTree = "<group>"; };
207212
83725F4914CA5BFA0014370E /* objc-opt.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "objc-opt.mm"; path = "runtime/objc-opt.mm"; sourceTree = "<group>"; };
213+
8379996D13CBAF6F007C2B5F /* a1a2-blocktramps-arm64.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "a1a2-blocktramps-arm64.s"; path = "runtime/a1a2-blocktramps-arm64.s"; sourceTree = "<group>"; };
208214
8383A3A1122600E9009290B8 /* a1a2-blocktramps-arm.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "a1a2-blocktramps-arm.s"; path = "runtime/a1a2-blocktramps-arm.s"; sourceTree = "<group>"; };
209215
8383A3A2122600E9009290B8 /* a2a3-blocktramps-arm.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "a2a3-blocktramps-arm.s"; path = "runtime/a2a3-blocktramps-arm.s"; sourceTree = "<group>"; };
210216
838485B30D6D682B00CEA253 /* libobjc.order */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = libobjc.order; sourceTree = "<group>"; };
@@ -260,6 +266,8 @@
260266
83BE02E50FCCB24D00661494 /* objc-file-old.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objc-file-old.h"; path = "runtime/objc-file-old.h"; sourceTree = "<group>"; };
261267
83BE02E60FCCB24D00661494 /* objc-file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objc-file.h"; path = "runtime/objc-file.h"; sourceTree = "<group>"; };
262268
83BE02E70FCCB24D00661494 /* objc-runtime-old.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objc-runtime-old.h"; path = "runtime/objc-runtime-old.h"; sourceTree = "<group>"; };
269+
83C9C3381668B50E00F4E544 /* objc-msg-simulator-x86_64.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "objc-msg-simulator-x86_64.s"; path = "runtime/Messengers.subproj/objc-msg-simulator-x86_64.s"; sourceTree = "<group>"; };
270+
83D49E4E13C7C84F0057F1DD /* objc-msg-arm64.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "objc-msg-arm64.s"; path = "runtime/Messengers.subproj/objc-msg-arm64.s"; sourceTree = "<group>"; };
263271
83E50D2A0FF19E8200D74C19 /* libobjc.A.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libobjc.A.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
264272
83E50D2B0FF19E9E00D74C19 /* IndigoSDK.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = IndigoSDK.xcconfig; path = AppleInternal/XcodeConfig/IndigoSDK.xcconfig; sourceTree = DEVELOPER_DIR; };
265273
83EB007A121C9EC200B92C16 /* objc-sel-table.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "objc-sel-table.s"; path = "runtime/objc-sel-table.s"; sourceTree = "<group>"; };
@@ -361,13 +369,16 @@
361369
834DF8B615993EE1002F2BC9 /* objc-sel-old.mm */,
362370
838485EA0D6D68A200CEA253 /* objc-sync.mm */,
363371
838485EB0D6D68A200CEA253 /* objc-typeencoding.mm */,
372+
8379996D13CBAF6F007C2B5F /* a1a2-blocktramps-arm64.s */,
364373
E8923D9C116AB2820071B552 /* a1a2-blocktramps-i386.s */,
365374
E8923D9D116AB2820071B552 /* a1a2-blocktramps-x86_64.s */,
366375
E8923D9E116AB2820071B552 /* a2a3-blocktramps-i386.s */,
367376
E8923D9F116AB2820071B552 /* a2a3-blocktramps-x86_64.s */,
368377
830F2A690D737FB800392440 /* objc-msg-arm.s */,
378+
83D49E4E13C7C84F0057F1DD /* objc-msg-arm64.s */,
369379
830F2A6A0D737FB800392440 /* objc-msg-i386.s */,
370380
83B1A8BC0FF1AC0D0019EA5B /* objc-msg-simulator-i386.s */,
381+
83C9C3381668B50E00F4E544 /* objc-msg-simulator-x86_64.s */,
371382
830F2A720D737FB800392440 /* objc-msg-x86_64.s */,
372383
87BB4E900EC39633005D08E1 /* objc-probes.d */,
373384
);
@@ -582,6 +593,7 @@
582593
83E50CFC0FF19E8200D74C19 /* Sources */,
583594
83E50D240FF19E8200D74C19 /* Frameworks */,
584595
83E50D260FF19E8200D74C19 /* Run Script (symlink) */,
596+
96895502173DB369006D6747 /* Run Script (RC_HIDE_64) */,
585597
);
586598
buildRules = (
587599
);
@@ -601,6 +613,7 @@
601613
D289988505E68E00004EDB86 /* Frameworks */,
602614
830F2AB60D739AB600392440 /* Run Script (markgc) */,
603615
830F2AFA0D73BC5800392440 /* Run Script (symlink) */,
616+
96BF404516F7DC5300DA41F6 /* Run Script (RC_HIDE_64) */,
604617
);
605618
buildRules = (
606619
);
@@ -686,6 +699,34 @@
686699
shellPath = /bin/sh;
687700
shellScript = "cd \"${INSTALL_DIR}\"\n/bin/ln -s libobjc.A.dylib libobjc.dylib\n";
688701
};
702+
96895502173DB369006D6747 /* Run Script (RC_HIDE_64) */ = {
703+
isa = PBXShellScriptBuildPhase;
704+
buildActionMask = 8;
705+
files = (
706+
);
707+
inputPaths = (
708+
);
709+
name = "Run Script (RC_HIDE_64)";
710+
outputPaths = (
711+
);
712+
runOnlyForDeploymentPostprocessing = 1;
713+
shellPath = /bin/sh;
714+
shellScript = "cd \"${DSTROOT}\"\nif [ -n \"${RC_HIDE_64}\" ]\nthen\n find . -type f -name \"*.h\" | while read\n do\n unifdef -DOBJC_HIDE_64=1 -o \"$REPLY.tmp\" \"$REPLY\"\n sed 's/OBJC_ARM64_UNAVAILABLE//g' < \"$REPLY.tmp\" > \"$REPLY\"\n rm \"$REPLY.tmp\"\n done\nfi";
715+
};
716+
96BF404516F7DC5300DA41F6 /* Run Script (RC_HIDE_64) */ = {
717+
isa = PBXShellScriptBuildPhase;
718+
buildActionMask = 8;
719+
files = (
720+
);
721+
inputPaths = (
722+
);
723+
name = "Run Script (RC_HIDE_64)";
724+
outputPaths = (
725+
);
726+
runOnlyForDeploymentPostprocessing = 1;
727+
shellPath = /bin/sh;
728+
shellScript = "cd \"${DSTROOT}\"\nif [ -n \"${RC_HIDE_64}\" ]\nthen\n find . -type f -name \"*.h\" | while read\n do\n unifdef -DOBJC_HIDE_64=1 -o \"$REPLY.tmp\" \"$REPLY\"\n sed 's/OBJC_ARM64_UNAVAILABLE//g' < \"$REPLY.tmp\" > \"$REPLY\"\n rm \"$REPLY.tmp\"\n done\nfi";
729+
};
689730
/* End PBXShellScriptBuildPhase section */
690731

691732
/* Begin PBXSourcesBuildPhase section */
@@ -745,8 +786,10 @@
745786
8383A3D4122600FB009290B8 /* objc-probes.d in Sources */,
746787
8383A3DC1226291C009290B8 /* objc-externalref.mm in Sources */,
747788
39ABD72612F0B61800D1054C /* objc-weak.mm in Sources */,
789+
83D49E5013C7C84F0057F1DD /* objc-msg-arm64.s in Sources */,
748790
9672F7EF14D5F488007CEC96 /* NSObject.mm in Sources */,
749791
83725F4C14CA5C210014370E /* objc-opt.mm in Sources */,
792+
83C9C33A1668B56300F4E544 /* objc-msg-simulator-x86_64.s in Sources */,
750793
);
751794
runOnlyForDeploymentPostprocessing = 0;
752795
};
@@ -798,10 +841,13 @@
798841
8383A3A4122600E9009290B8 /* a2a3-blocktramps-arm.s in Sources */,
799842
399BC72E1224831B007FBDF0 /* objc-externalref.mm in Sources */,
800843
39ABD72412F0B61800D1054C /* objc-weak.mm in Sources */,
844+
83D49E4F13C7C84F0057F1DD /* objc-msg-arm64.s in Sources */,
845+
8379996E13CBAF6F007C2B5F /* a1a2-blocktramps-arm64.s in Sources */,
801846
9672F7EE14D5F488007CEC96 /* NSObject.mm in Sources */,
802847
83725F4A14CA5BFA0014370E /* objc-opt.mm in Sources */,
803848
83F550E0155E030800E95D3B /* objc-cache-old.mm in Sources */,
804849
834DF8B715993EE1002F2BC9 /* objc-sel-old.mm in Sources */,
850+
83C9C3391668B50E00F4E544 /* objc-msg-simulator-x86_64.s in Sources */,
805851
);
806852
runOnlyForDeploymentPostprocessing = 0;
807853
};
@@ -836,17 +882,22 @@
836882
"$(CONFIGURATION_BUILD_DIR)/usr/local/include/**",
837883
);
838884
INSTALL_PATH = /usr/lib;
839-
ORDER_FILE = libobjc.order;
885+
ORDER_FILE = "$(SDKROOT)/AppleInternal/OrderFiles/libobjc.order";
840886
OTHER_CFLAGS = (
841887
"-fdollars-in-identifiers",
842888
"$(OTHER_CFLAGS)",
843889
);
844-
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = "-lc++abi";
890+
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
891+
"-lc++abi",
892+
"-Wl,-segalign,0x4000",
893+
"-Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000",
894+
);
845895
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = "-l_BUILD_objc-simulator_TARGET_INSTEAD";
846896
"OTHER_LDFLAGS[sdk=macosx*]" = (
847897
"-lCrashReporterClient",
848898
"-lauto",
849899
"-lc++abi",
900+
"-Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000",
850901
);
851902
PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/objc;
852903
PRODUCT_NAME = objc.A;
@@ -870,17 +921,22 @@
870921
"$(CONFIGURATION_BUILD_DIR)/usr/local/include/**",
871922
);
872923
INSTALL_PATH = /usr/lib;
873-
ORDER_FILE = libobjc.order;
924+
ORDER_FILE = "$(SDKROOT)/AppleInternal/OrderFiles/libobjc.order";
874925
OTHER_CFLAGS = (
875926
"-fdollars-in-identifiers",
876927
"$(OTHER_CFLAGS)",
877928
);
878-
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = "-lc++abi";
929+
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
930+
"-lc++abi",
931+
"-Wl,-segalign,0x4000",
932+
"-Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000",
933+
);
879934
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = "-l_BUILD_objc-simulator_TARGET_INSTEAD";
880935
"OTHER_LDFLAGS[sdk=macosx*]" = (
881936
"-lCrashReporterClient",
882937
"-lauto",
883938
"-lc++abi",
939+
"-Xlinker -sectalign -Xlinker __DATA -Xlinker __objc_data -Xlinker 0x1000",
884940
);
885941
PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/objc;
886942
PRODUCT_NAME = objc.A;

runtime/Accessors.subproj/objc-accessors.mm

+9
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ - (id)mutableCopyWithZone:(void *)zone;
5757
#define MUTABLE_COPY 2
5858

5959
id objc_getProperty_non_gc(id self, SEL _cmd, ptrdiff_t offset, BOOL atomic) {
60+
if (offset == 0) {
61+
return object_getClass(self);
62+
}
63+
6064
// Retain release world
6165
id *slot = (id*) ((char*)self + offset);
6266
if (!atomic) return *slot;
@@ -76,6 +80,11 @@ id objc_getProperty_non_gc(id self, SEL _cmd, ptrdiff_t offset, BOOL atomic) {
7680

7781
static inline void reallySetProperty(id self, SEL _cmd, id newValue, ptrdiff_t offset, bool atomic, bool copy, bool mutableCopy)
7882
{
83+
if (offset == 0) {
84+
object_setClass(self, newValue);
85+
return;
86+
}
87+
7988
id oldValue;
8089
id *slot = (id*) ((char*)self + offset);
8190

runtime/Messengers.subproj/objc-msg-arm.s

+18-132
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ LMsgSendSuper2StretExit:
601601
MI_CALL_EXTERNAL(__class_lookupMethodAndLoadCache3)
602602
mov r12, r0 // r12 = IMP
603603

604-
teq r12, r12 // set eq for nonstret forwarding
604+
movs r9, #0 // r9=0, Z=1 for nonstret forwarding
605605
ldmfd sp!, {r0-r3,r7,lr}
606606
bx r12
607607

@@ -623,73 +623,27 @@ LMsgSendSuper2StretExit:
623623
MI_CALL_EXTERNAL(__class_lookupMethodAndLoadCache3)
624624
mov r12, r0 // r12 = IMP
625625

626-
tst r12, r12 // set ne for stret forwarding (r12!=0)
626+
movs r9, #1 // r9=1, Z=0 for stret forwarding
627627
ldmfd sp!, {r0-r3,r7,lr}
628628
bx r12
629629
630630
END_ENTRY _objc_msgSend_stret_uncached
631631

632632
633633
/********************************************************************
634-
*
635-
* id _objc_msgForward(id self,
636-
* SEL sel,
637-
* ...);
638-
* struct_type _objc_msgForward_stret (id self,
639-
* SEL sel,
640-
* ...);
641-
*
642-
* Both _objc_msgForward and _objc_msgForward_stret
643-
* send the message to a method having the signature:
644-
*
645-
* - forward:(SEL)sel :(marg_list)args;
646-
*
647-
* The marg_list's layout is:
648-
* d0 <-- args
649-
* d1
650-
* d2 | increasing address
651-
* d3 v
652-
* d4
653-
* d5
654-
* d6
655-
* d7
656-
* r0
657-
* r1
658-
* r2
659-
* r3
660-
* stack args...
661-
*
662-
* typedef struct objc_sendv_margs {
663-
* int a[4];
664-
* int stackArgs[...];
665-
* };
666-
*
667-
********************************************************************/
668-
669-
670-
.cstring
671-
LUnkSelStr:
672-
.ascii "Does not recognize selector %s\0"
673-
674-
.private_extern _FwdSel
675-
.data
676-
.align 2
677-
_FwdSel:
678-
.long 0
679-
680-
.private_extern __objc_forward_handler
681-
.data
682-
.align 2
683-
__objc_forward_handler:
684-
.long 0
685-
686-
.private_extern __objc_forward_stret_handler
687-
.data
688-
.align 2
689-
__objc_forward_stret_handler:
690-
.long 0
691-
634+
*
635+
* id _objc_msgForward(id self, SEL _cmd,...);
636+
*
637+
* _objc_msgForward and _objc_msgForward_stret are the externally-callable
638+
* functions returned by things like method_getImplementation().
639+
* _objc_msgForward_impcache is the function pointer actually stored in
640+
* method caches.
641+
*
642+
********************************************************************/
692643

644+
MI_EXTERN(__objc_forward_handler)
645+
MI_EXTERN(__objc_forward_stret_handler)
646+
693647
STATIC_ENTRY _objc_msgForward_impcache
694648
// Method cache version
695649

@@ -713,87 +667,19 @@ __objc_forward_stret_handler:
713667
ENTRY _objc_msgForward
714668
// Non-stret version
715669

716-
// check for user-installed forwarding handler
717-
MI_GET_ADDRESS(r12, __objc_forward_handler)
670+
MI_GET_EXTERN(r12, __objc_forward_handler)
718671
ldr r12, [r12]
719-
teq r12, #0
720-
it ne
721-
bxne r12
722-
723-
// build marg_list
724-
stmfd sp!, {r0-r3} // push args to marg_list
725-
726-
// build forward::'s parameter list (self, forward::, original sel, marg_list)
727-
// r0 already is self
728-
mov r2, r1 // original sel
729-
MI_GET_ADDRESS(r1, _FwdSel) // "forward::"
730-
ldr r1, [r1]
731-
mov r3, sp // marg_list
732-
733-
// check for forwarding of forward:: itself
734-
teq r1, r2
735-
beq LMsgForwardError // original sel == forward:: - give up
736-
737-
// push stack frame
738-
str lr, [sp, #-(2*4)]! // save lr and align stack
739-
740-
// send it
741-
bl _objc_msgSend
742-
743-
// pop stack frame and return
744-
ldr lr, [sp]
745-
add sp, sp, #(4 + 4 + 4*4) // skip lr, pad, r0..r3
746-
bx lr
747-
748-
LMsgForwardError:
749-
// currently r0=self, r1=forward::, r2 = original sel, r3 = marg_list
750-
// call __objc_error(self, format, original sel)
751-
MI_GET_ADDRESS(r1, LUnkSelStr)
752-
MI_CALL_EXTERNAL(___objc_error)
672+
bx r12
753673

754674
END_ENTRY _objc_msgForward
755675

756676

757677
ENTRY _objc_msgForward_stret
758678
// Struct-return version
759679

760-
// check for user-installed forwarding handler
761-
MI_GET_ADDRESS(r12, __objc_forward_stret_handler)
680+
MI_GET_EXTERN(r12, __objc_forward_stret_handler)
762681
ldr r12, [r12]
763-
teq r12, #0
764-
it ne
765-
bxne r12
766-
767-
// build marg_list
768-
stmfd sp!, {r0-r3} // push args to marg_list
769-
770-
// build forward::'s parameter list (self, forward::, original sel, marg_list)
771-
mov r0, r1 // self
772-
MI_GET_ADDRESS(r1, _FwdSel) // "forward::"
773-
ldr r1, [r1]
774-
// r2 is already original sel
775-
mov r3, sp // marg_list
776-
777-
// check for forwarding of forward:: itself
778-
teq r1, r2
779-
beq LMsgForwardStretError // original sel == forward:: - give up
780-
781-
// push stack frame
782-
str lr, [sp, #-(2*4)]! // save lr and align stack
783-
784-
// send it
785-
bl _objc_msgSend
786-
787-
// pop stack frame and return
788-
ldr lr, [sp]
789-
add sp, sp, #(4 + 4 + 4*4) // skip lr, pad, r0..r3
790-
bx lr
791-
792-
LMsgForwardStretError:
793-
// currently r0=self, r1=forward::, r2 = original sel, r3 = marglist
794-
// call __objc_error(self, format, original sel)
795-
MI_GET_ADDRESS(r1, LUnkSelStr)
796-
MI_CALL_EXTERNAL(___objc_error)
682+
bx r12
797683

798684
END_ENTRY _objc_msgForward_stret
799685

0 commit comments

Comments
 (0)