From b496e0986ba6c65ea66cb359f67cc7b28cd37f38 Mon Sep 17 00:00:00 2001 From: Apple Date: Mon, 17 Sep 2012 18:16:30 +0000 Subject: [PATCH] objc4-532.2.tar.gz --- objc.xcodeproj/project.pbxproj | 12 ---- runtime/Auto.subproj/objc-auto-i386.s | 95 ------------------------- runtime/Auto.subproj/objc-auto-x86_64.s | 89 ----------------------- runtime/objc-auto.m | 13 ---- runtime/objc-os.mm | 1 - runtime/objc-private.h | 4 +- runtime/objc-rtp.mm | 92 ------------------------ runtime/objc-runtime.mm | 3 - 8 files changed, 1 insertion(+), 308 deletions(-) delete mode 100644 runtime/Auto.subproj/objc-auto-i386.s delete mode 100644 runtime/Auto.subproj/objc-auto-x86_64.s delete mode 100644 runtime/objc-rtp.mm diff --git a/objc.xcodeproj/project.pbxproj b/objc.xcodeproj/project.pbxproj index ef1d461..f8b77c2 100644 --- a/objc.xcodeproj/project.pbxproj +++ b/objc.xcodeproj/project.pbxproj @@ -17,7 +17,6 @@ 830F2A740D737FB800392440 /* objc-msg-arm.s in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A690D737FB800392440 /* objc-msg-arm.s */; }; 830F2A750D737FB900392440 /* objc-msg-i386.s in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A6A0D737FB800392440 /* objc-msg-i386.s */; }; 830F2A7D0D737FBB00392440 /* objc-msg-x86_64.s in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A720D737FB800392440 /* objc-msg-x86_64.s */; }; - 830F2A890D73819A00392440 /* objc-auto-i386.s in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A850D73819A00392440 /* objc-auto-i386.s */; }; 830F2A940D73876100392440 /* objc-accessors.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F2A920D73876100392440 /* objc-accessors.h */; }; 830F2A950D73876100392440 /* objc-accessors.mm in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A930D73876100392440 /* objc-accessors.mm */; }; 830F2A980D738DC200392440 /* hashtable.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F2A970D738DC200392440 /* hashtable.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -53,7 +52,6 @@ 8383A3BF122600FB009290B8 /* objc-lockdebug.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485DB0D6D68A200CEA253 /* objc-lockdebug.mm */; }; 8383A3C0122600FB009290B8 /* objc-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = 831C85D40E10CF850066E64C /* objc-os.mm */; }; 8383A3C1122600FB009290B8 /* objc-references.mm in Sources */ = {isa = PBXBuildFile; fileRef = 393CEABF0DC69E3E000B69DE /* objc-references.mm */; }; - 8383A3C2122600FB009290B8 /* objc-rtp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485DF0D6D68A200CEA253 /* objc-rtp.mm */; }; 8383A3C3122600FB009290B8 /* objc-runtime-new.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485E10D6D68A200CEA253 /* objc-runtime-new.mm */; }; 8383A3C4122600FB009290B8 /* objc-runtime-old.m in Sources */ = {isa = PBXBuildFile; fileRef = 838485E20D6D68A200CEA253 /* objc-runtime-old.m */; }; 8383A3C5122600FB009290B8 /* objc-runtime.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485E40D6D68A200CEA253 /* objc-runtime.mm */; }; @@ -66,7 +64,6 @@ 8383A3CC122600FB009290B8 /* a1a2-blocktramps-x86_64.s in Sources */ = {isa = PBXBuildFile; fileRef = E8923D9D116AB2820071B552 /* a1a2-blocktramps-x86_64.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; }; 8383A3CD122600FB009290B8 /* a2a3-blocktramps-i386.s in Sources */ = {isa = PBXBuildFile; fileRef = E8923D9E116AB2820071B552 /* a2a3-blocktramps-i386.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; }; 8383A3CE122600FB009290B8 /* a2a3-blocktramps-x86_64.s in Sources */ = {isa = PBXBuildFile; fileRef = E8923D9F116AB2820071B552 /* a2a3-blocktramps-x86_64.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; }; - 8383A3CF122600FB009290B8 /* objc-auto-i386.s in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A850D73819A00392440 /* objc-auto-i386.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; }; 8383A3D0122600FB009290B8 /* objc-msg-arm.s in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A690D737FB800392440 /* objc-msg-arm.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; }; 8383A3D1122600FB009290B8 /* objc-msg-i386.s in Sources */ = {isa = PBXBuildFile; fileRef = 830F2A6A0D737FB800392440 /* objc-msg-i386.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; }; 8383A3D2122600FB009290B8 /* objc-msg-simulator-i386.s in Sources */ = {isa = PBXBuildFile; fileRef = 83B1A8BC0FF1AC0D0019EA5B /* objc-msg-simulator-i386.s */; settings = {COMPILER_FLAGS = " -Qunused-arguments"; }; }; @@ -98,7 +95,6 @@ 838486010D6D68A200CEA253 /* objc-loadmethod.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485DA0D6D68A200CEA253 /* objc-loadmethod.mm */; }; 838486020D6D68A200CEA253 /* objc-lockdebug.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485DB0D6D68A200CEA253 /* objc-lockdebug.mm */; }; 838486030D6D68A200CEA253 /* objc-private.h in Headers */ = {isa = PBXBuildFile; fileRef = 838485DC0D6D68A200CEA253 /* objc-private.h */; }; - 838486060D6D68A200CEA253 /* objc-rtp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485DF0D6D68A200CEA253 /* objc-rtp.mm */; }; 838486070D6D68A200CEA253 /* objc-runtime-new.h in Headers */ = {isa = PBXBuildFile; fileRef = 838485E00D6D68A200CEA253 /* objc-runtime-new.h */; }; 838486080D6D68A200CEA253 /* objc-runtime-new.mm in Sources */ = {isa = PBXBuildFile; fileRef = 838485E10D6D68A200CEA253 /* objc-runtime-new.mm */; }; 838486090D6D68A200CEA253 /* objc-runtime-old.m in Sources */ = {isa = PBXBuildFile; fileRef = 838485E20D6D68A200CEA253 /* objc-runtime-old.m */; }; @@ -191,7 +187,6 @@ 830F2A690D737FB800392440 /* objc-msg-arm.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "objc-msg-arm.s"; path = "runtime/Messengers.subproj/objc-msg-arm.s"; sourceTree = ""; }; 830F2A6A0D737FB800392440 /* objc-msg-i386.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "objc-msg-i386.s"; path = "runtime/Messengers.subproj/objc-msg-i386.s"; sourceTree = ""; }; 830F2A720D737FB800392440 /* objc-msg-x86_64.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "objc-msg-x86_64.s"; path = "runtime/Messengers.subproj/objc-msg-x86_64.s"; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; - 830F2A850D73819A00392440 /* objc-auto-i386.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = "objc-auto-i386.s"; path = "runtime/Auto.subproj/objc-auto-i386.s"; sourceTree = ""; }; 830F2A920D73876100392440 /* objc-accessors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objc-accessors.h"; path = "runtime/Accessors.subproj/objc-accessors.h"; sourceTree = ""; }; 830F2A930D73876100392440 /* objc-accessors.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "objc-accessors.mm"; path = "runtime/Accessors.subproj/objc-accessors.mm"; sourceTree = ""; }; 830F2A970D738DC200392440 /* hashtable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hashtable.h; path = runtime/hashtable.h; sourceTree = ""; }; @@ -234,7 +229,6 @@ 838485DA0D6D68A200CEA253 /* objc-loadmethod.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "objc-loadmethod.mm"; path = "runtime/objc-loadmethod.mm"; sourceTree = ""; }; 838485DB0D6D68A200CEA253 /* objc-lockdebug.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "objc-lockdebug.mm"; path = "runtime/objc-lockdebug.mm"; sourceTree = ""; }; 838485DC0D6D68A200CEA253 /* objc-private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objc-private.h"; path = "runtime/objc-private.h"; sourceTree = ""; }; - 838485DF0D6D68A200CEA253 /* objc-rtp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "objc-rtp.mm"; path = "runtime/objc-rtp.mm"; sourceTree = ""; }; 838485E00D6D68A200CEA253 /* objc-runtime-new.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objc-runtime-new.h"; path = "runtime/objc-runtime-new.h"; sourceTree = ""; }; 838485E10D6D68A200CEA253 /* objc-runtime-new.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "objc-runtime-new.mm"; path = "runtime/objc-runtime-new.mm"; sourceTree = ""; }; 838485E20D6D68A200CEA253 /* objc-runtime-old.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "objc-runtime-old.m"; path = "runtime/objc-runtime-old.m"; sourceTree = ""; }; @@ -347,7 +341,6 @@ 831C85D40E10CF850066E64C /* objc-os.mm */, 831C85D40E10CF850066E64C /* objc-os.mm */, 393CEABF0DC69E3E000B69DE /* objc-references.mm */, - 838485DF0D6D68A200CEA253 /* objc-rtp.mm */, 838485E10D6D68A200CEA253 /* objc-runtime-new.mm */, 838485E20D6D68A200CEA253 /* objc-runtime-old.m */, 838485E40D6D68A200CEA253 /* objc-runtime.mm */, @@ -360,7 +353,6 @@ E8923D9D116AB2820071B552 /* a1a2-blocktramps-x86_64.s */, E8923D9E116AB2820071B552 /* a2a3-blocktramps-i386.s */, E8923D9F116AB2820071B552 /* a2a3-blocktramps-x86_64.s */, - 830F2A850D73819A00392440 /* objc-auto-i386.s */, 830F2A690D737FB800392440 /* objc-msg-arm.s */, 830F2A6A0D737FB800392440 /* objc-msg-i386.s */, 83B1A8BC0FF1AC0D0019EA5B /* objc-msg-simulator-i386.s */, @@ -716,7 +708,6 @@ 8383A3BF122600FB009290B8 /* objc-lockdebug.mm in Sources */, 8383A3C0122600FB009290B8 /* objc-os.mm in Sources */, 8383A3C1122600FB009290B8 /* objc-references.mm in Sources */, - 8383A3C2122600FB009290B8 /* objc-rtp.mm in Sources */, 8383A3C3122600FB009290B8 /* objc-runtime-new.mm in Sources */, 8383A3C4122600FB009290B8 /* objc-runtime-old.m in Sources */, 8383A3C5122600FB009290B8 /* objc-runtime.mm in Sources */, @@ -729,7 +720,6 @@ 8383A3CC122600FB009290B8 /* a1a2-blocktramps-x86_64.s in Sources */, 8383A3CD122600FB009290B8 /* a2a3-blocktramps-i386.s in Sources */, 8383A3CE122600FB009290B8 /* a2a3-blocktramps-x86_64.s in Sources */, - 8383A3CF122600FB009290B8 /* objc-auto-i386.s in Sources */, 8383A3D0122600FB009290B8 /* objc-msg-arm.s in Sources */, 8383A3D1122600FB009290B8 /* objc-msg-i386.s in Sources */, 8383A3D2122600FB009290B8 /* objc-msg-simulator-i386.s in Sources */, @@ -760,7 +750,6 @@ 838485FF0D6D68A200CEA253 /* objc-load.mm in Sources */, 838486010D6D68A200CEA253 /* objc-loadmethod.mm in Sources */, 838486020D6D68A200CEA253 /* objc-lockdebug.mm in Sources */, - 838486060D6D68A200CEA253 /* objc-rtp.mm in Sources */, 838486080D6D68A200CEA253 /* objc-runtime-new.mm in Sources */, 838486090D6D68A200CEA253 /* objc-runtime-old.m in Sources */, 8384860B0D6D68A200CEA253 /* objc-runtime.mm in Sources */, @@ -774,7 +763,6 @@ 830F2A740D737FB800392440 /* objc-msg-arm.s in Sources */, 830F2A750D737FB900392440 /* objc-msg-i386.s in Sources */, 830F2A7D0D737FBB00392440 /* objc-msg-x86_64.s in Sources */, - 830F2A890D73819A00392440 /* objc-auto-i386.s in Sources */, 830F2A950D73876100392440 /* objc-accessors.mm in Sources */, 393CEAC00DC69E3E000B69DE /* objc-references.mm in Sources */, 831C85D60E10CF850066E64C /* objc-os.mm in Sources */, diff --git a/runtime/Auto.subproj/objc-auto-i386.s b/runtime/Auto.subproj/objc-auto-i386.s deleted file mode 100644 index 1e7345f..0000000 --- a/runtime/Auto.subproj/objc-auto-i386.s +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2004, 2007 Apple Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -#include - -#if __i386__ && !TARGET_OS_IPHONE && !TARGET_OS_WIN32 - -/* - This file defines the non-GC variants of objc_assign_* on a dedicated - page in the (__DATA,__data) section. At load time under GC, each - routine is overwritten with a jump to its GC variant. It is necessary - for these routines to exist on a dedicated page for vm_protect to - work properly in the GC case. The page exists in the data segment to - reduce the kernel's page table overhead. - - Note: To avoid wasting more space than necessary at runtime, this file - must not contain anything other than the objc_assign_* routines. -*/ - -.section __IMPORT, __objctext, regular, pure_instructions + self_modifying_code - -.align 12 // align to page boundary - -// id objc_assign_ivar(id value, id dest, ptrdiff_t offset); -.globl _objc_assign_ivar -_objc_assign_ivar: - pushl %ebp - movl %esp,%ebp - movl 0x08(%ebp),%eax // value - movl 0x0c(%ebp),%ecx // dest - movl 0x10(%ebp),%edx // offset - movl %eax,(%ecx,%edx) // return (*(dest + offset) = value); - leave - ret - -// id objc_assign_global(id value, id *dest); -.globl _objc_assign_global -_objc_assign_global: - pushl %ebp - movl %esp,%ebp - movl 0x08(%ebp),%eax // value - movl 0x0c(%ebp),%edx // dest - movl %eax,(%edx) // return (*dest = value); - leave - ret - -// id objc_assign_threadlocal(id value, id *dest); -.globl _objc_assign_threadlocal -_objc_assign_threadlocal: - pushl %ebp - movl %esp,%ebp - movl 0x08(%ebp),%eax // value - movl 0x0c(%ebp),%edx // dest - movl %eax,(%edx) // return (*dest = value); - leave - ret - -// As of OS X 10.5, objc_assign_strongCast_non_gc is identical to -// objc_assign_global_non_gc. - -// id objc_assign_strongCast(id value, id *dest); -.globl _objc_assign_strongCast -_objc_assign_strongCast: - pushl %ebp - movl %esp,%ebp - movl 0x08(%ebp),%eax // value - movl 0x0c(%ebp),%edx // dest - movl %eax,(%edx) // return (*dest = value); - leave - ret - -// Claim the remainder of the page. -.align 12, 0 - -#endif diff --git a/runtime/Auto.subproj/objc-auto-x86_64.s b/runtime/Auto.subproj/objc-auto-x86_64.s deleted file mode 100644 index ac2d144..0000000 --- a/runtime/Auto.subproj/objc-auto-x86_64.s +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2006-2007 Apple Inc. All Rights Reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -#error not currently used - -#ifdef __x86_64__ - -/* - This file defines the non-GC variants of objc_assign_* on a dedicated - page in the (__DATA,__data) section. At load time under GC, each - routine is overwritten with a jump to its GC variant. It is necessary - for these routines to exist on a dedicated page for vm_protect to - work properly in the GC case. The page exists in the data segment to - reduce the kernel's page table overhead. - - Note: To avoid wasting more space than necessary at runtime, this file - must not contain anything other than the objc_assign_* routines. -*/ - -.data -.align 12 // align to page boundary - -// id objc_assign_ivar(id value, id dest, ptrdiff_t offset); -.globl _objc_assign_ivar -_objc_assign_ivar: - pushq %rbp - movq %rsp,%rbp - movq %rdi,(%rsi,%rdx) // *(dest + offset) = value); - movq %rdi,%rax // return value; - leave - ret - -// id objc_assign_global(id value, id *dest); -.globl _objc_assign_global -_objc_assign_global: - pushq %rbp - movq %rsp,%rbp - movq %rdi,(%rsi) // *(dest = value); - movq %rdi,%rax // return value; - leave - ret - -// id objc_assign_threadlocal(id value, id *dest); -.globl _objc_assign_threadlocal -_objc_assign_threadlocal: - pushq %rbp - movq %rsp,%rbp - movq %rdi,(%rsi) // *(dest = value); - movq %rdi,%rax // return value; - leave - ret - -// As of OS X 10.5, objc_assign_strongCast_non_gc is identical to -// objc_assign_global_non_gc. - -// id objc_assign_strongCast(id value, id *dest); -.globl _objc_assign_strongCast -_objc_assign_strongCast: - pushq %rbp - movq %rsp,%rbp - movq %rdi,(%rsi) // *(dest = value); - movq %rdi,%rax // return value; - leave - ret - -// Claim the remainder of the page. -.align 12, 0 - -#endif diff --git a/runtime/objc-auto.m b/runtime/objc-auto.m index 8e9f9ff..1c1a792 100644 --- a/runtime/objc-auto.m +++ b/runtime/objc-auto.m @@ -334,16 +334,6 @@ id objc_assign_ivar_non_gc(id value, id base, ptrdiff_t offset) { * Called by pretty much all GC-supporting code. **********************************************************************/ - -#if defined(__i386__) - -// These 3 functions are defined in objc-auto-i386.s as -// the non-GC variants. Under GC, rtp_init stomps them with jumps to -// objc_assign_*_gc. - -#else - -// use generic implementation until time can be spent on optimizations id objc_assign_strongCast(id value, id *dest) { if (UseGC) { @@ -381,9 +371,6 @@ id objc_assign_ivar(id value, id dest, ptrdiff_t offset) } } -// not defined(__i386__) -#endif - #if __LP64__ #define LC_SEGMENT_COMMAND LC_SEGMENT_64 #define LC_ROUTINES_COMMAND LC_ROUTINES_64 diff --git a/runtime/objc-os.mm b/runtime/objc-os.mm index 06bb95e..3b50712 100644 --- a/runtime/objc-os.mm +++ b/runtime/objc-os.mm @@ -674,7 +674,6 @@ map_images_nolock(enum dyld_image_states state, uint32_t infoCount, verify_gc_readiness(wantsGC, &wantsCompaction, hList, hCount); gc_init(wantsGC, wantsCompaction); // needs executable for GC decision - rtp_init(); // needs GC decision first } else { verify_gc_readiness(wantsGC, &wantsCompaction, hList, hCount); } diff --git a/runtime/objc-private.h b/runtime/objc-private.h index 334b42c..667bac4 100644 --- a/runtime/objc-private.h +++ b/runtime/objc-private.h @@ -486,10 +486,9 @@ struct objc_method_description * lookup_protocol_method(struct old_protocol *pro Method _protocol_getMethod(Protocol *p, SEL sel, BOOL isRequiredMethod, BOOL isInstanceMethod, BOOL recursive); #endif -/* GC and RTP startup */ +/* GC startup */ extern void gc_init(BOOL wantsGC, BOOL wantsCompaction); extern void gc_init2(void); -extern void rtp_init(void); /* Exceptions */ struct alt_handler_list; @@ -571,7 +570,6 @@ ENV(PrintIvars); // env OBJC_PRINT_IVAR_SETUP ENV(PrintVtables); // env OBJC_PRINT_VTABLE_SETUP ENV(PrintVtableImages); // env OBJC_PRINT_VTABLE_IMAGES ENV(PrintFuture); // env OBJC_PRINT_FUTURE_CLASSES -ENV(PrintRTP); // env OBJC_PRINT_RTP ENV(PrintGC); // env OBJC_PRINT_GC ENV(PrintPreopt); // env OBJC_PRINT_PREOPTIMIZATION ENV(PrintCxxCtors); // env OBJC_PRINT_CXX_CTORS diff --git a/runtime/objc-rtp.mm b/runtime/objc-rtp.mm deleted file mode 100644 index d85e669..0000000 --- a/runtime/objc-rtp.mm +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2004-2007 Apple Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -#include "objc-private.h" -#include - - -#if defined(__i386__) - - -/********************************************************************** -* rtp_swap_imp -* -* Swap a function's current implementation with a new one. -* The routine at 'address' is assumed to be at least as large as the -* jump instruction required to reach the new implementation. -**********************************************************************/ -static void rtp_swap_imp(unsigned *address, void *code, const char *name) -{ - if (vm_protect(mach_task_self(), (vm_address_t)address, 1, - FALSE, VM_PROT_READ | VM_PROT_WRITE) != KERN_SUCCESS) - _objc_fatal("Could not get write access to %s.", name); - else - { - objc_write_branch(address, (unsigned*)code); - - if (vm_protect(mach_task_self(), (vm_address_t)address, 1, - FALSE, VM_PROT_READ | VM_PROT_EXECUTE) != KERN_SUCCESS) - _objc_fatal("Could not reprotect %s.", name); - } -} - - -void rtp_init(void) -{ - // At load time, the page on which the objc_assign_* routines live is not - // marked as executable. We fix that here, regardless of the GC choice. -#if SUPPORT_GC - if (UseGC) - { - rtp_swap_imp((unsigned*)objc_assign_ivar, - (void*)objc_assign_ivar_gc, "objc_assign_ivar"); - rtp_swap_imp((unsigned*)objc_assign_global, - (void*)objc_assign_global_gc, "objc_assign_global"); - rtp_swap_imp((unsigned*)objc_assign_threadlocal, - (void*)objc_assign_threadlocal_gc, "objc_assign_threadlocal"); - rtp_swap_imp((unsigned*)objc_assign_strongCast, - (void*)objc_assign_strongCast_gc, "objc_assign_strongCast"); - } - else -#endif - { // Not GC, just make the page executable. - if (vm_protect(mach_task_self(), (vm_address_t)objc_assign_ivar, 1, - FALSE, VM_PROT_READ | VM_PROT_EXECUTE) != KERN_SUCCESS) - _objc_fatal("Could not reprotect objc_assign_*."); - } -} - - -#else - - -void rtp_init(void) -{ - if (PrintRTP) { - _objc_inform("RTP: no rtp implementation for this platform"); - } -} - - -#endif - diff --git a/runtime/objc-runtime.mm b/runtime/objc-runtime.mm index 01eb72d..49719ab 100644 --- a/runtime/objc-runtime.mm +++ b/runtime/objc-runtime.mm @@ -56,7 +56,6 @@ int PrintIvars = -1; // env OBJC_PRINT_IVAR_SETUP int PrintVtables = -1; // env OBJC_PRINT_VTABLE_SETUP int PrintVtableImages = -1;//env OBJC_PRINT_VTABLE_IMAGES int PrintFuture = -1; // env OBJC_PRINT_FUTURE_CLASSES -int PrintRTP = -1; // env OBJC_PRINT_RTP int PrintGC = -1; // env OBJC_PRINT_GC int PrintPreopt = -1; // env OBJC_PRINT_PREOPTIMIZATION int PrintCxxCtors = -1; // env OBJC_PRINT_CXX_CTORS @@ -325,8 +324,6 @@ void environ_init(void) "log processing of method caches"); OPTION(PrintFuture, OBJC_PRINT_FUTURE_CLASSES, "log use of future classes for toll-free bridging"); - OPTION(PrintRTP, OBJC_PRINT_RTP, - "log initialization of the Objective-C runtime pages"); OPTION(PrintGC, OBJC_PRINT_GC, "log some GC operations"); OPTION(PrintPreopt, OBJC_PRINT_PREOPTIMIZATION, -- 2.45.2