]> git.saurik.com Git - apple/objc4.git/commitdiff
objc4-208.tar.gz mac-os-x-100 mac-os-x-1004 v208
authorApple <opensource@apple.com>
Wed, 11 Apr 2001 15:41:56 +0000 (15:41 +0000)
committerApple <opensource@apple.com>
Wed, 11 Apr 2001 15:41:56 +0000 (15:41 +0000)
54 files changed:
Makefile [new file with mode: 0644]
Makefile.postamble [new file with mode: 0644]
Makefile.preamble [new file with mode: 0644]
PB.project [new file with mode: 0644]
runtime/Makefile [new file with mode: 0644]
runtime/Makefile.postamble [new file with mode: 0644]
runtime/Makefile.preamble [new file with mode: 0644]
runtime/Messengers.subproj/Makefile [new file with mode: 0644]
runtime/Messengers.subproj/Makefile.postamble [new file with mode: 0644]
runtime/Messengers.subproj/Makefile.preamble [new file with mode: 0644]
runtime/Messengers.subproj/PB.project [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-hppa-lock.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-hppa-nolock.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-hppa-pdo-pic.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-hppa-pdo.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-i386-nextpdo-winnt3.5.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-i386.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-m68k-lock.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-m68k-nolock.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-ppc.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-sparc-pdo.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg-sparc.s [new file with mode: 0644]
runtime/Messengers.subproj/objc-msg.s [new file with mode: 0644]
runtime/Object.h [new file with mode: 0644]
runtime/Object.m [new file with mode: 0644]
runtime/OldClasses.subproj/List.h [new file with mode: 0644]
runtime/OldClasses.subproj/List.m [new file with mode: 0644]
runtime/OldClasses.subproj/Makefile [new file with mode: 0644]
runtime/OldClasses.subproj/Makefile.preamble [new file with mode: 0644]
runtime/OldClasses.subproj/PB.project [new file with mode: 0644]
runtime/PB.project [new file with mode: 0644]
runtime/Protocol.h [new file with mode: 0644]
runtime/Protocol.m [new file with mode: 0644]
runtime/error.h [new file with mode: 0644]
runtime/hashtable2.h [new file with mode: 0644]
runtime/hashtable2.m [new file with mode: 0644]
runtime/maptable.h [new file with mode: 0644]
runtime/maptable.m [new file with mode: 0644]
runtime/objc-api.h [new file with mode: 0644]
runtime/objc-class.h [new file with mode: 0644]
runtime/objc-class.m [new file with mode: 0644]
runtime/objc-config.h [new file with mode: 0644]
runtime/objc-errors.m [new file with mode: 0644]
runtime/objc-file.m [new file with mode: 0644]
runtime/objc-load.h [new file with mode: 0644]
runtime/objc-load.m [new file with mode: 0644]
runtime/objc-moninit.c [new file with mode: 0644]
runtime/objc-private.h [new file with mode: 0644]
runtime/objc-runtime.h [new file with mode: 0644]
runtime/objc-runtime.m [new file with mode: 0644]
runtime/objc-sel.m [new file with mode: 0644]
runtime/objc.h [new file with mode: 0644]
runtime/objc_dllMain.c [new file with mode: 0644]
runtime/objc_hpux_register_shlib.c [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..977ac33
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+#
+# Generated by the Apple Project Builder.
+#
+# NOTE: Do NOT change this file -- Project Builder maintains it.
+#
+# Put all of your customizations in files called Makefile.preamble
+# and Makefile.postamble (both optional), and Makefile will include them.
+#
+
+NAME = objc4
+
+PROJECTVERSION = 2.8
+PROJECT_TYPE = Aggregate
+
+LIBRARIES = runtime
+
+OTHERSRCS = Makefile.preamble Makefile Makefile.postamble
+
+MAKEFILEDIR = $(MAKEFILEPATH)/pb_makefiles
+CODE_GEN_STYLE = DYNAMIC
+MAKEFILE = aggregate.make
+LIBS = 
+DEBUG_LIBS = $(LIBS)
+PROF_LIBS = $(LIBS)
+
+
+
+
+NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc
+WINDOWS_OBJCPLUS_COMPILER = $(DEVDIR)/gcc
+PDO_UNIX_OBJCPLUS_COMPILER = $(NEXTDEV_BIN)/gcc
+NEXTSTEP_JAVA_COMPILER = /usr/bin/javac
+WINDOWS_JAVA_COMPILER = $(JDKBINDIR)/javac.exe
+PDO_UNIX_JAVA_COMPILER = $(JDKBINDIR)/javac
+
+include $(MAKEFILEDIR)/platform.make
+
+-include Makefile.preamble
+
+include $(MAKEFILEDIR)/$(MAKEFILE)
+
+-include Makefile.postamble
+
+-include Makefile.dependencies
diff --git a/Makefile.postamble b/Makefile.postamble
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Makefile.preamble b/Makefile.preamble
new file mode 100644 (file)
index 0000000..e41455c
--- /dev/null
@@ -0,0 +1,5 @@
+
+ifeq "$(PLATFORM_OS)" "macos"
+       BEFORE_INSTALL += profile
+endif
+
diff --git a/PB.project b/PB.project
new file mode 100644 (file)
index 0000000..a8d3155
--- /dev/null
@@ -0,0 +1,24 @@
+{
+    DYNAMIC_CODE_GEN = YES; 
+    FILESTABLE = {
+        CLASSES = (); 
+        H_FILES = (); 
+        OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble); 
+        SUBPROJECTS = (runtime); 
+    }; 
+    LANGUAGE = English; 
+    LOCALIZABLE_FILES = {}; 
+    MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; 
+    NEXTSTEP_BUILDTOOL = /bin/gnumake; 
+    NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; 
+    NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; 
+    PDO_UNIX_BUILDTOOL = $NEXT_ROOT/Developer/bin/make; 
+    PDO_UNIX_JAVA_COMPILER = "$(JDKBINDIR)/javac"; 
+    PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; 
+    PROJECTNAME = objc4; 
+    PROJECTTYPE = Aggregate; 
+    PROJECTVERSION = 2.8; 
+    WINDOWS_BUILDTOOL = $NEXT_ROOT/Developer/Executables/make; 
+    WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; 
+    WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; 
+}
diff --git a/runtime/Makefile b/runtime/Makefile
new file mode 100644 (file)
index 0000000..b0dc277
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Generated by the Apple Project Builder.
+#
+# NOTE: Do NOT change this file -- Project Builder maintains it.
+#
+# Put all of your customizations in files called Makefile.preamble
+# and Makefile.postamble (both optional), and Makefile will include them.
+#
+
+NAME = runtime
+
+PROJECTVERSION = 2.8
+PROJECT_TYPE = Library
+
+HFILES = error.h hashtable2.h maptable.h objc-api.h objc-class.h\
+         objc-config.h objc-load.h objc-private.h objc-runtime.h\
+        objc.h Object.h Protocol.h
+
+MFILES = hashtable2.m maptable.m objc-class.m objc-errors.m\
+         objc-file.m objc-load.m objc-runtime.m objc-sel.m\
+         Object.m Protocol.m
+
+CFILES = objc-moninit.c
+
+SUBPROJECTS = Messengers.subproj OldClasses.subproj
+
+OTHERSRCS = Makefile.preamble Makefile Makefile.postamble\
+            objc_hpux_register_shlib.c objc_dllMain.c 
+
+
+MAKEFILEDIR = $(MAKEFILEPATH)/pb_makefiles
+CURRENTLY_ACTIVE_VERSION = YES
+DEPLOY_WITH_VERSION_NAME = A
+CODE_GEN_STYLE = DYNAMIC
+MAKEFILE = library.make
+NEXTSTEP_INSTALLDIR = /usr/lib
+#NEXTSTEP_INSTALLDIR = /Local/Developer/libs
+WINDOWS_INSTALLDIR = /.
+PDO_UNIX_INSTALLDIR = $(LOCAL_DEVELOPER_DIR)/Libraries
+LIBS = 
+DEBUG_LIBS = $(LIBS)
+PROF_LIBS = $(LIBS)
+
+
+PUBLIC_HEADERS = objc-class.h objc-api.h objc-load.h objc-runtime.h\
+                 objc.h Object.h Protocol.h error.h hashtable2.h
+
+
+
+NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc
+WINDOWS_OBJCPLUS_COMPILER = $(DEVDIR)/gcc
+PDO_UNIX_OBJCPLUS_COMPILER = $(NEXTDEV_BIN)/gcc
+NEXTSTEP_JAVA_COMPILER = /usr/bin/javac
+WINDOWS_JAVA_COMPILER = $(JDKBINDIR)/javac.exe
+PDO_UNIX_JAVA_COMPILER = $(NEXTDEV_BIN)/javac
+
+include $(MAKEFILEDIR)/platform.make
+
+-include Makefile.preamble
+
+include $(MAKEFILEDIR)/$(MAKEFILE)
+
+-include Makefile.postamble
+
+-include Makefile.dependencies
diff --git a/runtime/Makefile.postamble b/runtime/Makefile.postamble
new file mode 100644 (file)
index 0000000..3a6e960
--- /dev/null
@@ -0,0 +1,43 @@
+###############################################################################
+#  Makefile.postamble
+#  Copyright 1997,2000 Apple Computer, Inc.
+###############################################################################
+
+ifeq "$(PLATFORM_OS)" "macos"
+
+PROFILE_PRODUCT = $(PRODUCT_DIR)/$(LIBRARY_PREFIX)$(NAME)$(PROFILE_SUFFIX)$(LIBRARY_EXT)
+VERSIONED_PROFILE_PRODUCT = $(PRODUCT_DIR)/$(LIBRARY_PREFIX)$(NAME)$(PROFILE_SUFFIX).$(VERSION_NAME)$(LIBRARY_EXT)
+PRODUCTS += $(PROFILE_PRODUCT) $(VERSIONED_PROFILE_PRODUCT) 
+STRIPPED_PRODUCTS += $(VERSIONED_PROFILE_PRODUCT)
+DYLIB_INSTALL_NAME = $(LIBRARY_PREFIX)$(NAME)$(BUILD_TYPE_SUFFIX).$(VERSION_NAME)$(LIBRARY_EXT)
+PRODUCT = $(PRODUCT_DIR)/$(DYLIB_INSTALL_NAME)
+
+endif
+
+create-profile-lib-compat-link:
+       $(SYMLINK) $(notdir $(VERSIONED_PROFILE_PRODUCT)) $(DSTROOT)$(INSTALLDIR)/libobjc.A_profile.dylib
+
+link-hashtable:
+ifeq ("$(PLATFORM_OS)", "macos")
+       $(RM) -f $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable.h
+       $(CP) $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable2.h $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable.h
+endif
+ifeq ("$(PLATFORM_OS)", "solaris")
+       $(RM) -f $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable.h
+       $(LN) $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable2.h $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable.h
+endif
+ifeq ("$(PLATFORM_OS)", "hpux")
+       $(RM) -f $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable.h
+       $(LN) $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable2.h $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable.h
+endif
+       true
+
+# from AFTER_POSTINSTALL
+postprocess:
+ifeq ("$(PLATFORM_OS)", "winnt")
+       $(MKDIRS) $(DSTROOT)$(LOCAL_DEVELOPER_DIR)/Libraries
+       $(CP) $(SYMROOT)/runtime.lib $(DSTROOT)$(LOCAL_DEVELOPER_DIR)/Libraries/libobjc.a
+       $(CP) $(SYMROOT)/runtime.lib $(DSTROOT)$(LOCAL_DEVELOPER_DIR)/Libraries/libobjc_g.a
+       $(RM) -f $(DSTROOT)$(INSTALLDIR)/runtime.lib
+endif
+
diff --git a/runtime/Makefile.preamble b/runtime/Makefile.preamble
new file mode 100644 (file)
index 0000000..1cc06c0
--- /dev/null
@@ -0,0 +1,71 @@
+###############################################################################
+#  Makefile.preamble
+#  Copyright 1997,2000 Apple Computer, Inc.
+###############################################################################
+
+ifeq "$(PLATFORM_OS)" "winnt"
+       BUILDING_ON_WINDOWS = YES
+else
+ifeq "$(PLATFORM_OS)" "win95"
+       BUILDING_ON_WINDOWS = YES
+else
+ifeq "$(PLATFORM_OS)" "win32"
+       BUILDING_ON_WINDOWS = YES
+endif # win32
+endif # win95
+endif # winnt
+
+ifeq "$(PLATFORM_OS)" "macos"
+       NAME = objc
+       OTHER_CFLAGS += -Wno-unused
+       OTHER_LIBTOOL_FLAGS += -Wl,-init,___initialize_objc
+       FRAMEWORKS += -framework CoreFoundation
+       HEADER_PATHS += -I$(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders
+       AFTER_INSTALL += create-profile-lib-compat-link
+endif
+ifeq "$(BUILDING_ON_WINDOWS)" "YES"
+       LIBRARY_STYLE = STATIC
+       OTHER_LIBTOOL_FLAGS = -debugtype:both
+endif
+ifeq "$(PLATFORM_OS)" "solaris"
+       OTHER_CFLAGS += -Wno-unused -fPIC
+       LIBRARY_STYLE = STATIC
+endif
+ifeq "$(PLATFORM_OS)" "hpux"
+       OTHER_CFLAGS += -Wno-unused -Wno-comment -D_REENTRANT -DNSBUILDINGHPUXSHLIB -fPIC
+       LIBRARY_STYLE = STATIC
+endif
+
+OTHER_CFLAGS += -DNSBUILDINGOBJC -I$(SYMROOT)
+OTHER_LDFLAGS =
+
+AFTER_INSTALLHDRS += link-hashtable
+AFTER_POSTINSTALL += postprocess
+
+ifeq ("$(PLATFORM_OS)", "macos")
+       PUBLIC_HEADER_DIR = /usr/include
+       PRIVATE_HEADER_DIR = /usr/local/include
+else
+ifeq ("$(PLATFORM_OS)", "solaris")
+       PUBLIC_HEADER_DIR = $(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/Versions/A/Headers
+       PRIVATE_HEADER_DIR = $(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/Versions/A/PrivateHeaders
+else
+ifeq ("$(PLATFORM_OS)", "hpux")
+       PUBLIC_HEADER_DIR = $(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/Versions/A/Headers
+       PRIVATE_HEADER_DIR = $(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/Versions/A/PrivateHeaders
+else
+       PUBLIC_HEADER_DIR = $(SYSTEM_DEVELOPER_DIR)/Headers
+       PRIVATE_HEADER_DIR = $(LOCAL_DEVELOPER_DIR)/Headers
+endif
+endif
+endif
+
+# If, in a subproject, you want to append to the parent's PUBLIC_HEADER_DIR# 
+# (say, to add a subdirectory like "/sys"), you can use:
+PUBLIC_HEADER_DIR_SUFFIX = /objc
+PRIVATE_HEADER_DIR_SUFFIX = /objc
+
+OTHER_PUBLIC_HEADERS = 
+OTHER_PRIVATE_HEADERS = maptable.h 
+OTHER_PROJECT_HEADERS = $(PUBLIC_HEADERS) $(OTHER_PRIVATE_HEADERS) objc-private.h objc-config.h
+
diff --git a/runtime/Messengers.subproj/Makefile b/runtime/Messengers.subproj/Makefile
new file mode 100644 (file)
index 0000000..e4dda7b
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# Generated by the NeXT Project Builder.
+#
+# NOTE: Do NOT change this file -- Project Builder maintains it.
+#
+# Put all of your customizations in files called Makefile.preamble
+# and Makefile.postamble (both optional), and Makefile will include them.
+#
+
+NAME = Messengers
+
+PROJECTVERSION = 2.8
+PROJECT_TYPE = Component
+
+OTHERLINKED = objc-msg.s
+
+OTHERSRCS = Makefile.preamble Makefile Makefile.postamble\
+            objc-msg-hppa-lock.s objc-msg-hppa-nolock.s\
+            objc-msg-hppa-pdo.s objc-msg-hppa-pdo-pic.s objc-msg-i386.s\
+            objc-msg-i386-nextpdo-winnt3.5.s objc-msg-ppc.s\
+            objc-msg-m68k-lock.s objc-msg-m68k-nolock.s objc-msg-sparc.s\
+            objc-msg-sparc-pdo.s
+
+OTHERLINKEDOFILES = objc-msg.o
+
+MAKEFILEDIR = $(MAKEFILEPATH)/pb_makefiles
+CODE_GEN_STYLE = DYNAMIC
+MAKEFILE = subproj.make
+LIBS = 
+DEBUG_LIBS = $(LIBS)
+PROF_LIBS = $(LIBS)
+
+
+
+
+NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc
+WINDOWS_OBJCPLUS_COMPILER = $(DEVDIR)/gcc
+PDO_UNIX_OBJCPLUS_COMPILER = $(NEXTDEV_BIN)/gcc
+NEXTSTEP_JAVA_COMPILER = /usr/bin/javac
+WINDOWS_JAVA_COMPILER = $(JDKBINDIR)/javac.exe
+PDO_UNIX_JAVA_COMPILER = $(NEXTDEV_BIN)/javac
+
+include $(MAKEFILEDIR)/platform.make
+
+-include Makefile.preamble
+
+include $(MAKEFILEDIR)/$(MAKEFILE)
+
+-include Makefile.postamble
+
+-include Makefile.dependencies
diff --git a/runtime/Messengers.subproj/Makefile.postamble b/runtime/Messengers.subproj/Makefile.postamble
new file mode 100644 (file)
index 0000000..1ace51f
--- /dev/null
@@ -0,0 +1,107 @@
+###############################################################################
+#  Makefile.postamble
+#  Copyright 1997, Apple Computer, Inc.
+#
+#  Use this makefile, which is imported after all other makefiles, to
+#  override attributes for a project's Makefile environment. This allows you  
+#  to take advantage of the environment set up by the other Makefiles. 
+#  You can also define custom rules at the end of this file.
+#
+###############################################################################
+# 
+# These variables are exported by the standard makefiles and can be 
+# used in any customizations you make.  They are *outputs* of
+# the Makefiles and should be used, not set.
+# 
+#  PRODUCTS: products to install.  All of these products will be placed in
+#       the directory $(DSTROOT)$(INSTALLDIR)
+#  GLOBAL_RESOURCE_DIR: The directory to which resources are copied.
+#  LOCAL_RESOURCE_DIR: The directory to which localized resources are copied.
+#  OFILE_DIR: Directory into which .o object files are generated.
+#  DERIVED_SRC_DIR: Directory used for all other derived files
+#
+#  ALL_CFLAGS:  flags to pass when compiling .c files
+#  ALL_MFLAGS:  flags to pass when compiling .m files
+#  ALL_CCFLAGS:  flags to pass when compiling .cc, .cxx, and .C files
+#  ALL_MMFLAGS:  flags to pass when compiling .mm, .mxx, and .M files
+#  ALL_PRECOMPFLAGS:  flags to pass when precompiling .h files
+#  ALL_LDFLAGS:  flags to pass when linking object files
+#  ALL_LIBTOOL_FLAGS:  flags to pass when libtooling object files
+#  ALL_PSWFLAGS:  flags to pass when processing .psw and .pswm (pswrap) files
+#  ALL_RPCFLAGS:  flags to pass when processing .rpc (rpcgen) files
+#  ALL_YFLAGS:  flags to pass when processing .y (yacc) files
+#  ALL_LFLAGS:  flags to pass when processing .l (lex) files
+#
+#  NAME: name of application, bundle, subproject, palette, etc.
+#  LANGUAGE: langage in which the project is written (default "English")
+#  LOCAL_RESOURCES: localized resources (e.g. nib's, images) of project
+#  GLOBAL_RESOURCES: non-localized resources of project
+#
+#  SRCROOT:  base directory in which to place the new source files
+#  SRCPATH:  relative path from SRCROOT to present subdirectory
+#
+#  INSTALLDIR: Directory the product will be installed into by 'install' target
+#  PUBLIC_HDR_INSTALLDIR: where to install public headers.  Don't forget
+#        to prefix this with DSTROOT when you use it.
+#  PRIVATE_HDR_INSTALLDIR: where to install private headers.  Don't forget
+#       to prefix this with DSTROOT when you use it.
+#
+#  EXECUTABLE_EXT: Executable extension for the platform (i.e. .exe on Windows)
+#
+###############################################################################
+
+# Some compiler flags can be overridden here for certain build situations.
+#
+#    WARNING_CFLAGS:  flag used to set warning level (defaults to -Wmost)
+#    DEBUG_SYMBOLS_CFLAGS:  debug-symbol flag passed to all builds (defaults
+#      to -g)
+#    DEBUG_BUILD_CFLAGS:  flags passed during debug builds (defaults to -DDEBUG)
+#    OPTIMIZE_BUILD_CFLAGS:  flags passed during optimized builds (defaults
+#      to -O)
+#    PROFILE_BUILD_CFLAGS:  flags passed during profile builds (defaults
+#      to -pg -DPROFILE)
+#    LOCAL_DIR_INCLUDE_DIRECTIVE:  flag used to add current directory to
+#      the include path (defaults to -I.)
+#    DEBUG_BUILD_LDFLAGS, OPTIMIZE_BUILD_LDFLAGS, PROFILE_BUILD_LDFLAGS: flags
+#      passed to ld/libtool (defaults to nothing)
+
+ifeq "$(PLATFORM_OS)" "solaris"
+CODE_GEN_STYLE = STATIC
+else
+ifeq "$(PLATFORM_OS)" "hpux"
+CODE_GEN_STYLE = STATIC
+endif # hpux
+endif # solaris
+
+# Library and Framework projects only:
+#    INSTALL_NAME_DIRECTIVE:  This directive ensures that executables linked
+#      against the framework will run against the correct version even if
+#      the current version of the framework changes.  You may override this
+#      to "" as an alternative to using the DYLD_LIBRARY_PATH during your
+#      development cycle, but be sure to restore it before installing.
+
+
+# Ownership and permissions of files installed by 'install' target
+
+#INSTALL_AS_USER = root
+        # User/group ownership 
+#INSTALL_AS_GROUP = wheel
+        # (probably want to set both of these) 
+#INSTALL_PERMISSIONS =
+        # If set, 'install' chmod's executable to this
+
+
+# Options to strip.  Note: -S strips debugging symbols (executables can be stripped
+# down further with -x or, if they load no bundles, with no options at all).
+
+#STRIPFLAGS = -S
+
+
+#########################################################################
+# Put rules to extend the behavior of the standard Makefiles here.  Include them in
+# the dependency tree via cvariables like AFTER_INSTALL in the Makefile.preamble.
+#
+# You should avoid redefining things like "install" or "app", as they are
+# owned by the top-level Makefile API and no context has been set up for where 
+# derived files should go.
+#
diff --git a/runtime/Messengers.subproj/Makefile.preamble b/runtime/Messengers.subproj/Makefile.preamble
new file mode 100644 (file)
index 0000000..83f25c7
--- /dev/null
@@ -0,0 +1,123 @@
+###############################################################################
+#  Makefile.preamble
+#  Copyright 1997, Apple Computer, Inc.
+#
+#  Use this makefile for configuring the standard application makefiles 
+#  associated with ProjectBuilder. It is included before the main makefile.
+#  In Makefile.preamble you set attributes for a project, so they are available
+#  to the project's makefiles.  In contrast, you typically write additional rules or 
+#  override built-in behavior in the Makefile.postamble.
+#  
+#  Each directory in a project tree (main project plus subprojects) should 
+#  have its own Makefile.preamble and Makefile.postamble.
+###############################################################################
+#
+# Before the main makefile is included for this project, you may set:
+#
+#    MAKEFILEDIR: Directory in which to find $(MAKEFILE)
+#    MAKEFILE: Top level mechanism Makefile (e.g., app.make, bundle.make)
+
+# Compiler/linker flags added to the defaults:  The OTHER_* variables will be 
+# inherited by all nested sub-projects, but the LOCAL_ versions of the same
+# variables will not.  Put your -I, -D, -U, and -L flags in ProjectBuilder's
+# Build Attributes inspector if at all possible.  To override the default flags
+# that get passed to ${CC} (e.g. change -O to -O2), see Makefile.postamble.  The
+# variables below are *inputs* to the build process and distinct from the override
+# settings done (less often) in the Makefile.postamble.
+#
+#    OTHER_CFLAGS, LOCAL_CFLAGS:  additional flags to pass to the compiler
+#      Note that $(OTHER_CFLAGS) and $(LOCAL_CFLAGS) are used for .h, ...c, .m,
+#      .cc, .cxx, .C, and .M files.  There is no need to respecify the
+#      flags in OTHER_MFLAGS, etc.
+#    OTHER_MFLAGS, LOCAL_MFLAGS:  additional flags for .m files
+#    OTHER_CCFLAGS, LOCAL_CCFLAGS:  additional flags for .cc, .cxx, and ...C files
+#    OTHER_MMFLAGS, LOCAL_MMFLAGS:  additional flags for .mm and .M files
+#    OTHER_PRECOMPFLAGS, LOCAL_PRECOMPFLAGS:  additional flags used when
+#      precompiling header files
+#    OTHER_LDFLAGS, LOCAL_LDFLAGS:  additional flags passed to ld and libtool
+#    OTHER_PSWFLAGS, LOCAL_PSWFLAGS:  additional flags passed to pswrap
+#    OTHER_RPCFLAGS, LOCAL_RPCFLAGS:  additional flags passed to rpcgen
+#    OTHER_YFLAGS, LOCAL_YFLAGS:  additional flags passed to yacc
+#    OTHER_LFLAGS, LOCAL_LFLAGS:  additional flags passed to lex
+
+# These variables provide hooks enabling you to add behavior at almost every 
+# stage of the make:
+#
+#    BEFORE_PREBUILD: targets to build before installing headers for a subproject
+#    AFTER_PREBUILD: targets to build after installing headers for a subproject
+#    BEFORE_BUILD_RECURSION: targets to make before building subprojects
+#    BEFORE_BUILD: targets to make before a build, but after subprojects
+#    AFTER_BUILD: targets to make after a build
+#
+#    BEFORE_INSTALL: targets to build before installing the product
+#    AFTER_INSTALL: targets to build after installing the product
+#    BEFORE_POSTINSTALL: targets to build before postinstalling every subproject
+#    AFTER_POSTINSTALL: targts to build after postinstalling every subproject
+#
+#    BEFORE_INSTALLHDRS: targets to build before installing headers for a 
+#         subproject
+#    AFTER_INSTALLHDRS: targets to build after installing headers for a subproject
+#    BEFORE_INSTALLSRC: targets to build before installing source for a subproject
+#    AFTER_INSTALLSRC: targets to build after installing source for a subproject
+#
+#    BEFORE_DEPEND: targets to build before building dependencies for a
+#        subproject
+#    AFTER_DEPEND: targets to build after building dependencies for a
+#        subproject
+#
+#    AUTOMATIC_DEPENDENCY_INFO: if YES, then the dependency file is
+#        updated every time the project is built.  If NO, the dependency
+#        file is only built when the depend target is invoked.
+
+# Framework-related variables:
+#    FRAMEWORK_DLL_INSTALLDIR:  On Windows platforms, this variable indicates
+#      where to put the framework's DLL.  This variable defaults to 
+#      $(INSTALLDIR)/../Executables
+
+# Library-related variables:
+#    PUBLIC_HEADER_DIR:  Determines where public exported header files
+#      should be installed.  Do not include $(DSTROOT) in this value --
+#      it is prefixed automatically.
+#    PRIVATE_HEADER_DIR:  Determines where private exported header files
+#      should be installed.  Do not include $(DSTROOT) in this value --
+#      it is prefixed automatically.
+#    LIBRARY_STYLE:  This may be either STATIC or DYNAMIC, and determines
+#      whether the libraries produced are statically linked when they
+#      are used or if they are dynamically loadable. <<default?>>
+#    LIBRARY_DLL_INSTALLDIR:  On Windows platforms, this variable indicates
+#      where to put the library's DLL.  This variable defaults to 
+#      $(INSTALLDIR)/../Executables
+#
+#    INSTALL_AS_USER: owner of the intalled products (default root)
+#    INSTALL_AS_GROUP: group of the installed products (default wheel)
+#    INSTALL_PERMISSION: permissions of the installed product (default o+rX)
+#
+#    OTHER_RECURSIVE_VARIABLES: The names of variables which you want to be
+#      passed on the command line to recursive invocations of make.  Note that
+#      the values in OTHER_*FLAGS are inherited by subprojects automatically --
+#      you do not have to (and shouldn't) add OTHER_*FLAGS to 
+#      OTHER_RECURSIVE_VARIABLES. 
+
+# Additional headers to export beyond those in the PB.project:
+#    OTHER_PUBLIC_HEADERS
+#    OTHER_PROJECT_HEADERS
+#    OTHER_PRIVATE_HEADERS
+
+# Additional files for the project's product: <<path relative to proj?>>
+#    OTHER_RESOURCES: (non-localized) resources for this project
+#    OTHER_OFILES: relocatables to be linked into this project
+#    OTHER_LIBS: more libraries to link against
+#    OTHER_PRODUCT_DEPENDS: other dependencies of this project
+#    OTHER_SOURCEFILES: other source files maintained by .pre/postamble
+#    OTHER_GARBAGE: additional files to be removed by `make clean'
+
+# Set this to YES if you don't want a final libtool call for a library/framework.
+#    BUILD_OFILES_LIST_ONLY
+
+# To include a version string, project source must exist in a directory named 
+# $(NAME).%d[.%d][.%d] and the following line must be uncommented.
+# OTHER_GENERATED_OFILES = $(VERS_OFILE)
+
+# This definition will suppress stripping of debug symbols when an executable
+# is installed.  By default it is YES.
+# STRIP_ON_INSTALL = NO
diff --git a/runtime/Messengers.subproj/PB.project b/runtime/Messengers.subproj/PB.project
new file mode 100644 (file)
index 0000000..fd1a78e
--- /dev/null
@@ -0,0 +1,40 @@
+{
+    DYNAMIC_CODE_GEN = YES; 
+    FILESTABLE = {
+        CLASSES = (); 
+        H_FILES = (); 
+        OTHER_LINKED = ("objc-msg.s"); 
+        OTHER_SOURCES = (
+            Makefile.preamble, 
+            Makefile, 
+            Makefile.postamble, 
+            "objc-msg-hppa-lock.s", 
+            "objc-msg-hppa-nolock.s", 
+            "objc-msg-hppa-pdo.s", 
+            "objc-msg-hppa-pdo-pic.s", 
+            "objc-msg-i386.s", 
+            "objc-msg-i386-nextpdo-winnt3.5.s", 
+            "objc-msg-ppc.s", 
+            "objc-msg-m68k-lock.s", 
+            "objc-msg-m68k-nolock.s", 
+            "objc-msg-sparc.s", 
+            "objc-msg-sparc-pdo.s"
+        ); 
+        SUBPROJECTS = (); 
+    }; 
+    LANGUAGE = English; 
+    LOCALIZABLE_FILES = {}; 
+    MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; 
+    NEXTSTEP_BUILDTOOL = /bin/gnumake; 
+    NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; 
+    NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; 
+    PDO_UNIX_BUILDTOOL = $NEXT_ROOT/Developer/bin/make; 
+    PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; 
+    PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; 
+    PROJECTNAME = Messengers; 
+    PROJECTTYPE = Component; 
+    PROJECTVERSION = 2.8; 
+    WINDOWS_BUILDTOOL = $NEXT_ROOT/Developer/Executables/make; 
+    WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; 
+    WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; 
+}
diff --git a/runtime/Messengers.subproj/objc-msg-hppa-lock.s b/runtime/Messengers.subproj/objc-msg-hppa-lock.s
new file mode 100644 (file)
index 0000000..b55820a
--- /dev/null
@@ -0,0 +1,523 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifdef KERNEL
+#define OBJC_LOCK_ROUTINE _simple_lock
+#else
+; _objc_entryPoints and _objc_exitPoints are used by moninitobjc() to setup
+; objective-C messages for profiling.  The are made private_externs when in
+; a shared library.
+       .reference _moninitobjc
+       .const
+       .align 2
+.globl _objc_entryPoints
+_objc_entryPoints:
+       .long _objc_msgSend
+       .long _objc_msgSendSuper
+       .long _objc_msgSendv
+       .long 0
+
+.globl _objc_exitPoints
+_objc_exitPoints:
+       .long Lexit1
+       .long Lexit2
+       .long Lexit3
+       .long Lexit4
+       .long Lexit5
+       .long Lexit6
+       .long Lexit7
+       .long Lexit8
+       .long 0
+       
+#define OBJC_LOCK_ROUTINE _spin_lock
+#endif /* KERNEL */
+
+#define isa 0
+#define cache 32
+#define mask  0
+#define buckets 8
+#define method_name 0
+#define method_imp 8
+
+
+; optimized for hppa: 20? clocks (best case) + 6 clocks / probe
+
+        .text
+       .align 4
+       .globl _objc_msgSend
+       
+_objc_msgSend:
+       ldil    L`__objc_multithread_mask,%r1
+       ldw     R`__objc_multithread_mask(%r1),%r19
+       and,=   %r19,%r26,%r19
+       b,n     L0                      ; if (self & multi) goto normalcase
+        comiclr,= 0,%r26,0               
+        b,n    LSendLocking            ; else if (self) goto lockingcase
+        nop
+        bv      0(%r2)                  ; else return null
+        copy    0,%r28                  ; <delay slot> return val = 0
+L0:     
+        ldw      isa(0,%r26),%r19       ;     class = self->isa;
+        ldw      cache(0,%r19),%r20     ;     cache = class->cache
+        ldw      mask(0,%r20),%r21      ;     mask = cache->mask
+        ldo      buckets(%r20),%r20     ;     buckets = cache->buckets
+        and      %r21,%r25,%r22         ;     index = selector & mask;
+L1:
+        ldwx,s   %r22(0,%r20),%r19     ;     method = cache->buckets[index];
+        comib,=,n 0,%r19,LcacheMiss    ;     if (method == NULL)
+        ldw     method_name(0,%r19),%r1 ; 
+        addi    1,%r22,%r22             ; ++index
+        comb,<> %r1, %r25, L1          ; if (name!=sel) continue loop
+        and     %r21,%r22,%r22          ; <delay slot> index &=mask
+        ldw     method_imp(0,%r19),%r19
+Lexit1:
+        bv,n     0(%r19)                ;    goto *imp;  (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+LcacheMiss:
+; We have to save all the register based arguments (including floating
+; point) before calling _class_lookupMethodAndLoadCache.  This is because
+; we do not know what arguments were passed to us, and the arguments are
+; not guaranteed to be saved across procedure calls (they are all caller-saved)
+; We also have to save the return address (since we did not save it on entry).
+
+
+        copy    %r30,%r19
+        ldo     128(%r30),%r30          ; Allocate space on stack
+        stwm    %r2,4(0,%r19)           ; Save return pointer
+        stwm    %r23,4(0,%r19)          ; Save old args
+        stwm    %r24,4(0,%r19)          ;
+        stwm    %r25,4(0,%r19)          ;
+        stwm    %r26,4(0,%r19)          ;
+#ifndef KERNEL
+        fstds,mb  %fr4,4(0,%r19)        ; Save floating point args
+        fstds,mb  %fr5,8(0,%r19)        ;    mb (modify before) is used instead
+        fstds,mb  %fr6,8(0,%r19)        ;    of ma (as is implicit in above
+        fstds,mb  %fr7,8(0,%r19)        ;    stores) with an initial value of 4
+                                        ;    so that doubles are aligned
+                                        ;    to 8 byte boundaries.
+                                        ; Arg 1 (selector) is the same
+#endif /* KERNEL */            
+
+        stw     %r28,8(0,%r19)          ; save return struct ptr
+        ldw      isa(0,%r26),%r26       ; <delay slot> arg 0 = self->isa
+        CALL_EXTERN(__class_lookupMethodAndLoadCache)
+
+        ldo     -128(%r30),%r30         ;   deallocate
+        copy    %r30,%r19               ;
+        ldwm    4(0,%r19),%r2           ; restore everything
+        ldwm    4(0,%r19),%r23          ; 
+        ldwm    4(0,%r19),%r24          ;
+        ldwm    4(0,%r19),%r25          ;
+        ldwm    4(0,%r19),%r26          ;
+#ifndef KERNEL
+        fldds,mb  4(0,%r19),%fr4        ; see comment above about alignment
+        fldds,mb  8(0,%r19),%fr5        ;
+        fldds,mb  8(0,%r19),%fr6        ;
+        fldds,mb  8(0,%r19),%fr7        ;
+#endif /* KERNEL */            
+        ldw     8(0,%r19),%r20          ; get ret structure ptr
+
+        copy    %r28,%r19
+        copy    %r20,%r28               ; restore ret structure ptr
+Lexit2:
+        bv,n    0(%r19)                 ;  goto *imp   (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+
+
+; Locking version of objc_msgSend
+; uses spin_lock() to lock the mutex.
+
+LSendLocking:
+        copy    %r30,%r19
+        ldo     128(%r30),%r30          ; Allocate space on stack
+        stwm    %r2,4(0,%r19)           ; Save return pointer
+        stwm    %r23,4(0,%r19)          ; Save old args
+        stwm    %r24,4(0,%r19)          ;
+        stwm    %r25,4(0,%r19)          ;
+        stwm    %r26,4(0,%r19)          ;
+        stwm    %r28,4(0,%r19)          ; save return struct ptr
+#ifndef KERNEL         
+        fstds,ma  %fr4,8(0,%r19)        ; Save floating point args
+        fstds,ma  %fr5,8(0,%r19)        ;
+        fstds,ma  %fr6,8(0,%r19)        ;
+        fstds,ma  %fr7,8(0,%r19)        ;
+#endif /* KERNEL */            
+       
+       ldil    L`_messageLock,%r1
+       ldo     R`_messageLock(%r1),%r26
+       ldil    L`OBJC_LOCK_ROUTINE,%r1 ; call spin_lock() with _messageLock
+       ble     R`OBJC_LOCK_ROUTINE(%sr4,%r1)
+       copy    %r31,%r2
+        ldw    -112(%r30),%r26         ; restore arg0 
+       ldw     -108(%r30),%r28         ; and ret0 (spin_lock doesnt
+                                       ; touch anything else important)
+       ldw      isa(0,%r26),%r19       ;     class = self->isa;
+        ldw      cache(0,%r19),%r20     ;     cache = class->cache
+        ldw      mask(0,%r20),%r21      ;     mask = cache->mask
+        ldo      buckets(%r20),%r20     ;     buckets = cache->buckets
+        and      %r21,%r25,%r22         ;     index = selector & mask;
+LL1:
+        ldwx,s   %r22(0,%r20),%r19     ;     method = cache->buckets[index];
+        comib,=,n 0,%r19,LL2           ;     if (method == NULL)
+        ldw     method_name(0,%r19),%r1 ; 
+        addi    1,%r22,%r22             ; ++index
+        comb,<> %r1, %r25, LL1         ; if (name!=sel) continue loop
+        and     %r21,%r22,%r22          ; <delay slot> index &=mask
+        ldw     method_imp(0,%r19),%r19
+#if KERNEL
+       ldil    L`_messageLock,%r1
+       ldo     R`_messageLock(%r1),%r20
+       addi        0xc,%r20,%r20
+       depi        0,31,4,%r20
+       zdepi       1,31,1,%r1
+       stw         %r1,0(0,%r20)
+#else
+        ldil   L`_messageLock,%r1
+       stw     %r0,R`_messageLock(%r1) ; unlock the lock
+#endif 
+       ldwm    -128(%r30),%r2          ; restore original rp and deallocate
+Lexit3:
+       bv,n     0(%r19)                ;    goto *imp;  (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+LL2:
+        ldw      isa(0,%r26),%r26       ; arg 0 = self->isa
+        CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+
+        ldo     -128(%r30),%r30         ;   deallocate
+        copy    %r30,%r19               ;
+        ldwm    4(0,%r19),%r2           ; restore everything
+        ldwm    4(0,%r19),%r23          ; 
+        ldwm    4(0,%r19),%r24          ;
+        ldwm    4(0,%r19),%r25          ;
+        ldwm    4(0,%r19),%r26          ;
+        ldwm    4(0,%r19),%r20          ; get ret structure ptr
+#ifndef KERNEL         
+        fldds,ma  8(0,%r19),%fr4        ;
+        fldds,ma  8(0,%r19),%fr5        ;
+        fldds,ma  8(0,%r19),%fr6        ;
+        fldds,ma  8(0,%r19),%fr7        ;
+#endif /* KERNEL */            
+        copy    %r28,%r19
+        copy    %r20,%r28               ; restore ret structure ptr
+#if KERNEL
+       ldil    L`_messageLock,%r1
+       ldo     R`_messageLock(%r1),%r20
+       addi        0xc,%r20,%r20
+       depi        0,31,4,%r20
+       zdepi       1,31,1,%r1
+    stw         %r1,0(0,%r20)
+#else
+        ldil   L`_messageLock,%r1
+       stw     %r0,R`_messageLock(%r1) ; unlock the lock
+#endif
+Lexit4:
+        bv,n    0(%r19)                 ;  goto *imp   (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+
+
+
+
+#define receiver 0
+#define class 4
+
+        .globl _objc_msgSendSuper
+_objc_msgSendSuper:
+       ldil    L`__objc_multithread_mask,%r1
+       ldw     R`__objc_multithread_mask(%r1),%r19
+       combt,= %r0,%r19,LSuperLocking  ; 
+        ldw      class(0,%r26),%r19     ;     class = caller->class;
+        ldw      cache(0,%r19),%r20     ;     cache = class->cache
+        ldw      mask(0,%r20),%r21      ;     mask = cache->mask
+        ldo      buckets(%r20),%r20     ;     buckets = cache->buckets
+        and      %r21,%r25,%r22         ;     index = selector & mask;
+LS1:                                   ;
+        ldwx,s   %r22(0,%r20),%r19      ;     method = cache->buckets[index];
+        comib,=,n 0,%r19,LS2           ;     if (method == NULL)
+        ldw     method_name(0,%r19),%r1; 
+        addi    1,%r22,%r22             ; ++index
+        comb,<> %r1, %r25, LS1          ; if (name!=sel) continue loop
+        and     %r21,%r22,%r22          ; <delay slot> index &=mask
+        ldw     method_imp(0,%r19),%r19
+        ldw     receiver(0,%r26),%r26   ;     self = caller->receiver;
+Lexit5:  
+        bv,n     0(%r19)                ;    goto *imp;  (nullify delay)
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+                                        ;
+LS2:                                   ;
+        copy    %r30,%r19
+        ldo     128(%r30),%r30          ; Allocate space on stack
+        stwm    %r2,4(0,%r19)           ; Save return pointer
+        stwm    %r23,4(0,%r19)          ; Save old args
+        stwm    %r24,4(0,%r19)          ;
+        stwm    %r25,4(0,%r19)          ;
+        stwm    %r26,4(0,%r19)          ;
+#ifndef KERNEL         
+        fstds,mb  %fr4,4(0,%r19)        ; Save floating point args
+        fstds,mb  %fr5,8(0,%r19)        ;    mb (modify before) is used instead
+        fstds,mb  %fr6,8(0,%r19)        ;    of ma (as is implicit in above
+        fstds,mb  %fr7,8(0,%r19)        ;    stores) with an initial value of 4
+                                        ;    so that doubles are aligned
+                                        ;    to 8 byte boundaries.
+                                        ; Arg 1 (selector) is the same
+#endif /* KERNEL */                                                                            
+        stw     %r28,8(0,%r19)          ; save return struct ptr
+        ldw      class(0,%r26),%r26     ; arg 0 = caller->class;
+        CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+        ldo     -128(%r30),%r30         ;   deallocate
+        copy    %r30,%r19               ;
+        ldwm    4(0,%r19),%r2           ; restore everything
+        ldwm    4(0,%r19),%r23          ; 
+        ldwm    4(0,%r19),%r24          ;
+        ldwm    4(0,%r19),%r25          ;
+        ldwm    4(0,%r19),%r26          ;
+#ifndef KERNEL                         
+        fldds,mb  4(0,%r19),%fr4        ; see comment above about alignment
+        fldds,mb  8(0,%r19),%fr5        ;
+        fldds,mb  8(0,%r19),%fr6        ;
+        fldds,mb  8(0,%r19),%fr7        ;
+#endif /* KERNEL */                                                                            
+        ldw     8(0,%r19),%r20          ; get ret structure ptr
+        ldw      receiver(0,%r26),%r26  ;     self = caller->receiver;
+        copy    %r28,%r19
+        copy    %r20,%r28
+Lexit6:  bv,n    0(%r19)                 ;  goto *imp   (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+
+
+
+
+; locking version of objc_msgSendSuper
+; uses spin_lock() to lock the lock.
+
+
+LSuperLocking:
+        copy    %r30,%r19
+        ldo     128(%r30),%r30          ; Allocate space on stack
+        stwm    %r2,4(0,%r19)           ; Save return pointer
+        stwm    %r23,4(0,%r19)          ; Save old args
+        stwm    %r24,4(0,%r19)          ;
+        stwm    %r25,4(0,%r19)          ;
+        stwm    %r26,4(0,%r19)          ;
+        stwm    %r28,4(0,%r19)          ; save return struct ptr
+#ifndef KERNEL         
+        fstds,ma  %fr4,8(0,%r19)        ; Save floating point args
+        fstds,ma  %fr5,8(0,%r19)        ;
+        fstds,ma  %fr6,8(0,%r19)        ;
+        fstds,ma  %fr7,8(0,%r19)        ;
+#endif /* KERNEL */                                                                            
+       ldil    L`_messageLock,%r1
+       ldo     R`_messageLock(%r1),%r26
+       ldil    L`OBJC_LOCK_ROUTINE,%r1 ; call spin_lock() with _messageLock
+       ble     R`OBJC_LOCK_ROUTINE(%sr4,%r1)
+       copy    %r31,%r2
+        ldw    -112(%r30),%r26         ; restore arg0 
+       ldw     -108(%r30),%r28         ; and ret0 (spin_lock doesnt
+                                       ; touch anything else)
+        ldw      class(0,%r26),%r19     ;     class = caller->class;
+        ldw      cache(0,%r19),%r20     ;     cache = class->cache
+        ldw      mask(0,%r20),%r21      ;     mask = cache->mask
+        ldo      buckets(%r20),%r20     ;     buckets = cache->buckets
+        and      %r21,%r25,%r22         ;     index = selector & mask;
+LLS1:                                  ;
+        ldwx,s   %r22(0,%r20),%r19      ;     method = cache->buckets[index];
+        comib,=,n 0,%r19,LLS2           ;     if (method == NULL)
+        ldw     method_name(0,%r19),%r1; 
+        addi    1,%r22,%r22             ; ++index
+        comb,<> %r1, %r25, LLS1          ; if (name!=sel) continue loop
+        and     %r21,%r22,%r22          ; <delay slot> index &=mask
+        ldw     method_imp(0,%r19),%r19
+        ldw     receiver(0,%r26),%r26   ;     self = caller->receiver;
+#if KERNEL
+       ldil    L`_messageLock,%r1
+       ldo     R`_messageLock(%r1),%r20
+       addi        0xc,%r20,%r20
+       depi        0,31,4,%r20
+       zdepi       1,31,1,%r1
+    stw         %r1,0(0,%r20)
+#else
+        ldil   L`_messageLock,%r1
+       stw     %r0,R`_messageLock(%r1) ; unlock the lock
+#endif
+       ldwm    -128(%r30),%r2          ; restore original rp and deallocate
+Lexit7:  
+        bv,n     0(%r19)                ;    goto *imp;  (nullify delay)
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+                                        ;
+LLS2:                                  ;
+        ldw     class(0,%r26),%r26     ; <delay slot> arg 0 = caller->class;
+        CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+        ldo     -128(%r30),%r30         ;   deallocate
+        copy    %r30,%r19               ;
+        ldwm    4(0,%r19),%r2           ; restore everything
+        ldwm    4(0,%r19),%r23          ; 
+        ldwm    4(0,%r19),%r24          ;
+        ldwm    4(0,%r19),%r25          ;
+        ldwm    4(0,%r19),%r26          ;
+        ldwm    4(0,%r19),%r20          ; get ret structure ptr
+#ifndef KERNEL
+        fldds,ma  8(0,%r19),%fr4        ; 
+        fldds,ma  8(0,%r19),%fr5        ;
+        fldds,ma  8(0,%r19),%fr6        ;
+        fldds,ma  8(0,%r19),%fr7        ;
+#endif /* KERNEL */                                                                                            
+        ldw      receiver(0,%r26),%r26  ;     self = caller->receiver;
+        copy    %r28,%r19
+        copy    %r20,%r28
+#if KERNEL
+       ldil    L`_messageLock,%r1
+       ldo     R`_messageLock(%r1),%r20
+       addi        0xc,%r20,%r20
+       depi        0,31,4,%r20
+       zdepi       1,31,1,%r1
+    stw         %r1,0(0,%r20)
+#else
+        ldil   L`_messageLock,%r1
+       stw     %r0,R`_messageLock(%r1) ; unlock the lock
+#endif
+Lexit8:  bv,n    0(%r19)                 ;  goto *imp   (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+
+
+        
+        .objc_meth_var_names
+       .align 1
+L30:    .ascii "forward::\0"
+
+        .objc_message_refs
+       .align 2
+L31:    .long L30
+
+        .cstring
+       .align 1
+L32:    .ascii "Does not recognize selector %s\0"
+
+        .text
+        .align 1
+;
+; NOTE: Because the stack grows from low mem to high mem on this machine
+; and the args go the other way, the marg_list pointer is to the first argument
+; and subsequent arguments are at NEGATIVE offsets from the marg_list.
+; This means that marg_getValue() and related macros will have to be adjusted
+; appropriately.
+;
+       .globl __objc_msgForward
+__objc_msgForward:
+        stw     %r2,-20(0,%r30)         ; save rp
+        ldo     64(%r30),%r30           ; create frame area (no locals needed)
+        ldil    L`L31,%r1
+        ldo     R`L31(%r1),%r19
+        ldw     0(0,%r19),%r19
+        combt,=,n %r19, %r25,L34       ; if (sel==@selector(forward::))
+        ldo     -112(%r30),%r20         ; ptr to arg3 homing area
+        stwm    %r23,4(0,%r20)          ; Mirror registers onto stack
+        stwm    %r24,4(0,%r20)          ;
+        stwm    %r25,4(0,%r20)          ;
+        stwm    %r26,4(0,%r20)          ;
+        
+        copy    %r25,%r24
+        copy    %r19,%r25               ; [self forward:sel :marg_list]
+
+        bl      _objc_msgSend,%r2
+        copy    %r20,%r23               ; <delay slot> copy original sel
+
+        ldo     -64(%r30),%r30         ; deallocate
+        ldw     -20(0,%r30),%r2                ; restore rp
+        bv,n    0(%r2)                 ; return
+L34:
+        ldil    L`L32,%r1
+        ldo     R`L32(%r1),%r25
+        copy    %r19,%r24              ;
+       BRANCH_EXTERN(__objc_error)
+
+
+; Algorithm is as follows:
+; . Calculate how much stack size is needed for any arguments not in the
+;   general registers and allocate space on stack.
+; . Restore general argument regs from the bottom of the marg_list.
+; . Restore fp argument regs from the same area.
+;   (The first two args in the marg list are always old obj and old SEL.)
+; . Call the new method.
+       .globl _objc_msgSendv
+_objc_msgSendv:
+                                        ; objc_msgSendv(self, sel, size, margs)
+        stw     %r2,-20(0,%r30)         ; Save rp
+        stw     %r4,-36(0,%r30)         ; Save callee-saved r4 
+        copy    %r30,%r4                ; Save old sp vale
+        ldo     95(%r24),%r19           ; Calculate frame size, rounded
+        depi    0,31,6,%r19             ; up to 64 byte boundary...
+
+        add     %r19,%r30,%r30          ; Allocate frame area (no locals)
+        copy    %r24,%r20               ; r20 now holds arg size
+        ldo     -16(%r23),%r21          ; r21 now holds marg_list+16
+        ldws    0(0,%r21),%r23          ; Get old general register args (dont
+        ldws    4(0,%r21),%r24          ; need first two: always self & SEL)
+#ifndef KERNEL         
+        fldds   0(0,%r21),%fr7          ; Mirror to fp regs
+        fldws   4(0,%r21),%fr6          ; 
+#endif /* KERNEL */            
+
+        ldo     -52(%r30),%r22          ; newly allocated stack area.
+        ldo     -8(%r20),%r20           ; Size -= 8
+        comibf,<,n 0,%r20,L36
+L35:    ldws,mb -4(0,%r21),%r19         ; while(size>0)
+        addibf,<= -4,%r20,L35          ;  { *(dest--) = *(src--); size-=4; }
+        stws,ma %r19,-4(0,%r22)         ; <delay slot>
+L36:    bl      _objc_msgSend,%r2
+        nop
+        copy    %r4,%r30                ; deallocate
+        ldw     -36(0,%r30), %r4
+        ldw     -20(0,%r30), %r2
+        bv,n    0(%r2)
+
+
diff --git a/runtime/Messengers.subproj/objc-msg-hppa-nolock.s b/runtime/Messengers.subproj/objc-msg-hppa-nolock.s
new file mode 100644 (file)
index 0000000..549beb2
--- /dev/null
@@ -0,0 +1,307 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifdef KERNEL
+#define OBJC_LOCK_ROUTINE _simple_lock
+#else
+; _objc_entryPoints and _objc_exitPoints are used by moninitobjc() to setup
+; objective-C messages for profiling.  The are made private_externs when in
+; a shared library.
+       .reference _moninitobjc
+       .const
+       .align 2
+.globl _objc_entryPoints
+_objc_entryPoints:
+       .long _objc_msgSend
+       .long _objc_msgSendSuper
+       .long 0
+
+.globl _objc_exitPoints
+_objc_exitPoints:
+       .long Lexit1
+       .long Lexit5
+       .long 0
+       
+#define OBJC_LOCK_ROUTINE _spin_lock
+#endif /* KERNEL */
+
+#define isa 0
+#define cache 32
+#define mask  0
+#define buckets 8
+#define method_name 0
+#define method_imp 8
+
+
+; optimized for hppa: 20? clocks (best case) + 6 clocks / probe
+
+        .text
+       .align 4
+       .globl _objc_msgSend
+       
+_objc_msgSend:
+        comib,<>,n  0,%r26,L0          ; if (self) goto normalcase
+       nop
+        bv      0(%r2)                  ; else return null
+        copy    0,%r28                  ; <delay slot> return val = 0
+L0:     
+        ldw      isa(0,%r26),%r19       ;     class = self->isa;
+        ldw      cache(0,%r19),%r20     ;     cache = class->cache
+        ldw      mask(0,%r20),%r21      ;     mask = cache->mask
+        ldo      buckets(%r20),%r20     ;     buckets = cache->buckets
+        and      %r21,%r25,%r22         ;     index = selector & mask;
+L1:
+        ldwx,s   %r22(0,%r20),%r19     ;     method = cache->buckets[index];
+        comib,=,n 0,%r19,LcacheMiss    ;     if (method == NULL)
+        ldw     method_name(0,%r19),%r1 ; 
+        addi    1,%r22,%r22             ; ++index
+        comb,<> %r1, %r25, L1          ; if (name!=sel) continue loop
+        and     %r21,%r22,%r22          ; <delay slot> index &=mask
+        ldw     method_imp(0,%r19),%r19
+Lexit1:
+        bv,n     0(%r19)                ;    goto *imp;  (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+LcacheMiss:
+; We have to save all the register based arguments (including floating
+; point) before calling _class_lookupMethodAndLoadCache.  This is because
+; we do not know what arguments were passed to us, and the arguments are
+; not guaranteed to be saved across procedure calls (they are all caller-saved)
+; We also have to save the return address (since we did not save it on entry).
+
+
+        copy    %r30,%r19
+        ldo     128(%r30),%r30          ; Allocate space on stack
+        stwm    %r2,4(0,%r19)           ; Save return pointer
+        stwm    %r23,4(0,%r19)          ; Save old args
+        stwm    %r24,4(0,%r19)          ;
+        stwm    %r25,4(0,%r19)          ;
+        stwm    %r26,4(0,%r19)          ;
+#ifndef KERNEL
+        fstds,mb  %fr4,4(0,%r19)        ; Save floating point args
+        fstds,mb  %fr5,8(0,%r19)        ;    mb (modify before) is used instead
+        fstds,mb  %fr6,8(0,%r19)        ;    of ma (as is implicit in above
+        fstds,mb  %fr7,8(0,%r19)        ;    stores) with an initial value of 4
+                                        ;    so that doubles are aligned
+                                        ;    to 8 byte boundaries.
+                                        ; Arg 1 (selector) is the same
+#endif /* KERNEL */            
+
+        stw     %r28,8(0,%r19)          ; save return struct ptr
+        ldw      isa(0,%r26),%r26       ; arg 0 = self->isa
+        CALL_EXTERN(__class_lookupMethodAndLoadCache)
+
+        ldo     -128(%r30),%r30         ;   deallocate
+        copy    %r30,%r19               ;
+        ldwm    4(0,%r19),%r2           ; restore everything
+        ldwm    4(0,%r19),%r23          ; 
+        ldwm    4(0,%r19),%r24          ;
+        ldwm    4(0,%r19),%r25          ;
+        ldwm    4(0,%r19),%r26          ;
+#ifndef KERNEL
+        fldds,mb  4(0,%r19),%fr4        ; see comment above about alignment
+        fldds,mb  8(0,%r19),%fr5        ;
+        fldds,mb  8(0,%r19),%fr6        ;
+        fldds,mb  8(0,%r19),%fr7        ;
+#endif /* KERNEL */            
+        ldw     8(0,%r19),%r20          ; get ret structure ptr
+
+        copy    %r28,%r19
+        copy    %r20,%r28               ; restore ret structure ptr
+Lexit2:
+        bv,n    0(%r19)                 ;  goto *imp   (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+
+
+
+
+#define receiver 0
+#define class 4
+
+        .globl _objc_msgSendSuper
+_objc_msgSendSuper:
+        ldw      class(0,%r26),%r19     ;     class = caller->class;
+        ldw      cache(0,%r19),%r20     ;     cache = class->cache
+        ldw      mask(0,%r20),%r21      ;     mask = cache->mask
+        ldo      buckets(%r20),%r20     ;     buckets = cache->buckets
+        and      %r21,%r25,%r22         ;     index = selector & mask;
+LS1:                                   ;
+        ldwx,s   %r22(0,%r20),%r19      ;     method = cache->buckets[index];
+        comib,=,n 0,%r19,LS2           ;     if (method == NULL)
+        ldw     method_name(0,%r19),%r1; 
+        addi    1,%r22,%r22             ; ++index
+        comb,<> %r1, %r25, LS1          ; if (name!=sel) continue loop
+        and     %r21,%r22,%r22          ; <delay slot> index &=mask
+        ldw     method_imp(0,%r19),%r19
+        ldw     receiver(0,%r26),%r26   ;     self = caller->receiver;
+Lexit5:  
+        bv,n     0(%r19)                ;    goto *imp;  (nullify delay)
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+                                        ;
+LS2:                                   ;
+        copy    %r30,%r19
+        ldo     128(%r30),%r30          ; Allocate space on stack
+        stwm    %r2,4(0,%r19)           ; Save return pointer
+        stwm    %r23,4(0,%r19)          ; Save old args
+        stwm    %r24,4(0,%r19)          ;
+        stwm    %r25,4(0,%r19)          ;
+        stwm    %r26,4(0,%r19)          ;
+#ifndef KERNEL         
+        fstds,mb  %fr4,4(0,%r19)        ; Save floating point args
+        fstds,mb  %fr5,8(0,%r19)        ;    mb (modify before) is used instead
+        fstds,mb  %fr6,8(0,%r19)        ;    of ma (as is implicit in above
+        fstds,mb  %fr7,8(0,%r19)        ;    stores) with an initial value of 4
+                                        ;    so that doubles are aligned
+                                        ;    to 8 byte boundaries.
+                                        ; Arg 1 (selector) is the same
+#endif /* KERNEL */                                                                            
+        stw     %r28,8(0,%r19)          ; save return struct ptr
+        ldw      class(0,%r26),%r26     ; arg 0 = caller->class;
+        CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+
+        ldo     -128(%r30),%r30         ;   deallocate
+        copy    %r30,%r19               ;
+        ldwm    4(0,%r19),%r2           ; restore everything
+        ldwm    4(0,%r19),%r23          ; 
+        ldwm    4(0,%r19),%r24          ;
+        ldwm    4(0,%r19),%r25          ;
+        ldwm    4(0,%r19),%r26          ;
+#ifndef KERNEL                         
+        fldds,mb  4(0,%r19),%fr4        ; see comment above about alignment
+        fldds,mb  8(0,%r19),%fr5        ;
+        fldds,mb  8(0,%r19),%fr6        ;
+        fldds,mb  8(0,%r19),%fr7        ;
+#endif /* KERNEL */                                                                            
+        ldw     8(0,%r19),%r20          ; get ret structure ptr
+        ldw      receiver(0,%r26),%r26  ;     self = caller->receiver;
+        copy    %r28,%r19
+        copy    %r20,%r28
+Lexit6:  bv,n    0(%r19)                 ;  goto *imp   (nullify delay)
+
+#ifdef MONINIT
+        .space 128                      ; /* area for moninitobjc to write */
+#endif
+
+        
+.objc_meth_var_names
+.align 1
+L30:    .ascii "forward::\0"
+
+.objc_message_refs
+.align 2
+L31:    .long L30
+
+.cstring
+.align 1
+L32:    .ascii "Does not recognize selector %s\0"
+
+.text
+.align 1
+;
+; NOTE: Because the stack grows from low mem to high mem on this machine
+; and the args go the other way, the marg_list pointer is to the first argument
+; and subsequent arguments are at NEGATIVE offsets from the marg_list.
+; This means that marg_getValue() and related macros will have to be adjusted
+; appropriately.
+;
+       .globl __objc_msgForward
+__objc_msgForward:
+        stw     %r2,-20(0,%r30)         ; save rp
+        ldo     64(%r30),%r30           ; create frame area (no locals needed)
+        ldil    L`L31,%r1
+        ldo     R`L31(%r1),%r19
+        ldw     0(0,%r19),%r19
+        combt,=,n %r19, %r25,L34       ; if (sel==@selector(forward::))
+        ldo     -112(%r30),%r20         ; ptr to arg3 homing area
+        stwm    %r23,4(0,%r20)          ; Mirror registers onto stack
+        stwm    %r24,4(0,%r20)          ;
+        stwm    %r25,4(0,%r20)          ;
+        stwm    %r26,4(0,%r20)          ;
+        
+        copy    %r25,%r24
+        copy    %r19,%r25               ; [self forward:sel :marg_list]
+
+        bl      _objc_msgSend,%r2
+        copy    %r20,%r23               ; <delay slot> copy original sel
+
+        ldo     -64(%r30),%r30         ; deallocate
+        ldw     -20(0,%r30),%r2                ; restore rp
+        bv,n    0(%r2)                 ; return
+L34:
+        ldil    L`L32,%r1
+        ldo     R`L32(%r1),%r25
+        copy    %r19,%r24                ; no need to clean up.
+        BRANCH_EXTERN(__objc_error)
+
+
+; Algorithm is as follows:
+; . Calculate how much stack size is needed for any arguments not in the
+;   general registers and allocate space on stack.
+; . Restore general argument regs from the bottom of the marg_list.
+; . Restore fp argument regs from the same area.
+;   (The first two args in the marg list are always old obj and old SEL.)
+; . Call the new method.
+       .globl _objc_msgSendv
+_objc_msgSendv:
+                                        ; objc_msgSendv(self, sel, size, margs)
+        stw     %r2,-20(0,%r30)         ; Save rp
+        stw     %r4,-36(0,%r30)         ; Save callee-saved r4 
+        copy    %r30,%r4                ; Save old sp vale
+        ldo     95(%r24),%r19           ; Calculate frame size, rounded
+        depi    0,31,6,%r19             ; up to 64 byte boundary...
+
+        add     %r19,%r30,%r30          ; Allocate frame area (no locals)
+        copy    %r24,%r20               ; r20 now holds arg size
+        ldo     -16(%r23),%r21          ; r21 now holds marg_list+16
+        ldws    0(0,%r21),%r23          ; Get old general register args (dont
+        ldws    4(0,%r21),%r24          ; need first two: always self & SEL)
+#ifndef KERNEL         
+        fldds,mb   0(0,%r21),%fr7          ; Mirror to fp regs
+        fldws   4(0,%r21),%fr6          ; 
+#endif /* KERNEL */            
+
+        ldo     -52(%r30),%r22          ; newly allocated stack area.
+        ldo     -8(%r20),%r20           ; Size -= 8
+        comibf,<,n 0,%r20,L36
+L35:    ldws,mb -4(0,%r21),%r19         ; while(size>0)
+        addibf,<= -4,%r20,L35          ;  { *(dest--) = *(src--); size-=4; }
+        stws,ma %r19,-4(0,%r22)         ; <delay slot>
+L36:    bl      _objc_msgSend,%r2
+        nop
+        copy    %r4,%r30                ; deallocate
+        ldw     -36(0,%r30), %r4
+        ldw     -20(0,%r30), %r2
+Lexit9:
+        bv,n    0(%r2)
+
+
diff --git a/runtime/Messengers.subproj/objc-msg-hppa-pdo-pic.s b/runtime/Messengers.subproj/objc-msg-hppa-pdo-pic.s
new file mode 100644 (file)
index 0000000..f33393b
--- /dev/null
@@ -0,0 +1,563 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/*
+** June 16, 1999 - Laurent Ramontianu
+**    A PIC/sanitized version of the standard hppa-pdo messenger
+**    for use with shared libraries.
+*/
+
+    .SPACE $PRIVATE$
+    .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
+    .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
+    .SUBSPA $$OBJC_MESSAGE_REFS$$,QUAD=1,ALIGN=4,ACCESS=31
+    .SPACE $TEXT$
+    .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
+    .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
+
+    .IMPORT _objc_msgSend_v,DATA
+    .IMPORT _objc_multithread_mask,DATA
+    .IMPORT messageLock,DATA
+    .IMPORT $$dyncall,MILLICODE
+    .IMPORT _class_lookupMethodAndLoadCache,CODE
+    .IMPORT __objc_error,CODE
+
+
+#define isa            0
+#define cache          32
+#define mask           0
+#define buckets                8
+#define method_name    0
+#define method_imp     8
+
+;;
+;; objc_msgSend: Standard messenger
+;;
+
+    .SPACE $TEXT$
+    .SUBSPA $CODE$
+    .align 4
+    .EXPORT objc_msgSend,CODE
+    .EXPORT objc_msgSend,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+objc_msgSend
+    .PROC
+    .CALLINFO
+    .ENTRY
+
+    comib,=    0,%arg0,L$exitNull              ; Return 0 if self == nil
+    nop
+
+    addil      LT'_objc_multithread_mask,%r19          ; '
+    ldw                RT'_objc_multithread_mask(%r1),%r1      ; '
+    ldw                0(0,%r1),%r1
+    comib,=    0,%r1,L$lock                    ; lock if multithreaded
+    nop
+
+L$continue
+    ldw        isa(0,%arg0),%r20               ; class = self->isa;
+    ldw        cache(0,%r20),%r20              ; cache = class->cache
+    ldw        mask(0,%r20),%r21               ; mask = cache->mask
+    ldo        buckets(%r20),%r20              ; buckets = cache->buckets
+    and        %r21,%arg1,%r22                 ; index = selector & mask
+
+L$loop
+    ldwx,s     %r22(0,%r20),%r1                ; method= cache->buckets[index]
+    comib,=    0,%r1,L$cacheMiss               ; if (method == NULL)
+    nop
+
+    ldw        method_name(0,%r1),%r1          ;
+    comb,=     %r1,%arg1,L$finishOff           ; if (name=sel) break loop
+    nop
+
+    addi       1,%r22,%r22                     ; ++index
+    and        %r22,%r21,%r22                  ; index &= mask
+    b          L$loop                          ; continue loop
+    nop
+
+L$finishOff
+    ldwx,s     %r22(0,%r20),%r1                ; method= cache->buckets[index]
+    ldw        method_imp(0,%r1),%r22          ; implementation into r22
+
+    addil      LT'_objc_multithread_mask,%r19          ; '
+    ldw                RT'_objc_multithread_mask(%r1),%r1      ; '
+    ldw                0(0,%r1),%r1
+    comib,=    0,%r1,L$unlock                  ; unlock if multithreaded
+    nop
+
+    b          __next_dynjmp                   ; goto *imp
+    nop
+
+L$exitNull
+    bv         0(%rp)                          ; return null
+    copy       0,%ret0                         ; <delay slot> return val = 0
+
+L$lock
+    addil      LT'messageLock,%r19             ; '
+    ldw                RT'messageLock(%r1),%r20        ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+L$spin
+    ldcws      0(0,%r20),%r1                   ; try to lock it
+    comib,=    0,%r1,L$spin                    ; if locked, try again
+    nop
+
+    b          L$continue                      ; rejoin mainline
+    nop                                                ; <ds>
+
+L$unlock
+    addil      LT'messageLock,%r19             ; '
+    ldw                RT'messageLock(%r1),%r20        ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+    ldi                1,%r1                           ; get a one
+    stw                %r1,0(0,%r20)                   ; clear lock
+
+    b          __next_dynjmp                   ; goto *imp
+    .EXIT
+    nop
+
+/*
+** We have to save all the register based arguments (including floating
+** point) before calling _class_lookupMethodAndLoadCache.  This is because
+** we don't know what arguments were passed to us, and the arguments are
+** not guaranteed to be saved across procedure calls (they're all caller-saved)
+** We also have to save the return address (since we didn't save it on entry).
+*/
+L$cacheMiss
+    .CALLINFO FRAME=128,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r1                 ; save sp in r1 to use store modify
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r1,%r3                 ; establish new frame pointer
+
+    stw                %rp,-20(0,%r3)          ; save rp in frame marker
+    stw                %sp,-4(0,%r3)           ; save sp in frame marker
+
+    stw                %arg0,-36(0,%r3)        ; save arg0 in fixed arg area
+    stw                %arg1,-40(0,%r3)        ; save arg1 in fixed arg area
+    stw                %arg2,-44(0,%r3)        ; save arg2 in fixed arg area
+    stw                %arg3,-48(0,%r3)        ; save arg3 in fixed arg area
+    stw                %ret0,4(0,%r3)          ; save return struct ptr
+    stw                %ret1,8(0,%r3)          ; save return struct ptr
+
+    fstds,mb   %fr4,8(0,%r1)           ; Save floating point args
+    fstds,mb   %fr5,8(0,%r1)           ; mb (modify before) is used
+    fstds,mb   %fr6,8(0,%r1)
+    fstds,mb   %fr7,8(0,%r1)
+
+    .CALL ARGW0=GR,ARGW1=GR
+    bl         _class_lookupMethodAndLoadCache,2
+    ldw                isa(0,%arg0),%arg0      ; <delay slot> arg 0 = self->isa
+
+    copy       %ret0,%r22              ; move return value r22 for dynjmp
+
+    copy       %r3,%r1                 ; prev frame for fldds,mb
+    fldds,mb   8(0,%r1),%fr4
+    fldds,mb   8(0,%r1),%fr5
+    fldds,mb   8(0,%r1),%fr6
+    fldds,mb   8(0,%r1),%fr7
+
+    ldw                4(0,%r3),%ret0          ; restore everything
+    ldw                8(0,%r3),%ret1          ; restore everything
+    ldw                -36(0,%r3),%arg0
+    ldw                -40(0,%r3),%arg1
+    ldw                -44(0,%r3),%arg2
+    ldw                -48(0,%r3),%arg3
+
+    ldw                -20(0,%r3),%rp          ; restore return pointer
+    ldwm       -128(0,%sp),%r3         ; free stack,restore prev frame pointer
+
+    addil       LT'_objc_multithread_mask,%r19         ; '
+    ldw         RT'_objc_multithread_mask(%r1),%r1     ; '
+    ldw                0(0,%r1),%r1
+    comib,=    0,%r1,L$unlock          ; unlock if multithreaded
+    nop
+
+    b          __next_dynjmp           ; goto *imp
+    .EXIT
+    nop
+    .PROCEND
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+#define receiver       0
+#define class          4
+
+    .SPACE $TEXT$
+    .SUBSPA $CODE$
+    .align 4
+    .EXPORT objc_msgSendSuper,CODE
+    .EXPORT objc_msgSendSuper,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+objc_msgSendSuper
+    .PROC
+    .CALLINFO
+    .ENTRY
+
+    addil      LT'_objc_multithread_mask,%r19          ; '
+    ldw                RT'_objc_multithread_mask(%r1),%r1      ; '
+    ldw                0(0,%r1),%r1
+    comib,=    0,%r1,L$slock                   ; lock if multithreaded
+    nop
+
+L$scontinue
+    ldw                class(0,%arg0),%r20             ; class = caller->class;
+    ldw                cache(0,%r20),%r20              ; cache = class->cache
+    ldw                mask(0,%r20),%r21               ; mask = cache->mask
+    ldo                buckets(%r20),%r20              ; buckets = cache->buckets
+    and                %r21,%arg1,%r22                 ; index = selector & mask;
+
+L$sloop
+    ldwx,s     %r22(0,%r20),%r1                ; method= cache->buckets[index]
+    comib,=    0,%r1,L$scacheMiss              ; if (method == NULL)
+    nop
+
+    ldw                method_name(0,%r1),%r1          ;
+    comb,=     %r1,%arg1,L$sfinishOff          ; if (name=sel) break loop
+    nop
+
+    addi       1,%r22,%r22                     ; ++index
+    and        %r22,%r21,%r22                  ; index &= mask
+    b          L$sloop                         ; continue loop
+    nop
+
+L$sfinishOff
+    ldwx,s     %r22(0,%r20),%r1                ; method= cache->buckets[index]
+    ldw                method_imp(0,%r1),%r22          ; implementation into r22
+
+    addil      LT'_objc_multithread_mask,%r19          ; '
+    ldw                RT'_objc_multithread_mask(%r1),%r1      ; '
+    ldw                0(0,%r1),%r1
+    ldw                receiver(0,%arg0),%arg0         ; self = caller->receiver;
+    comib,=    0,%r1,L$sunlock                 ; unlock if multithreaded
+    nop
+
+    b          __next_dynjmp                   ; goto *imp
+    nop
+
+L$slock
+    addil      LT'messageLock,%r19             ; '
+    ldw                RT'messageLock(%r1),%r20        ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+L$sspin
+    ldcws      0(0,%r20),%r1                   ; try to lock it
+    comib,=    0,%r1,L$sspin                   ; if locked, try again
+    nop
+
+    b          L$scontinue                     ; rejoin mainline
+    nop                                                ; <ds>
+
+L$sunlock
+    addil      LT'messageLock,%r19             ; '
+    ldw                RT'messageLock(%r1),%r20        ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+    ldi                1,%r1                           ; get a one
+    stw                %r1,0(0,%r20)                   ; clear lock
+
+    b          __next_dynjmp                   ; goto *imp
+    .EXIT
+    nop
+
+L$scacheMiss
+    .CALLINFO FRAME=128,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r1                 ; save sp in r1 to use store modify
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r1,%r3                 ; establish new frame pointer
+
+    stw                %rp,-20(0,%r3)          ; save rp in frame marker
+    stw                %sp,-4(0,%r3)           ; save sp in frame marker
+
+    stw                %arg0,-36(0,%r3)        ; save arg0 in fixed arg area
+    stw                %arg1,-40(0,%r3)        ; save arg1 in fixed arg area
+    stw                %arg2,-44(0,%r3)        ; save arg2 in fixed arg area
+    stw                %arg3,-48(0,%r3)        ; save arg3 in fixed arg area
+    stw                %ret0,4(0,%r3)          ; save return struct ptr
+    stw                %ret1,8(0,%r3)          ; save return struct ptr
+
+    fstds,mb   %fr4,8(0,%r1)           ; Save floating point args
+    fstds,mb   %fr5,8(0,%r1)           ; mb (modify before) is used
+    fstds,mb   %fr6,8(0,%r1)
+    fstds,mb   %fr7,8(0,%r1)
+
+    .CALL ARGW0=GR,ARGW1=GR
+    bl         _class_lookupMethodAndLoadCache,2
+    ldw                class(0,%arg0),%arg0    ; <delay slot> arg0 = caller->class
+
+    copy       %ret0,%r22              ; move return value to r22 for dynjmp
+
+    copy       %r3,%r1                 ; prev frame for fldds,mb
+    fldds,mb   8(0,%r1),%fr4
+    fldds,mb   8(0,%r1),%fr5
+    fldds,mb   8(0,%r1),%fr6
+    fldds,mb   8(0,%r1),%fr7
+
+    ldw                4(0,%r3),%ret0          ; restore everything
+    ldw                8(0,%r3),%ret1          ; restore everything
+    ldw                -36(0,%r3),%arg0
+    ldw                -40(0,%r3),%arg1
+    ldw                -44(0,%r3),%arg2
+    ldw                -48(0,%r3),%arg3
+
+    ldw                -20(0,%r3),%rp          ; restore return pointer
+    ldwm       -128(0,%sp),%r3         ; free stack, restore prev frame pointer
+
+    addil      LT'_objc_multithread_mask,%r19          ; '
+    ldw                RT'_objc_multithread_mask(%r1),%r1      ; '
+    ldw                0(0,%r1),%r1
+    ldw                receiver(0,%arg0),%arg0 ; self = caller->receiver;
+    comib,=    0,%r1,L$sunlock         ; unlock if multithreaded
+    nop
+
+    b          __next_dynjmp           ; goto *imp
+    .EXIT
+    nop
+    .PROCEND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+    .SPACE $PRIVATE$
+    .SUBSPA $DATA$
+    .align 4
+    .EXPORT OBJC_METH_VAR_NAME_FORWARD,DATA
+
+OBJC_METH_VAR_NAME_FORWARD:
+    .STRING "forward::\0"
+
+    .SPACE $PRIVATE$
+    .SUBSPA $$OBJC_MESSAGE_REFS$$
+    .align 4
+forwardstr
+    .word OBJC_METH_VAR_NAME_FORWARD
+
+    .SPACE $PRIVATE$
+    .SUBSPA $DATA$
+;   .cstring
+;   .align 1
+errstr
+    .string "Does not recognize selector %s\0"
+
+;
+; NOTE: Because the stack grows from low mem to high mem on this machine
+; and the args go the other way, the marg_list pointer is 4 above the first arg
+; and subsequent arguments are at NEGATIVE offsets from the marg_list.
+; This means that marg_getValue() and related macros will have to be adjusted
+; appropriately.
+;
+    .SPACE $TEXT$
+    .SUBSPA $CODE$
+    .align 4
+    .EXPORT _objc_msgForward,CODE
+    .EXPORT _objc_msgForward,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+_objc_msgForward
+    .PROC
+    .CALLINFO FRAME=128,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r1                 ; save sp
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r1,%r3                 ; establish new frame pointer
+
+    stw                %rp,  -20(0,%r3)        ; save rp in frame marker
+    stw                %sp,   -4(0,%r3)        ; save sp in frame marker
+    stw                %arg3,-48(0,%r3)        ; save args in fixed arg area
+    stw                %arg2,-44(0,%r3)        ; ...
+    stw                %arg1,-40(0,%r3)        ; _cmd selector (arg1)
+    stw                %arg0,-36(0,%r3)        ; self
+
+    addil      LT'forwardstr,%r19              ; '
+    ldw                RT'forwardstr(%r1),%r20         ; '
+    ldw         0(0,%r20),%r20         ; get forward::
+    combt,=    %r20,%arg1,L$error      ; if (sel==@selector(forward::))
+    nop
+
+    ; Set up call as [self forward:sel :marg_list]
+    copy       %arg1,%arg2             ; original selector in arg2
+    copy       %r20,%arg1              ; forward:: as arg1 (_cmd)
+    ldo        -32(%r3),%arg3          ; copy original sel
+
+    addil      LT'_objc_msgSend_v,%r19         ; '
+    ldw                RT'_objc_msgSend_v(%r1),%r1     ; '
+    ldw                0(0,%r1),%r22
+    .CALL ARGW0=GR
+    bl         $$dyncall,%r31
+    copy       %r31,%r2
+
+    ldw                -20(0,%r3),%rp          ; restore RP
+    bv         0(%rp)                  ; return to caller
+    ldwm       -128(0,%sp),%r3         ; free stack, restore prev frame pointer
+
+L$error
+    addil      LT'errstr,%r19          ; '
+    ldw                RT'errstr(%r1),%arg1    ; '
+    .CALL ARGW0=GR,ARGW1=GR
+    bl         __objc_error,%rp        ; __objc_error never returns,
+    .EXIT
+    copy       %r20,%arg2              ; so no need to clean up.
+    .PROCEND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Algorithm is as follows:
+; . Calculate how much stack size is needed for any arguments not in the
+;   general registers and allocate space on stack.
+; . Restore general argument regs from the bottom of the marg_list.
+; . Restore fp argument regs from the same area.
+;   The first two args in the marg list are always old obj and struct
+;   return address - since old selector (_cmd) is not needed, struct
+;   return (which might be needed) is stashed in place of _cmd.
+; . Call the new method.
+
+    .SPACE $TEXT$
+    .SUBSPA $CODE$
+    .align 4
+    .EXPORT objc_msgSendv,CODE
+    .EXPORT objc_msgSendv,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+objc_msgSendv
+    .PROC
+    .CALLINFO FRAME=128,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r1                 ; save sp
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r1,%r3                 ; establish new frame pointer
+
+    stw                %rp,  -20(0,%r3)        ; save rp in frame marker
+    stw                %sp,   -4(0,%r3)        ; save sp in frame marker
+
+    ldo        95(%arg2),%r1           ; Calculate frame size, rounded
+    depi       0,31,6,%r1              ; up to 64 byte boundary...
+    add        %r1,%sp,%sp             ; Allocate frame area (no locals)
+
+    copy       %arg2,%r20              ; r20 now holds arg size
+    ldo        -16(%arg3),%r21         ; r21 now holds marg_list+16
+    ldws       0(0,%r21),%arg3         ; Get old general register args 2-3
+    ldws       4(0,%r21),%arg2         ; (self and sel not needed)
+    fldds      0(0,%r21),%fr7          ; Mirror to fp regs
+    fldws      4(0,%r21),%fr6          ; ditto
+
+    ldo        -52(%sp),%r22           ; newly allocated stack area.
+    ldo        -8(%r20),%r20           ; Size -= 8
+    comibf,<   0,%r20,L$L36
+    nop
+L$L35
+    ldws,mb    -4(0,%r21),%r1          ; while(size>0)
+    addibf,<=  -4,%r20,L$L35           ;  { *(dest--) = *(src--); size-=4; }
+    stws,ma    %r1,-4(0,%r22)          ; <delay slot>
+
+L$L36
+    addil      LT'_objc_msgSend_v,%r19         ; '
+    ldw                RT'_objc_msgSend_v(%r1),%r1     ; '
+    ldw                0(0,%r1),%r22
+    .CALL ARGW0=GR
+    bl         $$dyncall,%r31
+    copy       %r31,%r2
+
+    ldw                -20(0,%r3),%rp          ; restore RP
+    ldo                128(%r3),%sp            ; restore SP (free variable space)
+
+    ldwm       -128(0,%sp),%r3         ; restore frame pointer & free stack
+    bv         0(%rp)                  ; return to caller
+    .EXIT
+    nop
+    .PROCEND
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;
+;; lock/unlock routines
+;;
+;;
+
+;;
+;; Lock routine
+;;
+    .SPACE $TEXT$
+    .SUBSPA $CODE$
+    .align 4
+    .EXPORT _objc_private_lock,CODE
+    .EXPORT _objc_private_lock,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+_objc_private_lock
+    .PROC
+    .CALLINFO FRAME=0,NO_CALLS
+    .ENTRY
+    addi       0xf,%arg0,%arg0         ; add 15
+    depi       0,31,4,%arg0            ; clear low byte to align on 16
+L_lockspin:
+    ldcws      0(0,%arg0),%r1          ; try to lock it
+    comib,=    0,%r1,L_lockspin        ; if had 0, try again
+    nop                                        ; <ds>
+    .EXIT
+    bv,n       0(%rp)                  ; return
+    .PROCEND
+
+;;
+;; Unlock routine
+;;
+    .SPACE $TEXT$
+    .SUBSPA $CODE$
+    .align 4
+    .EXPORT _objc_private_unlock,CODE
+    .EXPORT _objc_private_unlock,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+_objc_private_unlock
+    .PROC
+    .CALLINFO FRAME=0,NO_CALLS
+    .ENTRY
+    addi       0xf,%arg0,%arg0         ; add 15
+    depi       0,31,4,%arg0            ; clear low byte to align on 16
+    ldi                1,%r1                   ; get a one
+    bv         0(%rp)                  ; return
+    .EXIT
+    stw                %r1,0(0,%arg0)          ; <ds> clear lock
+    .PROCEND
+
+;;
+;; __next_dynjmp routine
+;;
+    .SPACE $TEXT$
+    .SUBSPA $CODE$
+    .align 4
+    .EXPORT __next_dynjmp,CODE
+    .EXPORT __next_dynjmp,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+__next_dynjmp
+    .PROC
+    .CALLINFO FRAME=0,NO_CALLS
+    .ENTRY
+    bb,>=,n %r22,0x1e,L$jumpExternal
+    depi 0,31,2,%r22
+    ldws 4(%sr0,%r22),%r19
+    ldws 0(%sr0,%r22),%r22
+L$jumpExternal
+    ldsid (%sr0,%r22),%r1
+    mtsp %r1,%sr0
+    be 0(%sr0,%r22)
+    .EXIT
+    nop
+    .PROCEND
+
diff --git a/runtime/Messengers.subproj/objc-msg-hppa-pdo.s b/runtime/Messengers.subproj/objc-msg-hppa-pdo.s
new file mode 100644 (file)
index 0000000..06b403b
--- /dev/null
@@ -0,0 +1,438 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+** 9605: Dan Schmidt (DSG&A)
+**     Modified to clean up the calling conventions on all routines.
+**     This allows gdb to back trace from and through these routines.
+*/
+
+#define isa            0
+#define cache          32
+#define mask           0
+#define buckets                8
+#define method_name    0
+#define method_imp     8
+
+;;
+;; Objc_msgSend: Standard messenger
+;; optimized for hppa: 20? clocks (best case) + 6 clocks / probe
+;;
+
+    .CODE
+objc_msgSend
+    .PROC
+    .CALLINFO
+    .ENTRY
+
+    comib,=,n  0,%arg0,L$exitNull              ; Return 0 if self == nil
+    ldil       L'_objc_multithread_mask,%r20   ; '
+    ldw                R'_objc_multithread_mask(%r20),%r31     ; '
+    comib,=    0,%r31,L$lock                   ; lock if multithreaded
+    ldw        isa(0,%arg0),%r19               ; <ds> class = self->isa;
+L$continue
+    ldw        cache(0,%r19),%r20              ; cache = class->cache
+    ldw        mask(0,%r20),%r21               ; mask = cache->mask
+    ldo        buckets(%r20),%r20              ; buckets = cache->buckets
+    and        %r21,%arg1,%r22                 ; index = selector & mask
+L$loop
+    ldwx,s     %r22(0,%r20),%r19               ; method = cache->buckets[index]
+    comib,=,n  0,%r19,L$cacheMiss              ; if (method == NULL)
+    ldw        method_name(0,%r19),%r1         ;
+    addi       1,%r22,%r22                     ; ++index
+    comb,<>    %r1,%arg1,L$loop                ; if (name!=sel) continue loop
+    and        %r21,%r22,%r22                  ; <delay slot> index &=mask
+    ldw        method_imp(0,%r19),%r22         ; Implementation into r22
+    comib,=,n  0,%r31,L$unlock                 ; unlock if multithreaded
+    b          $$dyncall                       ; goto *imp;
+    nop
+
+L$exitNull
+    bv         0(%rp)                          ; return null
+    copy       0,%ret0                         ; <delay slot> return val = 0
+
+L$lock
+    ldil       L'messageLock,%r1               ; '
+    ldo                R'messageLock(%r1),%r20         ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+L$spin
+    ldcws      0(0,%r20),%r1                   ; try to lock it
+    comib,=    0,%r1,L$spin                    ; if locked, try again
+    nop                                                ; <ds>
+    b          L$continue                      ; rejoin mainline
+    nop                                                ; <ds>
+
+L$unlock
+    ldil       L'messageLock,%r1               ; '
+    ldo                R'messageLock(%r1),%r20         ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+    ldi                1,%r1                           ; get a one
+    b          $$dyncall                       ;    goto *imp;
+    .EXIT
+    stw                %r1,0(0,%r20)                   ; <ds> clear lock
+
+/*
+** We have to save all the register based arguments (including floating
+** point) before calling _class_lookupMethodAndLoadCache.  This is because
+** we don't know what arguments were passed to us, and the arguments are
+** not guaranteed to be saved across procedure calls (they're all caller-saved)
+** We also have to save the return address (since we didn't save it on entry).
+*/
+L$cacheMiss
+    .CALLINFO FRAME=80, CALLS, SAVE_RP, SAVE_SP, ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r19                ; save sp in r19 to use store modify
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r19,%r3                ; establish new frame pointer
+
+    stw                %rp,  -20(0,%r3)        ; save rp in frame marker
+    stw                %sp,   -4(0,%r3)        ; save sp in frame marker
+    stw                %arg0,-36(0,%r3)        ; save arg0 in fixed arg area
+    stw                %arg1,-40(0,%r3)        ; save arg1 in fixed arg area
+    stw                %arg2,-44(0,%r3)        ; save arg2 in fixed arg area
+    stw                %arg3,-48(0,%r3)        ; save arg3 in fixed arg area
+    stw                %ret0,  4(0,%r3)        ; save return struct ptr
+
+    fstds,mb   %fr4,8(0,%r19)          ; Save floating point args
+    fstds,mb   %fr5,8(0,%r19)          ; mb (modify before) is used
+    fstds,mb   %fr6,8(0,%r19)
+    fstds,mb   %fr7,8(0,%r19)
+
+    .CALL
+    bl         _class_lookupMethodAndLoadCache,2
+    ldw                isa(0,%arg0),%arg0      ; <delay slot> arg 0 = self->isa
+    copy       %ret0,%r22              ; move return value r22 for dyncall
+
+    copy       %r3,%r19                ; prev frame for fldds,mb
+    fldds,mb   8(0,%r19),%fr4
+    fldds,mb   8(0,%r19),%fr5
+    fldds,mb   8(0,%r19),%fr6
+    fldds,mb   8(0,%r19),%fr7
+
+    ldw                   4(0,%r3),%ret0       ; restore everything
+    ldw                 -36(0,%r3),%arg0
+    ldw                 -40(0,%r3),%arg1
+    ldw                 -44(0,%r3),%arg2
+    ldw                 -48(0,%r3),%arg3
+    ldw                 -20(0,%r3),%rp         ; restore return pointer
+    ldwm       -128(0,%sp),%r3         ; free stack, restore prev frame pointer
+
+    ldil       L'_objc_multithread_mask,%r20           ; '
+    ldw                R'_objc_multithread_mask(%r20),%r20     ; '
+    comib,=    0,%r20,L$unlock         ; unlock if multithreaded
+    nop                                        ; delay slot
+
+    b          $$dyncall               ; goto *imp (in r22);
+    .EXIT
+    nop
+    .PROCEND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+#define receiver       0
+#define class          4
+
+objc_msgSendSuper
+    .PROC
+    .CALLINFO
+    .ENTRY
+
+    ldil       L'_objc_multithread_mask,%r20           ; '
+    ldw                R'_objc_multithread_mask(%r20),%r31     ; '
+    comib,=    0,%r31,L$slock                  ; lock if multithreaded
+    ldw                class(0,%arg0),%r19             ; <ds> class = caller->class;
+L$scontinue
+    ldw                cache(0,%r19),%r20              ; cache = class->cache
+    ldw                mask(0,%r20),%r21               ; mask = cache->mask
+    ldo                buckets(%r20),%r20              ; buckets = cache->buckets
+    and                %r21,%arg1,%r22                 ; index = selector & mask;
+L$LS1
+    ldwx,s     %r22(0,%r20),%r19               ; method = cache->buckets[index]
+    comib,=,n  0,%r19,L$cacheMiss2             ; if (method == NULL)
+    ldw                method_name(0,%r19),%r1         ; get method name
+    addi       1,%r22,%r22                     ; ++index
+    comb,<>    %r1, %arg1, L$LS1               ; if (name!=sel) continue loop
+    and                %r21,%r22,%r22                  ; <delay slot> index &=mask
+    ldw                method_imp(0,%r19),%r22         ; get method implementation
+    comib,=    0,%r31,L$sunlock                ; unlock if multithreaded
+    ldw                receiver(0,%arg0),%arg0         ; self = caller->receiver;
+    b          $$dyncall                       ; goto *imp (in r22);
+    nop
+
+L$slock
+    ldil       L'messageLock,%r1               ; '
+    ldo                R'messageLock(%r1),%r20         ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+L$sspin
+    ldcws      0(0,%r20),%r1                   ; try to lock it
+    comib,=    0,%r1,L$sspin                   ; if locked, try again
+    nop                                                ; <ds>
+    b          L$scontinue                     ; rejoin mainline
+    nop                                                ; <ds>
+
+L$sunlock
+    ldil       L'messageLock,%r1               ; '
+    ldo                R'messageLock(%r1),%r20         ; '
+    addi       0xf,%r20,%r20                   ; add 15
+    depi       0,31,4,%r20                     ; clear low byte to align on 16
+    ldi                1,%r1                           ; get a one
+    b          $$dyncall                       ; goto *imp (in r22);
+    .EXIT
+    stw                %r1,0(0,%r20)                   ; <ds> clear lock
+
+L$cacheMiss2
+    .CALLINFO FRAME=80, CALLS, SAVE_RP, SAVE_SP, ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r19                ; save sp in r19 to use store modify
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r19,%r3                ; establish new frame pointer
+
+    stw                %rp,  -20(0,%r3)        ; save rp in frame marker
+    stw                %sp,   -4(0,%r3)        ; save sp in frame marker
+    stw                %arg0,-36(0,%r3)        ; save arg0 in fixed arg area
+    stw                %arg1,-40(0,%r3)        ; save arg1 in fixed arg area
+    stw                %arg2,-44(0,%r3)        ; save arg2 in fixed arg area
+    stw                %arg3,-48(0,%r3)        ; save arg3 in fixed arg area
+    stw                %ret0,  4(0,%r3)        ; save return struct ptr
+
+    fstds,mb   %fr4,8(0,%r19)          ; Save floating point args
+    fstds,mb   %fr5,8(0,%r19)          ; mb (modify before) is used
+    fstds,mb   %fr6,8(0,%r19)
+    fstds,mb   %fr7,8(0,%r19)
+
+    .CALL
+    bl         _class_lookupMethodAndLoadCache,2
+    ldw                class(0,%arg0),%arg0    ; <delay slot> arg0 = caller->class;
+    copy       %ret0,%r22              ; move return value r22 for dyncall
+
+    copy       %r3,%r19                ; prev frame for fldds,mb
+    fldds,mb   8(0,%r19),%fr4
+    fldds,mb   8(0,%r19),%fr5
+    fldds,mb   8(0,%r19),%fr6
+    fldds,mb   8(0,%r19),%fr7
+
+    ldw                   4(0,%r3),%ret0       ; restore everything
+    ldw                 -36(0,%r3),%arg0
+    ldw                 -40(0,%r3),%arg1
+    ldw                 -44(0,%r3),%arg2
+    ldw                 -48(0,%r3),%arg3
+    ldw                 -20(0,%r3),%rp         ; restore return pointer
+    ldwm       -128(0,%sp),%r3         ; free stack, restore prev frame pointer
+
+    ldil       L'_objc_multithread_mask,%r20           ; '
+    ldw                R'_objc_multithread_mask(%r20),%r20     ; '
+    comib,=    0,%r20,L$unlock                 ; unlock if multithreaded
+    ldw         receiver(0,%arg0),%arg0                ; self = caller->receiver;
+
+    b          $$dyncall                       ; goto *imp (in r22);
+    .EXIT
+    nop
+    .PROCEND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+    .EXPORT OBJC_METH_VAR_NAME_FORWARD,DATA
+    .SPACE $PRIVATE$
+    .SUBSPA $DATA$
+OBJC_METH_VAR_NAME_FORWARD:
+    .STRING "forward::\0"
+
+    .SUBSPA $$OBJC_MESSAGE_REFS$$,QUAD=1,ALIGN=4,ACCESS=31
+forwardstr
+    .word OBJC_METH_VAR_NAME_FORWARD
+
+    .DATA
+;   .cstring
+;   .align 1
+errstr
+    .string "Does not recognize selector %s\0"
+
+    .CODE
+
+;
+; NOTE: Because the stack grows from low mem to high mem on this machine
+; and the args go the other way, the marg_list pointer is 4 above the first arg
+; and subsequent arguments are at NEGATIVE offsets from the marg_list.
+; This means that marg_getValue() and related macros will have to be adjusted
+; appropriately.
+;
+_objc_msgForward
+    .PROC
+    .CALLINFO FRAME=80, CALLS, SAVE_RP, SAVE_SP, ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r19                ; save sp
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r19,%r3                ; establish new frame pointer
+
+    stw                %rp,  -20(0,%r3)        ; save rp in frame marker
+    stw                %sp,   -4(0,%r3)        ; save sp in frame marker
+    stw                %arg3,-48(0,%r3)        ; save args in fixed arg area
+    stw                %arg2,-44(0,%r3)        ; 
+    stw                %arg1,-40(0,%r3)        ; _cmd selector (arg1)
+    stw                %arg0,-36(0,%r3)        ; self
+
+    addil       L'forwardstr-$global$,%dp      ; '
+    ldo         R'forwardstr-$global$(%r1),%r20        ; '
+    ldw         0(0,%r20),%r20                 ; get forward::
+    combt,=,n  %r20,%arg1,L$error              ; if (sel==@selector(forward::))
+
+    ; Set up call as [self forward:sel :marg_list]
+    copy       %arg1,%arg2                     ; original selector in arg2
+    copy       %r20,%arg1                      ; forward:: as arg1 (_cmd)
+
+    .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+    bl         objc_msgSend,2                  ; call forward::
+    ldo        -32(%r3),%arg3                  ; <delay slot> copy original sel
+
+    ldw                -20(0,%r3),%rp          ; restore RP
+    bv         0(%rp)                  ; return to caller
+    ldwm       -128(0,%sp),%r3         ; free stack, restore prev frame pointer
+
+L$error
+    addil      L'errstr-$global$,%dp           ; '
+    ldo        R'errstr-$global$(%r1),%arg1    ; '
+    .CALL ARGW0=GR,ARGW1=GR
+    bl         __objc_error,%rp                ; __objc_error never returns,
+    .EXIT
+    copy       %r20,%arg2                      ; so no need to clean up.
+    .PROCEND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Algorithm is as follows:
+; . Calculate how much stack size is needed for any arguments not in the
+;   general registers and allocate space on stack.
+; . Restore general argument regs from the bottom of the marg_list.
+; . Restore fp argument regs from the same area.
+;   The first two args in the marg list are always old obj and struct
+;   return address - since old selector (_cmd) is not needed, struct
+;   return (which might be needed) is stashed in place of _cmd.
+; . Call the new method.
+
+objc_msgSendv
+    .PROC
+    .CALLINFO FRAME=80, CALLS, SAVE_RP, SAVE_SP, ENTRY_GR=3
+    .ENTRY
+
+    copy       %sp,%r19                ; save sp
+    stwm       %r3,128(0,%sp)          ; save frame pointer & allocate stack
+    copy       %r19,%r3                ; establish new frame pointer
+
+    stw                %rp,  -20(0,%r3)        ; save rp in frame marker
+    stw                %sp,   -4(0,%r3)        ; save sp in frame marker
+
+    ldo        95(%arg2),%r19          ; Calculate frame size, rounded
+    depi       0,31,6,%r19             ; up to 64 byte boundary...
+    add        %r19,%sp,%sp            ; Allocate frame area (no locals)
+
+    copy       %arg2,%r20              ; r20 now holds arg size
+    ldo        -16(%arg3),%r21         ; r21 now holds marg_list+16
+    ldws       0(0,%r21),%arg3         ; Get old general register args 2-3
+    ldws       4(0,%r21),%arg2         ; (self and sel not needed)
+    fldds      0(0,%r21),%fr7          ; Mirror to fp regs
+    fldws      4(0,%r21),%fr6          ; ditto
+
+    ldo        -52(%sp),%r22           ; newly allocated stack area.
+    ldo        -8(%r20),%r20           ; Size -= 8
+    comibf,<,n 0,%r20,L$L36
+L$L35
+    ldws,mb    -4(0,%r21),%r19         ; while(size>0)
+    addibf,<=  -4,%r20,L$L35           ;  { *(dest--) = *(src--); size-=4; }
+    stws,ma    %r19,-4(0,%r22)         ; <delay slot>
+
+    .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+L$L36
+    bl         objc_msgSend,2          ; Call method
+    nop
+
+    ldw                -20(0,%r3),%rp          ; restore RP
+    ldo                128(%r3),%sp            ; restore SP (free variable space)
+    bv         0(%rp)                  ; return to caller
+    .EXIT
+    ldwm       -128(0,%sp),%r3         ; restore frame pointer & free stack
+    .PROCEND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;
+;; Lock routines
+;;
+;;
+
+;;
+;; Lock routine
+;;
+_objc_private_lock
+    .PROC
+    .CALLINFO FRAME=0,NO_CALLS
+    .ENTRY
+    addi       0xf,%arg0,%arg0         ; add 15
+    depi       0,31,4,%arg0            ; clear low byte to align on 16
+L_lockspin:
+    ldcws      0(0,%arg0),%r1          ; try to lock it
+    comib,=    0,%r1,L_lockspin        ; if had 0, try again
+    nop                                        ; <ds>
+    .EXIT
+    bv,n       0(%rp)                  ; return
+    .PROCEND
+;;
+;; Unlock routine
+;;
+_objc_private_unlock
+    .PROC
+    .CALLINFO FRAME=0,NO_CALLS
+    .ENTRY
+    addi       0xf,%arg0,%arg0         ; add 15
+    depi       0,31,4,%arg0            ; clear low byte to align on 16
+    ldi                1,%r1                   ; get a one
+    bv         0(%rp)                  ; return
+    .EXIT
+    stw                %r1,0(0,%arg0)          ; <ds> clear lock
+    .PROCEND
+
+;
+;
+; Imports and Exports
+;
+;
+
+    .IMPORT $global$,DATA
+    .IMPORT $$dyncall,MILLICODE
+    .IMPORT _objc_multithread_mask,DATA
+    .IMPORT messageLock,DATA
+    .IMPORT _class_lookupMethodAndLoadCache,CODE
+    .IMPORT __objc_error,CODE
+
+    .EXPORT objc_msgSend,        ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+    .EXPORT objc_msgSendv,       ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+    .EXPORT objc_msgSendSuper,   ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+    .EXPORT _objc_msgForward,    ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR
+    .EXPORT _objc_private_lock,  ENTRY,PRIV_LEV=3,ARGW0=GR
+    .EXPORT _objc_private_unlock,ENTRY,PRIV_LEV=3,ARGW0=GR
+
diff --git a/runtime/Messengers.subproj/objc-msg-i386-nextpdo-winnt3.5.s b/runtime/Messengers.subproj/objc-msg-i386-nextpdo-winnt3.5.s
new file mode 100644 (file)
index 0000000..e297ad8
--- /dev/null
@@ -0,0 +1,688 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+       .file   "objc-msg-i386.s"
+gcc2_compiled.:
+___gnu_compiled_objc:
+#ifdef KERNEL
+.globl _objc_entryPoints
+_objc_entryPoints:
+       .long _objc_msgSend
+       .long _objc_msgSendSuper
+       .long _objc_msgSendv
+       .long 0
+
+.globl _objc_exitPoints
+_objc_exitPoints:
+       .long Lexit1
+       .long Lexit2
+       .long Lexit3
+       .long Lexit4
+       .long Lexit5
+       .long Lexit6
+       .long Lexit7
+       .long Lexit8
+       .long 0
+#endif /* KERNEL */
+
+/********************************************************************
+ ********************************************************************
+ *
+ * Objective-C message dispatching for the Win32/i386
+ *
+ ********************************************************************
+ ********************************************************************/
+
+// Make this non-zero to use old style 32-bit-dirty structure returns
+#define COMPATIBLE_CODE                0
+
+/********************************************************************
+ *
+ * Stack frame definitions.
+ *
+ ********************************************************************/
+
+       // standard word-return arguments
+       self                                    = 4
+       selector                                = 8
+
+       // standard struct-return arguments
+       // These values are used when doing a struct return message.
+       // The return value of the struct return is pushed on the stack
+       // as a "hidden" first parameter so the remaining parameters
+       // are 4 bytes further down the stack than they are in a 
+       // normal message
+       struct_return_addr              = self
+       struct_return_self              = self + 4
+       struct_return_selector  = selector + 4
+
+       // additional arguments for _objc_msgForward
+       margSize                                = 12
+       margs                                   = 16
+
+       // additional arguments for _objc_msgForward_stret
+       struct_return_margSize  = margSize + 4
+       struct_return_margs             = margs + 4
+
+
+       // special self argument for objc_msgSendSuper
+       caller                                  = self
+
+       // special self argument for objc_msgSendSuper_stret
+       struct_return_caller    = caller + 4
+
+/********************************************************************
+ *
+ * Structure definitions.
+ *
+ ********************************************************************/
+
+// objc_super parameter to objc_msgSendSuper
+       receiver                = 0
+       class                   = 4
+
+// Selected field offsets in class structure
+       isa                             = 0
+       cache                   = 32
+
+// Method descriptor
+       method_name             = 0
+       method_imp              = 8
+
+// Cache header
+       mask                    = 0
+       occupied                = 4
+       buckets                 = 8             // variable length array (null terminated)
+
+/********************************************************************
+ *
+ * Constants.
+ *
+ ********************************************************************/
+
+// In case the implementation is _objc_msgForward, indicate to it
+// whether the method was invoked as a word-return or struct-return.
+// This flag is passed in a register that is caller-saved, and is
+// not part of the parameter passing convention (i.e. it is "out of
+// band").  This works because _objc_msgForward is only entered
+// from here in the messenger.
+       kFwdMsgSend                     = 0
+       kFwdMsgSendStret        = 1
+
+/********************************************************************
+ * id          objc_msgSend       (id          self,
+ *                                                             SEL             op,
+ *                                                             ...);
+ *
+ * On entry:   (sp+4) is the message receiver,
+ *                             (sp+8) is the selector
+ *
+ * And the structure-return version :
+ *
+ * struct_type objc_msgSend_stret     (id              self,
+ *                                                                             SEL             op,
+ *                                                                             ...);
+ *
+ * objc_msgSend_stret is the struct-return form of msgSend.
+ * The ABI calls for (sp+4) to be used as the address of the structure
+ * being returned, with the parameters in the succeeding locations.
+ *
+ * On entry:   (sp+4)is the address where the structure is returned,
+ *                             (sp+8) is the message receiver,
+ *                             (sp+12) is the selector
+ ********************************************************************/
+
+       .text
+       .globl  _objc_msgSend
+       .globl  _objc_msgSend_stret
+       .align  4, 0x90
+_objc_msgSend_stret:
+       movl    struct_return_self(%esp), %eax          // %eax = self
+       movl    struct_return_selector(%esp), %ecx      // %ecx = selector
+       pushl   $kFwdMsgSendStret                                       // flag struct-return for _objc_msgForward
+       jmp             L1check_message
+
+       .align  4, 0x90
+_objc_msgSend:
+#if COMPATIBLE_CODE
+       movl    self(%esp), %eax
+       andl    $0x80000000, %eax
+       jne             _objc_msgSend_stret
+#endif
+       movl    self(%esp), %eax                                        // %eax = self
+       movl    selector(%esp), %ecx                            // %ecx = selector
+       pushl   $kFwdMsgSend                                            // flag word-return for _objc_msgForward
+
+L1check_message:
+       pushl   %ecx                                                            // Push selector
+       pushl   %eax                                                            // Push self
+       movl    %eax, %edx                                                      // Move self off to do a comparison
+       andl    __objc_multithread_mask, %edx           // And it against the multithreading mask
+                                                                                               //   This will also tell us if it's a nil object
+       je              L1nil_or_multi                                          // Jump if nil or multithreading is on
+
+// Load variables and save caller registers.
+// Overlapped to prevent AGI
+// At this point, self has been loaded into eax and selector has been 
+// loaded into ecx.
+       movl    isa(%eax), %eax                                         // class = self->isa
+       pushl   %edi                                                            //
+       movl    cache(%eax), %eax                                       // cache = class->cache
+       pushl   %esi                                                            //
+
+       lea             buckets(%eax), %edi                                     // buckets = &cache->buckets
+       movl    mask(%eax), %esi                                        // mask = cache->mask
+       movl    %ecx, %edx                                                      // index = selector
+
+L1probe_cache:
+       andl    %esi, %edx                                                      // index &= mask
+       movl    (%edi, %edx, 4), %eax                           // method_name = buckets[index]
+
+       testl   %eax, %eax                                                      // if (method != NULL) {
+       je              L1cache_miss                                            //
+       cmpl    method_name(%eax), %ecx                         //    method_name = method->name
+       jne             L1not_the_method                                        //        if (method_name == selector) {
+
+       movl    method_imp(%eax), %eax                          //      imp = method->method_imp
+       popl    %esi                                                            //
+       popl    %edi                                                            //
+       addl    $8, %esp                                                        // dump saved self and selector
+       popl    %edx                                                            // secret word/struct return flag to _objc_msgForward
+Lexit1:        jmp     *%eax                                                           //      goto *imp
+       .space 17                                                                       // area for moninitobjc to write
+                                                                                               //        }
+L1not_the_method:
+       inc             %edx                                                            //    index++
+       jmp             L1probe_cache                                           // }
+
+       .align 4, 0x90
+L1cache_miss:
+       // restore caller registers
+       popl    %esi                                                            //
+       popl    %edi                                                            //
+
+// self and selector are already on the stack, so just
+// replace self with its class pointer
+       popl    %eax                                                            // pop self
+       movl    isa(%eax), %eax                                         // load the class pointer
+       pushl   %eax                                                            // push class pointer, selector is already there
+       call    __class_lookupMethodAndLoadCache        // lookup the method and load the cache
+       addl    $8, %esp                                                        // pop the args off the stack
+       popl    %edx                                                            // secret word/struct return flag to _objc_msgForward
+Lexit2:        jmp     *%eax   
+       .space 17                                                                       // area for moninitobjc to write
+
+       .align 4, 0x90
+L1nil_or_multi:
+       testl   %eax,%eax                                                       // Check for a nil object
+       jne             L1multi_msgSend                                         // Jump to multi_msgSend if it's not a real object
+
+       movl    __objc_msgNil, %eax                                     // Load nil message handler
+       testl   %eax, %eax
+       je              Ljust_return                                            // If NULL just return and don't do anything
+       call    *%eax                                                           //      call __objc_msgNil
+       xorl    %eax, %eax                                                      // Rezero $eax just in case
+Ljust_return:
+       addl    $12, %esp                                                       // pop the args and flag off the stack
+       ret
+
+
+// locking version of send - its the same except for the lock/clear
+       .align 4, 0x90
+L1multi_msgSend:
+       // spin lock
+       movl    $1, %ecx                                                        // Move 1 into ecx
+       leal    _messageLock, %eax                                      // Then load the address of _messageLock 
+L11spin:
+       xchgl   %ecx, (%eax)
+       cmpl    $0, %ecx
+       jne             L11spin
+
+       movl    0(%esp),%eax                                            // retrieve self
+       movl    4(%esp),%ecx                                            // retrieve selector
+
+// load variables and save caller registers.
+// Overlapped to prevent AGI
+// At this point, self has been loaded into eax and selector has been 
+// loaded into ecx.
+       movl    isa(%eax), %eax                                         // class = self->isa
+       pushl   %edi                                                            //
+       movl    cache(%eax), %eax                                       // cache = class->cache
+       pushl   %esi                                                            //
+
+       lea             buckets(%eax), %edi                                     // buckets = &cache->buckets
+       movl    mask(%eax), %esi                                        // mask = cache->mask
+       movl    %ecx, %edx                                                      // index = selector
+
+L11probe_cache:
+       andl    %esi, %edx                                                      // index &= mask
+       movl    (%edi, %edx, 4), %eax                           // method_name = buckets[index]
+
+       testl   %eax, %eax                                                      // if (method != NULL) {
+       je              L11cache_miss                                           //
+       cmpl    method_name(%eax), %ecx                         //    method_name = method->name
+       jne             L11not_the_method                                       //        if (method_name == selector) {
+
+       movl    method_imp(%eax), %eax                          //      imp = method->method_imp
+       popl    %esi                                                            //
+       popl    %edi                                                            //
+       addl    $8, %esp                                                        // dump saved self and selector
+       movl    $0, _messageLock                                        // unlock
+       popl    %edx                                                            // secret word/struct return flag to _objc_msgForward
+Lexit3:        jmp     *%eax                                                           //      goto *imp
+       .space 17                                                                       // area for moninitobjc to write
+                                                                                               //        }
+       .align 4, 0x90
+L11not_the_method:
+       inc     %edx                                                                    //    index++
+       jmp     L11probe_cache                                                  // }
+
+       .align 4, 0x90
+L11cache_miss:
+       // restore caller registers
+       popl    %esi                                                            //
+       popl    %edi                                                            //
+
+// self and selector are already on the stack, so just
+// replace self with its class pointer
+       popl    %eax                                                            // pop self
+       movl    isa(%eax), %eax                                         // load the class pointer
+       pushl   %eax                                                            // push class pointer, selector is already there
+       call    __class_lookupMethodAndLoadCache
+       addl    $8, %esp
+       movl    $0, _messageLock                                        // unlock
+       popl    %edx                                                            // secret word/struct return flag to _objc_msgForward
+Lexit4:        jmp     *%eax
+       .space 17                                                                       // area for moninitobjc to write
+
+
+/********************************************************************
+ * id  objc_msgSendSuper          (struct objc_super * super,
+ *                                                             SEL                                     op,
+ *                                                             ...);
+ *
+ * struct objc_super {
+ *     id              receiver;
+ *     Class   class;
+ * };
+ *
+ * And the structure-return version:
+ *
+ * struct_type objc_msgSendSuper_stret    (objc_super *        super,
+ *                                                                                     SEL                             op,
+ *                                                                                     ...);
+ *
+ * struct objc_super {
+ *     id              receiver;
+ *     Class   class;
+ * };
+ *
+ *
+ * objc_msgSendSuper_stret is the struct-return form of msgSendSuper.
+ * The ABI calls for (sp+4) to be used as the address of the structure
+ * being returned, with the parameters in the succeeding registers.
+ *
+ * On entry:   (sp+4) is the address to which to copy the returned structure,
+ *                             (sp+8) is the address of the objc_super structure,
+ *                             (sp+12) is the selector
+ *
+ ********************************************************************/
+
+       .globl  _objc_msgSendSuper
+       .globl  _objc_msgSendSuper_stret
+       .align 4, 0x90
+_objc_msgSendSuper:
+#if COMPATIBLE_CODE
+       movl    caller(%esp), %eax
+       andl    $0x80000000, %eax
+       jne             _objc_msgSendSuper_stret
+#endif
+       movl    caller(%esp), %eax                                      // %eax = caller
+       movl    receiver(%eax), %edx                            // get receiver
+       movl    %edx, caller(%esp)                                      // replace caller with receiver
+       movl    selector(%esp), %ecx                            // %ecx = selector
+       pushl   $kFwdMsgSend                                            // flag word-return for _objc_msgForward
+       jmp             L1check_message_sendSuper                       // goto common code
+
+_objc_msgSendSuper_stret:
+       movl    struct_return_caller(%esp), %eax        // %eax = caller
+       movl    receiver(%eax), %edx                            // get receiver
+       movl    %edx, struct_return_caller (%esp)       // replace caller with receiver
+       movl    struct_return_selector(%esp), %ecx      // %ecx = selector
+       pushl   $kFwdMsgSendStret                                       // flag struct-return for _objc_msgForward
+
+       .align 4, 0x90
+L1check_message_sendSuper:
+       pushl   %ecx                                                            // push selector
+       movl    class(%eax), %eax                                       // class = caller->class
+       pushl   %eax                                                            // push callers class
+
+       movl    __objc_multithread_mask, %edx           //
+       testl   %edx, %edx                                                      // if (multi)
+       je              L2multi_msgSuperSend                            //      goto locking version
+
+// At this point, callers class is in eax and selector is in ecx
+       pushl   %edi                                                            //
+       movl    cache(%eax), %eax                                       // cache = class->cache
+       pushl   %esi                                                            //
+
+       lea             buckets(%eax), %edi                                     // buckets = &cache->buckets
+       movl    mask(%eax), %esi                                        // mask = cache->mask
+       movl    %ecx, %edx                                                      // index = selector
+
+L2probe_cache:
+       andl    %esi, %edx                                                      // index &= mask
+       movl    (%edi, %edx, 4), %eax                           // method_name = buckets[index]
+
+       testl   %eax, %eax                                                      // if (method != NULL) {
+       je              L2cache_miss                                            //
+       cmpl    method_name(%eax), %ecx                         //    method_name = method->name
+       jne             L2not_the_method                                        //        if (method_name == selector) {
+
+       // Cache hit
+       popl    %esi                                                            // restore caller register
+       popl    %edi                                                            // restore caller register
+       addl    $8, %esp                                                        // dump saved class/selector
+
+       // extract imp
+       movl    method_imp(%eax), %eax                          // imp = method->method_imp
+       popl    %edx                                                            // secret word/struct return flag to _objc_msgForward
+Lexit5:        jmp     *%eax                                                           //      goto *imp
+       .space 17                                                                       // area for moninitobjc to write
+                                                                                               //        }
+       .align 4, 0x90
+L2not_the_method:
+       inc             %edx                                                            //    index++
+       jmp             L2probe_cache                                           // }
+
+       .align 4, 0x90
+L2cache_miss:
+       popl    %esi                                                            // restore register
+       popl    %edi                                                            // restore register
+
+       // Go lookup the method.  Parameters are the class and
+       // selector, which are already on the stack in the
+       // proper order.
+       call    __class_lookupMethodAndLoadCache
+       addl    $8, %esp
+       popl    %edx                                                            // secret word/struct return flag to _objc_msgForward
+Lexit6:        jmp     *%eax
+       .space 17                                                                       // area for moninitobjc to write
+
+
+
+// locking version of super send
+
+       .align 4, 0x90
+L2multi_msgSuperSend:
+       // spin lock
+       movl    $1, %ecx
+       leal    _messageLock, %eax
+L22spin:
+       xchgl   %ecx, (%eax)
+       cmpl    $0, %ecx
+       jne             L22spin
+
+       movl    0(%esp), %eax                                   // retrieve class
+       movl    4(%esp), %ecx                                   // retrieve selector
+
+       pushl   %edi                                                    //
+       movl    cache(%eax), %eax                               // cache = class->cache
+       pushl   %esi                                                    //
+
+       lea             buckets(%eax), %edi                             // buckets = &cache->buckets
+       movl    mask(%eax), %esi                                // mask = cache->mask
+       movl    %ecx, %edx                                              // index = selector
+
+L22probe_cache:
+       andl    %esi, %edx                                              // index &= mask
+       movl    (%edi, %edx, 4), %eax                   // method_name = buckets[index]
+
+       testl   %eax, %eax                                              // if (method != NULL) {
+       je              L22cache_miss                                   //
+
+       cmpl    method_name(%eax), %ecx                 //    method_name = method->name
+       jne             L22not_the_method                               //        if (method_name == selector) {
+       
+       // Cache hit
+       movl    method_imp(%eax), %eax                  // imp = method->method_imp
+       popl    %esi                                                    // restore caller register
+       popl    %edi                                                    // restore caller register
+       addl    $8, %esp                                                // dump saved caller/selector
+       movl    $0, _messageLock                                // unlock
+       popl    %edx                                                    // secret word/struct return flag to _objc_msgForward
+Lexit7:        jmp     *%eax                                                   //      goto *imp
+       .space 17                                                               // area for moninitobjc to write
+                                                                                       //        }
+       .align 4, 0x90
+L22not_the_method:
+       inc             %edx                                                    //    index++
+       jmp             L22probe_cache                                  // }
+
+       .align 4, 0x90
+L22cache_miss:
+       popl    %esi                                                            // restore caller register
+       popl    %edi                                                            // restore caller register
+
+       // Go lookup the method.  Parameters are the class and
+       // selector, which are already on the stack in the
+       // proper order.
+       call    __class_lookupMethodAndLoadCache
+       addl    $8, %esp
+       movl    $0, _messageLock                                // unlock
+       popl    %edx                                                    // secret word/struct return flag to _objc_msgForward
+Lexit8:        jmp     *%eax
+       .space 17                                                               // area for moninitobjc to write
+
+/********************************************************************
+ *
+ * Out-of-band parameter %edx indicates whether it was objc_msgSend or
+ * objc_msgSend_stret that triggered the message forwarding.  The 
+ *
+ * Iff %edx == kFwdMsgSend, it is the word-return (objc_msgSend) case,
+ * and the interface is:
+ *
+ * id          _objc_msgForward           (id          self,
+ *                                                                     SEL             selector,
+ *                                                                     ...);
+ *
+ * Iff %edx != kFwdMsgSend, it is the structure-return
+ * (objc_msgSend_stret) case, and the interface is:
+ *
+ * struct_type _objc_msgForward   (id          self,
+ *                                                                     SEL             selector,
+ *                                                                     ...);
+ *
+ * There are numerous reasons why it is better to have one
+ * _objc_msgForward, rather than adding _objc_msgForward_stret.
+ * The best one is that _objc_msgForward is the method that
+ * gets cached when respondsToMethod returns false, and it
+ * wouldnt know which one to use.
+ * 
+ * Sends the message to a method having the signature
+ *
+ *      - forward: (SEL) selector : (marg_list) margs;
+ ********************************************************************/
+
+// Location LFwdStr contains the string "forward::"
+// Location LFwdSel contains a pointer to LFwdStr, that can be changed
+// to point to another forward:: string for selector uniquing
+// purposes.  ALWAYS dereference LFwdSel to get to "forward::" !!
+        .global objc_meth_var_names
+objc_meth_var_names:
+       .align  2, 0x90
+LFwdStr:       .ascii "forward::\0"
+
+        .global objc_message_refs
+objc_message_refs:
+       .align  2, 0x90
+//LFwdSel:     .long   LFwdStr
+LFwdSel:       .long   _OBJC_METH_VAR_NAME_FORWARD
+
+       .align  2, 0x90
+LUnkSelStr:    .ascii "Does not recognize selector %s\0"
+
+        .text
+        .globl __objc_msgForward
+       .align  4, 0x90
+__objc_msgForward:
+       cmpl    $kFwdMsgSend, %edx                                      // check secret flag for word vs struct return
+       jne             LMsgForwardStretSel                                     // jump if struct return
+
+       // word-return
+       movl    selector(%esp), %eax                            // %eax = selector
+       movl    self(%esp), %edx                                        // %edx = self
+       leal    (self)(%esp), %ecx                                      // %ecx = &parameters
+       jmp             LMsgForwardCommon
+
+       // structure return
+       .align 4, 0x90
+LMsgForwardStretSel:
+       movl    struct_return_selector(%esp), %eax      // %eax = selector
+       movl    struct_return_self(%esp), %edx          // %edx = self
+       leal    (struct_return_addr)(%esp), %ecx        // %ecx = &parameters
+
+       // common code
+LMsgForwardCommon:
+       cmpl    LFwdSel, %eax                                           // forwarding "forward::"?
+       je              LMsgForwardError                                        // that would be an error
+
+       pushl   %ecx                                                            // push &parameters
+       pushl   %eax                                                            // push original selector
+       pushl   LFwdSel                                                         // push "forward::" selector
+       pushl   %edx                                                            // push self
+       call    _objc_msgSend                                           // send the message
+       addl    $16, %esp                                                       // dump parameters
+       ret
+
+       // die because the receiver does not implement forward:: 
+       .align  4, 0x90
+LMsgForwardError:
+       pushl   $LFwdSel                                                        // push "forward::" selector 
+       pushl   $LUnkSelStr                                                     // push "unknown selector" string
+       pushl   %edx                                                            // push self
+       call    ___objc_error                                           // volatile, will not return
+
+/********************************************************************
+ * id          objc_msgSendv  (id                      self,
+ *                                                     SEL                     selector,
+ *                                                     unsigned        margSize,
+ *                                                     marg_list       margs);
+ *
+ * On entry:   (sp+4)  is the message receiver,
+ *                             (sp+8)  is the selector,
+ *                             (sp+12) is the size of the marg_list, in bytes,
+ *                             (sp+16) is the address of the marg_list
+ * 
+ ********************************************************************/
+
+       .text
+       .globl _objc_msgSendv
+       .align  4, 0x90
+_objc_msgSendv:
+#if COMPATIBLE_CODE
+       movl    (margs + 4)(%ebp), %eax
+       andl    $0x80000000, %eax
+       jne             _objc_msgSendv_stret
+#endif
+       pushl   %ebp                                                    // save %ebp
+       movl    %esp, %ebp                                              // set stack frame base pointer
+       movl    (margs + 4)(%ebp), %edx                 // get address of method arguments
+       addl    $8, %edx                                                // skip self & selector
+       movl    (margSize + 4)(%ebp), %ecx              // get byte count
+       subl    $5, %ecx                                                // skip self & selector and begin rounding
+       shrl    $2, %ecx                                                // make it a word count (rounding up)
+       jle             LMsgSendvArgsOK                                 // jump if self/selector are the only parameters
+
+LMsgSendvArgLoop:
+       decl    %ecx                                                    // decrement counter
+       movl    0(%edx, %ecx, 4), %eax                  // load one word
+       pushl   %eax                                                    // store one word
+       jg              LMsgSendvArgLoop                                // check counter, iterate if non-zero
+
+LMsgSendvArgsOK:
+       movl    (selector + 4)(%ebp), %ecx              // push selector
+       pushl   %ecx
+       movl    (self + 4)(%ebp),%ecx                   // push self
+       pushl   %ecx
+       call    _objc_msgSend                                   // send the message
+       movl    %ebp,%esp                                               // restore stack
+       popl    %ebp                                                    // restore %ebp
+
+       ret
+
+/********************************************************************
+ * struct_type objc_msgSendv_stret    (id                      self,
+ *                                                                             SEL                     op,
+ *                                                                             unsigned        arg_size,
+ *                                                                             marg_list       arg_frame); 
+ *
+ * objc_msgSendv_stret is the struct-return form of msgSendv.
+ * The ABI calls for (sp+4) to be used as the address of the structure
+ * being returned, with the parameters in the succeeding locations.
+ * 
+ * An equally correct way to prototype this routine is:
+ *
+ * void                objc_msgSendv_stret    (void *          structStorage,
+ *                                                                     id                      self,
+ *                                                                     SEL                     op,
+ *                                                                     unsigned        arg_size,
+ *                                                                     marg_list       arg_frame);
+ *
+ * which is useful in, for example, message forwarding where the
+ * structure-return address needs to be passed in.
+ *
+ * On entry:   (sp+4)  is the address in which the returned struct is put,
+ *                             (sp+8)  is the message receiver,
+ *                             (sp+12) is the selector,
+ *                             (sp+16) is the size of the marg_list, in bytes,
+ *                             (sp+20) is the address of the marg_list
+ ********************************************************************/
+
+       .text
+       .globl _objc_msgSendv_stret
+       .align  4, 0x90
+_objc_msgSendv_stret:
+       pushl   %ebp                                                                    // save %ebp
+       movl    %esp, %ebp                                                              // set stack frame base pointer
+       movl    (struct_return_margs + 4)(%ebp), %edx   // get address of method arguments
+       addl    $12, %edx                                                               // skip struct return, self & selector
+       movl    (struct_return_margSize + 4)(%ebp), %ecx // get byte count
+       subl    $9, %ecx                                                                // skip struct addr, self & selector and begin rounding
+       shrl    $2, %ecx                                                                // make it a word count (rounding up)
+       jle             LMsgSendvStretArgsOK                                    // jump if self/selector are the only parameters
+
+LMsgSendvStretArgLoop:
+       decl    %ecx                                                                    // decrement counter
+       pushl   0(%edx, %ecx, 4)                                                // copy one word
+       jg              LMsgSendvStretArgLoop                                   // check counter, iterate if non-zero
+
+LMsgSendvStretArgsOK:
+       pushl   (struct_return_selector + 4)(%ebp)              // push selector
+       pushl   (struct_return_self + 4)(%ebp)                  // push self
+       pushl   (struct_return_addr + 4)(%ebp)                  // push structure return address
+       call    _objc_msgSend_stret                                             // send the message
+       movl    %ebp,%esp                                                               // restore stack
+       popl    %ebp                                                                    // restore %ebp
+
+       ret
diff --git a/runtime/Messengers.subproj/objc-msg-i386.s b/runtime/Messengers.subproj/objc-msg-i386.s
new file mode 100644 (file)
index 0000000..6bd3565
--- /dev/null
@@ -0,0 +1,1068 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/********************************************************************
+ ********************************************************************
+ **
+ **  objc-msg-i386.s - i386 code to support objc messaging.
+ **
+ ********************************************************************
+ ********************************************************************/
+
+// The assembler syntax for an immediate value is the same as the
+// syntax for a macro argument number (dollar sign followed by the
+// digits).  Argument number wins in this ambiguity.  Until the
+// assembler is fixed we have to find another way.
+#define NO_MACRO_CONSTS
+#ifdef NO_MACRO_CONSTS
+       kTwo                    = 2
+       kEight                  = 8
+#endif
+
+#if defined(OBJC_COLLECTING_CACHE)
+// _objc_entryPoints and _objc_exitPoints are used by objc
+// to get the critical regions for which method caches 
+// cannot be garbage collected.
+
+       .data
+.globl         _objc_entryPoints
+_objc_entryPoints:
+       .long   _objc_msgSend
+       .long   _objc_msgSend_stret
+       .long   _objc_msgSendSuper
+       .long   _objc_msgSendSuper_stret
+       .long   0
+
+.globl         _objc_exitPoints
+_objc_exitPoints:
+       .long   LMsgSendExit
+       .long   LMsgSendStretExit
+       .long   LMsgSendSuperExit
+       .long   LMsgSendSuperStretExit
+       .long   0
+#endif
+
+
+/********************************************************************
+ *
+ * Constants.
+ *
+ ********************************************************************/
+
+// In case the implementation is _objc_msgForward, indicate to it
+// whether the method was invoked as a word-return or struct-return.
+// This flag is passed in a register that is caller-saved, and is
+// not part of the parameter passing convention (i.e. it is "out of
+// band").  This works because _objc_msgForward is only entered
+// from here in the messenger.
+       kFwdMsgSend             = 0
+       kFwdMsgSendStret                = 1
+
+
+/********************************************************************
+ *
+ * Common offsets.
+ *
+ ********************************************************************/
+
+       self                    = 4
+       super                   = 4
+       selector                = 8
+       marg_size               = 12
+       marg_list               = 16
+
+       struct_addr             = 4
+
+       self_stret              = 8
+       super_stret             = 8
+       selector_stret          = 12
+       marg_size_stret         = 16
+       marg_list_stret         = 20
+
+
+/********************************************************************
+ *
+ * Structure definitions.
+ *
+ ********************************************************************/
+
+// objc_super parameter to sendSuper
+       receiver                = 0
+       class                   = 4
+
+// Selected field offsets in class structure
+       isa                     = 0
+       cache                   = 32
+
+// Method descriptor
+       method_name             = 0
+       method_imp              = 8
+
+// Cache header
+       mask                    = 0
+       occupied                = 4
+       buckets                 = 8             // variable length array
+
+#if defined(OBJC_INSTRUMENTED)
+// Cache instrumentation data, follows buckets
+       hitCount                = 0
+       hitProbes               = hitCount + 4
+       maxHitProbes            = hitProbes + 4
+       missCount               = maxHitProbes + 4
+       missProbes              = missCount + 4
+       maxMissProbes           = missProbes + 4
+       flushCount              = maxMissProbes + 4
+       flushedEntries          = flushCount + 4
+
+// Buckets in CacheHitHistogram and CacheMissHistogram
+       CACHE_HISTOGRAM_SIZE    = 512
+#endif
+
+
+//////////////////////////////////////////////////////////////////////
+//
+// LOAD_STATIC_WORD    targetReg, symbolName, LOCAL_SYMBOL | EXTERNAL_SYMBOL
+//
+// Load the value of the named static data word.
+//
+// Takes: targetReg                    - the register, other than r0, to load
+//               symbolName            - the name of the symbol
+//               LOCAL_SYMBOL          - symbol name used as-is
+//               EXTERNAL_SYMBOL       - symbol name gets nonlazy treatment
+//
+// Eats: edx and targetReg
+//////////////////////////////////////////////////////////////////////
+
+// Values to specify whether the symbol is plain or nonlazy
+LOCAL_SYMBOL   = 0
+EXTERNAL_SYMBOL        = 1
+
+.macro LOAD_STATIC_WORD
+
+#if defined(__DYNAMIC__)
+       call    1f
+1:     popl    %edx
+.if $2 == EXTERNAL_SYMBOL
+       movl    L$1-1b(%edx),$0
+       movl    0($0),$0
+.elseif $2 == LOCAL_SYMBOL
+       movl    $1-1b(%edx),$0
+.else
+       !!! Unknown symbol type !!!
+.endif
+#else
+       movl    $1,$0
+#endif
+
+.endmacro
+
+//////////////////////////////////////////////////////////////////////
+//
+// LEA_STATIC_DATA     targetReg, symbolName, LOCAL_SYMBOL | EXTERNAL_SYMBOL
+//
+// Load the address of the named static data.
+//
+// Takes: targetReg            - the register, other than edx, to load
+//      symbolName             - the name of the symbol
+//      LOCAL_SYMBOL           - symbol is local to this module
+//      EXTERNAL_SYMBOL        - symbol is imported from another module
+//
+// Eats: edx and targetReg
+//////////////////////////////////////////////////////////////////////
+
+.macro LEA_STATIC_DATA
+#if defined(__DYNAMIC__)
+       call    1f
+1:     popl    %edx
+.if $2 == EXTERNAL_SYMBOL
+       movl    L$1-1b(%edx),$0
+.elseif $2 == LOCAL_SYMBOL
+       leal    $1-1b(%edx),$0
+.else
+       !!! Unknown symbol type !!!
+.endif
+#else
+       leal    $1,$0
+#endif
+
+.endmacro
+
+//////////////////////////////////////////////////////////////////////
+//
+// ENTRY               functionName
+//
+// Assembly directives to begin an exported function.
+//
+// Takes: functionName - name of the exported function
+//////////////////////////////////////////////////////////////////////
+
+.macro ENTRY
+       .text
+       .globl  $0
+       .align  4, 0x90
+$0:
+.endmacro
+
+//////////////////////////////////////////////////////////////////////
+//
+// END_ENTRY   functionName
+//
+// Assembly directives to end an exported function.  Just a placeholder,
+// a close-parenthesis for ENTRY, until it is needed for something.
+//
+// Takes: functionName - name of the exported function
+//////////////////////////////////////////////////////////////////////
+
+.macro END_ENTRY
+.endmacro
+
+//////////////////////////////////////////////////////////////////////
+//
+// CALL_MCOUNTER       counterName
+//
+// Allocate and maintain a counter for the call site.
+//
+// Takes: counterName - name of counter.
+//////////////////////////////////////////////////////////////////////
+HAVE_CALL_EXTERN_mcount        = 0
+
+.macro CALL_MCOUNTER
+#ifdef PROFILE
+       pushl   %ebp
+       movl    %esp,%ebp
+       LOAD_STATIC_WORD %eax, $0, LOCAL_SYMBOL
+.if HAVE_CALL_EXTERN_mcount == 0
+HAVE_CALL_EXTERN_mcount = 1
+       CALL_EXTERN(mcount)
+.else
+       CALL_EXTERN_AGAIN(mcount)
+.endif
+       .data
+       .align  2
+$0:
+       .long   0
+       .text
+       movl    %ebp,%esp
+       popl    %ebp
+#endif
+.endmacro
+
+
+/////////////////////////////////////////////////////////////////////
+//
+//
+// CacheLookup WORD_RETURN | STRUCT_RETURN, MSG_SEND | MSG_SENDSUPER, cacheMissLabel
+//
+// Locate the implementation for a selector in a class method cache.
+//
+// Takes: WORD_RETURN  (first parameter is at sp+4)
+//       STRUCT_RETURN (struct address is at sp+4, first parameter at sp+8)
+//        MSG_SEND     (first parameter is receiver)
+//       MSG_SENDSUPER (first parameter is address of objc_super structure)
+//
+//       cacheMissLabel = label to branch to iff method is not cached
+//
+// On exit:    (found) imp in eax register
+//             (not found) jumps to cacheMissLabel
+//     
+/////////////////////////////////////////////////////////////////////
+
+
+// Values to specify to method lookup macros whether the return type of
+// the method is word or structure.
+WORD_RETURN    = 0
+STRUCT_RETURN  = 1
+
+// Values to specify to method lookup macros whether the first argument
+// is an object/class reference or a 'objc_super' structure.
+MSG_SEND       = 0
+MSG_SENDSUPER  = 1
+
+.macro CacheLookup
+
+// load variables and save caller registers.
+// Overlapped to prevent AGI
+.if $0 == WORD_RETURN                  // Regular word return
+.if $1 == MSG_SEND                     // MSG_SEND
+       movl    isa(%eax), %eax         //   class = self->isa
+       movl    selector(%esp), %ecx    //   get selector
+.else                                  // MSG_SENDSUPER
+       movl    super(%esp), %eax       //   get objc_super address
+       movl    class(%eax), %eax       //   class = caller->class
+       movl    selector(%esp), %ecx    //   get selector
+.endif
+.else                                  // Struct return
+.if $1 == MSG_SEND                     // MSG_SEND (stret)
+       movl    isa(%eax), %eax         //   class = self->isa
+       movl    (selector_stret)(%esp), %ecx    //   get selector
+.else                                  // MSG_SENDSUPER (stret)
+       movl    super_stret(%esp), %eax //   get objc_super address
+       movl    class(%eax), %eax       //   class = caller->class
+       movl    (selector_stret)(%esp), %ecx    //   get selector
+.endif
+.endif
+
+       pushl   %edi                    // save scratch register
+       movl    cache(%eax), %eax       // cache = class->cache
+       pushl   %esi                    // save scratch register
+
+#if defined(OBJC_INSTRUMENTED)
+       pushl   %ebx                    // save non-volatile register
+       pushl   %eax                    // save cache pointer
+       xorl    %ebx, %ebx              // probeCount = 0
+#endif
+       leal    buckets(%eax), %edi     // buckets = &cache->buckets
+       movl    mask(%eax), %esi                // mask = cache->mask
+       movl    %ecx, %edx              // index = selector
+
+// search the receiver's cache
+LMsgSendProbeCache_$0_$1:
+#if defined(OBJC_INSTRUMENTED)
+       inc     %ebx                    // probeCount += 1
+#endif
+       andl    %esi, %edx              // index &= mask
+       movl    (%edi, %edx, 4), %eax   // method = buckets[index]
+
+       testl   %eax, %eax              // check for end of bucket
+       je      LMsgSendCacheMiss_$0_$1 // go to cache miss code
+       cmpl    method_name(%eax), %ecx // check for method name match
+       je      LMsgSendCacheHit_$0_$1  // go handle cache hit
+       inc     %edx                    // bump index ...
+       jmp     LMsgSendProbeCache_$0_$1// ... and loop
+
+// not found in cache: restore state and go to callers handler
+LMsgSendCacheMiss_$0_$1:
+#if defined(OBJC_INSTRUMENTED)
+       popl    %edx                    // retrieve cache pointer
+       movl    mask(%edx), %esi                // mask = cache->mask
+       testl   %esi, %esi              // a mask of zero is only for the...
+       je      LMsgSendMissInstrumentDone_$0   // ... emptyCache, do not record anything
+
+       // locate and update the CacheInstrumentation structure
+       inc     %esi                    // entryCount = mask + 1
+#ifdef NO_MACRO_CONSTS
+       shll    $kTwo, %esi             // tableSize = entryCount * sizeof(entry)
+#else
+       shll    $2, %esi                        // tableSize = entryCount * sizeof(entry)
+#endif
+       addl    $buckets, %esi          // offset = buckets + tableSize
+       addl    %edx, %esi              // cacheData = &cache->buckets[mask+1]
+
+       movl    missCount(%esi), %edi   // 
+       inc     %edi                    // 
+       movl    %edi, missCount(%esi)   // cacheData->missCount += 1
+       movl    missProbes(%esi), %edi  // 
+       addl    %ebx, %edi              // 
+       movl    %edi, missProbes(%esi)  // cacheData->missProbes += probeCount
+       movl    maxMissProbes(%esi), %edi// if (cacheData->maxMissProbes < probeCount)
+       cmpl    %ebx, %edi              // 
+       jge     LMsgSendMaxMissProbeOK_$0       // 
+       movl    %ebx, maxMissProbes(%esi)// cacheData->maxMissProbes = probeCount
+LMsgSendMaxMissProbeOK_$0:
+
+       // update cache miss probe histogram
+       cmpl    $CACHE_HISTOGRAM_SIZE, %ebx     // pin probeCount to max index
+       jl      LMsgSendMissHistoIndexSet_$0
+       movl    $(CACHE_HISTOGRAM_SIZE-1), %ebx
+LMsgSendMissHistoIndexSet_$0:
+       LEA_STATIC_DATA %esi, _CacheMissHistogram, EXTERNAL_SYMBOL
+#ifdef NO_MACRO_CONSTS
+       shll    $kTwo, %ebx             // convert probeCount to histogram index
+#else
+       shll    $2, %ebx                        // convert probeCount to histogram index
+#endif
+       addl    %ebx, %esi              // calculate &CacheMissHistogram[probeCount<<2]
+       movl    0(%esi), %edi           // get current tally
+       inc     %edi                    // 
+       movl    %edi, 0(%esi)           // tally += 1
+LMsgSendMissInstrumentDone_$0:
+       popl    %ebx                    // restore non-volatile register
+#endif
+
+.if $0 == WORD_RETURN                  // Regular word return
+.if $1 == MSG_SEND                     // MSG_SEND
+       popl    %esi                    //  restore callers register
+       popl    %edi                    //  restore callers register
+       movl    self(%esp), %eax                //  get messaged object
+       movl    isa(%eax), %eax         //  get objects class
+.else                                  // MSG_SENDSUPER
+       // replace "super" arg with "receiver"
+       movl    super+8(%esp), %edi     //  get super structure
+       movl    receiver(%edi), %esi    //  get messaged object
+       movl    %esi, super+8(%esp)     //  make it the first argument
+       movl    class(%edi), %eax       //  get messaged class
+       popl    %esi                    //  restore callers register
+       popl    %edi                    //  restore callers register
+.endif
+.else                                  // Struct return
+.if $1 == MSG_SEND                     // MSG_SEND (stret)
+       popl    %esi                    //  restore callers register
+       popl    %edi                    //  restore callers register
+       movl    self_stret(%esp), %eax  //  get messaged object
+       movl    isa(%eax), %eax         //  get objects class
+.else                                  // MSG_SENDSUPER (stret)
+       // replace "super" arg with "receiver"
+       movl    super_stret+8(%esp), %edi//  get super structure
+       movl    receiver(%edi), %esi    //  get messaged object
+       movl    %esi, super_stret+8(%esp)//  make it the first argument
+       movl    class(%edi), %eax       //  get messaged class
+       popl    %esi                    //  restore callers register
+       popl    %edi                    //  restore callers register
+.endif
+.endif
+
+       jmp     $2                      // go to callers handler
+
+// eax points to matching cache entry
+       .align  4, 0x90
+LMsgSendCacheHit_$0_$1:
+#if defined(OBJC_INSTRUMENTED)
+       popl    %edx                    // retrieve cache pointer
+       movl    mask(%edx), %esi                // mask = cache->mask
+       testl   %esi, %esi              // a mask of zero is only for the...
+       je      LMsgSendHitInstrumentDone_$0_$1 // ... emptyCache, do not record anything
+
+       // locate and update the CacheInstrumentation structure
+       inc     %esi                    // entryCount = mask + 1
+#ifdef NO_MACRO_CONSTS
+       shll    $kTwo, %esi             // tableSize = entryCount * sizeof(entry)
+#else
+       shll    $2, %esi                        // tableSize = entryCount * sizeof(entry)
+#endif
+       addl    $buckets, %esi          // offset = buckets + tableSize
+       addl    %edx, %esi              // cacheData = &cache->buckets[mask+1]
+
+       movl    hitCount(%esi), %edi
+       inc     %edi
+       movl    %edi, hitCount(%esi)    // cacheData->hitCount += 1
+       movl    hitProbes(%esi), %edi
+       addl    %ebx, %edi
+       movl    %edi, hitProbes(%esi)   // cacheData->hitProbes += probeCount
+       movl    maxHitProbes(%esi), %edi// if (cacheData->maxHitProbes < probeCount)
+       cmpl    %ebx, %edi
+       jge     LMsgSendMaxHitProbeOK_$0_$1
+       movl    %ebx, maxHitProbes(%esi)// cacheData->maxHitProbes = probeCount
+LMsgSendMaxHitProbeOK_$0_$1:
+
+       // update cache hit probe histogram
+       cmpl    $CACHE_HISTOGRAM_SIZE, %ebx     // pin probeCount to max index
+       jl      LMsgSendHitHistoIndexSet_$0_$1
+       movl    $(CACHE_HISTOGRAM_SIZE-1), %ebx
+LMsgSendHitHistoIndexSet_$0_$1:
+       LEA_STATIC_DATA %esi, _CacheHitHistogram, EXTERNAL_SYMBOL
+#ifdef NO_MACRO_CONSTS
+       shll    $kTwo, %ebx             // convert probeCount to histogram index
+#else
+       shll    $2, %ebx                        // convert probeCount to histogram index
+#endif
+       addl    %ebx, %esi              // calculate &CacheHitHistogram[probeCount<<2]
+       movl    0(%esi), %edi           // get current tally
+       inc     %edi                    // 
+       movl    %edi, 0(%esi)           // tally += 1
+LMsgSendHitInstrumentDone_$0_$1:
+       popl    %ebx                    // restore non-volatile register
+#endif
+
+// load implementation address, restore state, and we're done
+       movl    method_imp(%eax), %eax  // imp = method->method_imp
+
+.if $0 == WORD_RETURN                  // Regular word return
+.if $1 == MSG_SENDSUPER                        // MSG_SENDSUPER
+       // replace "super" arg with "self"
+       movl    super+8(%esp), %edi
+       movl    receiver(%edi), %esi
+       movl    %esi, super+8(%esp)
+.endif
+.else                                  // Struct return
+.if $1 == MSG_SENDSUPER                        // MSG_SENDSUPER (stret)
+       // replace "super" arg with "self"
+       movl    super_stret+8(%esp), %edi
+       movl    receiver(%edi), %esi
+       movl    %esi, super_stret+8(%esp)
+.endif
+.endif
+
+       // restore caller registers
+       popl    %esi
+       popl    %edi
+.endmacro
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// MethodTableLookup WORD_RETURN | STRUCT_RETURN, MSG_SEND | MSG_SENDSUPER
+//
+// Takes: WORD_RETURN  (first parameter is at sp+4)
+//       STRUCT_RETURN (struct address is at sp+4, first parameter at sp+8)
+//       MSG_SEND      (first parameter is receiver)
+//       MSG_SENDSUPER (first parameter is address of objc_super structure)
+//
+// On exit: Register parameters restored from CacheLookup
+//       imp in eax
+//
+/////////////////////////////////////////////////////////////////////
+
+HAVE_CALL_EXTERN_lookupMethodAndLoadCache = 0
+
+.macro MethodTableLookup
+
+       // push args (class, selector)
+       pushl   %ecx
+       pushl   %eax
+.if HAVE_CALL_EXTERN_lookupMethodAndLoadCache == 0
+HAVE_CALL_EXTERN_lookupMethodAndLoadCache = 1
+       CALL_EXTERN(__class_lookupMethodAndLoadCache)
+.else
+       CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+.endif
+#ifdef NO_MACRO_CONSTS
+       addl    $kEight, %esp                           // pop parameters
+#else
+       addl    $8, %esp                                        // pop parameters
+#endif
+.endmacro
+
+/**************************
+ * This #defines is missing from asm_help.h
+ ***************************/
+#define EXTERN_TO_REG_AGAIN(var, reg)                    \
+       call    1f                                      ; \
+1:                                                     ; \
+       popl    %edx                                    ; \
+       movl    L ## var ##$non_lazy_ptr-1b(%edx),reg   ; 
+
+#define BRANCH_EXTERN_AGAIN(func)      \
+       PICIFY(func)                  ; \
+       jmp     %edx                  ; 
+
+/********************************************************************
+ *
+ * id objc_msgSend(id self, SEL        _cmd,...);
+ *
+ ********************************************************************/
+
+       ENTRY   _objc_msgSend
+       CALL_MCOUNTER   LP0
+
+       movl    self(%esp), %eax
+
+// check whether receiver is nil 
+       testl   %eax, %eax
+       je      LMsgSendNilSelf
+
+#if !defined(OBJC_COLLECTING_CACHE)
+// check whether context is multithreaded
+       EXTERN_TO_REG(__objc_multithread_mask,%ecx)
+       testl   %ecx, %ecx
+       je      LMsgSendMT
+#endif
+
+// single threaded and receiver is non-nil: search the cache
+       CacheLookup WORD_RETURN, MSG_SEND, LMsgSendCacheMiss
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SEND
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+#if !defined(OBJC_COLLECTING_CACHE)
+// multithreaded: hold _messageLock while accessing cache
+LMsgSendMT:
+       movl    $1, %ecx                        // acquire _messageLock
+       LEA_STATIC_DATA %eax, _messageLock, EXTERNAL_SYMBOL
+LMsgSendLockSpin:
+       xchgl   %ecx, (%eax)
+       cmpl    $0, %ecx
+       jne     LMsgSendLockSpin
+       movl    self(%esp), %eax                // restore eax
+
+       CacheLookup WORD_RETURN, MSG_SEND, LMsgSendMTCacheMiss
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendMTCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SEND
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+#endif
+
+// message sent to nil object: call optional handler and return nil
+LMsgSendNilSelf:
+       EXTERN_TO_REG(__objc_msgNil,%eax)
+       movl    0(%eax), %eax           // load nil message handler
+       testl   %eax, %eax
+       je      LMsgSendDone            // if NULL just return and don't do anything
+       call    *%eax                   // call __objc_msgNil
+       xorl    %eax, %eax              // Rezero $eax just in case
+LMsgSendDone:
+       ret
+
+LMsgSendExit:
+       END_ENTRY       _objc_msgSend
+
+/********************************************************************
+ *
+ * id objc_msgSendSuper(struct objc_super *super, SEL _cmd,...);
+ *
+ * struct objc_super {
+ *             id      receiver;
+ *             Class   class;
+ * };
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendSuper
+       CALL_MCOUNTER LP1
+
+       movl    super(%esp), %eax
+
+#if !defined(OBJC_COLLECTING_CACHE)
+// check whether context is multithreaded
+       EXTERN_TO_REG_AGAIN(__objc_multithread_mask,%ecx)
+       testl   %ecx, %ecx
+       je      LMsgSendSuperMT
+#endif
+
+// single threaded and receiver is non-nil: search the cache
+       CacheLookup WORD_RETURN, MSG_SENDSUPER, LMsgSendSuperCacheMiss
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendSuperCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SENDSUPER
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+#if !defined(OBJC_COLLECTING_CACHE)
+LMsgSendSuperMT:
+// multithreaded: hold _messageLock while accessing cache
+       movl    $1, %ecx                        // acquire _messageLock
+       LEA_STATIC_DATA %eax, _messageLock, EXTERNAL_SYMBOL
+LMsgSendSuperLockSpin:
+       xchgl   %ecx, (%eax)
+       cmpl    $0, %ecx
+       jne     LMsgSendSuperLockSpin
+       movl    super(%esp), %eax       // restore eax
+
+       CacheLookup WORD_RETURN, MSG_SENDSUPER, LMsgSendSuperMTCacheMiss
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendSuperMTCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SENDSUPER
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSend, %edx      // flag word-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+#endif
+
+LMsgSendSuperExit:
+       END_ENTRY       _objc_msgSendSuper
+
+/********************************************************************
+ * id objc_msgSendv(id self, SEL _cmd, unsigned size, marg_list frame);
+ *
+ * On entry:
+ *             (sp+4)  is the message receiver,
+ *             (sp+8)  is the selector,
+ *             (sp+12) is the size of the marg_list, in bytes,
+ *             (sp+16) is the address of the marg_list
+ *
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendv
+
+#if defined(KERNEL)
+       trap                            // _objc_msgSendv is not for the kernel
+#else
+       pushl   %ebp
+       movl    %esp, %ebp
+       movl    (marg_list+4)(%ebp), %edx
+       addl    $8, %edx                        // skip self & selector
+       movl    (marg_size+4)(%ebp), %ecx
+       subl    $5, %ecx                        // skip self & selector
+       shrl    $2, %ecx
+       jle     LMsgSendvArgsOK
+LMsgSendvArgLoop:
+       decl    %ecx
+       movl    0(%edx, %ecx, 4), %eax
+       pushl   %eax
+       jg      LMsgSendvArgLoop
+
+LMsgSendvArgsOK:
+       movl    (selector+4)(%ebp), %ecx
+       pushl   %ecx
+       movl    (self+4)(%ebp),%ecx
+       pushl   %ecx
+       call    _objc_msgSend
+       movl    %ebp,%esp
+       popl    %ebp
+
+       ret
+#endif
+       END_ENTRY       _objc_msgSendv
+
+
+/********************************************************************
+ *
+ * void        objc_msgSend_stret(void *st_addr        , id self, SEL _cmd, ...);
+ *
+ *
+ * objc_msgSend_stret is the struct-return form of msgSend.
+ * The ABI calls for (sp+4) to be used as the address of the structure
+ * being returned, with the parameters in the succeeding locations.
+ *
+ * On entry:   (sp+4)is the address where the structure is returned,
+ *             (sp+8) is the message receiver,
+ *             (sp+12) is the selector
+ ********************************************************************/
+
+       ENTRY   _objc_msgSend_stret
+       CALL_MCOUNTER   LP2
+
+       movl    self_stret(%esp), %eax
+
+// check whether receiver is nil 
+       testl   %eax, %eax
+       je      LMsgSendStretNilSelf
+
+#if !defined(OBJC_COLLECTING_CACHE)
+// check whether context is multithreaded
+       EXTERN_TO_REG_AGAIN(__objc_multithread_mask,%ecx)
+       testl   %ecx, %ecx
+       je      LMsgSendStretMT
+#endif
+
+// single threaded and receiver is non-nil: search the cache
+       CacheLookup STRUCT_RETURN, MSG_SEND, LMsgSendStretCacheMiss
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendStretCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SEND
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+#if !defined(OBJC_COLLECTING_CACHE)
+// multithreaded: hold _messageLock while accessing cache
+LMsgSendStretMT:
+       movl    $1, %ecx                        // acquire _messageLock
+       LEA_STATIC_DATA %eax, _messageLock, EXTERNAL_SYMBOL
+LMsgSendStretLockSpin:
+       xchgl   %ecx, (%eax)
+       cmpl    $0, %ecx
+       jne     LMsgSendStretLockSpin
+       movl    self_stret(%esp), %eax  // restore eax
+
+       CacheLookup STRUCT_RETURN, MSG_SEND, LMsgSendStretMTCacheMiss
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendStretMTCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SEND
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+#endif
+
+// message sent to nil object: call optional handler and return nil
+LMsgSendStretNilSelf:
+       EXTERN_TO_REG_AGAIN(__objc_msgNil,%eax)
+       movl    0(%eax), %eax           // load nil message handler
+       testl   %eax, %eax
+       je      LMsgSendStretDone       // if NULL just return and don't do anything
+
+       call    *%eax                   // call __objc_msgNil
+       xorl    %eax, %eax              // Rezero $eax just in case
+LMsgSendStretDone:
+       ret
+
+LMsgSendStretExit:
+       END_ENTRY       _objc_msgSend_stret
+
+/********************************************************************
+ *
+ * void objc_msgSendSuper_stret(void *st_addr, struct objc_super *super, SEL _cmd, ...);
+ *
+ * struct objc_super {
+ *             id      receiver;
+ *             Class   class;
+ * };
+ *
+ * objc_msgSendSuper_stret is the struct-return form of msgSendSuper.
+ * The ABI calls for (sp+4) to be used as the address of the structure
+ * being returned, with the parameters in the succeeding registers.
+ *
+ * On entry:   (sp+4)is the address where the structure is returned,
+ *             (sp+8) is the address of the objc_super structure,
+ *             (sp+12) is the selector
+ *
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendSuper_stret
+       CALL_MCOUNTER LP3
+
+       movl    super_stret(%esp), %eax
+
+#if !defined(OBJC_COLLECTING_CACHE)
+// check whether context is multithreaded
+       EXTERN_TO_REG_AGAIN(__objc_multithread_mask,%ecx)
+       testl   %ecx, %ecx
+       je      LMsgSendSuperStretMT
+#endif
+
+// single threaded and receiver is non-nil: search the cache
+       CacheLookup STRUCT_RETURN, MSG_SENDSUPER, LMsgSendSuperStretCacheMiss
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendSuperStretCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SENDSUPER
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+#if !defined(OBJC_COLLECTING_CACHE)
+LMsgSendStretSuperMT:
+// multithreaded: hold _messageLock while accessing cache
+       movl    $1, %ecx                        // acquire _messageLock
+       LEA_STATIC_DATA %eax, _messageLock, EXTERNAL_SYMBOL
+LMsgSendSuperStretLockSpin:
+       xchgl   %ecx, (%eax)
+       cmpl    $0, %ecx
+       jne     LMsgSendSuperStretLockSpin
+       movl    super_stret(%esp), %eax // restore eax
+
+       CacheLookup STRUCT_RETURN, MSG_SENDSUPER, LMsgSendSuperStretMTCacheMiss
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+
+// cache miss: go search the method lists
+LMsgSendSuperStretMTCacheMiss:
+       MethodTableLookup MSG_SENDSUPER
+       LEA_STATIC_DATA %ecx, _messageLock, EXTERNAL_SYMBOL
+       movl    $0, (%ecx)              // unlock
+       movl    $kFwdMsgSendStret, %edx // flag struct-return for _objc_msgForward
+       jmp     *%eax                   // goto *imp
+#endif
+
+LMsgSendSuperStretExit:
+       END_ENTRY       _objc_msgSendSuper_stret
+
+
+/********************************************************************
+ * id objc_msgSendv_stret(void *st_addr, id self, SEL _cmd, unsigned size, marg_list frame);
+ *
+ * objc_msgSendv_stret is the struct-return form of msgSendv.
+ * The ABI calls for (sp+4) to be used as the address of the structure
+ * being returned, with the parameters in the succeeding locations.
+ * 
+ * On entry:   (sp+4)  is the address in which the returned struct is put,
+ *             (sp+8)  is the message receiver,
+ *             (sp+12) is the selector,
+ *             (sp+16) is the size of the marg_list, in bytes,
+ *             (sp+20) is the address of the marg_list
+ *
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendv_stret
+
+#if defined(KERNEL)
+       trap                            // _objc_msgSendv_stret is not for the kernel
+#else
+       pushl   %ebp
+       movl    %esp, %ebp
+       movl    (marg_list_stret+4)(%ebp), %edx
+       addl    $8, %edx                        // skip self & selector
+       movl    (marg_size_stret+4)(%ebp), %ecx
+       subl    $5, %ecx                        // skip self & selector
+       shrl    $2, %ecx
+       jle     LMsgSendvStretArgsOK
+LMsgSendvStretArgLoop:
+       decl    %ecx
+       movl    0(%edx, %ecx, 4), %eax
+       pushl   %eax
+       jg      LMsgSendvStretArgLoop
+
+LMsgSendvStretArgsOK:
+       movl    (selector_stret+4)(%ebp), %ecx
+       pushl   %ecx
+       movl    (self_stret+4)(%ebp),%ecx
+       pushl   %ecx
+       movl    (struct_addr+4)(%ebp),%ecx
+       pushl   %ecx
+       call    _objc_msgSend_stret
+       movl    %ebp,%esp
+       popl    %ebp
+
+       ret
+#endif
+       END_ENTRY       _objc_msgSendv_stret
+
+
+/********************************************************************
+ *
+ * id _objc_msgForward(id self, SEL _cmd,...);
+ *
+ ********************************************************************/
+
+// Location LFwdStr contains the string "forward::"
+// Location LFwdSel contains a pointer to LFwdStr, that can be changed
+// to point to another forward:: string for selector uniquing
+// purposes.  ALWAYS dereference LFwdSel to get to "forward::" !!
+       .objc_meth_var_names
+       .align  2
+LFwdStr:.ascii "forward::\0"
+
+       .objc_message_refs
+       .align  2
+LFwdSel:.long  LFwdStr
+
+       .cstring
+       .align  2
+LUnkSelStr:    .ascii  "Does not recognize selector %s\0"
+
+       ENTRY   __objc_msgForward
+
+#if defined(KERNEL)
+       trap                            // _objc_msgForward is not for the kernel
+#else
+       cmpl    $kFwdMsgSendStret, %edx // check secret flag for word vs struct return
+       je      LForwardStretVersion    // jump to struct return version...
+
+       // non-stret version ...
+       pushl   %ebp
+       movl    %esp,%ebp
+       movl    (selector+4)(%esp), %eax
+#if defined(__DYNAMIC__)
+       call    L__objc_msgForward$pic_base
+L__objc_msgForward$pic_base:
+       popl    %edx
+       leal    LFwdSel-L__objc_msgForward$pic_base(%edx),%ecx
+       cmpl    %ecx, %eax
+#else
+       cmpl    LFwdSel, %eax
+#endif
+       je      LMsgForwardError
+
+       leal    (self+4)(%esp), %ecx
+       pushl   %ecx
+       pushl   %eax
+#if defined(__DYNAMIC__)
+       movl    LFwdSel-L__objc_msgForward$pic_base(%edx),%ecx
+#else
+       movl    LFwdSel,%ecx
+#endif
+       pushl   %ecx
+       pushl   (self+16)(%esp)
+       call    _objc_msgSend
+       movl    %ebp,%esp
+       popl    %ebp
+       ret
+
+// call error handler with unrecognized selector message
+       .align  4, 0x90
+LMsgForwardError:
+#if defined(__DYNAMIC__)
+       leal    LFwdSel-L__objc_msgForward$pic_base(%edx),%eax
+       pushl   %eax
+       leal    LUnkSelStr-L__objc_msgForward$pic_base(%edx),%eax
+       pushl   %eax
+#else
+       pushl   $LFwdSel
+       pushl   $LUnkSelStr
+#endif
+       pushl   (self+12)(%esp)
+       BRANCH_EXTERN(___objc_error)    // volatile, will not return
+
+// ***** Stret version of function below
+// ***** offsets have been changed (by adding a word to make room for the 
+// ***** structure, and labels have been changed to be unique.
+
+LForwardStretVersion:
+       pushl   %ebp
+       movl    %esp,%ebp
+       movl    (selector_stret+4)(%esp), %eax
+
+#if defined(__DYNAMIC__)
+       call    L__objc_msgForwardStret$pic_base
+L__objc_msgForwardStret$pic_base:
+       popl    %edx
+       leal    LFwdSel-L__objc_msgForwardStret$pic_base(%edx),%ecx
+       cmpl    %ecx, %eax
+#else
+       cmpl    LFwdSel, %eax
+#endif
+       je      LMsgForwardStretError
+
+       leal    (self_stret+4)(%esp), %ecx
+       pushl   %ecx
+       pushl   %eax
+#if defined(__DYNAMIC__)
+       movl    LFwdSel-L__objc_msgForwardStret$pic_base(%edx),%ecx
+#else
+       movl    LFwdSel,%ecx
+#endif
+       pushl   %ecx
+       pushl   (self_stret+16)(%esp)
+       call    _objc_msgSend_stret
+       movl    %ebp,%esp
+       popl    %ebp
+       ret
+
+// call error handler with unrecognized selector message
+       .align  4, 0x90
+LMsgForwardStretError:
+#if defined(__DYNAMIC__)
+       leal    LFwdSel-L__objc_msgForwardStret$pic_base(%edx),%eax
+       pushl   %eax
+       leal    LUnkSelStr-L__objc_msgForwardStret$pic_base(%edx),%eax
+       pushl   %eax
+#else
+       pushl   $LFwdSel
+       pushl   $LUnkSelStr
+#endif
+       pushl   (self_stret+12)(%esp)
+       BRANCH_EXTERN_AGAIN(___objc_error)      // volatile, will not return
+
+#endif defined (KERNEL)
+       END_ENTRY       __objc_msgForward
+
diff --git a/runtime/Messengers.subproj/objc-msg-m68k-lock.s b/runtime/Messengers.subproj/objc-msg-m68k-lock.s
new file mode 100644 (file)
index 0000000..370bd9a
--- /dev/null
@@ -0,0 +1,283 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifndef KERNEL
+| _objc_entryPoints and _objc_exitPoints are used by moninitobjc() to setup
+| objective-C messages for profiling.  The are made private_externs when in
+| a shared library.
+       .reference _moninitobjc
+       .const
+.globl _objc_entryPoints
+_objc_entryPoints:
+       .long _objc_msgSend
+       .long _objc_msgSendSuper
+       .long _objc_msgSendv
+       .long 0
+
+.globl _objc_exitPoints
+_objc_exitPoints:
+       .long Lexit1
+       .long Lexit2
+       .long Lexit3
+       .long Lexit4
+       .long Lexit5
+       .long Lexit6
+       .long Lexit7
+       .long Lexit8
+       .long 0
+#endif /* KERNEL */
+
+       self = 4
+       selector = 8
+       cache = 32
+       buckets = 8
+       method_imp = 8
+
+| optimized for 68040: 27 clocks (best case) + 16 clocks / probe
+
+       .text
+       .align 1
+       .globl _objc_msgSend
+_objc_msgSend:
+       movel sp@(self),d0              | (1)
+       movel d0,a0                     | (1)
+       andl __objc_multithread_mask,d0 | (1) if (_objc_multithread_mask == 0)
+       jne L1                          | (2)   goto lock;
+       tstl a0                         |     if (self != nil)
+       jne L11                         |       continue with objc_msgSend
+        movel __objc_msgNil,a0         | (?) load nil object handler
+        tstl a0                                | (?) If NULL just return and dont do anything
+        jeq L10                                | (?)
+        jbsr a0@                       | (?) call __objc_msgNil;
+       clrl d0                         | (1) zero d0, just in case nil handler changed them
+       movel d0,a0                     | (1) zero a0, just in case nil handler changed them
+L10:   rts                             |
+L1:    movel a0@,a0                    | (1) class = self->isa;
+       movel a1,sp@-                   | (2) (save a1)
+       movel a0@(cache),a1             | (1) cache = class->cache;
+       movel sp@(selector+4),d1        | (1) index = selector;
+L2:    andl a1@,d1                     | (1) index &= cache->mask;
+       movel a1@(buckets,d1:l:4),d0    | (4) method = cache->buckets[index];
+       movel d0,a0                     | (1) if (method == NULL)
+       jne L3                          | (2)   goto cache_miss;
+       jra L5                          |
+L3:    movel sp@(selector+4),d0        | (1)
+       cmpl a0@,d0                     | (1) if (method_name == selector)
+       jeq L4                          | (2)   goto cache_hit;
+       addql #1,d1                     |     index++
+       jra L2                          |     goto loop;
+L4:    movel a0@(method_imp),a0        | (1) imp = method->method_imp;
+       movel sp@+,a1                   | (1) (restore a1)
+Lexit1:        jmp a0@                         | (3) goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+L5:    movel sp@(self+4),a0            |     cache_miss:
+       movel sp@(selector+4),sp@-      |     imp =
+       movel a0@,sp@-                  |     _class_lookupMethodAndLoadCache
+       CALL_EXTERN(__class_lookupMethodAndLoadCache)   |     (class, selector);
+       addql #8,sp                     |
+       movel d0,a0                     |
+       movel sp@+,a1                   |     (restore a1)
+Lexit2:        jmp a0@                         |     goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+
+
+
+| locking version of objc_msgSend:
+
+L11:   clrb _messageLock+1             |     (workaround 040 bug)
+       tas _messageLock                |     mutex_lock (messageLock);
+       jpl L24                         |
+       jra L11                         |
+L24:   movel a0@,a0                    |     class = self->isa;
+       movel a1,sp@-                   |     (save a1)
+       movel a0@(cache),a1             |     cache = class->cache;
+       movel sp@(selector+4),d1        |     index = selector;
+L12:   andl a1@,d1                     |     index &= cache->mask;
+       movel a1@(buckets,d1:l:4),d0    |     method = cache->buckets[index];
+       movel d0,a0                     |     if (method == NULL)
+       jne L13                         |       goto cache_miss;
+       jra L15                         |
+L13:   movel sp@(selector+4),d0        |    
+       cmpl a0@,d0                     |     if (method_name == selector)
+       jeq L14                         |       goto cache_hit;
+       addql #1,d1                     |     index++
+       jra L12                         |     goto loop;
+L14:   movel a0@(method_imp),a0        |     imp = method->method_imp;
+       movel sp@+,a1                   |     (restore a1)
+       clrb _messageLock               |     mutex_unlock (messageLock);
+Lexit3: jmp a0@                                |     goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+L15:   movel sp@(self+4),a0            |     cache_miss:
+       movel sp@(selector+4),sp@-      |     imp =
+       movel a0@,sp@-                  |     _class_lookupMethodAndLoadCache
+       CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)     |     (class, selector);
+       addql #8,sp                     |
+       movel d0,a0                     |
+       movel sp@+,a1                   |     (restore a1)
+       clrb _messageLock               |     mutex_unlock (messageLock);
+Lexit4:        jmp a0@                         |     goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+
+
+
+       caller = 4
+
+| optimized for 68040: 31 clocks (best case) + 16 clocks / probe
+
+       .align 1
+       .globl _objc_msgSendSuper
+_objc_msgSendSuper:
+       tstl __objc_multithread_mask    | (1) if (_objc_multithread_mask == 0)
+       jne L20                         | (2)   goto lock;
+       jra L21                         |
+L20:   movel sp@(caller),a0            | (1)
+       movel a2,sp@-                   | (2) (save a2)
+       movel a0@+,sp@(self+4)          | (2) self = caller->receiver;
+       movel a0@,a2                    | (1) class = caller->class;
+       movel a1,sp@-                   | (2) (save a1)
+       movel a2@(cache),a1             | (1) cache = class->cache;
+       movel sp@(selector+8),d1        | (1) index = selector;
+L6:    andl a1@,d1                     | (1) index &= cache->mask;
+       movel a1@(buckets,d1:l:4),d0    | (4) method = cache->buckets[index];
+       movel d0,a0                     | (1) if (method == NULL)
+       jne L7                          | (2)   goto cache_miss;
+       jra L9                          |
+L7:    movel sp@(selector+8),d0        | (1)
+       cmpl a0@,d0                     | (1) if (method_name == selector)
+       jeq L8                          | (2)   goto cache_hit;
+       addql #1,d1                     |     index++
+       jra L6                          |     goto loop;
+L8:    movel a0@(method_imp),a0        | (1) imp = method->method_imp;
+       movel sp@+,a1                   | (1) (restore a1)
+       movel sp@+,a2                   | (1) (restore a2)
+Lexit5:        jmp a0@                         | (3) goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+L9:    movel sp@(selector+8),sp@-      |     imp =
+       movel a2,sp@-                   |     _class_lookupMethodAndLoadCache
+       CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)     |     (class, selector);
+       addql #8,sp                     |
+       movel d0,a0                     |
+       movel sp@+,a1                   |     (restore a1)
+       movel sp@+,a2                   |     (restore a2)
+Lexit6:        jmp a0@                         |     goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+
+
+
+| locking version of objc_msgSendSuper:
+
+L21:   clrb _messageLock+1             |     (workaround 040 bug)
+       tas _messageLock                |     mutex_lock (messageLock);
+       jpl L27                         |
+       jra L21                         |
+L27:   movel sp@(caller),a0            |    
+       movel a2,sp@-                   |     (save a2)
+       movel a0@+,sp@(self+4)          |     self = caller->receiver;
+       movel a0@,a2                    |     class = caller->class;
+       movel a1,sp@-                   |     (save a1)
+       movel a2@(cache),a1             |     cache = class->cache;
+       movel sp@(selector+8),d1        |     index = selector;
+L16:   andl a1@,d1                     |     index &= cache->mask;
+       movel a1@(buckets,d1:l:4),d0    |     method = cache->buckets[index];
+       movel d0,a0                     |     if (method == NULL)
+       jne L17                         |       goto cache_miss;
+       jra L19                         |
+L17:   movel sp@(selector+8),d0        |    
+       cmpl a0@,d0                     |     if (method_name == selector)
+       jeq L18                         |       goto cache_hit;
+       addql #1,d1                     |     index++
+       jra L16                         |     goto loop;
+L18:   movel a0@(method_imp),a0        |     imp = method->method_imp;
+       movel sp@+,a1                   |     (restore a1)
+       movel sp@+,a2                   |     (restore a2)
+       clrb _messageLock               |     mutex_unlock (messageLock);
+Lexit7:        jmp a0@                         |     goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+L19:   movel sp@(selector+8),sp@-      |     imp =
+       movel a2,sp@-                   |     _class_lookupMethodAndLoadCache
+       CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)     |     (class, selector);
+       addql #8,sp                     |
+       movel d0,a0                     |
+       movel sp@+,a1                   |     (restore a1)
+       movel sp@+,a2                   |     (restore a2)
+       clrb _messageLock               |     mutex_unlock (messageLock);
+Lexit8:        jmp a0@                         |     goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+
+
+       .objc_meth_var_names
+       .align 1
+L30:   .ascii "forward::\0"
+
+       .objc_message_refs
+       .align 2
+L31:   .long L30
+
+       .cstring
+       .align 1
+L32:   .ascii "Does not recognize selector %s\0"
+
+       .text
+       .align 1
+       .globl __objc_msgForward
+__objc_msgForward:
+       linkw a6,#0x0                   |  set up frame pointer
+       movel sp@(selector+4),d0        |  +n accounts for sp pushes
+       cmpl L31,d0                     |  if (sel == @selector (forward::))
+       bne L33                         |  
+       pea L30                         |  __objc_error (self,
+       pea L32                         |                _errDoesntRecognize
+       movel sp@(self+12),sp@-         |                "forward::");
+       BRANCH_EXTERN(___objc_error)            |  
+L33:    pea sp@(self+4)                        |  return [self forward: sel : &self];
+       movel d0,sp@-                   |  
+       movel L31,sp@-                  |  
+       movel sp@(self+16),sp@-         |  
+       bsr _objc_msgSend               |  
+       unlk a6                         |  clear frame pointer
+       rts                             |  
+
+
+       size = 12
+       args = 16
+
+       .text
+       .align 1
+       .globl _objc_msgSendv
+_objc_msgSendv:
+       linkw a6,#0                     |  
+       movel a6@(size+4),d0            |  
+       addql #3,d0                     |  size = round_up (size, 4);
+       andl #0xfffffffc,d0             |  
+       movel a6@(args+4),a0            |  
+       addl d0,a0                      |  arg_ptr = &args[size];
+       subql #8,d0                     |  size -= 8;
+       ble L35                         |  while (size > 0)
+L34:   movel a0@-,sp@-                 |    *--sp = *--arg_ptr;
+       subql #4,d0                     |    size -= 4;
+       bgt L34                         |  
+L35:   movel a6@(selector+4),sp@-      |  
+       movel a6@(self+4),sp@-          |  objc_msgSend (self, selector, ...);
+       bsr _objc_msgSend               |  
+       unlk a6                         |  (deallocate variable storage)
+       rts                             |  
diff --git a/runtime/Messengers.subproj/objc-msg-m68k-nolock.s b/runtime/Messengers.subproj/objc-msg-m68k-nolock.s
new file mode 100644 (file)
index 0000000..ea94610
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifndef KERNEL
+| _objc_entryPoints and _objc_exitPoints are used by moninitobjc() to setup
+| objective-C messages for profiling.  The are made private_externs when in
+| a shared library.
+       .reference _moninitobjc
+       .data
+.globl _objc_entryPoints
+_objc_entryPoints:
+       .long _objc_msgSend
+       .long _objc_msgSendSuper
+       .long 0
+
+.globl _objc_exitPoints
+_objc_exitPoints:
+       .long Lexit1
+       .long Lexit5
+       .long 0
+#endif /* KERNEL */
+
+       self = 4
+       selector = 8
+       cache = 32
+       buckets = 8
+       method_imp = 8
+
+| optimized for 68040: 27 clocks (best case) + 16 clocks / probe
+
+       .text
+       .align 1
+       .globl _objc_msgSend
+_objc_msgSend:
+       movel sp@(self),a0              | (1)
+       tstl a0                         |     if (self == nil)
+       jne L1                          |
+       movel a0,d0                     |       return nil
+        movel __objc_msgNil,a0         | (?) load nil object handler
+        tstl a0                                | (?) If NULL just return and dont do anything
+        jeq L10                                | (?)
+        jbsr a0@                       | (?) call __objc_msgNil;
+       clrl d0                         | (1) zero d0, just in case nil handler changed them
+       movel d0,a0                     | (1) zero a0, just in case nil handler changed them
+L10:   rts                             |
+L1:    movel a0@,a0                    | (1) class = self->isa;
+       movel a1,sp@-                   | (2) (save a1)
+       movel a0@(cache),a1             | (1) cache = class->cache;
+       movel sp@(selector+4),d1        | (1) index = selector;
+L2:    andl a1@,d1                     | (1) index &= cache->mask;
+       movel a1@(buckets,d1:l:4),d0    | (4) method = cache->buckets[index];
+       movel d0,a0                     | (1) if (method == NULL)
+       jne L3                          | (2)   goto cache_miss;
+       jra L5                          |
+L3:    movel sp@(selector+4),d0        | (1)
+       cmpl a0@,d0                     | (1) if (method_name == selector)
+       jeq L4                          | (2)   goto cache_hit;
+       addql #1,d1                     |     index++
+       jra L2                          |     goto loop;
+L4:    movel a0@(method_imp),a0        | (1) imp = method->method_imp;
+       movel sp@+,a1                   | (1) (restore a1)
+Lexit1:        jmp a0@                         | (3) goto *imp;
+#ifdef MONINIT
+       .space 22                       | /* area for moninitobjc to write */
+#endif
+L5:    movel sp@(self+4),a0            |     cache_miss:
+       movel sp@(selector+4),sp@-      |     imp =
+       movel a0@,sp@-                  |     _class_lookupMethodAndLoadCache
+       CALL_EXTERN(__class_lookupMethodAndLoadCache)   |     (class, selector);
+       addql #8,sp                     |
+       movel d0,a0                     |
+       movel sp@+,a1                   |     (restore a1)
+Lexit2:        jmp a0@                         |     goto *imp;
+       .space 22                       | /* area for moninitobjc to write */
+
+
+
+       caller = 4
+
+| optimized for 68040: 31 clocks (best case) + 16 clocks / probe
+
+       .align 1
+       .globl _objc_msgSendSuper
+_objc_msgSendSuper:
+       movel sp@(caller),a0            | (1)
+       movel a2,sp@-                   | (2) (save a2)
+       movel a0@+,sp@(self+4)          | (2) self = caller->receiver;
+       movel a0@,a2                    | (1) class = caller->class;
+       movel a1,sp@-                   | (2) (save a1)
+       movel a2@(cache),a1             | (1) cache = class->cache;
+       movel sp@(selector+8),d1        | (1) index = selector;
+L6:    andl a1@,d1                     | (1) index &= cache->mask;
+       movel a1@(buckets,d1:l:4),d0    | (4) method = cache->buckets[index];
+       movel d0,a0                     | (1) if (method == NULL)
+       jne L7                          | (2)   goto cache_miss;
+       jra L9                          |
+L7:    movel sp@(selector+8),d0        | (1)
+       cmpl a0@,d0                     | (1) if (method_name == selector)
+       jeq L8                          | (2)   goto cache_hit;
+       addql #1,d1                     |     index++
+       jra L6                          |     goto loop;
+L8:    movel a0@(method_imp),a0        | (1) imp = method->method_imp;
+       movel sp@+,a1                   | (1) (restore a1)
+       movel sp@+,a2                   | (1) (restore a2)
+Lexit5:        jmp a0@                         | (3) goto *imp;
+#ifdef MONINIT
+       .space 22                       | /* area for moninitobjc to write */
+#endif
+L9:    movel sp@(selector+8),sp@-      |     imp =
+       movel a2,sp@-                   |     _class_lookupMethodAndLoadCache
+       CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)     |     (class, selector);
+       addql #8,sp                     |
+       movel d0,a0                     |
+       movel sp@+,a1                   |     (restore a1)
+       movel sp@+,a2                   |     (restore a2)
+Lexit6:        jmp a0@                         |     goto *imp;
+#ifdef MONINIT
+       .space 22                       | /* area for moninitobjc to write */
+#endif
+
+
+
+       .objc_meth_var_names
+       .align 1
+L30:   .ascii "forward::\0"
+
+       .objc_message_refs
+       .align 2
+L31:   .long L30
+
+       .cstring
+       .align 1
+L32:   .ascii "Does not recognize selector %s\0"
+
+       .text
+       .align 1
+       .globl __objc_msgForward
+__objc_msgForward:
+       linkw a6,#0x0                   |  set up frame pointer
+       movel sp@(selector+4),d0        |  +n accounts for sp pushes
+       cmpl L31,d0                     |  if (sel == @selector (forward::))
+       bne L33                         |  
+       pea L30                         |  __objc_error (self,
+       pea L32                         |                _errDoesntRecognize
+       movel sp@(self+12),sp@-         |                "forward::");
+       BRANCH_EXTERN(___objc_error)            |  
+L33:    pea sp@(self+4)                        |  return [self forward: sel : &self];
+       movel d0,sp@-                   |  
+       movel L31,sp@-                  |  
+       movel sp@(self+16),sp@-         |  
+       bsr _objc_msgSend               |  
+       unlk a6                         |  clear frame pointer
+       rts                             |  
+
+
+       size = 12
+       args = 16
+
+       .text
+       .align 1
+       .globl _objc_msgSendv
+_objc_msgSendv:
+       linkw a6,#0                     |  
+       movel a6@(size+4),d0            |  
+       addql #3,d0                     |  size = round_up (size, 4);
+       andl #0xfffffffc,d0             |  
+       movel a6@(args+4),a0            |  
+       addl d0,a0                      |  arg_ptr = &args[size];
+       subql #8,d0                     |  size -= 8;
+       ble L35                         |  while (size > 0)
+L34:   movel a0@-,sp@-                 |    *--sp = *--arg_ptr;
+       subql #4,d0                     |    size -= 4;
+       bgt L34                         |  
+L35:   movel a6@(selector+4),sp@-      |  
+       movel a6@(self+4),sp@-          |  objc_msgSend (self, selector, ...);
+       bsr _objc_msgSend               |  
+       unlk a6                         |  (deallocate variable storage)
+       rts                             |  
diff --git a/runtime/Messengers.subproj/objc-msg-ppc.s b/runtime/Messengers.subproj/objc-msg-ppc.s
new file mode 100644 (file)
index 0000000..c3d3ce0
--- /dev/null
@@ -0,0 +1,1606 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/********************************************************************
+ *
+ *  objc-msg-ppc.s - PowerPC code to support objc messaging.
+ *
+ *  Copyright 1988-1996 NeXT Software, Inc.
+ *
+ *  8-Nov-2000 Laurent Ramontianu (ramontia@apple.com)
+ *             Added "few args" params. to CacheLookup and MethodTableLookup
+ *             Added the alternate entry points:
+ *                     objc_msgSendFew, objc_msgSendFew_stret,
+ *                     objc_msgSendSuperFew, objc_msgSendSuperFew_stret
+ *
+ *  18-Jun-97  David Harrison  (harrison@apple.com)
+ *             Restructured.
+ *
+ *  1-May-97   Umesh Vaishampayan  (umeshv@NeXT.com)
+ *             Incorporated locking code fixes from
+ *             David Harrison  (harrison@NeXT.com) 
+ *
+ *  2-Apr-97   Umesh Vaishampayan  (umeshv@NeXT.com)
+ *             Incorporated changes for messenger with struct return
+ *             Cleaned up the labels to use local labels
+ *             Fixed bug in the msgSendSuper that did not do the locking.
+ *
+ *  31-Dec-96  Umesh Vaishampayan  (umeshv@NeXT.com)
+ *             Created from m98k.
+ ********************************************************************/
+
+#if defined(OBJC_COLLECTING_CACHE)
+; _objc_entryPoints and _objc_exitPoints are used by method dispatch
+; caching code to figure out whether any threads are actively 
+; in the cache for dispatching.  The labels surround the asm code
+; that do cache lookups.  The tables are zero-terminated.
+       .data
+.globl _objc_entryPoints
+_objc_entryPoints:
+       .long   _objc_msgSend
+       .long   _objc_msgSend_stret
+       .long   _objc_msgSendSuper
+       .long   _objc_msgSendSuper_stret
+       .long   _objc_msgSendFew
+       .long   _objc_msgSendFew_stret
+       .long   _objc_msgSendSuperFew
+       .long   _objc_msgSendSuperFew_stret
+       .long   0
+
+.globl _objc_exitPoints
+_objc_exitPoints:
+       .long   LMsgSendExit
+       .long   LMsgSendStretExit
+       .long   LMsgSendSuperExit
+       .long   LMsgSendSuperStretExit
+       .long   LMsgSendFewExit
+       .long   LMsgSendFewStretExit
+       .long   LMsgSendSuperFewExit
+       .long   LMsgSendSuperFewStretExit
+       .long   0
+#endif
+
+/********************************************************************
+ *
+ * Structure definitions.
+ *
+ ********************************************************************/
+
+; objc_super parameter to sendSuper
+       receiver                = 0
+       class                   = 4
+
+; Selected field offsets in class structure
+       isa                     = 0
+       cache                   = 32
+
+; Method descriptor
+       method_name             = 0
+       method_imp              = 8
+
+; Cache header
+       mask                    = 0
+       occupied                = 4
+       buckets                 = 8     // variable length array
+
+#if defined(OBJC_INSTRUMENTED)
+; Cache instrumentation data, follows buckets
+       hitCount                = 0
+       hitProbes               = hitCount + 4
+       maxHitProbes            = hitProbes + 4
+       missCount               = maxHitProbes + 4
+       missProbes              = missCount + 4
+       maxMissProbes           = missProbes + 4
+       flushCount              = maxMissProbes + 4
+       flushedEntries          = flushCount + 4
+#endif
+
+/********************************************************************
+ *
+ * Constants.
+ *
+ ********************************************************************/
+
+// In case the implementation is _objc_msgForward, indicate to it
+// whether the method was invoked as a word-return or struct-return.
+// The li instruction costs nothing because it fits into spare
+// processor cycles.
+
+kFwdMsgSend            = 0
+kFwdMsgSendStret       = 1
+
+/********************************************************************
+ *
+ * Useful macros.  Macros are used instead of subroutines, for speed.
+ *
+ ********************************************************************/
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; LOAD_STATIC_WORD     targetReg, symbolName, LOCAL_SYMBOL | EXTERNAL_SYMBOL
+;
+; Load the value of the named static data word.
+;
+; Takes: targetReg      - the register, other than r0, to load
+;       symbolName      - the name of the symbol
+;       LOCAL_SYMBOL    - symbol name used as-is
+;       EXTERNAL_SYMBOL - symbol name gets nonlazy treatment
+;
+; Eats: r0 and targetReg
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Values to specify whether the symbols is plain or nonlazy
+LOCAL_SYMBOL   = 0
+EXTERNAL_SYMBOL        = 1
+
+.macro LOAD_STATIC_WORD
+
+#if defined(__DYNAMIC__)
+       mflr            r0
+       bl              1f
+1:     mflr            $0
+       mtlr            r0
+.if $2 == EXTERNAL_SYMBOL
+       addis           $0,$0,ha16(L$1-1b)
+       lwz             $0,lo16(L$1-1b)($0)
+       lwz             $0,0($0)
+.elseif $2 == LOCAL_SYMBOL
+       addis           $0,$0,ha16($1-1b)
+       lwz             $0,lo16($1-1b)($0)
+.else
+       !!! Unknown symbol type !!!
+.endif
+#else
+       lis             $0,ha16($1)
+       lwz             $0,lo16($1)($0)
+#endif
+
+.endmacro
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; LEA_STATIC_DATA      targetReg, symbolName, LOCAL_SYMBOL | EXTERNAL_SYMBOL
+;
+; Load the address of the named static data.
+;
+; Takes: targetReg      - the register, other than r0, to load
+;       symbolName      - the name of the symbol
+;       LOCAL_SYMBOL    - symbol is local to this module
+;       EXTERNAL_SYMBOL - symbol is imported from another module
+;
+; Eats: r0 and targetReg
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.macro LEA_STATIC_DATA
+#if defined(__DYNAMIC__)
+       mflr            r0
+       bl              1f
+1:     mflr            $0
+       mtlr            r0
+.if $2 == EXTERNAL_SYMBOL
+       addis           $0,$0,ha16(L$1-1b)
+       lwz             $0,lo16(L$1-1b)($0)
+.elseif $2 == LOCAL_SYMBOL
+       addis           $0,$0,ha16($1-1b)
+       addi            $0,$0,lo16($1-1b)
+.else
+       !!! Unknown symbol type !!!
+.endif
+#else
+       lis             $0,hi16($1)
+       ori             $0,$0,lo16($1)
+#endif
+
+.endmacro
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; ENTRY                functionName
+;
+; Assembly directives to begin an exported function.
+;
+; Takes: functionName - name of the exported function
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.macro ENTRY
+       .text
+       .align          2
+       .globl          $0
+$0:
+.endmacro
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; END_ENTRY    functionName
+;
+; Assembly directives to end an exported function.  Just a placeholder,
+; a close-parenthesis for ENTRY, until it is needed for something.
+;
+; Takes: functionName - name of the exported function
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.macro END_ENTRY
+.endmacro
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; PLOCK                scratchReg, lockName
+;
+; Acquire named spinlock.
+;
+; Takes: scratchReg - a register, other than r0, that can be mangled
+;      lockName   - the name of a static, aligned, 32-bit lock word
+;
+; Eats: r0 and scratchReg
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.macro PLOCK
+       LEA_STATIC_DATA $0, $1, EXTERNAL_SYMBOL
+       b               .+16                    ; jump into loop at the reserving check
+       lwz             r0,0($0)                ; check with fast, less intrusive lwz versus lwarx
+       cmplwi          r0,0                    ; lock held?
+       bne             .-8                     ; if so, spin until it appears unlocked
+       lwarx           r0,0,$0                 ; get lock value, acquire memory reservation 
+       cmplwi          r0,0                    ; lock held?
+       bne             .-20                    ; if locked, go spin waiting for unlock
+       li              r0,1                    ; get value that means locked
+       sync                                    ; PPC errata #7: Avoid address comparison qualification failure
+       stwcx.          r0,0,$0                 ; store it iff reservation still holds
+       bne-            .-20                    ; if reservation was lost, go re-reserve
+       isync                                   ; discard effects of prefetched instructions 
+.endmacro      
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; PUNLOCK      scratchReg, lockName
+;
+; Release named spinlock.
+;
+; Takes: scratchReg - a register, other than r0, that can be mangled
+;      lockName   - the name of a static, aligned, 32-bit lock word
+;
+; Eats: r0 and scratchReg
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.macro PUNLOCK
+       sync                                    ; force out changes before unlocking
+       LEA_STATIC_DATA $0, $1, EXTERNAL_SYMBOL
+       li              r0,0                    ; get value meaning "unlocked"
+       stw             r0,0($0)                ; unlock the lock
+.endmacro
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; CacheLookup  WORD_RETURN | STRUCT_RETURN, MSG_SEND | MSG_SENDSUPER, cacheMissLabel, FEW_ARGS | MANY_ARGS
+;
+; Locate the implementation for a selector in a class method cache.
+;
+; Takes: WORD_RETURN   (r3 is first parameter)
+;      STRUCT_RETURN   (r3 is structure return address, r4 is first parameter)
+;      MSG_SEND        (first parameter is receiver)
+;      MSG_SENDSUPER   (first parameter is address of objc_super structure)
+;
+;      cacheMissLabel = label to branch to iff method is not cached
+;
+; Eats: r0, r11, r12
+; On exit:     (found) imp in ctr register
+;              (not found) jumps to cacheMissLabel
+;      
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Values to specify to method lookup macros whether the return type of
+; the method is an integer or structure.
+WORD_RETURN    = 0
+STRUCT_RETURN  = 1
+
+; Values to specify to method lookup macros whether the return type of
+; the method is an integer or structure.
+MSG_SEND       = 0
+MSG_SENDSUPER  = 1
+
+; Values to specify to method lookup macros whether this is a "few args" call or not
+; (number of args < 5 , including self and _cmd)
+FEW_ARGS       = 0
+MANY_ARGS      = 1
+
+.macro CacheLookup
+
+#if defined(OBJC_INSTRUMENTED)
+       ; when instrumented, we use r6 and r7
+       stw             r6,36(r1)               ; save r6 for use as cache pointer
+       stw             r7,40(r1)               ; save r7 for use as probe count
+       li              r7,0                    ; no probes so far!
+#endif
+
+       stw             r8,44(r1)               ; save r8
+.if $3 == MANY_ARGS
+       stw             r9,48(r1)               ; save r9 and r10
+       stw             r10,52(r1)              ;
+.endif
+
+; locate the cache
+.if $0 == WORD_RETURN                          ; WORD_RETURN
+
+.if $1 == MSG_SEND                             ; MSG_SEND
+       lwz             r12,isa(r3)             ; class = receiver->isa
+.else                                          ; MSG_SENDSUPER
+       lwz             r12,class(r3)           ; class = super->class
+.endif
+
+.else  
+                                               ; STRUCT_RETURN
+.if $1 == MSG_SEND                             ; MSG_SEND
+       lwz             r12,isa(r4)             ; class = receiver->isa
+.else                                          ; MSG_SENDSUPER
+       lwz             r12,class(r4)           ; class = super->class
+.endif
+
+.endif
+
+       lwz             r12,cache(r12)          ; cache = class->cache
+#if defined(OBJC_INSTRUMENTED)
+       mr              r6,r12                  ; save cache pointer
+#endif
+       lwz             r11,mask(r12)           ; mask = cache->mask
+       addi            r9,r12,buckets          ; buckets = cache->buckets
+.if $0 == WORD_RETURN                          ; WORD_RETURN
+       and             r12,r4,r11              ; index = selector & mask
+.else                                          ; STRUCT_RETURN
+       and             r12,r5,r11              ; index = selector & mask
+.endif
+
+#if defined(OBJC_INSTRUMENTED)
+       b               LLoop_$0_$1_$2
+
+LMiss_$0_$1_$2:
+       ; r6 = cache, r7 = probeCount
+       lwz             r9,mask(r6)             ; entryCount = mask + 1
+       addi            r9,r9,1                 ;
+       slwi            r9,r9,2                 ; tableSize = entryCount * sizeof(entry)
+       addi            r9,r9,buckets           ; offset = buckets + tableSize
+       add             r8,r6,r9                ; cacheData = &cache->buckets[mask+1]
+       lwz             r9,missCount(r8)        ; cacheData->missCount += 1
+       addi            r9,r9,1                 ; 
+       stw             r9,missCount(r8)        ; 
+       lwz             r9,missProbes(r8)       ; cacheData->missProbes += probeCount
+       add             r9,r9,r7                ; 
+       stw             r9,missProbes(r8)       ; 
+       lwz             r9,maxMissProbes(r8)    ; if (probeCount > cacheData->maxMissProbes)
+       cmplw           r7,r9                   ; maxMissProbes = probeCount
+       ble             .+8                     ; 
+       stw             r7,maxMissProbes(r8)    ;
+
+       lwz             r6,36(r1)               ; restore r6
+       lwz             r7,40(r1)               ; restore r7
+
+       b               $2                      ; goto cacheMissLabel
+#endif
+
+; search the cache
+LLoop_$0_$1_$2:
+#if defined(OBJC_INSTRUMENTED)
+       addi            r7,r7,1                 ; probeCount += 1
+#endif
+       slwi            r0,r12,2                ; convert word index into byte count
+       lwzx            r10,r9,r0               ; method = cache->buckets[index]
+       cmplwi          r10,0                   ; if (method == NULL)
+#if defined(OBJC_INSTRUMENTED)
+       beq             LMiss_$0_$1_$2
+#else
+       beq             $2                      ; goto cacheMissLabel
+#endif
+
+       addi            r12,r12,1               ; index += 1
+       lwz             r8,method_name(r10)     ; name  = method->method_name
+       and             r12,r12,r11             ; index &= mask
+       lwz             r10,method_imp(r10)     ; imp = method->method_imp
+.if $0 == WORD_RETURN                          ; WORD_RETURN
+       cmplw           r8,r4                   ; if (name != selector)
+.else                                          ; STRUCT_RETURN
+       cmplw           r8,r5                   ; if (name != selector)
+.endif
+       bne             LLoop_$0_$1_$2          ; goto loop
+
+; cache hit, r10 == method implementation address
+       mr              r12,r10                 ; copy implementation to r12
+       mtctr           r10                     ; ctr = imp
+
+#if defined(OBJC_INSTRUMENTED)
+       ; r6 = cache, r7 = probeCount
+       lwz             r9,mask(r6)             ; entryCount = mask + 1
+       addi            r9,r9,1                 ;
+       slwi            r9,r9,2                 ; tableSize = entryCount * sizeof(entry)
+       addi            r9,r9,buckets           ; offset = buckets + tableSize
+       add             r8,r6,r9                ; cacheData = &cache->buckets[mask+1]
+       lwz             r9,hitCount(r8)         ; cache->hitCount += 1
+       addi            r9,r9,1                 ; 
+       stw             r9,hitCount(r8)         ; 
+       lwz             r9,hitProbes(r8)        ; cache->hitProbes += probeCount
+       add             r9,r9,r7                ; 
+       stw             r9,hitProbes(r8)        ; 
+       lwz             r9,maxHitProbes(r8)     ; if (probeCount > cache->maxMissProbes)
+       cmplw           r7,r9                   ;maxMissProbes = probeCount
+       ble             .+8                     ; 
+       stw             r7,maxHitProbes(r8)     ; 
+
+       lwz             r6,36(r1)               ; restore r6
+       lwz             r7,40(r1)               ; restore r7
+#endif
+
+       lwz             r8,44(r1)               ; restore r8
+.if $3 == MANY_ARGS
+       lwz             r9,48(r1)               ; restore r9 and r10
+       lwz             r10,52(r1)              ;
+.endif
+
+.endmacro
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+; MethodTableLookup WORD_RETURN | STRUCT_RETURN, MSG_SEND | MSG_SENDSUPER, FEW_ARGS | MANY_ARGS
+;
+; Takes: WORD_RETURN    (r3 is first parameter)
+;      STRUCT_RETURN   (r3 is structure return address, r4 is first parameter)
+;      MSG_SEND        (first parameter is receiver)
+;      MSG_SENDSUPER   (first parameter is address of objc_super structure)
+;
+; Eats: r0, r11, r12
+; On exit: restores registers r8 and possibly, r9 and r10, saved by CacheLookup
+;      imp in ctr
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+HAVE_CALL_EXTERN_lookupMethodAndLoadCache      = 0
+
+.macro  MethodTableLookup
+       stw             r3, 24(r1)              ; save arguments
+       stw             r4, 28(r1)              ; 
+       stw             r5, 32(r1)              ;
+       stw             r6, 36(r1)              ;
+       stw             r7, 40(r1)              ;
+       ; r8 and possibly, r9 and r10, were saved by CacheLookup
+
+       mflr            r0                      ; save lr
+       stw             r0,8(r1)                ;
+
+#if defined(KERNEL)
+       stwu            r1,-64(r1)              ; grow the stack
+#else
+
+.if $2 == MANY_ARGS
+       stfd            f13, -8(r1)             ; save the fp parameter registers
+       stfd            f12, -16(r1)            ;
+       stfd            f11, -24(r1)            ;
+       stfd            f10, -32(r1)            ;
+       stfd            f9, -40(r1)             ;
+       stfd            f8, -48(r1)             ;
+       stfd            f7, -56(r1)             ;
+       stfd            f6, -64(r1)             ;
+       stfd            f5, -72(r1)             ;
+.endif
+       stfd            f4, -80(r1)             ;
+       stfd            f3, -88(r1)             ;
+       stfd            f2, -96(r1)             ;
+       stfd            f1, -104(r1)            ;
+
+       stwu            r1,-56-(13*8)(r1)       ; grow the stack
+#endif
+
+; Pass parameters to __class_lookupMethodAndLoadCache.  First parameter is
+; the class pointer.  Second parameter is the selector.  Where they come
+; from depends on who called us.  In the int return case, the selector is
+; already in r4.
+.if $0 == WORD_RETURN                          ; WORD_RETURN
+.if $1 == MSG_SEND                             ; MSG_SEND
+       lwz             r3,isa(r3)              ; class = receiver->isa
+.else                                          ; MSG_SENDSUPER
+       lwz             r3,class(r3)            ; class = super->class
+.endif
+
+.else                                          ; STRUCT_RETURN
+.if $1 == MSG_SEND                             ; MSG_SEND
+       lwz             r3,isa(r4)              ; class = receiver->isa
+.else                                          ; MSG_SENDSUPER
+       lwz             r3,class(r4)            ; class = super->class
+.endif
+       mr              r4,r5                   ; selector = selector 
+.endif
+
+.if HAVE_CALL_EXTERN_lookupMethodAndLoadCache == 0
+HAVE_CALL_EXTERN_lookupMethodAndLoadCache = 1
+       CALL_EXTERN(__class_lookupMethodAndLoadCache)
+.else
+       CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+.endif
+
+       mr              r12,r3                  ; copy implementation to r12
+       mtctr           r3                      ; copy imp to ctr
+       lwz             r1,0(r1)                ; restore the stack pointer
+       lwz             r0,8(r1)                ;
+       mtlr            r0                      ; restore return pc
+
+#if !defined(KERNEL)
+
+.if $2 == MANY_ARGS
+       lfd             f13, -8(r1)             ; restore fp parameter registers
+       lfd             f12, -16(r1)            ;
+       lfd             f11, -24(r1)            ;
+       lfd             f10, -32(r1)            ;
+       lfd             f9, -40(r1)             ;
+       lfd             f8, -48(r1)             ;
+       lfd             f7, -56(r1)             ;
+       lfd             f6, -64(r1)             ;
+       lfd             f5, -72(r1)             ;
+.endif
+       lfd             f4, -80(r1)             ;
+       lfd             f3, -88(r1)             ;
+       lfd             f2, -96(r1)             ;
+       lfd             f1, -104(r1)            ;
+#endif
+
+       lwz             r3, 24(r1)              ; restore parameter registers
+       lwz             r4, 28(r1)              ;
+       lwz             r5, 32(r1)              ;
+       lwz             r6, 36(r1)              ;
+       lwz             r7, 40(r1)              ;
+
+       lwz             r8, 44(r1)              ; restore leftovers from CacheLookup...
+.if $2 == MANY_ARGS
+       lwz             r9, 48(r1)              ;
+       lwz             r10,52(r1)              ;
+.endif
+
+.endmacro
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; CALL_MCOUNT
+;
+; Macro to call mcount function in profiled builds.
+;
+; NOTE: Makes sure to save/restore r11 and r12, even though they
+; are not defined to be volatile, because they are used during
+; forwarding.
+;
+; Takes: lr                        Callers return PC
+;
+; Eats: r0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+HAVE_CALL_EXTERN_mcount        = 0
+
+       .macro  CALL_MCOUNT
+#if defined(PROFILE)
+       mflr            r0                      ; save return pc
+       stw             r0,8(r1)                ;
+
+       stwu            r1,-208(r1)             ; push aligned areas, set stack link
+
+       stw             r3, 56(r1)              ; save all volatile registers
+       stw             r4, 60(r1)              ; 
+       stw             r5, 64(r1)              ;
+       stw             r6, 68(r1)              ; 
+       stw             r7, 72(r1)              ;
+       stw             r8, 76(r1)              ;
+       stw             r9, 80(r1)              ;
+       stw             r10,84(r1)              ;
+       stw             r11,88(r1)              ; save r11 and r12, too
+       stw             r12,92(r1)              ;
+
+       stfd            f1, 96(r1)              ;
+       stfd            f2, 104(r1)             ;
+       stfd            f3, 112(r1)             ;
+       stfd            f4, 120(r1)             ;
+       stfd            f5, 128(r1)             ;
+       stfd            f6, 136(r1)             ;
+       stfd            f7, 144(r1)             ;
+       stfd            f8, 152(r1)             ;
+       stfd            f9, 160(r1)             ;
+       stfd            f10, 168(r1)            ;
+       stfd            f11, 176(r1)            ;
+       stfd            f12, 184(r1)            ;
+       stfd            f13, 192(r1)            ;
+
+       mflr            r3                      ; pass our callers address
+.if HAVE_CALL_EXTERN_mcount == 0
+HAVE_CALL_EXTERN_mcount = 1
+       CALL_EXTERN(mcount)
+.else
+       CALL_EXTERN_AGAIN(mcount)
+.endif
+
+       lwz             r3, 56(r1)              ; restore all volatile registers
+       lwz             r4, 60(r1)              ; 
+       lwz             r5, 64(r1)              ;
+       lwz             r6, 68(r1)              ; 
+       lwz             r7, 72(r1)              ;
+       lwz             r8, 76(r1)              ;
+       lwz             r9, 80(r1)              ;
+       lwz             r10,84(r1)              ;
+       lwz             r11,88(r1)              ; restore r11 and r12, too
+       lwz             r12,92(r1)              ;
+
+       lfd             f1, 96(r1)              ;
+       lfd             f2, 104(r1)             ;
+       lfd             f3, 112(r1)             ;
+       lfd             f4, 120(r1)             ;
+       lfd             f5, 128(r1)             ;
+       lfd             f6, 136(r1)             ;
+       lfd             f7, 144(r1)             ;
+       lfd             f8, 152(r1)             ;
+       lfd             f9, 160(r1)             ;
+       lfd             f10, 168(r1)            ;
+       lfd             f11, 176(r1)            ;
+       lfd             f12, 184(r1)            ;
+       lfd             f13, 192(r1)            ;
+
+       lwz             r1,0(r1)                ; restore the stack pointer
+       lwz             r0,8(r1)                ;
+       mtlr            r0                      ; restore return pc
+#endif
+       .endmacro
+
+/********************************************************************
+ * id          objc_msgSend(id self,
+ *                     SEL     op,
+ *                     ...);
+ *
+ * On entry:   r3 is the message receiver,
+ *             r4 is the selector
+ ********************************************************************/
+
+#if defined(__DYNAMIC__)
+/* Allocate reference to external static data */
+       .non_lazy_symbol_pointer
+L__objc_msgNil:
+       .indirect_symbol __objc_msgNil
+       .long   0
+       .text
+#endif
+
+       ENTRY   _objc_msgSend
+; do profiling when enabled
+       CALL_MCOUNT
+
+; check whether receiver is nil
+       cmplwi          r3,0                    ; receiver nil?
+       beq             LMsgSendNilSelf         ; if so, call handler or return nil
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendMT              ; branch to the locking case
+#endif
+
+; single threaded and receiver is non-nil: search the cache
+       CacheLookup WORD_RETURN, MSG_SEND, LMsgSendCacheMiss, MANY_ARGS
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SEND, MANY_ARGS
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendMT:
+       PLOCK   r11, _messageLock
+       CacheLookup WORD_RETURN, MSG_SEND, LMsgSendMTCacheMiss, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendMTCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SEND, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+; message sent to nil object call: optional handler and return nil
+LMsgSendNilSelf:
+       LOAD_STATIC_WORD r11, __objc_msgNil, EXTERNAL_SYMBOL
+       cmplwi          r11,0                   ; handler nil?
+       beqlr                                   ; if no handler, return nil
+
+       mflr            r0                      ; save return pc
+       stw             r0,8(r1)                ;
+       subi            r1,r1,64                ; allocate linkage area
+       mtctr           r11                     ; 
+       bctrl                                   ; call handler
+       addi            r1,r1,64                ; deallocate linkage area
+       lwz             r0,8(r1)                ; restore return pc
+       mtlr            r0                      ; 
+
+       li              r3,0            ; re-zero return value, in case handler changed it
+       blr                                     ; return to caller
+
+LMsgSendExit:
+       END_ENTRY       _objc_msgSend
+
+
+/********************************************************************
+ * struct_type objc_msgSend_stret(id   self,
+ *                             SEL     op,
+ *                                     ...);
+ *
+ * objc_msgSend_stret is the struct-return form of msgSend.
+ * The ABI calls for r3 to be used as the address of the structure
+ * being returned, with the parameters in the succeeding registers.
+ *
+ * On entry:   r3 is the address where the structure is returned,
+ *             r4 is the message receiver,
+ *             r5 is the selector
+ ********************************************************************/
+
+       ENTRY   _objc_msgSend_stret
+; do profiling when enabled
+       CALL_MCOUNT
+
+; check whether receiver is nil
+       cmplwi          r4,0                    ; receiver nil?
+       beq             LMsgSendStretNilSelf    ; if so, call handler or just return
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendStretMT         ; branch to the locking case
+#endif
+
+; single threaded and receiver is non-nil: search the cache
+       CacheLookup STRUCT_RETURN, MSG_SEND, LMsgSendStretCacheMiss, MANY_ARGS
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendStretCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SEND, MANY_ARGS
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendStretMT:       
+       PLOCK   r11, _messageLock
+       CacheLookup STRUCT_RETURN, MSG_SEND, LMsgSendStretMTCacheMiss, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendStretMTCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SEND, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+; message sent to nil object call optional handler and return nil
+LMsgSendStretNilSelf:
+       LOAD_STATIC_WORD r11, __objc_msgNil, EXTERNAL_SYMBOL
+       cmplwi          r11,0                   ; handler nil?
+       beqlr                                   ; if no handler, return
+
+       mflr            r0                      ; save return pc
+       stw             r0,8(r1)                ;
+       subi            r1,r1,64                ; allocate linkage area
+       mr              r3,r4                   ; move self to r3
+       mr              r4,r5                   ; move SEL to r4
+       mtctr           r11                                     ; 
+       bctrl                                   ; call handler
+       addi            r1,r1,64                ; deallocate linkage area
+       lwz             r0,8(r1)                ; restore return pc
+       mtlr            r0                      ; 
+
+       blr                                     ; return to caller
+
+LMsgSendStretExit:
+       END_ENTRY       _objc_msgSend_stret
+
+
+/********************************************************************
+ * id  objc_msgSendSuper(struct objc_super     *super,
+ *                     SEL                     op,
+ *                                             ...);
+ *
+ * struct objc_super {
+ *     id      receiver;
+ *     Class   class;
+ * };
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendSuper
+; do profiling when enabled
+       CALL_MCOUNT
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendSuperMT         ; branch to the locking case
+#endif
+
+; single threaded: search the cache
+       CacheLookup WORD_RETURN, MSG_SENDSUPER, LMsgSendSuperCacheMiss, MANY_ARGS
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SENDSUPER, MANY_ARGS
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendSuperMT:       
+       PLOCK   r11, _messageLock
+       CacheLookup WORD_RETURN, MSG_SENDSUPER, LMsgSendSuperMTCacheMiss, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperMTCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SENDSUPER, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+LMsgSendSuperExit:
+       END_ENTRY       _objc_msgSendSuper
+
+
+/********************************************************************
+ * struct_type objc_msgSendSuper_stret(objc_super      *super,
+ *                                     SEL             op,
+ *                                                     ...);
+ *
+ * struct objc_super {
+ *     id      receiver;
+ *     Class   class;
+ * };
+ *
+ *
+ * objc_msgSendSuper_stret is the struct-return form of msgSendSuper.
+ * The ABI calls for r3 to be used as the address of the structure
+ * being returned, with the parameters in the succeeding registers.
+ *
+ * On entry:   r3 is the address to which to copy the returned structure,
+ *             r4 is the address of the objc_super structure,
+ *             r5 is the selector
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendSuper_stret
+; do profiling when enabled
+       CALL_MCOUNT
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendSuperStretMT    ; branch to the locking case
+#endif
+
+; single threaded: search the cache
+       CacheLookup STRUCT_RETURN, MSG_SENDSUPER, LMsgSendSuperStretCacheMiss, MANY_ARGS
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperStretCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SENDSUPER, MANY_ARGS
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendSuperStretMT:  
+       PLOCK   r11, _messageLock
+       CacheLookup STRUCT_RETURN, MSG_SENDSUPER, LMsgSendSuperStretMTCacheMiss, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperStretMTCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SENDSUPER, MANY_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+LMsgSendSuperStretExit:
+       END_ENTRY       _objc_msgSendSuper_stret
+
+
+/********************************************************************
+ *
+ * Out-of-band parameter r11 indicates whether it was objc_msgSend or
+ * objc_msgSend_stret that triggered the message forwarding.  The 
+ *
+ * Iff r11 == kFwdMsgSend, it is the word-return (objc_msgSend) case,
+ * and the interface is:
+ *
+ * id          _objc_msgForward(id     self,
+ *                             SEL     sel,
+ *                                     ...);
+ *
+ * Iff r11 == kFwdMsgSendStret, it is the structure-return
+ * (objc_msgSend_stret) case, and the interface is:
+ *
+ * struct_type _objc_msgForward(id     self,
+ *                             SEL     sel,
+ *                                     ...);
+ *
+ * There are numerous reasons why it is better to have one
+ * _objc_msgForward, rather than adding _objc_msgForward_stret.
+ * The best one is that _objc_msgForward is the method that
+ * gets cached when respondsToMethod returns false, and it
+ * wouldnt know which one to use.
+ * 
+ * Sends the message to a method having the signature
+ *
+ *      - forward:(SEL)sel :(marg_list)args;
+ * 
+ * But the marg_list is prepended with the 13 double precision
+ * floating point registers that could be used as parameters into
+ * the method (fortunately, the same registers are used for either
+ * single or double precision floats).  These registers are layed
+ * down by _objc_msgForward, and picked up by _objc_msgSendv.  So
+ * the "marg_list" is actually:
+ *
+ * typedef struct objc_sendv_margs {
+ *     double          floatingPointArgs[13];
+ *     int             linkageArea[6];
+ *     int             registerArgs[8];
+ *     int             stackArgs[variable];
+ * };
+ *
+ ********************************************************************/
+
+; Location LFwdStr contains the string "forward::"
+; Location LFwdSel contains a pointer to LFwdStr, that can be changed
+; to point to another forward:: string for selector uniquing
+; purposes.  ALWAYS dereference LFwdSel to get to "forward::" !!
+       .objc_meth_var_names
+       .align 1
+LFwdStr:       .ascii "forward::\0"
+
+       .objc_message_refs
+       .align  2
+LFwdSel:.long  LFwdStr
+
+       .cstring
+       .align  1
+LUnkSelStr:    .ascii  "Does not recognize selector %s\0"
+
+       ENTRY   __objc_msgForward
+; do profiling when enabled
+       CALL_MCOUNT
+
+#if defined(KERNEL)
+       trap                                    ; _objc_msgForward is not for the kernel
+#else
+       LOAD_STATIC_WORD r12, LFwdSel, LOCAL_SYMBOL     ; get uniqued selector for "forward::"
+       cmplwi          r11,kFwdMsgSend         ; via objc_msgSend or objc_msgSend_stret?
+       bne             LMsgForwardStretSel     ; branch for objc_msgSend_stret
+       cmplw           r12,r4                  ; if (sel == @selector (forward::))
+       b               LMsgForwardSelCmpDone   ; check the result in common code
+LMsgForwardStretSel:
+       cmplw           r12,r5                  ; if (sel == @selector (forward::))
+LMsgForwardSelCmpDone:
+       beq             LMsgForwardError        ;   goto error
+
+       mflr            r0
+       stw             r0,8(r1)                ; save lr
+       
+       stw             r3, 24(r1)              ; put register arguments on stack for forwarding
+       stw             r4, 28(r1)              ; (stack based args already follow this area)
+       stw             r5, 32(r1)              ;
+       stw             r6, 36(r1)              ; 
+       stw             r7, 40(r1)              ;
+       stw             r8, 44(r1)
+       stw             r9, 48(r1)
+       stw             r10,52(r1)
+
+       stfd            f13, -8(r1)             ; prepend floating point registers to marg_list
+       stfd            f12, -16(r1)            ;
+       stfd            f11, -24(r1)            ;
+       stfd            f10, -32(r1)            ;
+       stfd            f9, -40(r1)             ;
+       stfd            f8, -48(r1)             ;
+       stfd            f7, -56(r1)             ;
+       stfd            f6, -64(r1)             ;
+       stfd            f5, -72(r1)             ;
+       stfd            f4, -80(r1)             ;
+       stfd            f3, -88(r1)             ;
+       stfd            f2, -96(r1)             ;
+       stfd            f1, -104(r1)            ;
+
+       cmplwi          r11,kFwdMsgSend         ; via objc_msgSend or objc_msgSend_stret?
+       bne             LMsgForwardStretParams  ; branch for objc_msgSend_stret
+                                               ; first arg (r3) remains self
+       mr              r5,r4                   ; third arg is previous selector
+       b               LMsgForwardParamsDone
+LMsgForwardStretParams:
+       mr              r3,r4                   ; first arg is self
+                                               ; third arg (r5) remains previous selector
+LMsgForwardParamsDone:
+       mr              r4,r12                  ; second arg is "forward::"
+       subi            r6,r1,13*8              ; fourth arg is &objc_sendv_margs
+
+       stwu            r1,-56-(13*8)(r1)       ; push aligned linkage and parameter areas, set stack link
+       bl              _objc_msgSend           ; [self forward:sel :objc_sendv_margs]
+       addi            r1,r1,56+13*8           ; deallocate linkage and parameters areas
+
+       lwz             r0,8(r1)                ; restore lr
+       mtlr            r0                      ;
+       blr                                     ;
+
+; call error handler with unrecognized selector message
+LMsgForwardError:
+       cmplwi          r11,kFwdMsgSendStret    ; via objc_msgSend or objc_msgSend_stret?
+       bne             LMsgForwardErrorParamsOK;  branch for objc_msgSend
+       mr              r3,r4                   ; first arg is self
+LMsgForwardErrorParamsOK:
+       LEA_STATIC_DATA r4, LUnkSelStr, LOCAL_SYMBOL
+       mr              r5,r12                  ; third arg is "forward::"
+       CALL_EXTERN(___objc_error)              ; never returns
+       trap                                    ; ___objc_error should never return
+#endif
+
+       END_ENTRY       __objc_msgForward
+
+
+/********************************************************************
+ * id          objc_msgSendv(id        self,
+ *                     SEL             op,
+ *                     unsigned        arg_size,
+ *                     marg_list       arg_frame);
+ *
+ * But the marg_list is prepended with the 13 double precision
+ * floating point registers that could be used as parameters into
+ * the method (fortunately, the same registers are used for either
+ * single or double precision floats).  These registers are layed
+ * down by _objc_msgForward, and picked up by _objc_msgSendv.  So
+ * the "marg_list" is actually:
+ *
+ * typedef struct objc_sendv_margs {
+ *     double          floatingPointArgs[13];
+ *     int             linkageArea[6];
+ *     int             registerArgs[8];
+ *     int             stackArgs[variable];
+ * };
+ *
+ * arg_size is the number of bytes of parameters in registerArgs and
+ * stackArgs combined (i.e. it is method_getSizeOfArguments(method)).
+ * Specifically, it is NOT the overall arg_frame size, because that
+ * would include the floatingPointArgs and linkageArea, which are
+ * PowerPC-specific.  This is consistent with the other architectures.
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendv
+
+#if defined(KERNEL)
+       trap                                    ; _objc_msgSendv is not for the kernel
+#else
+; do profiling when enabled
+       CALL_MCOUNT
+
+       mflr            r0
+       stw             r0,8(r1)                ; save lr
+
+       cmplwi          r5,32                   ; check parameter size against minimum
+       ble+            LMsgSendvMinFrame       ; is less than minimum, go use minimum
+       mr              r12,r1                  ; remember current stack pointer
+       sub             r11,r1,r5               ; push parameter area
+       rlwinm          r1,r11,0,0,27           ; align stack pointer to 16 byte boundary
+       stwu            r12,-32(r1)             ; push aligned linkage area, set stack link 
+       b               LMsgSendvHaveFrame
+
+LMsgSendvMinFrame:
+       stwu            r1,-64(r1)              ; push aligned linkage and parameter areas, set stack link
+
+LMsgSendvHaveFrame:
+       ; restore floating point register parameters from marg_list
+       lfd             f13,96(r6)              ; 
+       lfd             f12,88(r6)              ;
+       lfd             f11,80(r6)              ;
+       lfd             f10,72(r6)              ;
+       lfd             f9,64(r6)               ;
+       lfd             f8,56(r6)               ;
+       lfd             f7,48(r6)               ;
+       lfd             f6,40(r6)               ;
+       lfd             f5,32(r6)               ;
+       lfd             f4,24(r6)               ;
+       lfd             f3,16(r6)               ;
+       lfd             f2,8(r6)                ;
+       lfd             f1,0(r6)                ;
+
+; load the register based arguments from the marg_list
+; the first two parameters are already in r3 and r4, respectively
+       subi            r0,r5,5                 ; make word count from byte count rounded up to multiple of 4...
+       srwi.           r0,r0,2                 ; ... and subtracting for params already in r3 and r4
+       beq             LMsgSendvSendIt         ; branch if there are no parameters to load
+       mtctr           r0                      ; counter = number of remaining words
+       lwz             r5,32+(13*8)(r6)        ; load 3rd parameter
+       bdz             LMsgSendvSendIt         ; decrement counter, branch if result is zero
+       addi            r11,r6,36+(13*8)        ; switch to r11, because we are setting r6
+       lwz             r6,0(r11)               ; load 4th parameter
+       bdz             LMsgSendvSendIt         ; decrement counter, branch if result is zero
+       lwz             r7,4(r11)               ; load 5th parameter
+       bdz             LMsgSendvSendIt         ; decrement counter, branch if result is zero
+       lwz             r8,8(r11)               ; load 6th parameter
+       bdz             LMsgSendvSendIt         ; decrement counter, branch if result is zero
+       lwz             r9,12(r11)              ; load 7th parameter
+       bdz             LMsgSendvSendIt         ; decrement counter, branch if result is zero
+       lwzu            r10,16(r11)             ; load 8th parameter, and update r11
+       bdz             LMsgSendvSendIt         ; decrement counter, branch if result is zero
+
+; copy the stack based arguments from the marg_list
+       addi            r12,r1,24+32-4          ; target = address of stack based parameters
+LMsgSendvArgLoop:
+       lwzu            r0,4(r11)               ; loop to copy remaining marg_list words to stack
+       stwu            r0,4(r12)               ;
+       bdnz            LMsgSendvArgLoop        ; decrement counter, branch if still non-zero
+
+LMsgSendvSendIt:
+       bl              _objc_msgSend           ; objc_msgSend (self, selector, ...)
+
+       lwz             r1,0(r1)                ; restore stack pointer
+       lwz             r0,8(r1)                ; restore lr
+       mtlr            r0                      ;
+       blr                                     ;
+#endif
+
+       END_ENTRY       _objc_msgSendv
+
+
+/********************************************************************
+ * struct_type objc_msgSendv_stret(id          self,
+ *                             SEL             op,
+ *                             unsigned        arg_size,
+ *                             marg_list       arg_frame); 
+ *
+ * objc_msgSendv_stret is the struct-return form of msgSendv.
+ * The ABI calls for r3 to be used as the address of the structure
+ * being returned, with the parameters in the succeeding registers.
+ * 
+ * An equally correct way to prototype this routine is:
+ *
+ * void objc_msgSendv_stret(void       *structStorage,
+ *                     id              self,
+ *                     SEL             op,
+ *                     unsigned        arg_size,
+ *                     marg_list       arg_frame);
+ *
+ * which is useful in, for example, message forwarding where the
+ * structure-return address needs to be passed in.
+ *
+ * The ABI for the two cases are identical.
+ *
+ * On entry:   r3 is the address in which the returned struct is put,
+ *             r4 is the message receiver,
+ *             r5 is the selector,
+ *             r6 is the size of the marg_list, in bytes,
+ *             r7 is the address of the marg_list
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendv_stret
+
+#if defined(KERNEL)
+       trap                                    ; _objc_msgSendv_stret is not for the kernel 
+#else
+; do profiling when enabled
+       CALL_MCOUNT
+
+       mflr            r0
+       stw             r0,8(r1)                ; (save return pc)
+
+       cmplwi          r6,32                   ; check parameter size against minimum
+       ble+            LMsgSendvStretMinFrame  ; is less than minimum, go use minimum
+       mr              r12,r1                  ; remember current stack pointer
+       sub             r11,r1,r6               ; push parameter area
+       rlwinm          r1,r11,0,0,27           ; align stack pointer to 16 byte boundary
+       stwu            r12,-32(r1)             ; push aligned linkage area, set stack link 
+       b               LMsgSendvStretHaveFrame
+
+LMsgSendvStretMinFrame:
+       stwu            r1,-64(r1)              ; push aligned linkage and parameter areas, set stack link
+
+LMsgSendvStretHaveFrame:
+; restore floating point register parameters from marg_list
+       lfd             f13,96(r7)              ; 
+       lfd             f12,88(r7)              ;
+       lfd             f11,80(r7)              ;
+       lfd             f10,72(r7)              ;
+       lfd             f9,64(r7)               ;
+       lfd             f8,56(r7)               ;
+       lfd             f7,48(r7)               ;
+       lfd             f6,40(r7)               ;
+       lfd             f5,32(r7)               ;
+       lfd             f4,24(r7)               ;
+       lfd             f3,16(r7)               ;
+       lfd             f2,8(r7)                ;
+       lfd             f1,0(r7)                ;
+
+; load the register based arguments from the marg_list
+; the structure return address and the first two parameters
+; are already in r3, r4, and r5, respectively.
+; NOTE: The callers r3 probably, but not necessarily, matches
+; the r3 in the marg_list.  That is, the struct-return
+; storage used by the caller could be an intermediate buffer
+; that will end up being copied into the original
+; struct-return buffer (pointed to by the marg_listed r3).
+       subi            r0,r6,5                 ; make word count from byte count rounded up to multiple of 4...
+       srwi.           r0,r0,2                 ; ... and subtracting for params already in r4 and r5
+       beq             LMsgSendvStretSendIt    ; branch if there are no parameters to load
+       mtctr           r0                      ; counter = number of remaining words
+       lwz             r6,36+(13*8)(r7)        ; load 4th parameter
+       bdz             LMsgSendvStretSendIt    ; decrement counter, branch if result is zero
+       addi            r11,r7,40+(13*8)        ; switch to r11, because we are setting r7
+       lwz             r7,0(r11)               ; load 5th parameter
+       bdz             LMsgSendvStretSendIt    ; decrement counter, branch if result is zero
+       lwz             r8,4(r11)               ; load 6th parameter
+       bdz             LMsgSendvStretSendIt    ; decrement counter, branch if result is zero
+       lwz             r9,8(r11)               ; load 7th parameter
+       bdz             LMsgSendvStretSendIt    ; decrement counter, branch if result is zero
+       lwzu            r10,12(r11)             ; load 8th parameter, and update r11
+       bdz             LMsgSendvStretSendIt    ; decrement counter, branch if result is zero
+
+; copy the stack based arguments from the marg_list
+       addi            r12,r1,24+32-4          ; target = address of stack based parameters
+LMsgSendvStretArgLoop:
+       lwzu            r0,4(r11)               ; loop to copy remaining marg_list words to stack
+       stwu            r0,4(r12)               ;
+       bdnz            LMsgSendvStretArgLoop   ; decrement counter, branch if still non-zero
+
+LMsgSendvStretSendIt:
+       bl              _objc_msgSend_stret     ; struct_type objc_msgSend_stret (self, selector, ...)
+
+       lwz             r1,0(r1)                ; restore stack pointer
+       lwz             r0,8(r1)                ; restore return pc
+       mtlr            r0
+       blr                                     ; return
+#endif
+
+       END_ENTRY       _objc_msgSendv_stret
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; ****************  THE "FEW" API  ****************
+;
+; The "few args" apis; The compiler needs to be updated to generate calls to
+; these functions, rather than to their counterparts, when the number of
+; arguments to a method is < 6 (5 for struct returns).
+;
+; *************************************************
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+/********************************************************************
+ * id          objc_msgSendFew(id      self,
+ *                             SEL     op,
+ *                                     ...);
+ *
+ * On entry:   r3 is the message receiver,
+ *             r4 is the selector
+ *             + at most 3 args (ints or doubles)
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendFew
+; do profiling when enabled
+       CALL_MCOUNT
+
+; check whether receiver is nil
+       cmplwi          r3,0                    ; receiver nil?
+       beq             LMsgSendFewNilSelf      ; if so, call handler or return nil
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendFewMT           ; branch to the locking case
+#endif
+
+; single threaded and receiver is non-nil: search the cache
+       CacheLookup WORD_RETURN, MSG_SEND, LMsgSendFewCacheMiss, FEW_ARGS
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendFewCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SEND, FEW_ARGS
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendFewMT:
+       PLOCK   r11, _messageLock
+       CacheLookup WORD_RETURN, MSG_SEND, LMsgSendFewMTCacheMiss, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendFewMTCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SEND, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+; message sent to nil object call: optional handler and return nil
+LMsgSendFewNilSelf:
+       LOAD_STATIC_WORD r11, __objc_msgNil, EXTERNAL_SYMBOL
+       cmplwi          r11,0                   ; handler nil?
+       beqlr                                   ; if no handler, return nil
+
+       mflr            r0                      ; save return pc
+       stw             r0,8(r1)                ;
+       subi            r1,r1,64                ; allocate linkage area
+       mtctr           r11                     ; 
+       bctrl                                   ; call handler
+       addi            r1,r1,64                ; deallocate linkage area
+       lwz             r0,8(r1)                ; restore return pc
+       mtlr            r0                      ; 
+
+       li              r3,0            ; re-zero return value, in case handler changed it
+       blr                                     ; return to caller
+
+LMsgSendFewExit:
+       END_ENTRY       _objc_msgSendFew
+
+
+/********************************************************************
+ * struct_type objc_msgSendFew_stret(id        self,
+ *                                     SEL     op,
+ *                                             ...);
+ *
+ * objc_msgSend_stret is the struct-return form of msgSend.
+ * The ABI calls for r3 to be used as the address of the structure
+ * being returned, with the parameters in the succeeding registers.
+ *
+ * On entry:   r3 is the address where the structure is returned,
+ *             r4 is the message receiver,
+ *             r5 is the selector
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendFew_stret
+; do profiling when enabled
+       CALL_MCOUNT
+
+; check whether receiver is nil
+       cmplwi          r4,0                    ; receiver nil?
+       beq             LMsgSendFewStretNilSelf ; if so, call handler or just return
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendFewStretMT      ; branch to the locking case
+#endif
+
+; single threaded and receiver is non-nil: search the cache
+       CacheLookup STRUCT_RETURN, MSG_SEND, LMsgSendFewStretCacheMiss, FEW_ARGS
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendFewStretCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SEND, FEW_ARGS
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendFewStretMT:    
+       PLOCK   r11, _messageLock
+       CacheLookup STRUCT_RETURN, MSG_SEND, LMsgSendFewStretMTCacheMiss, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendFewStretMTCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SEND, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+; message sent to nil object call optional handler and return nil
+LMsgSendFewStretNilSelf:
+       LOAD_STATIC_WORD r11, __objc_msgNil, EXTERNAL_SYMBOL
+       cmplwi          r11,0                   ; handler nil?
+       beqlr                                   ; if no handler, return
+
+       mflr            r0                      ; save return pc
+       stw             r0,8(r1)                ;
+       subi            r1,r1,64                ; allocate linkage area
+       mr              r3,r4                   ; move self to r3
+       mr              r4,r5                   ; move SEL to r4
+       mtctr           r11                     ; 
+       bctrl                                   ; call handler
+       addi            r1,r1,64                ; deallocate linkage area
+       lwz             r0,8(r1)                ; restore return pc
+       mtlr            r0                      ; 
+
+       blr                                     ; return to caller
+
+LMsgSendFewStretExit:
+       END_ENTRY       _objc_msgSendFew_stret
+
+
+/********************************************************************
+ * id  objc_msgSendSuperFew(struct objc_super  *super,
+ *                             SEL                     op,
+ *                                                     ...);
+ *
+ * struct objc_super {
+ *     id      receiver;
+ *     Class   class;
+ * };
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendSuperFew
+; do profiling when enabled
+       CALL_MCOUNT
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendSuperFewMT      ; branch to the locking case
+#endif
+
+; single threaded: search the cache
+       CacheLookup WORD_RETURN, MSG_SENDSUPER, LMsgSendSuperFewCacheMiss, FEW_ARGS
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperFewCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SENDSUPER, FEW_ARGS
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendSuperFewMT:    
+       PLOCK   r11, _messageLock
+       CacheLookup WORD_RETURN, MSG_SENDSUPER, LMsgSendSuperFewMTCacheMiss, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperFewMTCacheMiss:
+       MethodTableLookup WORD_RETURN, MSG_SENDSUPER, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r3,receiver(r3)         ; receiver is the first arg
+       li              r11,kFwdMsgSend         ; indicate word-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+LMsgSendSuperFewExit:
+       END_ENTRY       _objc_msgSendSuperFew
+
+
+/********************************************************************
+ * struct_type objc_msgSendSuperFew_stret(objc_super   *super,
+ *                                             SEL             op,
+ *                                                             ...);
+ *
+ * struct objc_super {
+ *     id      receiver;
+ *     Class   class;
+ * };
+ *
+ *
+ * objc_msgSendSuper_stret is the struct-return form of msgSendSuper.
+ * The ABI calls for r3 to be used as the address of the structure
+ * being returned, with the parameters in the succeeding registers.
+ *
+ * On entry:   r3 is the address to which to copy the returned structure,
+ *             r4 is the address of the objc_super structure,
+ *             r5 is the selector
+ ********************************************************************/
+
+       ENTRY   _objc_msgSendSuperFew_stret
+; do profiling when enabled
+       CALL_MCOUNT
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; check whether context is multithreaded
+       lis             r11,ha16(__objc_multithread_mask)
+       lwz             r11,lo16(__objc_multithread_mask)(r11)
+       cmplwi          r11,0                   ; objc_multithread_mask zero?
+       beq             LMsgSendSuperFewStretMT ; branch to the locking case
+#endif
+
+; single threaded: search the cache
+       CacheLookup STRUCT_RETURN, MSG_SENDSUPER, LMsgSendSuperFewStretCacheMiss, FEW_ARGS
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperFewStretCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SENDSUPER, FEW_ARGS
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+#if !defined(OBJC_COLLECTING_CACHE)
+; multithreaded: hold _messageLock while accessing cache
+LMsgSendSuperFewStretMT:       
+       PLOCK   r11, _messageLock
+       CacheLookup STRUCT_RETURN, MSG_SENDSUPER, LMsgSendSuperFewStretMTCacheMiss, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+
+; cache miss: go search the method lists
+LMsgSendSuperFewStretMTCacheMiss:
+       MethodTableLookup STRUCT_RETURN, MSG_SENDSUPER, FEW_ARGS
+       PUNLOCK r11, _messageLock
+       lwz             r4,receiver(r4)         ; receiver is the first arg
+       li              r11,kFwdMsgSendStret    ; indicate struct-return to _objc_msgForward
+       bctr                                    ; goto *imp;
+#endif
+
+LMsgSendSuperFewStretExit:
+       END_ENTRY       _objc_msgSendSuperFew_stret
+
diff --git a/runtime/Messengers.subproj/objc-msg-sparc-pdo.s b/runtime/Messengers.subproj/objc-msg-sparc-pdo.s
new file mode 100644 (file)
index 0000000..55cb3dc
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     objc-msg-sparc.s
+ *     Copyright 1994 NeXT, Inc.
+ *     CREDITS: John Atkinson, Brad Taylor, Kresten Thorup,
+ *              Gordie Freedman, and everybody else and their dog too !
+ *
+ *
+ *      id objc_msgSend(id self, SEL sel, ...) 
+ *
+ *      Implement [anObject aSelector] 
+ *
+ *     NOTE: objc_msgSend() is defined as a C function in
+ *            objc-dispatch.c.  This code is derived from 
+ *            compiler generated assembly code. 
+ *
+ */
+
+#define CLEARLOW22     0xffc00000      /* mask to clear low 22 bits */
+
+#ifndef __svr4__
+#define _class_lookupMethodAndLoadCache __class_lookupMethodAndLoadCache
+#define objc_msgSend _objc_msgSend
+#define objc_msgSendv _objc_msgSendv
+#define objc_msgSendSuper _objc_msgSendSuper
+#define _objc_msgForward __objc_msgForward
+#define OBJC_METH_VAR_NAME_FORWARD _OBJC_METH_VAR_NAME_FORWARD
+#define  _objc_error __objc_error
+#define  _objc_multithread_mask __objc_multithread_mask
+#define  messageLock _messageLock
+#define  _objc_private_lock __objc_private_lock
+#define  _objc_private_unlock __objc_private_unlock
+#endif
+
+.text
+       .align 4
+       .global objc_msgSend
+       .type objc_msgSend,#function
+       .proc 0110
+//
+// ObjC message send:  
+// Arguments:  %i0   - receiver (self)
+//             %i1   - selector
+//             %i2.. - arguments
+
+objc_msgSend:
+       save    %sp,-96,%sp         // Save the stack
+.Ls1:
+       call .Ls2
+       nop
+.Ls2:
+       sethi %hi(_GLOBAL_OFFSET_TABLE_-(.Ls1-.)),%l6
+       or %l6,%lo(_GLOBAL_OFFSET_TABLE_-(.Ls1-.)),%l6
+       add %l6,%o7,%l6
+
+       tst     %i0                 // If (self == nil) 
+       bz      .L_receiver_is_nil   // Then goto nil return
+//     sethi   %hi(_objc_multithread_mask),%l2
+//     ld      [%l2+%lo(_objc_multithread_mask)],%l2
+       set _objc_multithread_mask,%l2
+       ld [%l6+%l2],%l2
+       ld [%l2],%l2
+       
+       tst     %l2             // If zero 
+       bz      .L_lock          // Then multithreaded
+       ld      [%i0],%l1       // <ds> cls = self->isa
+       ld      [%l1+32],%o0    // cache   = cls->cache
+.L_continue:
+       ld [%o0],%o4            // mask    = cache->mask  
+       add %o0,8,%o3           // buckets = cache->buckets    
+       and %i1,%o4,%o2         // index   = selector & mask   
+.L_loop:
+       sll %o2,2,%o1           // %o1 <= index << 2           
+       ld [%o3+%o1],%o0        // %o0 <= buckets[index]       
+       cmp %o0,0               // if (buckets[index] == 0)
+       be,a .L_cacheMiss        // then goto cacheMiss  
+       mov %l1,%o0             // <ds> Class goes into arg0
+       ld [%o0],%l3            // %l3 <= buckets[index]->method_name
+       cmp %l3,%i1             // if (method_name == sel)     
+       be,a .L_cacheHit         // goto cacheHit             
+       ld [%o0+8],%o0          // Fish out IMP address        
+       add %o2,1,%o2           // index++                      
+       b .L_loop                // Loop
+       and %o2,%o4,%o2         // <ds> index &= mask          
+.L_cacheMiss:
+       call _class_lookupMethodAndLoadCache,0
+       mov %i1,%o1             // <ds> Selector goes into arg1
+.L_cacheHit:
+       tst     %l2             // If mutithreaded is zero 
+       bz,a    .L_unlocked      // Then multithreaded, so unlock
+       swap    [%l7],%g0       // <ds> in the delay slot!
+.L_unlocked:
+       jmp %o0                 // Go to method imp
+       restore                 // <ds> restore the stack
+.L_receiver_is_nil:
+       ld [%i7+8],%g3          // load instruction 
+       sethi %hi(CLEARLOW22),%g2 // mask off low 22 bits 
+       andcc %g3,%g2,%g0       // if 0, then its an UNIMP inst 
+       bz .L_struct_returnSend  // and we will return a structure 
+       mov 0,%i1               // Second half of long long ret is 0 
+        ret                     // Get back, JoJo                      
+       restore                 // <ds> 
+.L_struct_returnSend:
+       jmp %i7 + 12            // convention for returning structs 
+       restore                 // <ds>
+.L_lock:
+       set     (messageLock),%l7 // get the lock addr
+       ld [%l6+%l7],%l7
+       set     1,%l3           // lock code (1)
+.L_lockspin:
+       swap    [%l7],%l3       // try to set the lock
+       tst     %l3             // if lock was already set
+       bnz     .L_lockspin     // try again
+       set     1,%l3           // <ds> lock code (1)
+       b       .L_continue      // Head back to mainline
+       ld      [%l1+32],%o0    // <ds> cache = cls->cache
+       
+/* 
+ *      Implement [super aSelector] 
+ *
+ *      id objc_msgSendSuper(struct objc_super *caller, SEL sel, ...)
+ *
+ *     NOTE: objc_msgSendSuper() is defined as a C function in
+ *            objc-dispatch.c.  This code is derived from 
+ *            compiler generated assembly code. 
+ */
+       .align 4
+       .global objc_msgSendSuper
+       .type objc_msgSendSuper,#function
+       .proc   0110
+objc_msgSendSuper:
+       // receiver and cls won't be nil on entry, can skip check
+       save %sp,-112,%sp
+.Lsu1:
+       call .Lsu2
+       nop
+.Lsu2:
+       sethi %hi(_GLOBAL_OFFSET_TABLE_-(.Lsu1-.)),%l6
+       or %l6,%lo(_GLOBAL_OFFSET_TABLE_-(.Lsu1-.)),%l6
+       add %l6,%o7,%l6
+
+//     sethi   %hi(_objc_multithread_mask),%l2
+//     ld      [%l2+%lo(_objc_multithread_mask)],%l2
+       set _objc_multithread_mask,%l2
+       ld [%l6+%l2],%l2
+       ld [%l2],%l2
+       tst     %l2               // If zero 
+       bz      .L_super_lock      // Then multithreaded
+       ld [%i0],%l1              // <ds> Put caller->receiver in %l1
+       st %l1,[%fp+68]           // Save receiver for later
+.L_super_continue:
+       ld [%i0+4],%o3            // Put caller->cls into %o3
+       ld [%o3+32],%o0           // cache   = cls->cache          
+       ld [%o0],%o2              // mask    = cls->cache->mask    
+       add %o0,8,%l0             // buckets = cache->buckets      
+       and %i1,%o2,%i0           // index   = selector & mask     
+.L_super_loop:
+       sll %i0,2,%o0             // Adjust to word index
+       ld [%l0+%o0],%o1          // method = buckets[index]
+       cmp %o1,0                 // if (method == NULL) ...
+       be .L_super_cacheMiss      // ... then have a cache miss
+       mov %o3,%o0               // <ds> Class arg for LoadCache
+       ld [%o1],%o0              // Method name into o0
+       cmp %o0,%i1               // Compare method name to one we want
+       be .L_super_cacheHit       // Equal, got a hit
+       ld [%o1+8],%g1            // <ds> Get implementation address
+       add %i0,1,%i0             // Increment index
+       b .L_super_loop            // Loop again
+       and %i0,%o2,%i0           // <ds> and with mask
+.L_super_cacheMiss:
+       call _class_lookupMethodAndLoadCache,0
+       mov %i1,%o1               // <ds> Selector into arg1
+       mov %o0,%g1               // Save result from LoadCache
+.L_super_cacheHit:
+       tst     %l2               // If multithread is zero 
+       bz,a    .L_super_unlocked  // Then multithreaded, so unlock
+       swap    [%l7],%g0         // <ds> in the delay slot!
+.L_super_unlocked:
+       restore                   // Restore the stack
+       jmp %g1                   // Go to the method
+       ld [%sp+68],%o0           // <ds> Put receiver in arg0
+.L_super_lock:
+       set     (messageLock),%l7 // get the lock addr
+       ld [%l6+%l7],%l7
+       set     1,%l3           // lock code (1)
+.L_super_lockspin:
+       swap    [%l7],%l3       // try to set the lock
+       tst     %l3             // if lock was already set
+       bnz     .L_super_lockspin// try again
+       set     1,%l3           // <ds> lock code (1)
+       b       .L_super_continue// Head back to mainline
+       st %l1,[%fp+68]         // <ds> Save receiver for later
+
+//
+//      id __objc_msgForward(id self, SEL sel, ...)
+//
+       .align 4
+       .global _objc_msgForward
+       .type _objc_msgForward,#function
+       .proc   0110
+_objc_msgForward:
+       save %sp,-96,%sp
+.Lmf1:
+       call .Lmf2
+       nop
+.Lmf2:
+       sethi %hi(_GLOBAL_OFFSET_TABLE_-(.Lmf1-.)),%l6
+       or %l6,%lo(_GLOBAL_OFFSET_TABLE_-(.Lmf1-.)),%l6
+       add %l6,%o7,%l6
+
+//     sethi %hi(OBJC_METH_VAR_NAME_FORWARD),%g2
+//     or %g2,%lo(OBJC_METH_VAR_NAME_FORWARD),%g2
+       set OBJC_METH_VAR_NAME_FORWARD,%g2
+       ld [%l6+%g2],%g2
+
+       cmp %g2,%i1             // if (sel==@selector(forward::)) 
+       be .LERROR               //   goto ERROR                   
+       mov %i1,%o2             // <ds> Put selector into %o2
+       add %fp,68,%g1          // Pointer to %i3 stack homing area 
+       st %i0,[%g1]            // Store first 6 parameters onto stack
+       st %i1,[%g1+4]
+       st %i2,[%g1+8]
+       st %i3,[%g1+12]
+       st %i4,[%g1+16]
+       st %i5,[%g1+20]
+       mov %g2,%o1             // Put forward:: into %o1
+       mov %g1,%o3             // Set margv vector as 4th parm
+
+       ld [%i7+8],%g3                  // load instruction 
+       sethi %hi(CLEARLOW22),%g2       // mask off low 22 bits 
+       andcc %g3,%g2,%g0               // if 0, then its an UNIMP inst 
+       be .Lstruct_returnForward       // and we will return a structure 
+       nop                             // fill me in later 
+
+       // No structure is returned
+       call objc_msgSend,0     // send the message 
+       mov %i0,%o0             // <ds> Set self 
+       mov %o0,%i0             // Restore return parameter 
+       ret                     // Return
+       restore %o1,0,%o1       // In case long long returned
+
+.Lstruct_returnForward:
+       ld [%fp+64],%g2         // get return struct ptr 
+       st %g2,[%sp+64]         // save return struct pointer 
+       call objc_msgSend,0     // send the message 
+       mov %i0,%o0             // Set self
+       unimp 0                 // let 0 mean size = unknown 
+       jmp %i7 + 12            // convention for returning structs 
+       restore
+.LERROR:                         // Error: Does not respond to sel 
+       sethi %hi(.LC0), %o1
+       or %o1,%lo(.LC0),%o1
+       b _objc_error           // __objc_error never returns,    
+       nop
+.LC0:
+       .ascii "Does not recognize selector %s\0"
+       .align 4
+
+//
+//     id objc_msgSendv(id self, SEL sel, unsigned size, marg_list args)
+//
+       .align 4
+       .global objc_msgSendv
+       .type objc_msgSendv,#function
+objc_msgSendv:
+       add %g0,-96,%g1         // Get min stack size + 4 (rounded by 8)
+       subcc %o2,28,%g2        // Get size of non reg params + 4
+       ble .Lsave_stack                // None or 1, so skip making stack larger
+       sub %g1,%g2,%g2         // Add local size to minimum stack
+       and %g2,-8,%g1          // Need to round to 8 bit boundary
+.Lsave_stack:
+       save %sp,%g1,%sp        // Save min stack + 4 for 8 byte bound ...
+       mov %i0,%o0
+       mov %i1,%o1
+       addcc %i2,-8,%i2           // The first 6 args go in registers 
+        be .Lsend_msg
+       nop
+       ld [%i3+8],%o2             // Got at least 1 arg 
+       addcc %i2,-4,%i2
+        be .Lsend_msg
+       nop
+       ld [%i3+12],%o3            // Got at least 2 args 
+       addcc %i2,-4,%i2
+        be .Lsend_msg
+       nop
+       ld [%i3+16],%o4            // Got at least 3 args 
+       addcc %i2,-4,%i2
+        be .Lsend_msg
+       nop
+       ld [%i3+20],%o5            // Got at least 4 args
+       addcc %i2,-4,%i2           // Decrement count past 4th arg
+       be .Lsend_msg
+       nop
+       add %i3,24,%i1             // %i1 <== args += 24
+       add %sp,92,%i5
+.Loop2:
+        ld [%i1],%i3              // Deal with remaining args
+        addcc %i2,-4,%i2
+        st %i3,[%i5]
+        add %i5,4,%i5
+        bne .Loop2
+        add %i1,4,%i1
+.Lsend_msg:
+
+       ld [%i7+8],%g3                  // load instruction
+       sethi %hi(CLEARLOW22),%g2       // mask off low 22 bits
+       andcc %g3,%g2,%g0               // if 0, then its an UNIMP inst
+       be .Lstruct_returnSendv         // and we will return a structure
+       nop                             // fill me in later
+
+       // No structure is returned
+       call objc_msgSend,0             // send the message 
+       nop                             // fill me in later 
+       mov %o0,%i0                     // Ret int, 1st half
+       ret                             // ... of long long 
+       restore %o1,0,%o1               // 2nd half of ll   
+
+.Lstruct_returnSendv:
+       ld [%fp+64],%g2         // get return struct ptr 
+       st %g2,[%sp+64]         // save return struct pointer 
+       call objc_msgSend,0     // send the message 
+       nop                     // fill me in later 
+       unimp 0                 // let 0 mean size = unknown 
+       jmp %i7 + 12            // convention for returning structs 
+       restore
+
+//
+//     void _objc_private_lock (long* lock)
+//
+       .align 4
+       .global _objc_private_lock      
+       .type _objc_private_lock,#function
+_objc_private_lock:
+       save    %sp,-96,%sp     // Save the stack
+       set     1,%l3           // lock code (1)
+.L_private_loop:
+       swap    [%i0],%l3       // try to set the lock
+       tst     %l3             // if lock was already set
+       bnz,a   .L_private_loop // try again
+       set     1,%l3           // <ds> lock code (1)
+       jmp %i7+8
+       restore 
+
+//
+//     void _objc_private_unlock (long* lock)
+//
+       .align 4
+       .global _objc_private_unlock    
+       .type _objc_private_unlock,#function
+_objc_private_unlock:
+       swap    [%o0],%g0       // clear the lock
+       jmp %o7+8
+       nop
diff --git a/runtime/Messengers.subproj/objc-msg-sparc.s b/runtime/Messengers.subproj/objc-msg-sparc.s
new file mode 100644 (file)
index 0000000..6be70b7
--- /dev/null
@@ -0,0 +1,393 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifdef DYLIB
+#warning Building of SPARC dynashlib not fully supported yet!
+#endif
+
+#ifdef KERNEL
+#define OBJC_LOCK_ROUTINE _simple_lock
+#else
+#define OBJC_LOCK_ROUTINE _spin_lock
+#endif /* KERNEL */
+
+#define CLEARLOW22     0xffc00000      /* mask to clear off low 22 bits */
+
+
+#define isa 0
+#define cache 32
+#define mask  0
+#define buckets 8
+#define method_name 0
+#define method_imp 8
+#define receiver 0
+#define class 4
+
+! optimized for sparc: 26 clocks (best case) + 7 clocks/probe
+
+        .text
+       .globl _objc_msgSend
+
+! ObjC message send:   
+! Arguments:   %i0   - receiver (self)
+!              %i1   - selector
+!              %i2.. - arguments
+       
+_objc_msgSend:
+       save    %sp,-96,%sp     ! save register windows
+       
+! test for nil argument and locking requirements
+       sethi   %hi(__objc_multithread_mask),%l1
+       ld      [%l1+%lo(__objc_multithread_mask)],%l1
+       andcc   %l1,%i0,%l1     ! if (self & multi) 
+       bnz,a   L_normalCase    ! then normalcase
+       ld      [%i0+isa],%o0   ! class = self->isa (class arg)
+       
+       tst     %i0             ! if (self)
+       bnz     L_sendLocking   ! lockingcase
+       nop
+! self is NIL, return
+       ld [%i7+8],%g3          // load instruction 
+       sethi %hi(CLEARLOW22),%g2 // mask off low 22 bits 
+       andcc %g3,%g2,%g0       // if 0, then its an UNIMP inst 
+       bz L_struct_returnSend0  // and we will return a structure 
+       nop             //
+        ret                     // Get back, JoJo                      
+       restore                 // <ds> 
+L_struct_returnSend0:
+       jmp %i7 + 12            // convention for returning structs 
+       restore                 // <ds>
+
+! Init pointers to class and cache
+L_normalCase:
+       ld      [%o0+cache],%l4 ! cache <- class->cache
+       ld      [%l4+mask],%l3  ! mask <- cache->mask
+       add     %l4,buckets,%l2 ! buckets <- cache->buckets
+       and     %i1,%l3,%l1     ! index <- selector & mask
+       
+! Try to find a method in the cache
+L_loop:
+       sll     %l1,2,%l6       ! adjust to word index
+       ld      [%l2+%l6],%l4   ! method = buckets[index]
+       tst     %l4             ! if (method == NULL)
+       bz,a    L_cacheMiss     ! handle cacheMiss case
+       mov     %i1,%o1         ! (DS) selector arg for LoadCache
+       
+       ld      [%l4+method_name],%l5! name = method->method_name
+       cmp     %l5,%i1         ! if (name == selector)
+       be,a    L_cacheHit      ! goto hit
+       ld      [%l4+method_imp],%o0! load method_imp pointer to call
+       
+       inc     %l1             ! index++
+       b       L_loop          ! check next cache entry
+       and     %l1,%l3,%l1     ! index = index & mask
+L_cacheMiss:
+        CALL_EXTERN(__class_lookupMethodAndLoadCache)
+L_cacheHit:
+       jmp     %o0             ! 
+       restore
+       
+! Locking version of objc_msgSend
+! spins on the mutex lock.
+
+L_sendLocking:
+       set     (_messageLock),%l7! get the lock addr
+       set     1,%l1           ! lock code (1) 
+L_lockspin:
+       swap    [%l7],%l1       ! try to set the lock
+       tst     %l1             ! if lock was already set
+       bnz     L_lockspin      ! try again
+       set     1,%l1           ! lock code (1)
+
+       ! got the lock, ready to proceed
+       
+       ld      [%i0+isa],%o0   ! class = self->isa
+       ld      [%o0+cache],%l4 ! cache = class->cache
+       ld      [%l4+mask],%l3  ! mask = cache->mask
+       add     %l4,buckets,%l2 ! buckets = cache->buckets
+       and     %i1,%l3,%l1     ! index = selector & mask
+       
+L_loop_lk:
+       sll     %l1,2,%l6       ! adjust to word index
+       ld      [%l2+%l6],%l4   ! method = buckets[index]
+       tst     %l4             ! if (method == NULL)
+       bz,a    L_cacheMiss_lk  ! handle cacheMiss case
+       mov     %i1,%o1         ! (DS) selector arg for LoadCache
+               
+       ld      [%l4+method_name],%l5! name = method->method_name
+       cmp     %l5,%i1         ! if (name == selector)
+       be,a    L_cacheHit_lk   ! goto hit
+       ld      [%l4+method_imp],%o0    ! impl = method->method_imp
+       
+       inc     %l1             ! index++
+       b       L_loop_lk       ! check next cache entry
+       and     %l1,%l3,%l1     ! index = index & mask
+       
+L_cacheMiss_lk:
+        CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+L_cacheHit_lk: 
+       swap    [%l7],%g0       ! clear the lock
+       jmp     %o0
+       restore
+
+
+        .globl _objc_msgSendSuper
+_objc_msgSendSuper:
+       save    %sp,-120,%sp    ! save register window
+       ld      [%i0+receiver],%l0      ! receiver = caller->receiver
+       tst     %l0             ! if (receiver)
+       bnz     L_receiver      ! work on it
+       st      %l0,[%fp+68]    ! <delay slot> save a copy
+L_noreceiver:                  ! return on NULL receiver
+       ld [%i7+8],%g3          // load instruction 
+       sethi %hi(CLEARLOW22),%g2 // mask off low 22 bits 
+       andcc %g3,%g2,%g0       // if 0, then its an UNIMP inst 
+       bz L_struct_returnSend1 // and we will return a structure 
+       nop                     //
+        ret                     // Get back, JoJo                      
+       restore                 // <ds> 
+L_struct_returnSend1:
+       jmp %i7 + 12            // convention for returning structs 
+       restore                 // <ds>
+       
+L_receiver:
+       sethi   %hi(__objc_multithread_mask),%l1
+       ld      [%l1+%lo(__objc_multithread_mask)],%l1
+       tst     %l1
+       bz      L_superLock
+       ld      [%i0+class],%o0 ! class = caller->class
+       ld      [%o0+cache],%l4 ! cache = class->cache
+       ld      [%l4+mask],%l3  ! mask = cache->mask
+       add     %l4,buckets,%l2 ! buckets = cache->buckets
+       and     %i1,%l3,%l1     ! index = selector & mask
+       
+L_super_loop:
+       sll     %l1,2,%l6       ! adjust to word index
+       ld      [%l2+%l6],%l4   ! method = buckets[index]
+       tst     %l4             ! if (method == NULL)
+       bz,a    L_super_cacheMiss       ! handle cacheMiss case
+       mov     %i1,%o1         ! (DS) selector arg for LoadCache
+               
+       ld      [%l4+method_name],%l5! name = method->method_name
+       cmp     %l5,%i1         ! if (name == selector)
+       be      L_super_cacheHit        ! goto hit
+       ld      [%l4+method_imp],%g1    ! method = buckets[index]
+       
+       inc     %l1             ! index++
+       b       L_super_loop    ! check next cache entry
+       and     %l1,%l3,%l1     ! index = index & mask
+       
+L_super_cacheMiss:
+        CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+       mov     %o0,%g1         ! save result from Loadcache
+       restore 
+       jmp     %g1
+       ld      [%sp+68],%o0            ! restore receiver
+
+       
+L_super_cacheHit:
+       restore
+       jmp     %g1
+       ld      [%sp+68],%o0            ! restore receiver
+
+
+! locking version of objc_msgSendSuper
+! spins on the mutex lock
+
+L_superLock:
+       sethi   %hi(_messageLock),%l1! aquire the lock addr
+       or      %l1,%lo(_messageLock),%l7
+L_super_lockspin:
+       ldstub  [%l7],%l1       ! try to set the lock
+       tst     %l1             ! if lock was already set
+       bne     L_super_lockspin        ! try again
+       nop
+
+       ! got the lock, ready to proceed
+                               ! %o0 = class [set above]
+       ld      [%o0+cache],%l4 ! cache = class->cache
+       ld      [%l4+mask],%l3  ! mask = cache->mask
+       add     %l4,buckets,%l2 ! buckets = cache->buckets
+       and     %i1,%l3,%l1     ! index = selector & mask
+       
+L_super_loop_lk:
+       sll     %l1,2,%l6       ! adjust to word index
+       ld      [%l2+%l6],%l4   ! method = buckets[index]
+       tst     %l4             ! if (method == NULL)
+       bz,a    L_super_cacheMiss_lk    ! handle cacheMiss case
+       mov     %i1,%o1         ! (DS) selector arg for LoadCache
+               
+       ld      [%l4+method_name],%l5! name = method->method_name
+       cmp     %l5,%i1         ! if (name == selector)
+       be      L_super_cacheHit_lk     ! goto hit
+       ld      [%l4+method_imp],%g1    ! impl = method->method_imp
+       
+       inc     %l1             ! index++
+       b       L_super_loop_lk ! check next cache entry
+       and     %l1,%l3,%l1     ! index = index & mask
+       
+L_super_cacheMiss_lk:
+        CALL_EXTERN_AGAIN(__class_lookupMethodAndLoadCache)
+       mov     %o0,%g1         ! save result from Loadcache
+       st      %g0,[%l7]       ! clear lock
+       restore
+       jmp     %g1
+       ld      [%sp+68],%o0            ! restore receiver
+       
+L_super_cacheHit_lk:   
+       st      %g0,[%l7]       ! clear the lock
+       restore
+       jmp     %g1
+       ld      [%sp+68],%o0            ! restore receiver
+
+        
+        .objc_meth_var_names
+       .align 1
+L30:    .ascii "forward::\0"
+
+        .objc_message_refs
+       .align 2
+L31:    .long L30
+
+        .cstring
+       .align 1
+L32:    .ascii "Does not recognize selector %s\0"
+
+        .text
+        .align 2
+
+       .globl __objc_msgForward
+__objc_msgForward:
+       save    %sp,-96,%sp
+       sethi   %hi(L31),%g2
+       ld      [%g2+%lo(L31)],%g2
+       cmp     %i1,%g2         ! if (selector == @selector(forward::))
+       be      L_error
+       nop
+       add     %fp,68,%g1      !  ptr to stack area
+       st      %i0,[%g1]
+       st      %i1,[%g1+4]
+       st      %i2,[%g1+8]
+       st      %i3,[%g1+12]
+       st      %i4,[%g1+16]
+       st      %i5,[%g1+20]
+       mov     %i1,%o2
+       mov     %g2,%o1
+       mov     %g1,%o3 
+       ld [%i7+8],%g3                          ! load instruction 
+       sethi %hi(CLEARLOW22),%g2       ! mask off low 22 bits 
+       andcc %g3,%g2,%g0                       ! if 0, then its an UNIMP inst 
+       be Lstruct_returnForward        ! and we will return a structure 
+       nop                                                     ! fill me in later 
+
+       ! No structure is returned
+       call _objc_msgSend                      ! send the message 
+       mov %i0,%o0                                     ! <ds> Set self 
+       mov %o0,%i0                                     ! Restore return parameter 
+       ret                                                     ! Return
+       restore %o1,0,%o1                       !In case long long returned
+
+Lstruct_returnForward:
+       ld [%fp+64],%g2                         ! get return struct ptr 
+       st %g2,[%sp+64]                         ! save return struct pointer 
+       call _objc_msgSend                      ! send the message 
+       mov %i0,%o0                                     ! Set self
+       unimp 0                                         ! let 0 mean size = unknown 
+       jmp %i7 + 12                            ! convention for returning structs 
+       restore
+       
+L_error:
+       mov     %i1, %o2
+       set     L32,%i1
+       BRANCH_EXTERN(__objc_error)     ! never returns
+
+
+! id objc_msgSendv(id self, SEL sel, unsigned size, marg_list args)
+       
+       .globl  _objc_msgSendv
+_objc_msgSendv:
+       add %g0,-96,%g1         ! Get min stack size + 4 (rounded by 8)
+       subcc %o2,28,%g2        ! Get size of non reg params + 4
+       ble Lsave_stack         ! None or 1, so skip making stack larger
+       sub %g1,%g2,%g2         ! Add local size to minimum stack
+       and %g2,-8,%g1          ! Need to round to 8 bit boundary
+Lsave_stack:
+       save %sp,%g1,%sp        ! Save min stack + 4 for 8 byte bound! ...
+       mov     %i0,%o0
+       mov     %i1,%o1
+       addcc   %i2,-8,%i2      ! adjust for first 2 args (self & sel)
+       be      L_send_msg
+       nop
+
+       ld      [%i3+8],%o2     ! get 3rd arg
+       addcc   %i2,-4,%i2      ! size--
+       be      L_send_msg
+       nop
+
+       ld      [%i3+12],%o3    ! arg 4
+       addcc   %i2,-4,%i2      ! size--
+       be      L_send_msg
+       nop
+
+       ld      [%i3+16],%o4    ! arg 5
+       addcc   %i2,-4,%i2      ! size--
+       be      L_send_msg
+       nop
+
+       ld      [%i3+20],%o5    ! arg 6
+       addcc   %i2,-4,%i2      ! size--
+       be      L_send_msg
+       nop
+       add     %i3,24,%i1      ! %i1 = args + 24
+       add     %sp,92,%i5
+L_loopv:                               ! deal with remaining args
+       ld      [%i1],%i3
+       addcc   %i2,-4,%i2      ! size--
+       st      %i3,[%i5]
+       add     %i5,4,%i5
+       bnz     L_loopv
+       add     %i1,4,%i1       ! arg++
+       
+L_send_msg:
+       ld      [%i7+8],%g3     ! load instruction
+       sethi   %hi(CLEARLOW22),%g2
+       andcc   %g3,%g2,%g0     ! if 0 it is an UNIMP inst
+       be      L_struct_returnSendv! return a structure
+       nop
+
+! Case of no struct returned
+
+       call    _objc_msgSend
+       nop
+       mov %o0,%i0                     ! Ret int, 1st half
+       ret                             ! ... of long long
+       restore %o1,0,%o1               ! 2nd half of ll
+
+L_struct_returnSendv:
+       ld      [%fp+64],%g2
+       st      %g2,[%sp+64]
+       call    _objc_msgSend
+       nop
+       unimp   0
+       jmp     %i7+12
+       restore
diff --git a/runtime/Messengers.subproj/objc-msg.s b/runtime/Messengers.subproj/objc-msg.s
new file mode 100644 (file)
index 0000000..738d09f
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     Copyright 1988-1996 NeXT Software, Inc.
+ *
+ *     objc-msg.s
+ *
+ *     31-Dec-96  Umesh Vaishampayan  (umeshv@NeXT.com)
+ *             Added support for ppc. cleaned m98k and m88k stuff.
+ */
+
+#import "../objc-config.h"
+
+#if defined (m68k)
+    #if defined(OBJC_COLLECTING_CACHE)
+        #include "objc-msg-m68k-nolock.s"
+    #else
+        #include "objc-msg-m68k-lock.s"
+    #endif
+
+#elif defined (WIN32)
+    #include "objc-msg-i386-nextpdo-winnt3.5.s"
+
+#elif defined (__i386__) || defined (i386)
+    #include "objc-msg-i386.s"
+
+#elif defined (hppa)
+    #if defined(NeXT_PDO)
+        #if defined(NSBUILDINGHPUXSHLIB)
+            #include "objc-msg-hppa-pdo-pic.s"
+        #else
+            #include "objc-msg-hppa-pdo.s"
+        #endif
+    #elif defined(OBJC_COLLECTING_CACHE)
+        #include "objc-msg-hppa-nolock.s"
+    #else
+        #include "objc-msg-hppa-lock.s"
+    #endif
+
+#elif defined (sparc)
+    #if defined(NeXT_PDO)
+        #include "objc-msg-sparc-pdo.s"
+    #else
+        #include "objc-msg-sparc.s"
+    #endif
+
+#elif defined (__ppc__) || defined(ppc)
+    #include "objc-msg-ppc.s"
+
+#else
+    #error Architecture not supported
+#endif
diff --git a/runtime/Object.h b/runtime/Object.h
new file mode 100644 (file)
index 0000000..c7cb936
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+       Object.h
+       Copyright 1988-1996 NeXT Software, Inc.
+  
+       DEFINED AS:     A common class
+       HEADER FILES:   <objc/Object.h>
+
+*/
+
+#ifndef _OBJC_OBJECT_H_
+#define _OBJC_OBJECT_H_
+
+#include <objc/objc-runtime.h>
+
+@class Protocol;
+
+@interface Object
+{
+       Class isa;      /* A pointer to the instance's class structure */
+}
+
+/* Initializing classes and instances */
+
++ initialize;
+- init;
+
+/* Creating, copying, and freeing instances */
+
++ new;
++ free;
+- free;
++ alloc;
+- copy;
++ allocFromZone:(void *)zone;
+- copyFromZone:(void *)zone;
+- (void *)zone;
+
+/* Identifying classes */
+
++ class;
++ superclass;
++ (const char *) name;
+- class;
+- superclass;
+- (const char *) name;
+
+/* Identifying and comparing instances */
+
+- self;
+- (unsigned int) hash;
+- (BOOL) isEqual:anObject;
+
+/* Testing inheritance relationships */
+
+- (BOOL) isKindOf: aClassObject;
+- (BOOL) isMemberOf: aClassObject;
+- (BOOL) isKindOfClassNamed: (const char *)aClassName;
+- (BOOL) isMemberOfClassNamed: (const char *)aClassName;
+
+/* Testing class functionality */
+
++ (BOOL) instancesRespondTo:(SEL)aSelector;
+- (BOOL) respondsTo:(SEL)aSelector;
+
+/* Testing protocol conformance */
+
+- (BOOL) conformsTo: (Protocol *)aProtocolObject;
++ (BOOL) conformsTo: (Protocol *)aProtocolObject;
+
+/* Obtaining method descriptors from protocols */
+
+- (struct objc_method_description *) descriptionForMethod:(SEL)aSel;
++ (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
+
+/* Obtaining method handles */
+
+- (IMP) methodFor:(SEL)aSelector;
++ (IMP) instanceMethodFor:(SEL)aSelector;
+
+/* Sending messages determined at run time */
+
+- perform:(SEL)aSelector;
+- perform:(SEL)aSelector with:anObject;
+- perform:(SEL)aSelector with:object1 with:object2;
+
+/* Posing */
+
++ poseAs: aClassObject;
+
+/* Enforcing intentions */
+- subclassResponsibility:(SEL)aSelector;
+- notImplemented:(SEL)aSelector;
+
+/* Error handling */
+
+- doesNotRecognize:(SEL)aSelector;
+- error:(const char *)aString, ...;
+
+/* Debugging */
+
+- (void) printForDebugger:(void *)stream;
+
+/* Archiving */
+
+- awake;
+- write:(void *)stream;
+- read:(void *)stream;
++ (int) version;
++ setVersion: (int) aVersion;
+
+/* Forwarding */
+
+- forward: (SEL)sel : (marg_list)args;
+- performv: (SEL)sel : (marg_list)args;
+
+@end
+
+/* Abstract Protocol for Archiving */
+
+@interface Object (Archiving)
+
+- startArchiving: (void *)stream;
+- finishUnarchiving;
+
+@end
+
+/* Abstract Protocol for Dynamic Loading */
+
+#if !defined(NeXT_PDO)
+@interface Object (DynamicLoading)
+
+//+ finishLoading:(headerType *)header;
++ finishLoading:(struct mach_header *)header;
++ startUnloading;
+
+@end
+#endif
+
+OBJC_EXPORT id object_dispose(Object *anObject);
+OBJC_EXPORT id object_copy(Object *anObject, unsigned nBytes);
+OBJC_EXPORT id object_copyFromZone(Object *anObject, unsigned nBytes, void *z);
+OBJC_EXPORT id object_realloc(Object *anObject, unsigned nBytes);
+OBJC_EXPORT id object_reallocFromZone(Object *anObject, unsigned nBytes, void *z);
+
+#endif /* _OBJC_OBJECT_H_ */
diff --git a/runtime/Object.m b/runtime/Object.m
new file mode 100644 (file)
index 0000000..569ae50
--- /dev/null
@@ -0,0 +1,1060 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+       Object.m
+       Copyright 1988-1996 NeXT Software, Inc.
+*/
+
+#ifdef WINNT
+#include <winnt-pdo.h>
+#endif
+
+#ifdef NeXT_PDO                        // pickup BUG fix flags
+#import <pdo.h>
+#endif
+
+#import <objc/Object.h>
+#import "objc-private.h"
+#import <objc/objc-runtime.h>
+#import <objc/Protocol.h>
+#import <stdarg.h> 
+#import <string.h> 
+
+OBJC_EXPORT id (*_cvtToId)(const char *);
+OBJC_EXPORT id (*_poseAs)();
+
+#define ISMETA(cls)            (((struct objc_class *)cls)->info & CLS_META) 
+
+// Error Messages
+static const char
+       _errNoMem[] = "failed -- out of memory(%s, %u)",
+       _errReAllocNil[] = "reallocating nil object",
+       _errReAllocFreed[] = "reallocating freed object",
+       _errReAllocTooSmall[] = "(%s, %u) requested size too small",
+       _errShouldHaveImp[] = "should have implemented the '%s' method.",
+       _errShouldNotImp[] = "should NOT have implemented the '%s' method.",
+       _errLeftUndone[] = "method '%s' not implemented",
+       _errBadSel[] = "method %s given invalid selector %s",
+       _errDoesntRecognize[] = "does not recognize selector %c%s";
+
+
+@implementation Object 
+
+
++ initialize
+{
+       return self; 
+}
+
+- awake 
+{
+       return self; 
+}
+
++ poseAs: aFactory
+{ 
+       return (*_poseAs)(self, aFactory); 
+}
+
++ new
+{
+       id newObject = (*_alloc)((Class)self, 0);
+       struct objc_class * metaClass = ((struct objc_class *) self)->isa;
+       if (metaClass->version > 1)
+           return [newObject init];
+       else
+           return newObject;
+}
+
++ alloc
+{
+       return (*_zoneAlloc)((Class)self, 0, malloc_default_zone()); 
+}
+
++ allocFromZone:(void *) z
+{
+       return (*_zoneAlloc)((Class)self, 0, z); 
+}
+
+- init
+{
+    return self;
+}
+
+- (const char *)name
+{
+       return ((struct objc_class *)isa)->name; 
+}
+
++ (const char *)name
+{
+       return ((struct objc_class *)self)->name; 
+}
+
+- (unsigned)hash
+{
+       return ((uarith_t)self) >> 2;
+}
+
+- (BOOL)isEqual:anObject
+{
+       return anObject == self; 
+}
+
+- free 
+{ 
+       return (*_dealloc)(self); 
+}
+
++ free
+{
+       return nil; 
+}
+
+- self
+{
+       return self; 
+}
+
+- class
+{
+       return (id)isa; 
+}
+
++ class 
+{
+       return self;
+}
+
+- (void *)zone
+{
+       void *z = malloc_zone_from_ptr(self);
+       return z ? z : malloc_default_zone();
+}
+
++ superclass 
+{ 
+       return ((struct objc_class *)self)->super_class; 
+}
+
+- superclass 
+{ 
+       return ((struct objc_class *)isa)->super_class; 
+}
+
++ (int) version
+{
+       struct objc_class *     class = (struct objc_class *) self;
+       return class->version;
+}
+
++ setVersion: (int) aVersion
+{
+       struct objc_class *     class = (struct objc_class *) self;
+       class->version = aVersion;
+       return self;
+}
+
+- (BOOL)isKindOf:aClass
+{
+       register Class cls;
+       for (cls = isa; cls; cls = ((struct objc_class *)cls)->super_class) 
+               if (cls == (Class)aClass)
+                       return YES;
+       return NO;
+}
+
+- (BOOL)isMemberOf:aClass
+{
+       return isa == (Class)aClass;
+}
+
+- (BOOL)isKindOfClassNamed:(const char *)aClassName
+{
+       register Class cls;
+       for (cls = isa; cls; cls = ((struct objc_class *)cls)->super_class) 
+               if (strcmp(aClassName, ((struct objc_class *)cls)->name) == 0)
+                       return YES;
+       return NO;
+}
+
+- (BOOL)isMemberOfClassNamed:(const char *)aClassName 
+{
+       return strcmp(aClassName, ((struct objc_class *)isa)->name) == 0;
+}
+
++ (BOOL)instancesRespondTo:(SEL)aSelector 
+{
+       return class_respondsToMethod((Class)self, aSelector);
+}
+
+- (BOOL)respondsTo:(SEL)aSelector 
+{
+       return class_respondsToMethod(isa, aSelector);
+}
+
+- copy 
+{
+       return [self copyFromZone: [self zone]];
+}
+
+- copyFromZone:(void *)z
+{
+       return (*_zoneCopy)(self, 0, z); 
+}
+
+- (IMP)methodFor:(SEL)aSelector 
+{
+       return class_lookupMethod(isa, aSelector);
+}
+
++ (IMP)instanceMethodFor:(SEL)aSelector 
+{
+       return class_lookupMethod(self, aSelector);
+}
+
+#if defined(__alpha__)
+#define MAX_RETSTRUCT_SIZE 256
+
+typedef struct _foolGCC {
+       char c[MAX_RETSTRUCT_SIZE];
+} _variableStruct;
+
+typedef _variableStruct (*callReturnsStruct)();
+
+OBJC_EXPORT long sizeOfReturnedStruct(char **);
+
+long sizeOfType(char **pp)
+{
+  char *p = *pp;
+  long stack_size = 0, n = 0;
+  switch(*p) {
+  case 'c':
+  case 'C':
+    stack_size += sizeof(char); // Alignment ?
+    break;
+  case 's':
+  case 'S':
+    stack_size += sizeof(short);// Alignment ?
+    break;
+  case 'i':
+  case 'I':
+  case '!':
+    stack_size += sizeof(int);
+    break;
+  case 'l':
+  case 'L':
+    stack_size += sizeof(long int);
+    break;
+  case 'f':
+    stack_size += sizeof(float);
+    break;
+  case 'd':
+    stack_size += sizeof(double);
+    break;
+  case '*':
+  case ':':
+  case '@':
+  case '%':
+    stack_size += sizeof(char*);
+    break;
+  case '{':
+    stack_size += sizeOfReturnedStruct(&p);
+    while(*p!='}') p++;
+    break;
+  case '[':
+    p++;
+    while(isdigit(*p))
+      n = 10 * n + (*p++ - '0');
+    stack_size += (n * sizeOfType(&p));
+    break;
+  default:
+    break;
+  }
+  *pp = p;
+  return stack_size;
+}
+
+long
+sizeOfReturnedStruct(char **pp)
+{
+  char *p = *pp;
+  long stack_size = 0, n = 0;
+  while(p!=NULL && *++p!='=') ; // skip the struct name
+  while(p!=NULL && *++p!='}')
+    stack_size += sizeOfType(&p);
+  return stack_size + 8;       // Add 8 as a 'forfait value'
+                               // to take alignment into account
+}
+
+- perform:(SEL)aSelector 
+{
+  char *p;
+  long stack_size;
+  _variableStruct *dummyRetVal;
+  Method       method;
+
+  if (aSelector) {
+    method = class_getInstanceMethod((Class)self->isa,
+                                    aSelector);
+    if(method==NULL)
+      method = class_getClassMethod((Class)self->isa,
+                                   aSelector);
+    if(method!=NULL) {
+      p = &method->method_types[0];
+      if(*p=='{') {
+       // Method returns a structure
+       stack_size = sizeOfReturnedStruct(&p);
+       if(stack_size<MAX_RETSTRUCT_SIZE)
+         {
+           //
+           // The MAX_RETSTRUCT_SIZE value allow us to support methods that
+           // return structures whose size is not grater than
+           // MAX_RETSTRUCT_SIZE.
+           // This is because the compiler allocates space on the stack
+           // for the size of the return structure, and when the method
+           // returns, the structure is copied on the space allocated
+           // on the stack: if the structure is greater than the space
+           // allocated... bang! (the stack is gone:-)
+           //
+           ((callReturnsStruct)objc_msgSend)(self, aSelector);
+         }
+       else
+         {
+           dummyRetVal  = (_variableStruct*) malloc(stack_size);
+
+           // Following asm code is equivalent to:
+           // *dummyRetVal=((callReturnsStruct)objc_msgSend)(self,aSelector);
+#if 0
+           asm("ldq $16,%0":"=g" (dummyRetVal):);
+           asm("ldq $17,%0":"=g" (self):);
+           asm("ldq $18,%0":"=g" (aSelector):);
+           asm("bis $31,1,$25");
+           asm("lda $27,objc_msgSend");
+           asm("jsr $26,($27),objc_msgSend");
+           asm("ldgp $29,0($26)");
+#else
+*dummyRetVal=((callReturnsStruct)objc_msgSend)(self,aSelector);
+#endif
+           free(dummyRetVal);
+         }
+       // When the method return a structure, we cannot return it here
+       // becuse we're not called in the right way, so we must return
+       // something else: wether it is self or NULL is a matter of taste.
+       return (id)NULL;
+      }
+    }
+    // We fall back here either because the method doesn't return
+    // a structure, or because method is NULL: in this latter
+    // case the call to msgSend will try to forward the message.
+    return objc_msgSend(self, aSelector);
+  }
+
+  // We fallback here only when aSelector is NULL
+  return [self error:_errBadSel, SELNAME(_cmd), aSelector];
+}
+
+- perform:(SEL)aSelector with:anObject 
+{
+  char *p;
+  long stack_size;
+  _variableStruct *dummyRetVal;
+  Method       method;
+
+  if (aSelector) {
+    method = class_getInstanceMethod((Class)self->isa,
+                                    aSelector);
+    if(method==NULL)
+      method = class_getClassMethod((Class)self->isa,
+                                   aSelector);
+    if(method!=NULL) {
+      p = &method->method_types[0];
+      if(*p=='{') {
+       // Method returns a structure
+       stack_size = sizeOfReturnedStruct(&p);
+       if(stack_size<MAX_RETSTRUCT_SIZE)
+         {
+           //
+           // The MAX_RETSTRUCT_SIZE value allow us to support methods that
+           // return structures whose size is not grater than
+           // MAX_RETSTRUCT_SIZE.
+           // This is because the compiler allocates space on the stack
+           // for the size of the return structure, and when the method
+           // returns, the structure is copied on the space allocated
+           // on the stack: if the structure is greater than the space
+           // allocated... bang! (the stack is gone:-)
+           //
+           ((callReturnsStruct)objc_msgSend)(self, aSelector, anObject);
+         }
+       else
+         {
+           dummyRetVal  = (_variableStruct*) malloc(stack_size);
+
+           // Following asm code is equivalent to:
+           // *dummyRetVal=((callReturnsStruct)objc_msgSend)(self,aSelector,anObject);
+#if 0
+           asm("ldq $16,%0":"=g" (dummyRetVal):);
+           asm("ldq $17,%0":"=g" (self):);
+           asm("ldq $18,%0":"=g" (aSelector):);
+           asm("ldq $19,%0":"=g" (anObject):);
+           asm("bis $31,1,$25");
+           asm("lda $27,objc_msgSend");
+           asm("jsr $26,($27),objc_msgSend");
+           asm("ldgp $29,0($26)");
+#else
+ *dummyRetVal=((callReturnsStruct)objc_msgSend)(self,aSelector,anObject);
+#endif
+           free(dummyRetVal);
+         }
+       // When the method return a structure, we cannot return it here
+       // becuse we're not called in the right way, so we must return
+       // something else: wether it is self or NULL is a matter of taste.
+       return (id)NULL;
+      }
+    }
+    // We fall back here either because the method doesn't return
+    // a structure, or because method is NULL: in this latter
+    // case the call to msgSend will try to forward the message.
+    return objc_msgSend(self, aSelector, anObject);
+  }
+
+  // We fallback here only when aSelector is NULL
+  return [self error:_errBadSel, SELNAME(_cmd), aSelector];
+}
+
+- perform:(SEL)aSelector with:obj1 with:obj2 
+{
+  char *p;
+  long stack_size;
+  _variableStruct *dummyRetVal;
+  Method       method;
+
+  if (aSelector) {
+    method = class_getInstanceMethod((Class)self->isa,
+                                    aSelector);
+    if(method==NULL)
+      method = class_getClassMethod((Class)self->isa,
+                                   aSelector);
+    if(method!=NULL) {
+      p = &method->method_types[0];
+      if(*p=='{') {
+       // Method returns a structure
+       stack_size = sizeOfReturnedStruct(&p);
+       if(stack_size<MAX_RETSTRUCT_SIZE)
+         {
+           //
+           // The MAX_RETSTRUCT_SIZE value allow us to support methods that
+           // return structures whose size is not grater than
+           // MAX_RETSTRUCT_SIZE.
+           // This is because the compiler allocates space on the stack
+           // for the size of the return structure, and when the method
+           // returns, the structure is copied on the space allocated
+           // on the stack: if the structure is greater than the space
+           // allocated... bang! (the stack is gone:-)
+           //
+           ((callReturnsStruct)objc_msgSend)(self, aSelector, obj1, obj2);
+         }
+       else
+         {
+           dummyRetVal  = (_variableStruct*) malloc(stack_size);
+
+           // Following asm code is equivalent to:
+           // *dummyRetVal=((callReturnsStruct)objc_msgSend)(self,aSelector,obj1,obj2);
+
+#if 0
+           asm("ldq $16,%0":"=g" (dummyRetVal):);
+           asm("ldq $17,%0":"=g" (self):);
+           asm("ldq $18,%0":"=g" (aSelector):);
+           asm("ldq $19,%0":"=g" (obj1):);
+           asm("ldq $20,%0":"=g" (obj2):);
+           asm("bis $31,1,$25");
+           asm("lda $27,objc_msgSend");
+           asm("jsr $26,($27),objc_msgSend");
+           asm("ldgp $29,0($26)");
+#else
+*dummyRetVal=((callReturnsStruct)objc_msgSend)(self,aSelector,obj1,obj2);
+#endif
+           free(dummyRetVal);
+         }
+       // When the method return a structure, we cannot return it here
+       // becuse we're not called in the right way, so we must return
+       // something else: wether it is self or NULL is a matter of taste.
+       return (id)NULL;
+      }
+    }
+    // We fall back here either because the method doesn't return
+    // a structure, or because method is NULL: in this latter
+    // case the call to msgSend will try to forward the message.
+    return objc_msgSend(self, aSelector, obj1, obj2);
+  }
+
+  // We fallback here only when aSelector is NULL
+  return [self error:_errBadSel, SELNAME(_cmd), aSelector];
+
+}
+#else
+- perform:(SEL)aSelector 
+{ 
+       if (aSelector)
+               return objc_msgSend(self, aSelector); 
+       else
+               return [self error:_errBadSel, SELNAME(_cmd), aSelector];
+}
+
+- perform:(SEL)aSelector with:anObject 
+{
+       if (aSelector)
+               return objc_msgSend(self, aSelector, anObject); 
+       else
+               return [self error:_errBadSel, SELNAME(_cmd), aSelector];
+}
+
+- perform:(SEL)aSelector with:obj1 with:obj2 
+{
+       if (aSelector)
+               return objc_msgSend(self, aSelector, obj1, obj2); 
+       else
+               return [self error:_errBadSel, SELNAME(_cmd), aSelector];
+}
+#endif
+
+- subclassResponsibility:(SEL)aSelector 
+{
+       return [self error:_errShouldHaveImp, sel_getName(aSelector)];
+}
+
+- notImplemented:(SEL)aSelector
+{
+       return [self error:_errLeftUndone, sel_getName(aSelector)];
+}
+
+- doesNotRecognize:(SEL)aMessage
+{
+       return [self error:_errDoesntRecognize, 
+               ISMETA (isa) ? '+' : '-', SELNAME(aMessage)];
+}
+
+- error:(const char *)aCStr, ... 
+{
+       va_list ap;
+       va_start(ap,aCStr); 
+       (*_error)(self, aCStr, ap); 
+       _objc_error (self, aCStr, ap);  /* In case (*_error)() returns. */
+       va_end(ap);
+        return nil;
+}
+
+- (void) printForDebugger:(void *)stream
+{
+}
+
+- write:(void *) stream 
+{
+       return self;
+}
+
+- read:(void *) stream 
+{
+       return self;
+}
+
+- forward: (SEL) sel : (marg_list) args 
+{
+    return [self doesNotRecognize: sel];
+}
+
+/* this method is not part of the published API */
+
+- (unsigned)methodArgSize:(SEL)sel 
+{
+    Method     method = class_getInstanceMethod((Class)isa, sel);
+    if (! method) return 0;
+    return method_getSizeOfArguments(method);
+}
+
+#if defined(__alpha__)
+
+typedef struct {
+       unsigned long int i16;
+       unsigned long int i17;
+       unsigned long int i18;
+       unsigned long int i19;
+       unsigned long int i20;
+       unsigned long int i21;
+       unsigned long int i25;
+       unsigned long int f16;
+       unsigned long int f17;
+       unsigned long int f18;
+       unsigned long int f19;
+       unsigned long int f20;
+       unsigned long int f21;
+       unsigned long int sp;
+ } *_m_args_p;
+
+- performv: (SEL) sel : (marg_list) args 
+{
+    char *             p;
+    long               stack_size;
+    Method             method;
+    unsigned long int  size;
+    char               scratchMem[MAX_RETSTRUCT_SIZE];
+    char *             scratchMemP;
+
+    // Messages to nil object always return nil
+    if (! self) return nil;
+
+    // Got to have a selector
+    if (!sel)
+        return [self error:_errBadSel, SELNAME(_cmd), sel];
+
+    // Handle a method which returns a structure and
+    // has been called as such
+    if (((_m_args_p)args)->i25){
+        // Calculate size of the marg_list from the method's
+        // signature.  This looks for the method in self
+        // and its superclasses.
+        size = [self methodArgSize: sel];
+
+        // If neither self nor its superclasses implement
+        // the method, forward the message because self
+        // might know someone who does.  This is a
+        // "chained" forward...
+        if (! size) return [self forward: sel: args];
+
+        // Message self with the specified selector and arguments
+        return objc_msgSendv (self, sel, size, args);
+    }
+
+    // Look for instance method in self's class and superclasses
+    method = class_getInstanceMethod((Class)self->isa,sel);
+
+    // Look for class method in self's class and superclass
+    if(method==NULL)
+        method = class_getClassMethod((Class)self->isa,sel);
+
+    // If neither self nor its superclasses implement
+    // the method, forward the message because self
+    // might know someone who does.  This is a
+    // "chained" forward...
+    if(method==NULL)
+        return [self forward: sel: args];
+
+    // Calculate size of the marg_list from the method's
+    // signature.
+    size = method_getSizeOfArguments(method);
+
+    // Ready to send message now if the return type
+    // is not a structure
+    p = &method->method_types[0];
+    if(*p!='{')
+        return objc_msgSendv(self, sel, size, args);
+
+    // Method returns a structure
+    stack_size = sizeOfReturnedStruct(&p);
+    if(stack_size>=MAX_RETSTRUCT_SIZE)
+        scratchMemP = (char*)malloc(stack_size);
+    else
+        scratchMemP = &scratchMem[0];
+
+    // Set i25 so objc_msgSendv will know that method returns a structure
+    ((_m_args_p)args)->i25 = 1;
+    
+    // Set first param of method to be called to safe return address
+    ((_m_args_p)args)->i16 = (unsigned long int) scratchMemP;
+    objc_msgSendv(self, sel, size, args);
+
+    if(stack_size>=MAX_RETSTRUCT_SIZE)
+      free(scratchMemP);
+
+    return (id)NULL;
+ }
+#else
+- performv: (SEL) sel : (marg_list) args 
+{
+    unsigned   size;
+#if hppa && 0
+    void *ret;
+   
+    // Save ret0 so methods that return a struct might work.
+    asm("copy %%r28, %0": "=r"(ret): );
+#endif hppa
+
+    // Messages to nil object always return nil
+    if (! self) return nil;
+
+    // Calculate size of the marg_list from the method's
+    // signature.  This looks for the method in self
+    // and its superclasses.
+    size = [self methodArgSize: sel];
+
+    // If neither self nor its superclasses implement
+    // it, forward the message because self might know
+    // someone who does.  This is a "chained" forward...
+    if (! size) return [self forward: sel: args];
+
+#if hppa && 0
+    // Unfortunately, it looks like the compiler puts something else in
+    // r28 right after this instruction, so this is all for naught.
+    asm("copy %0, %%r28": : "r"(ret));
+#endif hppa
+
+    // Message self with the specified selector and arguments
+    return objc_msgSendv (self, sel, size, args); 
+}
+#endif
+
+/* Testing protocol conformance */
+
+- (BOOL) conformsTo: (Protocol *)aProtocolObj
+{
+  return [(id)isa conformsTo:aProtocolObj];
+}
+
++ (BOOL) conformsTo: (Protocol *)aProtocolObj
+{
+  struct objc_class * class;
+
+  for (class = self; class; class = class->super_class)
+    {
+      if (class->isa->version >= 3)
+        {
+         struct objc_protocol_list *protocols = class->protocols;
+
+         while (protocols)
+           {
+             int i;
+
+             for (i = 0; i < protocols->count; i++)
+               {
+                 Protocol *p = protocols->list[i];
+    
+                 if ([p conformsTo:aProtocolObj])
+                   return YES;
+               }
+
+             if (class->isa->version <= 4)
+               break;
+
+             protocols = protocols->next;
+           }
+       }
+    }
+  return NO;
+}
+
+
+/* Looking up information for a method */
+
+- (struct objc_method_description *) descriptionForMethod:(SEL)aSelector
+{
+  struct objc_class * cls;
+  struct objc_method_description *m;
+
+  /* Look in the protocols first. */
+  for (cls = isa; cls; cls = cls->super_class)
+    {
+      if (cls->isa->version >= 3)
+        {
+         struct objc_protocol_list *protocols = cls->protocols;
+  
+         while (protocols)
+           {
+             int i;
+
+             for (i = 0; i < protocols->count; i++)
+               {
+                 Protocol *p = protocols->list[i];
+
+                 if (ISMETA (cls))
+                   m = [p descriptionForClassMethod:aSelector];
+                 else
+                   m = [p descriptionForInstanceMethod:aSelector];
+
+                 if (m) {
+                     return m;
+                 }
+               }
+  
+             if (cls->isa->version <= 4)
+               break;
+  
+             protocols = protocols->next;
+           }
+       }
+    }
+
+  /* Then try the class implementations. */
+    for (cls = isa; cls; cls = cls->super_class) {
+        void *iterator = 0;
+       int i;
+        struct objc_method_list *mlist;
+        while ( (mlist = _class_inlinedNextMethodList( cls, &iterator )) ) {
+            for (i = 0; i < mlist->method_count; i++)
+                if (mlist->method_list[i].method_name == aSelector) {
+                   struct objc_method_description *m;
+                   m = (struct objc_method_description *)&mlist->method_list[i];
+                    return m;
+               }
+        }
+    }
+  return 0;
+}
+
++ (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSelector
+{
+  struct objc_class * cls;
+
+  /* Look in the protocols first. */
+  for (cls = self; cls; cls = cls->super_class)
+    {
+      if (cls->isa->version >= 3)
+        {
+         struct objc_protocol_list *protocols = cls->protocols;
+  
+         while (protocols)
+           {
+             int i;
+
+             for (i = 0; i < protocols->count; i++)
+               {
+                 Protocol *p = protocols->list[i];
+                 struct objc_method_description *m;
+
+                 if ((m = [p descriptionForInstanceMethod:aSelector]))
+                   return m;
+               }
+  
+             if (cls->isa->version <= 4)
+               break;
+  
+             protocols = protocols->next;
+           }
+       }
+    }
+
+  /* Then try the class implementations. */
+    for (cls = self; cls; cls = cls->super_class) {
+        void *iterator = 0;
+       int i;
+        struct objc_method_list *mlist;
+        while ( (mlist = _class_inlinedNextMethodList( cls, &iterator )) ) {
+            for (i = 0; i < mlist->method_count; i++)
+                if (mlist->method_list[i].method_name == aSelector) {
+                   struct objc_method_description *m;
+                   m = (struct objc_method_description *)&mlist->method_list[i];
+                    return m;
+               }
+        }
+    }
+
+  return 0;
+}
+
+
+/* Obsolete methods (for binary compatibility only). */
+
++ superClass
+{
+       return [self superclass];
+}
+
+- superClass
+{
+       return [self superclass];
+}
+
+- (BOOL)isKindOfGivenName:(const char *)aClassName
+{
+       return [self isKindOfClassNamed: aClassName];
+}
+
+- (BOOL)isMemberOfGivenName:(const char *)aClassName 
+{
+       return [self isMemberOfClassNamed: aClassName];
+}
+
+- (struct objc_method_description *) methodDescFor:(SEL)aSelector
+{
+  return [self descriptionForMethod: aSelector];
+}
+
++ (struct objc_method_description *) instanceMethodDescFor:(SEL)aSelector
+{
+  return [self descriptionForInstanceMethod: aSelector];
+}
+
+- findClass:(const char *)aClassName
+{
+       return (*_cvtToId)(aClassName);
+}
+
+- shouldNotImplement:(SEL)aSelector
+{
+       return [self error:_errShouldNotImp, sel_getName(aSelector)];
+}
+
+@end
+
+static id _internal_object_copyFromZone(Object *anObject, unsigned nBytes, void *z) 
+{
+       id obj;
+       register unsigned siz;
+
+       if (anObject == nil)
+               return nil;
+
+       obj = (*_zoneAlloc)(anObject->isa, nBytes, z);
+       siz = ((struct objc_class *)anObject->isa)->instance_size + nBytes;
+       bcopy((const char*)anObject, (char*)obj, siz);
+       return obj;
+}
+
+static id _internal_object_copy(Object *anObject, unsigned nBytes) 
+{
+    void *z= malloc_zone_from_ptr(anObject);
+    return _internal_object_copyFromZone(anObject, 
+                                        nBytes,
+                                        z ? z : malloc_default_zone());
+}
+
+static id _internal_object_dispose(Object *anObject) 
+{
+       if (anObject==nil) return nil;
+       anObject->isa = _objc_getFreedObjectClass (); 
+       free(anObject);
+       return nil;
+}
+
+static id _internal_object_reallocFromZone(Object *anObject, unsigned nBytes, void *z) 
+{
+       Object *newObject; 
+       struct objc_class * tmp;
+
+       if (anObject == nil)
+               __objc_error(nil, _errReAllocNil, 0);
+
+       if (anObject->isa == _objc_getFreedObjectClass ())
+               __objc_error(anObject, _errReAllocFreed, 0);
+
+       if (nBytes < ((struct objc_class *)anObject->isa)->instance_size)
+               __objc_error(anObject, _errReAllocTooSmall, 
+                               object_getClassName(anObject), nBytes);
+
+       // Make sure not to modify space that has been declared free
+       tmp = anObject->isa; 
+       anObject->isa = _objc_getFreedObjectClass ();
+       newObject = (Object*)malloc_zone_realloc(z, (void*)anObject, (size_t)nBytes);
+       if (newObject) {
+               newObject->isa = tmp;
+               return newObject;
+       }
+       else
+            {
+               __objc_error(anObject, _errNoMem, 
+                               object_getClassName(anObject), nBytes);
+                return nil;
+            }
+}
+
+static id _internal_object_realloc(Object *anObject, unsigned nBytes) 
+{
+    void *z= malloc_zone_from_ptr(anObject);
+    return _internal_object_reallocFromZone(anObject,
+                                           nBytes,
+                                           z ? z : malloc_default_zone());
+}
+
+/* Functional Interface to system primitives */
+
+id object_copy(Object *anObject, unsigned nBytes) 
+{
+       return (*_copy)(anObject, nBytes); 
+}
+
+id object_copyFromZone(Object *anObject, unsigned nBytes, void *z) 
+{
+       return (*_zoneCopy)(anObject, nBytes, z); 
+}
+
+id object_dispose(Object *anObject) 
+{
+       return (*_dealloc)(anObject); 
+}
+
+id object_realloc(Object *anObject, unsigned nBytes) 
+{
+       return (*_realloc)(anObject, nBytes); 
+}
+
+id object_reallocFromZone(Object *anObject, unsigned nBytes, void *z) 
+{
+       return (*_zoneRealloc)(anObject, nBytes, z); 
+}
+
+Ivar object_setInstanceVariable(id obj, const char *name, void *value)
+{
+       Ivar ivar = 0;
+
+       if (obj && name) {
+               void **ivaridx;
+
+               if ((ivar = class_getInstanceVariable(((Object*)obj)->isa, name))) {
+                      ivaridx = (void **)((char *)obj + ivar->ivar_offset);
+                      *ivaridx = value;
+               }
+       }
+       return ivar;
+}
+
+Ivar object_getInstanceVariable(id obj, const char *name, void **value)
+{
+       Ivar ivar = 0;
+
+       if (obj && name) {
+               void **ivaridx;
+
+               if ((ivar = class_getInstanceVariable(((Object*)obj)->isa, name))) {
+                      ivaridx = (void **)((char *)obj + ivar->ivar_offset);
+                      *value = *ivaridx;
+               } else
+                      *value = 0;
+       }
+       return ivar;
+}
+
+#if defined(__hpux__)
+id (*_objc_msgSend_v)(id, SEL, ...) = objc_msgSend;
+#endif
+
+id (*_copy)(id, unsigned) = _internal_object_copy;
+id (*_realloc)(id, unsigned) = _internal_object_realloc;
+id (*_dealloc)(id)  = _internal_object_dispose;
+id (*_cvtToId)(const char *)= objc_lookUpClass;
+SEL (*_cvtToSel)(const char *)= sel_getUid;
+void (*_error)() = (void(*)())_objc_error;
+id (*_zoneCopy)(id, unsigned, void *) = _internal_object_copyFromZone;
+id (*_zoneRealloc)(id, unsigned, void *) = _internal_object_reallocFromZone;
+
+
diff --git a/runtime/OldClasses.subproj/List.h b/runtime/OldClasses.subproj/List.h
new file mode 100644 (file)
index 0000000..e7326f5
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+    List.h
+    Copyright 1988-1996 NeXT Software, Inc.
+
+    DEFINED AS:        A common class
+    HEADER FILES:      objc/List.h
+
+*/
+
+#warning the API in this header is obsolete
+
+#ifndef _OBJC_LIST_H_
+#define _OBJC_LIST_H_
+
+#import <objc/Object.h>
+
+@interface List : Object
+{
+@public
+    id                 *dataPtr;       /* data of the List object */
+    unsigned   numElements;    /* Actual number of elements */
+    unsigned   maxElements;    /* Total allocated elements */
+}
+
+/* Creating, freeing */
+
+- free;
+- freeObjects;
+- copyFromZone:(void *)z;
+  
+/* Initializing */
+
+- init;
+- initCount:(unsigned)numSlots;
+
+/* Comparing two lists */
+
+- (BOOL)isEqual: anObject;
+  
+/* Managing the storage capacity */
+
+- (unsigned)capacity;
+- setAvailableCapacity:(unsigned)numSlots;
+
+/* Manipulating objects by index */
+
+- (unsigned)count;
+- objectAt:(unsigned)index;
+- lastObject;
+- addObject:anObject;
+- insertObject:anObject at:(unsigned)index;
+- removeObjectAt:(unsigned)index;
+- removeLastObject;
+- replaceObjectAt:(unsigned)index with:newObject;
+- appendList: (List *)otherList;
+
+/* Manipulating objects by id */
+
+- (unsigned)indexOf:anObject;
+- addObjectIfAbsent:anObject;
+- removeObject:anObject;
+- replaceObject:anObject with:newObject;
+
+/* Emptying the list */
+
+- empty;
+
+/* Sending messages to elements of the list */
+
+- makeObjectsPerform:(SEL)aSelector;
+- makeObjectsPerform:(SEL)aSelector with:anObject;
+
+/*
+ * The following new... methods are now obsolete.  They remain in this 
+ * interface file for backward compatibility only.  Use Object's alloc method 
+ * and the init... methods defined in this class instead.
+ */
+
++ new;
++ newCount:(unsigned)numSlots;
+
+@end
+
+typedef struct {
+    @defs(List)
+} NXListId;
+
+#define NX_ADDRESS(x) (((NXListId *)(x))->dataPtr)
+
+#define NX_NOT_IN_LIST 0xffffffff
+
+#endif /* _OBJC_LIST_H_ */
diff --git a/runtime/OldClasses.subproj/List.m b/runtime/OldClasses.subproj/List.m
new file mode 100644 (file)
index 0000000..290334c
--- /dev/null
@@ -0,0 +1,296 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+       List.m
+       Copyright 1988-1996 NeXT Software, Inc.
+       Written by: Bryan Yamamoto
+       Responsibility: Bertrand Serlet
+*/
+
+#if defined(__svr4__) || defined(__hpux__) || defined(hpux)
+    #import <strings.h>                // for bcmp()
+#elif defined(WIN32)
+    #import <pdo.h>            // for bcopy()
+#endif
+
+#import <stdlib.h>
+#import <stdio.h>
+#import <string.h>
+#import <objc/List.h>
+
+#define DATASIZE(count) ((count) * sizeof(id))
+
+@implementation  List
+
++ initialize
+{
+    [self setVersion: 1];
+    return self;
+}
+
+- initCount:(unsigned)numSlots
+{
+    maxElements = numSlots;
+    if (maxElements) 
+       dataPtr = (id *)malloc(DATASIZE(maxElements));
+    return self;
+}
+
++ newCount:(unsigned)numSlots
+{
+    return [[self alloc] initCount:numSlots];
+}
+
++ new
+{
+    return [self newCount:0];
+}
+
+- init
+{
+    return [self initCount:0];
+}
+
+- free
+{
+    free(dataPtr);
+    return [super free];
+}
+
+- freeObjects
+{
+    id element;
+    while ((element = [self removeLastObject]))
+       [element free];
+    return self;
+}
+
+- copyFromZone:(void *)z
+{
+    List       *new = [[[self class] alloc] initCount: numElements];
+    new->numElements = numElements;
+    bcopy ((const char*)dataPtr, (char*)new->dataPtr, DATASIZE(numElements));
+    return new;
+}
+
+- (BOOL) isEqual: anObject
+{
+    List       *other;
+    if (! [anObject isKindOf: [self class]]) return NO;
+    other = (List *) anObject;
+    return (numElements == other->numElements) 
+       && (bcmp ((const char*)dataPtr, (const char*)other->dataPtr, DATASIZE(numElements)) == 0);
+}
+
+- (unsigned)capacity
+{
+    return maxElements;
+}
+
+- (unsigned)count
+{
+    return numElements;
+}
+
+- objectAt:(unsigned)index
+{
+    if (index >= numElements)
+       return nil;
+    return dataPtr[index];
+}
+
+- (unsigned)indexOf:anObject
+{
+    register id *this = dataPtr;
+    register id *last = this + numElements;
+    while (this < last) {
+        if (*this == anObject)
+           return this - dataPtr;
+       this++;
+    }
+    return NX_NOT_IN_LIST;
+}
+
+- lastObject
+{
+    if (! numElements)
+       return nil;
+    return dataPtr[numElements - 1];
+}
+
+- setAvailableCapacity:(unsigned)numSlots
+{
+    volatile id *tempDataPtr;
+    if (numSlots < numElements) return nil;
+    tempDataPtr = (id *) realloc (dataPtr, DATASIZE(numSlots));
+    dataPtr = (id *)tempDataPtr;
+    maxElements = numSlots;
+    return self;
+}
+
+- insertObject:anObject at:(unsigned)index
+{
+    register id *this, *last, *prev;
+    if (! anObject) return nil;
+    if (index > numElements)
+        return nil;
+    if ((numElements + 1) > maxElements) {
+    volatile id *tempDataPtr;
+       /* we double the capacity, also a good size for malloc */
+       maxElements += maxElements + 1;
+       tempDataPtr = (id *) realloc (dataPtr, DATASIZE(maxElements));
+       dataPtr = (id*)tempDataPtr;
+    }
+    this = dataPtr + numElements;
+    prev = this - 1;
+    last = dataPtr + index;
+    while (this > last) 
+       *this-- = *prev--;
+    *last = anObject;
+    numElements++;
+    return self;
+}
+
+- addObject:anObject
+{
+    return [self insertObject:anObject at:numElements];
+    
+}
+
+
+- addObjectIfAbsent:anObject
+{
+    register id *this, *last;
+    if (! anObject) return nil;
+    this = dataPtr;
+    last = dataPtr + numElements;
+    while (this < last) {
+        if (*this == anObject)
+           return self;
+       this++;
+    }
+    return [self insertObject:anObject at:numElements];
+    
+}
+
+
+- removeObjectAt:(unsigned)index
+{
+    register id *this, *last, *next;
+    id retval;
+    if (index >= numElements)
+        return nil;
+    this = dataPtr + index;
+    last = dataPtr + numElements;
+    next = this + 1;
+    retval = *this;
+    while (next < last)
+       *this++ = *next++;
+    numElements--;
+    return retval;
+}
+
+- removeObject:anObject
+{
+    register id *this, *last;
+    this = dataPtr;
+    last = dataPtr + numElements;
+    while (this < last) {
+       if (*this == anObject)
+           return [self removeObjectAt:this - dataPtr];
+       this++;
+    }
+    return nil;
+}
+
+- removeLastObject
+{
+    if (! numElements)
+       return nil;
+    return [self removeObjectAt: numElements - 1];
+}
+
+- empty
+{
+    numElements = 0;
+    return self;
+}
+
+- replaceObject:anObject with:newObject
+{
+    register id *this, *last;
+    if (! newObject)
+        return nil;
+    this = dataPtr;
+    last = dataPtr + numElements;
+    while (this < last) {
+       if (*this == anObject) {
+           *this = newObject;
+           return anObject;
+       }
+       this++;
+    }
+    return nil;
+}
+
+- replaceObjectAt:(unsigned)index with:newObject
+{
+    register id *this;
+    id retval;
+    if (! newObject)
+        return nil;
+    if (index >= numElements)
+        return nil;
+    this = dataPtr + index;
+    retval = *this;
+    *this = newObject;
+    return retval;
+}
+
+- makeObjectsPerform:(SEL)aSelector
+{
+    unsigned   count = numElements;
+    while (count--)
+       [dataPtr[count] perform: aSelector];
+    return self;
+}
+
+- makeObjectsPerform:(SEL)aSelector with:anObject
+{
+    unsigned   count = numElements;
+    while (count--)
+       [dataPtr[count] perform: aSelector with: anObject];
+    return self;
+}
+
+-appendList: (List *)otherList
+{
+    unsigned i, count;
+    
+    for (i = 0, count = [otherList count]; i < count; i++)
+       [self addObject: [otherList objectAt: i]];
+    return self;
+}
+
+@end
diff --git a/runtime/OldClasses.subproj/Makefile b/runtime/OldClasses.subproj/Makefile
new file mode 100644 (file)
index 0000000..2f15e0f
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Generated by the Apple Project Builder.
+#
+# NOTE: Do NOT change this file -- Project Builder maintains it.
+#
+# Put all of your customizations in files called Makefile.preamble
+# and Makefile.postamble (both optional), and Makefile will include them.
+#
+
+NAME = OldClasses
+
+PROJECTVERSION = 2.8
+PROJECT_TYPE = Component
+
+HFILES = List.h
+
+MFILES = List.m
+
+OTHERSRCS = Makefile.preamble Makefile
+
+
+MAKEFILEDIR = $(MAKEFILEPATH)/pb_makefiles
+CODE_GEN_STYLE = DYNAMIC
+MAKEFILE = subproj.make
+LIBS = 
+DEBUG_LIBS = $(LIBS)
+PROF_LIBS = $(LIBS)
+
+
+PUBLIC_HEADERS = List.h
+
+
+
+NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc
+WINDOWS_OBJCPLUS_COMPILER = $(DEVDIR)/gcc
+PDO_UNIX_OBJCPLUS_COMPILER = $(NEXTDEV_BIN)/gcc
+NEXTSTEP_JAVA_COMPILER = /usr/bin/javac
+WINDOWS_JAVA_COMPILER = $(JDKBINDIR)/javac.exe
+PDO_UNIX_JAVA_COMPILER = $(NEXTDEV_BIN)/javac
+
+include $(MAKEFILEDIR)/platform.make
+
+-include Makefile.preamble
+
+include $(MAKEFILEDIR)/$(MAKEFILE)
+
+-include Makefile.postamble
+
+-include Makefile.dependencies
diff --git a/runtime/OldClasses.subproj/Makefile.preamble b/runtime/OldClasses.subproj/Makefile.preamble
new file mode 100644 (file)
index 0000000..2b5897a
--- /dev/null
@@ -0,0 +1,7 @@
+
+OTHER_PROJECT_HEADERS = $(PUBLIC_HEADERS) $(OTHER_PRIVATE_HEADERS)
+
+PUBLIC_HEADER_DIR_SUFFIX = /objc
+PRIVATE_HEADER_DIR_SUFFIX = /objc
+
+
diff --git a/runtime/OldClasses.subproj/PB.project b/runtime/OldClasses.subproj/PB.project
new file mode 100644 (file)
index 0000000..da9c064
--- /dev/null
@@ -0,0 +1,27 @@
+{
+    DYNAMIC_CODE_GEN = YES; 
+    FILESTABLE = {
+        CLASSES = (); 
+        H_FILES = (List.h); 
+        OTHER_LINKED = (List.m); 
+        OTHER_SOURCES = (Makefile.preamble, Makefile); 
+        PROJECT_HEADERS = (); 
+        PUBLIC_HEADERS = (List.h); 
+        SUBPROJECTS = (); 
+    }; 
+    LANGUAGE = English; 
+    LOCALIZABLE_FILES = {}; 
+    MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; 
+    NEXTSTEP_BUILDTOOL = /bin/gnumake; 
+    NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; 
+    NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; 
+    PDO_UNIX_BUILDTOOL = $NEXT_ROOT/Developer/bin/make; 
+    PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; 
+    PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; 
+    PROJECTNAME = OldClasses; 
+    PROJECTTYPE = Component; 
+    PROJECTVERSION = 2.8; 
+    WINDOWS_BUILDTOOL = $NEXT_ROOT/Developer/Executables/make; 
+    WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; 
+    WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; 
+}
diff --git a/runtime/PB.project b/runtime/PB.project
new file mode 100644 (file)
index 0000000..09488b5
--- /dev/null
@@ -0,0 +1,73 @@
+{
+    CURRENTLY_ACTIVE_VERSION = YES; 
+    DEPLOY_WITH_VERSION_NAME = A; 
+    DYNAMIC_CODE_GEN = YES; 
+    FILESTABLE = {
+        CLASSES = (); 
+        HEADERSEARCH = (); 
+        H_FILES = (
+            error.h, 
+            hashtable2.h, 
+            maptable.h, 
+            "objc-api.h", 
+            "objc-class.h", 
+            "objc-config.h", 
+            "objc-load.h", 
+            "objc-private.h", 
+            "objc-runtime.h", 
+            objc.h, 
+            Object.h, 
+            Protocol.h
+        ); 
+        OTHER_LINKED = (
+            hashtable2.m, 
+            maptable.m, 
+            "objc-class.m", 
+            "objc-errors.m", 
+            "objc-file.m", 
+            "objc-load.m", 
+            "objc-moninit.c", 
+            "objc-runtime.m", 
+            "objc-sel.m", 
+            Object.m, 
+            Protocol.m
+        ); 
+        OTHER_SOURCES = (
+            Makefile.preamble, 
+            Makefile, 
+            Makefile.postamble, 
+            objc_hpux_register_shlib.c, 
+            objc_dllMain.c
+        ); 
+        PUBLIC_HEADERS = (
+            "objc-class.h", 
+            "objc-api.h", 
+            "objc-load.h", 
+            "objc-runtime.h", 
+            objc.h, 
+            Object.h, 
+            Protocol.h, 
+            error.h, 
+            hashtable2.h
+        ); 
+        SUBPROJECTS = (Messengers.subproj, OldClasses.subproj); 
+    }; 
+    LANGUAGE = English; 
+    LOCALIZABLE_FILES = {}; 
+    MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; 
+    NEXTSTEP_BUILDTOOL = /bin/gnumake; 
+    NEXTSTEP_INSTALLDIR = /usr/lib; 
+    NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; 
+    NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; 
+    PDO_UNIX_BUILDTOOL = $NEXT_ROOT/Developer/bin/make; 
+    PDO_UNIX_INSTALLDIR = "$(LOCAL_DEVELOPER_DIR)/Libraries"; 
+    PDO_UNIX_JAVA_COMPILER = "$(NEXTDEV_BIN)/javac"; 
+    PDO_UNIX_OBJCPLUS_COMPILER = "$(NEXTDEV_BIN)/gcc"; 
+    PROJECTNAME = runtime; 
+    PROJECTTYPE = Library; 
+    PROJECTVERSION = 2.8; 
+    WINDOWS_BUILDTOOL = $NEXT_ROOT/Developer/Executables/make; 
+    WINDOWS_INSTALLDIR = /.; 
+    WINDOWS_JAVA_COMPILER = "$(JDKBINDIR)/javac.exe"; 
+    WINDOWS_OBJCPLUS_COMPILER = "$(DEVDIR)/gcc"; 
+}
diff --git a/runtime/Protocol.h b/runtime/Protocol.h
new file mode 100644 (file)
index 0000000..033aa26
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+       Protocol.h
+       Copyright 1991-1996 NeXT Software, Inc.
+*/
+
+#ifndef _OBJC_PROTOCOL_H_
+#define _OBJC_PROTOCOL_H_
+
+#import <objc/Object.h>
+
+struct objc_method_description {
+       SEL name;
+       char *types;
+};
+struct objc_method_description_list {
+        int count;
+        struct objc_method_description list[1];
+};
+
+@interface Protocol : Object
+{
+@private
+       char *protocol_name;
+       struct objc_protocol_list *protocol_list;
+       struct objc_method_description_list *instance_methods, *class_methods;
+#ifdef NeXT_PDO        /* hppa needs 8 byte aligned protocol blocks */
+#if defined(__hpux__) || defined(hpux)
+       unsigned long   risc_pad; 
+#endif /* __hpux__ || hpux */
+#endif NeXT_PDO
+}
+
+/* Obtaining attributes intrinsic to the protocol */
+
+- (const char *)name;
+
+/* Testing protocol conformance */
+
+- (BOOL) conformsTo: (Protocol *)aProtocolObject;
+
+/* Looking up information specific to a protocol */
+
+- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
+- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
+
+@end
+
+#endif /* _OBJC_PROTOCOL_H_ */
diff --git a/runtime/Protocol.m b/runtime/Protocol.m
new file mode 100644 (file)
index 0000000..90cb3f8
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+       Protocol.h
+       Copyright 1991-1996 NeXT Software, Inc.
+*/
+
+#if defined(WIN32)
+    #include <winnt-pdo.h>
+#endif
+
+#include "objc-private.h"
+#import <objc/Protocol.h>
+
+#include <objc/objc-runtime.h>
+#include <stdlib.h>
+
+#if defined(__MACH__) 
+    #include <mach-o/dyld.h>
+    #include <mach-o/ldsyms.h>
+#endif 
+
+/* some forward declarations */
+
+static struct objc_method_description *
+lookup_method(struct objc_method_description_list *mlist, SEL aSel);
+
+static struct objc_method_description *
+lookup_class_method(struct objc_protocol_list *plist, SEL aSel);
+
+static struct objc_method_description *
+lookup_instance_method(struct objc_protocol_list *plist, SEL aSel);
+
+@implementation Protocol 
+
+
++ _fixup: (OBJC_PROTOCOL_PTR)protos numElements: (int) nentries
+{
+  int i;
+  for (i = 0; i < nentries; i++)
+    {
+      /* isa has been overloaded by the compiler to indicate version info */
+      protos[i] OBJC_PROTOCOL_DEREF isa = self;        // install the class descriptor.    
+    }
+
+  return self;
+}
+
++ load
+{
+  OBJC_PROTOCOL_PTR p;
+  int size;
+  headerType **hp;
+  headerType **hdrs;
+  hdrs = _getObjcHeaders();
+
+  for (hp = hdrs; *hp; hp++) 
+    {
+      p = (OBJC_PROTOCOL_PTR)_getObjcProtocols((headerType*)*hp, &size);
+      if (p && size) { [self _fixup:p numElements: size]; }
+    }
+  free (hdrs);
+
+  return self;
+}
+
+- (BOOL) conformsTo: (Protocol *)aProtocolObj
+{
+  if (!aProtocolObj)
+    return NO;
+
+  if (strcmp(aProtocolObj->protocol_name, protocol_name) == 0)
+    return YES;
+  else if (protocol_list)
+    {
+    int i;
+    
+    for (i = 0; i < protocol_list->count; i++)
+      {
+      Protocol *p = protocol_list->list[i];
+
+      if (strcmp(aProtocolObj->protocol_name, p->protocol_name) == 0)
+        return YES;
+   
+      if ([p conformsTo:aProtocolObj])
+       return YES;
+      }
+    return NO;
+    }
+  else
+    return NO;
+}
+
+- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel
+{
+   struct objc_method_description *m = lookup_method(instance_methods, aSel);
+
+   if (!m && protocol_list)
+     m = lookup_instance_method(protocol_list, aSel);
+
+   return m;
+}
+
+- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel
+{
+   struct objc_method_description *m = lookup_method(class_methods, aSel);
+
+   if (!m && protocol_list)
+     m = lookup_class_method(protocol_list, aSel);
+
+   return m;
+}
+
+- (const char *)name
+{
+  return protocol_name;
+}
+
+- (BOOL)isEqual:other
+{
+    return [other isKindOf:[Protocol class]] && [self conformsTo: other] && [other conformsTo: self];
+}
+
+- (unsigned int)hash
+{
+    return 23;
+}
+
+static 
+struct objc_method_description *
+lookup_method(struct objc_method_description_list *mlist, SEL aSel)
+{
+   if (mlist)
+     {
+     int i;
+     for (i = 0; i < mlist->count; i++)
+       if (mlist->list[i].name == aSel)
+         return mlist->list+i;
+     }
+   return 0;
+}
+
+static 
+struct objc_method_description *
+lookup_instance_method(struct objc_protocol_list *plist, SEL aSel)
+{
+   int i;
+   struct objc_method_description *m = 0;
+
+   for (i = 0; i < plist->count; i++)
+     {
+     if (plist->list[i]->instance_methods)
+       m = lookup_method(plist->list[i]->instance_methods, aSel);
+   
+     /* depth first search */  
+     if (!m && plist->list[i]->protocol_list)
+       m = lookup_instance_method(plist->list[i]->protocol_list, aSel);
+
+     if (m)
+       return m;
+     }
+   return 0;
+}
+
+static 
+struct objc_method_description *
+lookup_class_method(struct objc_protocol_list *plist, SEL aSel)
+{
+   int i;
+   struct objc_method_description *m = 0;
+
+   for (i = 0; i < plist->count; i++)
+     {
+     if (plist->list[i]->class_methods)
+       m = lookup_method(plist->list[i]->class_methods, aSel);
+   
+     /* depth first search */  
+     if (!m && plist->list[i]->protocol_list)
+       m = lookup_class_method(plist->list[i]->protocol_list, aSel);
+
+     if (m)
+       return m;
+     }
+   return 0;
+}
+
+@end
diff --git a/runtime/error.h b/runtime/error.h
new file mode 100644 (file)
index 0000000..19791e3
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/*
+    error.h
+
+    This file defines the interface to the exception raising scheme.
+
+    Copyright (c) 1988-1996 NeXT Software, Inc. as an unpublished work.
+    All rights reserved.
+*/
+
+#warning the API in this header is obsolete
+
+#ifndef _OBJC_ERROR_H_
+#define _OBJC_ERROR_H_
+
+#include <setjmp.h>
+#import <objc/objc-api.h>
+
+#if defined(__svr4__)
+    #define _setjmp setjmp
+    #define _longjmp longjmp
+#endif
+
+typedef struct _NXHandler {    /* a node in the handler chain */
+    jmp_buf jumpState;                 /* place to longjmp to */
+    struct _NXHandler *next;           /* ptr to next handler */
+    int code;                          /* error code of exception */
+    const void *data1, *data2;         /* blind data for describing error */
+} NXHandler;
+
+
+/* Handles RAISE's with nowhere to longjmp to */
+typedef void NXUncaughtExceptionHandler(int code, const void *data1,
+                                               const void *data2);
+OBJC_EXPORT NXUncaughtExceptionHandler *_NXUncaughtExceptionHandler;
+#define NXGetUncaughtExceptionHandler() _NXUncaughtExceptionHandler
+#define NXSetUncaughtExceptionHandler(proc) \
+                       (_NXUncaughtExceptionHandler = (proc))
+
+/* NX_DURING, NX_HANDLER and NX_ENDHANDLER are always used like:
+
+       NX_DURING
+           some code which might raise an error
+       NX_HANDLER
+           code that will be jumped to if an error occurs
+       NX_ENDHANDLER
+
+   If any error is raised within the first block of code, the second block
+   of code will be jumped to.  Typically, this code will clean up any
+   resources allocated in the routine, possibly case on the error code
+   and perform special processing, and default to RERAISE the error to
+   the next handler.  Within the scope of the handler, a local variable
+   called NXLocalHandler of type NXHandler holds information about the
+   error raised.
+
+   It is illegal to exit the first block of code by any other means than
+   NX_VALRETURN, NX_VOIDRETURN, or just falling out the bottom.
+ */
+
+/* private support routines.  Do not call directly. */
+OBJC_EXPORT void _NXAddHandler( NXHandler *handler );
+OBJC_EXPORT void _NXRemoveHandler( NXHandler *handler );
+
+#define NX_DURING { NXHandler NXLocalHandler;                  \
+                   _NXAddHandler(&NXLocalHandler);             \
+                   if( !_setjmp(NXLocalHandler.jumpState) ) {
+
+#define NX_HANDLER _NXRemoveHandler(&NXLocalHandler); } else {
+
+#define NX_ENDHANDLER }}
+
+#define NX_VALRETURN(val)  do { typeof(val) temp = (val);      \
+                       _NXRemoveHandler(&NXLocalHandler);      \
+                       return(temp); } while (0)
+
+#define NX_VOIDRETURN  do { _NXRemoveHandler(&NXLocalHandler); \
+                       return; } while (0)
+
+/* RAISE and RERAISE are called to indicate an error condition.  They
+   initiate the process of jumping up the chain of handlers.
+ */
+
+OBJC_EXPORT
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(NeXT_PDO)
+    volatile   /* never returns */
+#endif 
+void _NXRaiseError(int code, const void *data1, const void *data2)
+#if defined(__GNUC__)
+  __attribute__ ((noreturn))
+#endif
+;
+
+#define NX_RAISE( code, data1, data2 ) \
+               _NXRaiseError( (code), (data1), (data2) )
+
+#define NX_RERAISE()   _NXRaiseError( NXLocalHandler.code,     \
+                               NXLocalHandler.data1, NXLocalHandler.data2 )
+
+/* These routines set and return the procedure which is called when
+   exceptions are raised.  This procedure must NEVER return.  It will
+   usually either longjmp, or call the uncaught exception handler.
+   The default exception raiser is also declared
+ */
+typedef volatile void NXExceptionRaiser(int code, const void *data1, const void *data2);
+OBJC_EXPORT void NXSetExceptionRaiser(NXExceptionRaiser *proc);
+OBJC_EXPORT NXExceptionRaiser *NXGetExceptionRaiser(void);
+OBJC_EXPORT NXExceptionRaiser NXDefaultExceptionRaiser;
+
+
+/* The error buffer is used to allocate data which is passed up to other
+   handlers.  Clients should clear the error buffer in their top level
+   handler.  The Application Kit does this.
+ */
+OBJC_EXPORT void NXAllocErrorData(int size, void **data);
+OBJC_EXPORT void NXResetErrorData(void);
+
+#endif /* _OBJC_ERROR_H_ */
diff --git a/runtime/hashtable2.h b/runtime/hashtable2.h
new file mode 100644 (file)
index 0000000..ecb94be
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+    hashtable2.h
+    Scalable hash table.
+    Copyright 1989-1996 NeXT Software, Inc.
+*/
+
+#warning the API in this header is obsolete
+
+#ifndef _OBJC_LITTLE_HASHTABLE_H_
+#define _OBJC_LITTLE_HASHTABLE_H_
+
+#import <objc/objc.h>
+
+/*************************************************************************
+ *     Hash tables of arbitrary data
+ *************************************************************************/
+
+/* This module allows hashing of arbitrary data.  Such data must be pointers or integers, and client is responsible for allocating/deallocating this data.  A deallocation call-back is provided.
+The objective C class HashTable is prefered when dealing with (key, values) associations because it is easier to use in that situation.
+As well-behaved scalable data structures, hash tables double in size when they start becoming full, thus guaranteeing both average constant time access and linear size. */
+
+typedef struct {
+    uarith_t   (*hash)(const void *info, const void *data);
+    int                (*isEqual)(const void *info, const void *data1, const void *data2);
+    void       (*free)(const void *info, void *data);
+    int                style; /* reserved for future expansion; currently 0 */
+    } NXHashTablePrototype;
+    
+/* the info argument allows a certain generality, such as freeing according to some owner information */
+/* invariants assumed by the implementation: 
+       1 - data1 = data2 => hash(data1) = hash(data2)
+           when data varies over time, hash(data) must remain invariant
+                   e.g. if data hashes over a string key, the string must not be changed
+       2- isEqual (data1, data2) => data1= data2
+ */
+
+typedef struct {
+    const NXHashTablePrototype *prototype;
+    unsigned                   count;
+    unsigned                   nbBuckets;
+    void                       *buckets;
+    const void                 *info;
+   } NXHashTable;
+    /* private data structure; may change */
+    
+OBJC_EXPORT NXHashTable *NXCreateHashTableFromZone (NXHashTablePrototype prototype, unsigned capacity, const void *info, void *z);
+OBJC_EXPORT NXHashTable *NXCreateHashTable (NXHashTablePrototype prototype, unsigned capacity, const void *info);
+    /* if hash is 0, pointer hash is assumed */
+    /* if isEqual is 0, pointer equality is assumed */
+    /* if free is 0, elements are not freed */
+    /* capacity is only a hint; 0 creates a small table */
+    /* info allows call backs to be very general */
+
+OBJC_EXPORT void NXFreeHashTable (NXHashTable *table);
+    /* calls free for each data, and recovers table */
+       
+OBJC_EXPORT void NXEmptyHashTable (NXHashTable *table);
+    /* does not deallocate table nor data; keeps current capacity */
+
+OBJC_EXPORT void NXResetHashTable (NXHashTable *table);
+    /* frees each entry; keeps current capacity */
+
+OBJC_EXPORT BOOL NXCompareHashTables (NXHashTable *table1, NXHashTable *table2);
+    /* Returns YES if the two sets are equal (each member of table1 in table2, and table have same size) */
+
+OBJC_EXPORT NXHashTable *NXCopyHashTable (NXHashTable *table);
+    /* makes a fresh table, copying data pointers, not data itself.  */
+       
+OBJC_EXPORT unsigned NXCountHashTable (NXHashTable *table);
+    /* current number of data in table */
+       
+OBJC_EXPORT int NXHashMember (NXHashTable *table, const void *data);
+    /* returns non-0 iff data is present in table.
+    Example of use when the hashed data is a struct containing the key,
+    and when the callee only has a key:
+       MyStruct        pseudo;
+       pseudo.key = myKey;
+       return NXHashMember (myTable, &pseudo)
+    */
+       
+OBJC_EXPORT void *NXHashGet (NXHashTable *table, const void *data);
+    /* return original table data or NULL.
+    Example of use when the hashed data is a struct containing the key,
+    and when the callee only has a key:
+       MyStruct        pseudo;
+       MyStruct        *original;
+       pseudo.key = myKey;
+       original = NXHashGet (myTable, &pseudo)
+    */
+       
+OBJC_EXPORT void *NXHashInsert (NXHashTable *table, const void *data);
+    /* previous data or NULL is returned. */
+       
+OBJC_EXPORT void *NXHashInsertIfAbsent (NXHashTable *table, const void *data);
+    /* If data already in table, returns the one in table
+    else adds argument to table and returns argument. */
+
+OBJC_EXPORT void *NXHashRemove (NXHashTable *table, const void *data);
+    /* previous data or NULL is returned */
+       
+/* Iteration over all elements of a table consists in setting up an iteration state and then to progress until all entries have been visited.  An example of use for counting elements in a table is:
+    unsigned   count = 0;
+    MyData     *data;
+    NXHashState        state = NXInitHashState(table);
+    while (NXNextHashState(table, &state, &data)) {
+       count++;
+    }
+*/
+
+typedef struct {int i; int j;} NXHashState;
+    /* callers should not rely on actual contents of the struct */
+
+OBJC_EXPORT NXHashState NXInitHashState(NXHashTable *table);
+
+OBJC_EXPORT int NXNextHashState(NXHashTable *table, NXHashState *state, void **data);
+    /* returns 0 when all elements have been visited */
+
+/*************************************************************************
+ *     Conveniences for writing hash, isEqual and free functions
+ *     and common prototypes
+ *************************************************************************/
+
+OBJC_EXPORT uarith_t NXPtrHash(const void *info, const void *data);
+    /* scrambles the address bits; info unused */
+OBJC_EXPORT uarith_t NXStrHash(const void *info, const void *data);
+    /* string hashing; info unused */
+OBJC_EXPORT int NXPtrIsEqual(const void *info, const void *data1, const void *data2);
+    /* pointer comparison; info unused */
+OBJC_EXPORT int NXStrIsEqual(const void *info, const void *data1, const void *data2);
+    /* string comparison; NULL ok; info unused */
+OBJC_EXPORT void NXNoEffectFree(const void *info, void *data);
+    /* no effect; info unused */
+OBJC_EXPORT void NXReallyFree(const void *info, void *data);
+    /* frees it; info unused */
+
+/* The two following prototypes are useful for manipulating set of pointers or set of strings; For them free is defined as NXNoEffectFree */
+OBJC_EXPORT const NXHashTablePrototype NXPtrPrototype;
+    /* prototype when data is a pointer (void *) */
+OBJC_EXPORT const NXHashTablePrototype NXStrPrototype;
+    /* prototype when data is a string (char *) */
+
+/* following prototypes help describe mappings where the key is the first element of a struct and is either a pointer or a string.
+For example NXStrStructKeyPrototype can be used to hash pointers to Example, where Example is:
+       typedef struct {
+           char        *key;
+           int         data1;
+           ...
+           } Example
+    
+For the following prototypes, free is defined as NXReallyFree.
+ */
+OBJC_EXPORT const NXHashTablePrototype NXPtrStructKeyPrototype;
+OBJC_EXPORT const NXHashTablePrototype NXStrStructKeyPrototype;
+
+/*************************************************************************
+ *     Unique strings and buffers
+ *************************************************************************/
+
+/* Unique strings allows C users to enjoy the benefits of Lisp's atoms:
+A unique string is a string that is allocated once for all (never de-allocated) and that has only one representant (thus allowing comparison with == instead of strcmp).  A unique string should never be modified (and in fact some memory protection is done to ensure that).  In order to more explicitly insist on the fact that the string has been uniqued, a synonym of (const char *) has been added, NXAtom. */
+
+typedef const char *NXAtom;
+
+OBJC_EXPORT NXAtom NXUniqueString(const char *buffer);
+    /* assumes that buffer is \0 terminated, and returns
+     a previously created string or a new string that is a copy of buffer.
+    If NULL is passed returns NULL.
+    Returned string should never be modified.  To ensure this invariant,
+    allocations are made in a special read only zone. */
+       
+OBJC_EXPORT NXAtom NXUniqueStringWithLength(const char *buffer, int length);
+    /* assumes that buffer is a non NULL buffer of at least 
+    length characters.  Returns a previously created string or 
+    a new string that is a copy of buffer. 
+    If buffer contains \0, string will be truncated.
+    As for NXUniqueString, returned string should never be modified.  */
+       
+OBJC_EXPORT NXAtom NXUniqueStringNoCopy(const char *string);
+    /* If there is already a unique string equal to string, returns the original.  
+    Otherwise, string is entered in the table, without making a copy.  Argument should then never be modified.  */
+       
+OBJC_EXPORT char *NXCopyStringBuffer(const char *buffer);
+    /* given a buffer, allocates a new string copy of buffer.  
+    Buffer should be \0 terminated; returned string is \0 terminated. */
+
+OBJC_EXPORT char *NXCopyStringBufferFromZone(const char *buffer, void *z);
+    /* given a buffer, allocates a new string copy of buffer.  
+    Buffer should be \0 terminated; returned string is \0 terminated. */
+
+#endif /* _OBJC_LITTLE_HASHTABLE_H_ */
diff --git a/runtime/hashtable2.m b/runtime/hashtable2.m
new file mode 100644 (file)
index 0000000..a6cb71a
--- /dev/null
@@ -0,0 +1,645 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+       hashtable2.m
+       Copyright 1989-1996 NeXT Software, Inc.
+       Created by Bertrand Serlet, Feb 89
+ */
+
+#if defined(NeXT_PDO)
+#import <pdo.h>
+#endif
+
+#import <objc/hashtable2.h>
+#import "objc-private.h"
+
+/* Is this in the right spot ? <jf> */
+#if defined(__osf__)
+    #include <stdarg.h>
+#endif
+
+    #import <mach/mach.h>
+    #import <pthread.h>
+
+/* In order to improve efficiency, buckets contain a pointer to an array or directly the data when the array size is 1 */
+typedef union {
+    const void *one;
+    const void **many;
+    } oneOrMany;
+    /* an optimization consists of storing directly data when count = 1 */
+    
+typedef struct {
+    unsigned   count; 
+    oneOrMany  elements;
+    } HashBucket;
+    /* private data structure; may change */
+    
+/*************************************************************************
+ *
+ *     Macros and utilities
+ *     
+ *************************************************************************/
+
+static unsigned log2 (unsigned x) { return (x<2) ? 0 : log2 (x>>1)+1; };
+
+static unsigned exp2m1 (unsigned x) { return (1 << x) - 1; };
+
+#define        PTRSIZE         sizeof(void *)
+
+#define        ALLOCTABLE(z)   ((NXHashTable *) malloc_zone_malloc (z,sizeof (NXHashTable)))
+#define        ALLOCBUCKETS(z,nb)((HashBucket *) malloc_zone_calloc (z, nb, sizeof (HashBucket)))
+#define        ALLOCPAIRS(z,nb) ((const void **) malloc_zone_calloc (z, nb, sizeof (void *)))
+
+/* iff necessary this modulo can be optimized since the nbBuckets is of the form 2**n-1 */
+#define        BUCKETOF(table, data) (((HashBucket *)table->buckets)+((*table->prototype->hash)(table->info, data) % table->nbBuckets))
+
+#define ISEQUAL(table, data1, data2) ((data1 == data2) || (*table->prototype->isEqual)(table->info, data1, data2))
+       /* beware of double evaluation */
+       
+/*************************************************************************
+ *
+ *     Global data and bootstrap
+ *     
+ *************************************************************************/
+static int isEqualPrototype (const void *info, const void *data1, const void *data2) {
+    NXHashTablePrototype       *proto1 = (NXHashTablePrototype *) data1;
+    NXHashTablePrototype       *proto2 = (NXHashTablePrototype *) data2;
+    
+    return (proto1->hash == proto2->hash) && (proto1->isEqual == proto2->isEqual) && (proto1->free == proto2->free) && (proto1->style == proto2->style);
+    };
+    
+static uarith_t hashPrototype (const void *info, const void *data) {
+    NXHashTablePrototype       *proto = (NXHashTablePrototype *) data;
+    
+    return NXPtrHash(info, proto->hash) ^ NXPtrHash(info, proto->isEqual) ^ NXPtrHash(info, proto->free) ^ (uarith_t) proto->style;
+    };
+
+void NXNoEffectFree (const void *info, void *data) {};
+
+static NXHashTablePrototype protoPrototype = {
+    hashPrototype, isEqualPrototype, NXNoEffectFree, 0
+    };
+
+static NXHashTable *prototypes = NULL;
+       /* table of all prototypes */
+
+static void bootstrap (void) {
+    free(malloc(8));
+    prototypes = ALLOCTABLE (malloc_default_zone());
+    prototypes->prototype = &protoPrototype; 
+    prototypes->count = 1;
+    prototypes->nbBuckets = 1; /* has to be 1 so that the right bucket is 0 */
+    prototypes->buckets = ALLOCBUCKETS(malloc_default_zone(),  1);
+    prototypes->info = NULL;
+    ((HashBucket *) prototypes->buckets)[0].count = 1;
+    ((HashBucket *) prototypes->buckets)[0].elements.one = &protoPrototype;
+    };
+
+int NXPtrIsEqual (const void *info, const void *data1, const void *data2) {
+    return data1 == data2;
+    };
+
+/*************************************************************************
+ *
+ *     On z'y va
+ *     
+ *************************************************************************/
+
+NXHashTable *NXCreateHashTable (NXHashTablePrototype prototype, unsigned capacity, const void *info) {
+    return NXCreateHashTableFromZone(prototype, capacity, info, malloc_default_zone());
+}
+
+NXHashTable *NXCreateHashTableFromZone (NXHashTablePrototype prototype, unsigned capacity, const void *info, void *z) {
+    NXHashTable                        *table;
+    NXHashTablePrototype       *proto;
+    
+    table = ALLOCTABLE(z);
+    if (! prototypes) bootstrap ();
+    if (! prototype.hash) prototype.hash = NXPtrHash;
+    if (! prototype.isEqual) prototype.isEqual = NXPtrIsEqual;
+    if (! prototype.free) prototype.free = NXNoEffectFree;
+    if (prototype.style) {
+       _NXLogError ("*** NXCreateHashTable: invalid style\n");
+       return NULL;
+       };
+    proto = NXHashGet (prototypes, &prototype); 
+    if (! proto) {
+       proto
+       = (NXHashTablePrototype *) malloc_zone_malloc (malloc_default_zone(),
+                                                sizeof (NXHashTablePrototype));
+       bcopy ((const char*)&prototype, (char*)proto, sizeof (NXHashTablePrototype));
+       (void) NXHashInsert (prototypes, proto);
+       proto = NXHashGet (prototypes, &prototype);
+       if (! proto) {
+           _NXLogError ("*** NXCreateHashTable: bug\n");
+           return NULL;
+           };
+       };
+    table->prototype = proto; table->count = 0; table->info = info;
+    table->nbBuckets = exp2m1 (log2 (capacity)+1);
+    table->buckets = ALLOCBUCKETS(z, table->nbBuckets);
+    return table;
+    }
+
+static void freeBucketPairs (void (*freeProc)(const void *info, void *data), HashBucket bucket, const void *info) {
+    unsigned   j = bucket.count;
+    const void **pairs;
+    
+    if (j == 1) {
+       (*freeProc) (info, (void *) bucket.elements.one);
+       return;
+       };
+    pairs = bucket.elements.many;
+    while (j--) {
+       (*freeProc) (info, (void *) *pairs);
+       pairs ++;
+       };
+    free (bucket.elements.many);
+    };
+    
+static void freeBuckets (NXHashTable *table, int freeObjects) {
+    unsigned           i = table->nbBuckets;
+    HashBucket         *buckets = (HashBucket *) table->buckets;
+    
+    while (i--) {
+       if (buckets->count) {
+           freeBucketPairs ((freeObjects) ? table->prototype->free : NXNoEffectFree, *buckets, table->info);
+           buckets->count = 0;
+           buckets->elements.one = NULL;
+           };
+       buckets++;
+       };
+    };
+    
+void NXFreeHashTable (NXHashTable *table) {
+    freeBuckets (table, YES);
+    free (table->buckets);
+    free (table);
+    };
+    
+void NXEmptyHashTable (NXHashTable *table) {
+    freeBuckets (table, NO);
+    table->count = 0;
+    }
+
+void NXResetHashTable (NXHashTable *table) {
+    freeBuckets (table, YES);
+    table->count = 0;
+}
+
+BOOL NXIsEqualHashTable (NXHashTable *table1, NXHashTable *table2) {
+    if (table1 == table2) return YES;
+    if (NXCountHashTable (table1) != NXCountHashTable (table2)) return NO;
+    else {
+       void            *data;
+       NXHashState     state = NXInitHashState (table1);
+       while (NXNextHashState (table1, &state, &data)) {
+           if (! NXHashMember (table2, data)) return NO;
+       }
+       return YES;
+    }
+}
+
+BOOL NXCompareHashTables (NXHashTable *table1, NXHashTable *table2) {
+    if (table1 == table2) return YES;
+    if (NXCountHashTable (table1) != NXCountHashTable (table2)) return NO;
+    else {
+       void            *data;
+       NXHashState     state = NXInitHashState (table1);
+       while (NXNextHashState (table1, &state, &data)) {
+           if (! NXHashMember (table2, data)) return NO;
+       }
+       return YES;
+    }
+}
+
+NXHashTable *NXCopyHashTable (NXHashTable *table) {
+    NXHashTable                *new;
+    NXHashState                state = NXInitHashState (table);
+    void               *data;
+    void               *z = malloc_zone_from_ptr(table);
+    
+    new = ALLOCTABLE(z);
+    new->prototype = table->prototype; new->count = 0;
+    new->info = table->info;
+    new->nbBuckets = table->nbBuckets;
+    new->buckets = ALLOCBUCKETS(z, new->nbBuckets);
+    while (NXNextHashState (table, &state, &data))
+       (void) NXHashInsert (new, data);
+    return new;
+    }
+
+unsigned NXCountHashTable (NXHashTable *table) {
+    return table->count;
+    }
+
+int NXHashMember (NXHashTable *table, const void *data) {
+    HashBucket *bucket = BUCKETOF(table, data);
+    unsigned   j = bucket->count;
+    const void **pairs;
+    
+    if (! j) return 0;
+    if (j == 1) {
+       return ISEQUAL(table, data, bucket->elements.one);
+       };
+    pairs = bucket->elements.many;
+    while (j--) {
+       /* we don't cache isEqual because lists are short */
+       if (ISEQUAL(table, data, *pairs)) return 1; 
+       pairs ++;
+       };
+    return 0;
+    }
+
+void *NXHashGet (NXHashTable *table, const void *data) {
+    HashBucket *bucket = BUCKETOF(table, data);
+    unsigned   j = bucket->count;
+    const void **pairs;
+    
+    if (! j) return NULL;
+    if (j == 1) {
+       return ISEQUAL(table, data, bucket->elements.one)
+           ? (void *) bucket->elements.one : NULL; 
+       };
+    pairs = bucket->elements.many;
+    while (j--) {
+       /* we don't cache isEqual because lists are short */
+       if (ISEQUAL(table, data, *pairs)) return (void *) *pairs; 
+       pairs ++;
+       };
+    return NULL;
+    }
+
+static void _NXHashRehash (NXHashTable *table) {
+    /* Rehash: we create a pseudo table pointing really to the old guys,
+    extend self, copy the old pairs, and free the pseudo table */
+    NXHashTable        *old;
+    NXHashState        state;
+    void       *aux;
+    void       *z = malloc_zone_from_ptr(table);
+    
+    old = ALLOCTABLE(z);
+    old->prototype = table->prototype; old->count = table->count; 
+    old->nbBuckets = table->nbBuckets; old->buckets = table->buckets;
+    table->nbBuckets += table->nbBuckets + 1; /* 2 times + 1 */
+    table->count = 0; table->buckets = ALLOCBUCKETS(z, table->nbBuckets);
+    state = NXInitHashState (old);
+    while (NXNextHashState (old, &state, &aux))
+       (void) NXHashInsert (table, aux);
+    freeBuckets (old, NO);
+    if (old->count != table->count)
+       _NXLogError("*** hashtable: count differs after rehashing; probably indicates a broken invariant: there are x and y such as isEqual(x, y) is TRUE but hash(x) != hash (y)\n");
+    free (old->buckets); 
+    free (old);
+    };
+
+void *NXHashInsert (NXHashTable *table, const void *data) {
+    HashBucket *bucket = BUCKETOF(table, data);
+    unsigned   j = bucket->count;
+    const void **pairs;
+    const void **new;
+    void       *z = malloc_zone_from_ptr(table);
+    
+    if (! j) {
+       bucket->count++; bucket->elements.one = data; 
+       table->count++; 
+       return NULL;
+       };
+    if (j == 1) {
+       if (ISEQUAL(table, data, bucket->elements.one)) {
+           const void  *old = bucket->elements.one;
+           bucket->elements.one = data;
+           return (void *) old;
+           };
+       new = ALLOCPAIRS(z, 2);
+       new[1] = bucket->elements.one;
+       *new = data;
+       bucket->count++; bucket->elements.many = new; 
+       table->count++; 
+       if (table->count > table->nbBuckets) _NXHashRehash (table);
+       return NULL;
+       };
+    pairs = bucket->elements.many;
+    while (j--) {
+       /* we don't cache isEqual because lists are short */
+       if (ISEQUAL(table, data, *pairs)) {
+           const void  *old = *pairs;
+           *pairs = data;
+           return (void *) old;
+           };
+       pairs ++;
+       };
+    /* we enlarge this bucket; and put new data in front */
+    new = ALLOCPAIRS(z, bucket->count+1);
+    if (bucket->count) bcopy ((const char*)bucket->elements.many, (char*)(new+1), bucket->count * PTRSIZE);
+    *new = data;
+    free (bucket->elements.many);
+    bucket->count++; bucket->elements.many = new; 
+    table->count++; 
+    if (table->count > table->nbBuckets) _NXHashRehash (table);
+    return NULL;
+    }
+
+void *NXHashInsertIfAbsent (NXHashTable *table, const void *data) {
+    HashBucket *bucket = BUCKETOF(table, data);
+    unsigned   j = bucket->count;
+    const void **pairs;
+    const void **new;
+    void       *z = malloc_zone_from_ptr(table);
+    
+    if (! j) {
+       bucket->count++; bucket->elements.one = data; 
+       table->count++; 
+       return (void *) data;
+       };
+    if (j == 1) {
+       if (ISEQUAL(table, data, bucket->elements.one))
+           return (void *) bucket->elements.one;
+       new = ALLOCPAIRS(z, 2);
+       new[1] = bucket->elements.one;
+       *new = data;
+       bucket->count++; bucket->elements.many = new; 
+       table->count++; 
+       if (table->count > table->nbBuckets) _NXHashRehash (table);
+       return (void *) data;
+       };
+    pairs = bucket->elements.many;
+    while (j--) {
+       /* we don't cache isEqual because lists are short */
+       if (ISEQUAL(table, data, *pairs))
+           return (void *) *pairs;
+       pairs ++;
+       };
+    /* we enlarge this bucket; and put new data in front */
+    new = ALLOCPAIRS(z, bucket->count+1);
+    if (bucket->count) bcopy ((const char*)bucket->elements.many, (char*)(new+1), bucket->count * PTRSIZE);
+    *new = data;
+    free (bucket->elements.many);
+    bucket->count++; bucket->elements.many = new; 
+    table->count++; 
+    if (table->count > table->nbBuckets) _NXHashRehash (table);
+    return (void *) data;
+    }
+
+void *NXHashRemove (NXHashTable *table, const void *data) {
+    HashBucket *bucket = BUCKETOF(table, data);
+    unsigned   j = bucket->count;
+    const void **pairs;
+    const void **new;
+    void       *z = malloc_zone_from_ptr(table);
+    
+    if (! j) return NULL;
+    if (j == 1) {
+       if (! ISEQUAL(table, data, bucket->elements.one)) return NULL;
+       data = bucket->elements.one;
+       table->count--; bucket->count--; bucket->elements.one = NULL;
+       return (void *) data;
+       };
+    pairs = bucket->elements.many;
+    if (j == 2) {
+       if (ISEQUAL(table, data, pairs[0])) {
+           bucket->elements.one = pairs[1]; data = pairs[0];
+           }
+       else if (ISEQUAL(table, data, pairs[1])) {
+           bucket->elements.one = pairs[0]; data = pairs[1];
+           }
+       else return NULL;
+       free (pairs);
+       table->count--; bucket->count--;
+       return (void *) data;
+       };
+    while (j--) {
+       if (ISEQUAL(table, data, *pairs)) {
+           data = *pairs;
+           /* we shrink this bucket */
+           new = (bucket->count-1) 
+               ? ALLOCPAIRS(z, bucket->count-1) : NULL;
+           if (bucket->count-1 != j)
+                   bcopy ((const char*)bucket->elements.many, (char*)new, PTRSIZE*(bucket->count-j-1));
+           if (j)
+                   bcopy ((const char*)(bucket->elements.many + bucket->count-j), (char*)(new+bucket->count-j-1), PTRSIZE*j);
+           free (bucket->elements.many);
+           table->count--; bucket->count--; bucket->elements.many = new;
+           return (void *) data;
+           };
+       pairs ++;
+       };
+    return NULL;
+    }
+
+NXHashState NXInitHashState (NXHashTable *table) {
+    NXHashState        state;
+    
+    state.i = table->nbBuckets;
+    state.j = 0;
+    return state;
+    };
+    
+int NXNextHashState (NXHashTable *table, NXHashState *state, void **data) {
+    HashBucket         *buckets = (HashBucket *) table->buckets;
+    
+    while (state->j == 0) {
+       if (state->i == 0) return NO;
+       state->i--; state->j = buckets[state->i].count;
+       }
+    state->j--;
+    buckets += state->i;
+    *data = (void *) ((buckets->count == 1) 
+               ? buckets->elements.one : buckets->elements.many[state->j]);
+    return YES;
+    };
+
+/*************************************************************************
+ *
+ *     Conveniences
+ *     
+ *************************************************************************/
+
+uarith_t NXPtrHash (const void *info, const void *data) {
+    return (((uarith_t) data) >> 16) ^ ((uarith_t) data);
+    };
+    
+uarith_t NXStrHash (const void *info, const void *data) {
+    register uarith_t  hash = 0;
+    register unsigned char     *s = (unsigned char *) data;
+    /* unsigned to avoid a sign-extend */
+    /* unroll the loop */
+    if (s) for (; ; ) { 
+       if (*s == '\0') break;
+       hash ^= (uarith_t) *s++;
+       if (*s == '\0') break;
+       hash ^= (uarith_t) *s++ << 8;
+       if (*s == '\0') break;
+       hash ^= (uarith_t) *s++ << 16;
+       if (*s == '\0') break;
+       hash ^= (uarith_t) *s++ << 24;
+       }
+    return hash;
+    };
+    
+int NXStrIsEqual (const void *info, const void *data1, const void *data2) {
+    if (data1 == data2) return YES;
+    if (! data1) return ! strlen ((char *) data2);
+    if (! data2) return ! strlen ((char *) data1);
+    if (((char *) data1)[0] != ((char *) data2)[0]) return NO;
+    return (strcmp ((char *) data1, (char *) data2)) ? NO : YES;
+    };
+    
+void NXReallyFree (const void *info, void *data) {
+    free (data);
+    };
+
+/* All the following functions are really private, made non-static only for the benefit of shlibs */
+static uarith_t hashPtrStructKey (const void *info, const void *data) {
+    return NXPtrHash(info, *((void **) data));
+    };
+
+static int isEqualPtrStructKey (const void *info, const void *data1, const void *data2) {
+    return NXPtrIsEqual (info, *((void **) data1), *((void **) data2));
+    };
+
+static uarith_t hashStrStructKey (const void *info, const void *data) {
+    return NXStrHash(info, *((char **) data));
+    };
+
+static int isEqualStrStructKey (const void *info, const void *data1, const void *data2) {
+    return NXStrIsEqual (info, *((char **) data1), *((char **) data2));
+    };
+
+const NXHashTablePrototype NXPtrPrototype = {
+    NXPtrHash, NXPtrIsEqual, NXNoEffectFree, 0
+    };
+
+const NXHashTablePrototype NXStrPrototype = {
+    NXStrHash, NXStrIsEqual, NXNoEffectFree, 0
+    };
+
+const NXHashTablePrototype NXPtrStructKeyPrototype = {
+    hashPtrStructKey, isEqualPtrStructKey, NXReallyFree, 0
+    };
+
+const NXHashTablePrototype NXStrStructKeyPrototype = {
+    hashStrStructKey, isEqualStrStructKey, NXReallyFree, 0
+    };
+
+/*************************************************************************
+ *
+ *     Unique strings
+ *     
+ *************************************************************************/
+
+/* the implementation could be made faster at the expense of memory if the size of the strings were kept around */
+static NXHashTable *uniqueStrings = NULL;
+
+/* this is based on most apps using a few K of strings, and an average string size of 15 using sqrt(2*dataAlloced*perChunkOverhead) */
+#define CHUNK_SIZE     360
+
+static int accessUniqueString = 0;
+
+static char            *z = NULL;
+static vm_size_t       zSize = 0;
+static mutex_t         lock = (mutex_t)0;
+
+static const char *CopyIntoReadOnly (const char *str) {
+    unsigned int       len = strlen (str) + 1;
+    char       *new;
+    
+    if (len > CHUNK_SIZE/2) {  /* dont let big strings waste space */
+       new = malloc (len);
+       bcopy (str, new, len);
+       return new;
+    }
+
+    if (! lock) {
+       lock = (mutex_t)mutex_alloc ();
+       mutex_init (lock);
+       };
+
+    mutex_lock (lock);
+    if (zSize < len) {
+       zSize = CHUNK_SIZE *((len + CHUNK_SIZE - 1) / CHUNK_SIZE);
+       /* not enough room, we try to allocate.  If no room left, too bad */
+       z = malloc (zSize);
+       };
+    
+    new = z;
+    bcopy (str, new, len);
+    z += len;
+    zSize -= len;
+    mutex_unlock (lock);
+    return new;
+    };
+    
+NXAtom NXUniqueString (const char *buffer) {
+    const char *previous;
+    
+    if (! buffer) return buffer;
+    accessUniqueString++;
+    if (! uniqueStrings)
+       uniqueStrings = NXCreateHashTable (NXStrPrototype, 0, NULL);
+    previous = (const char *) NXHashGet (uniqueStrings, buffer);
+    if (previous) return previous;
+    previous = CopyIntoReadOnly (buffer);
+    if (NXHashInsert (uniqueStrings, previous)) {
+       _NXLogError ("*** NXUniqueString: invariant broken\n");
+       return NULL;
+       };
+    return previous;
+    };
+
+NXAtom NXUniqueStringNoCopy (const char *string) {
+    accessUniqueString++;
+    if (! uniqueStrings)
+       uniqueStrings = NXCreateHashTable (NXStrPrototype, 0, NULL);
+    return (const char *) NXHashInsertIfAbsent (uniqueStrings, string);
+    };
+
+#define BUF_SIZE       256
+
+NXAtom NXUniqueStringWithLength (const char *buffer, int length) {
+    NXAtom     atom;
+    char       *nullTermStr;
+    char       stackBuf[BUF_SIZE];
+
+    if (length+1 > BUF_SIZE)
+       nullTermStr = malloc (length+1);
+    else
+       nullTermStr = stackBuf;
+    bcopy (buffer, nullTermStr, length);
+    nullTermStr[length] = '\0';
+    atom = NXUniqueString (nullTermStr);
+    if (length+1 > BUF_SIZE)
+       free (nullTermStr);
+    return atom;
+    };
+
+char *NXCopyStringBufferFromZone (const char *str, void *z) {
+    return strcpy ((char *) malloc_zone_malloc(z, strlen (str) + 1), str);
+    };
+    
+char *NXCopyStringBuffer (const char *str) {
+    return NXCopyStringBufferFromZone(str, malloc_default_zone());
+    };
+
diff --git a/runtime/maptable.h b/runtime/maptable.h
new file mode 100644 (file)
index 0000000..c6ea9f0
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*     maptable.h
+       Scalable hash table of mappings.
+       Bertrand, August 1990
+       Copyright 1990-1996 NeXT Software, Inc.
+*/
+
+#warning the API in this header is obsolete
+
+#ifndef _OBJC_MAPTABLE_H_
+#define _OBJC_MAPTABLE_H_
+
+#import <objc/objc.h>
+
+/***************       Definitions             ***************/
+
+    /* This module allows hashing of arbitrary associations [key -> value].  Keys and values must be pointers or integers, and client is responsible for allocating/deallocating this data.  A deallocation call-back is provided.
+    NX_MAPNOTAKEY (-1) is used internally as a marker, and therefore keys must always be different from -1.
+    As well-behaved scalable data structures, hash tables double in size when they start becoming full, thus guaranteeing both average constant time access and linear size. */
+
+typedef struct _NXMapTable {
+    /* private data structure; may change */
+    const struct _NXMapTablePrototype  *prototype;
+    unsigned   count;
+    unsigned   nbBuckets;
+    void       *buckets;
+} NXMapTable;
+
+typedef struct _NXMapTablePrototype {
+    unsigned   (*hash)(NXMapTable *, const void *key);
+    int                (*isEqual)(NXMapTable *, const void *key1, const void *key2);
+    void       (*free)(NXMapTable *, void *key, void *value);
+    int                style; /* reserved for future expansion; currently 0 */
+} NXMapTablePrototype;
+    
+    /* invariants assumed by the implementation: 
+       A - key != -1
+       B - key1 == key2 => hash(key1) == hash(key2)
+           when key varies over time, hash(key) must remain invariant
+           e.g. if string key, the string must not be changed
+       C - isEqual(key1, key2) => key1 == key2
+    */
+
+#define NX_MAPNOTAKEY  ((void *)(-1))
+
+/***************       Functions               ***************/
+
+OBJC_EXPORT NXMapTable *NXCreateMapTableFromZone(NXMapTablePrototype prototype, unsigned capacity, void *z);
+OBJC_EXPORT NXMapTable *NXCreateMapTable(NXMapTablePrototype prototype, unsigned capacity);
+    /* capacity is only a hint; 0 creates a small table */
+
+OBJC_EXPORT void NXFreeMapTable(NXMapTable *table);
+    /* call free for each pair, and recovers table */
+       
+OBJC_EXPORT void NXResetMapTable(NXMapTable *table);
+    /* free each pair; keep current capacity */
+
+OBJC_EXPORT BOOL NXCompareMapTables(NXMapTable *table1, NXMapTable *table2);
+    /* Returns YES if the two sets are equal (each member of table1 in table2, and table have same size) */
+
+OBJC_EXPORT unsigned NXCountMapTable(NXMapTable *table);
+    /* current number of data in table */
+       
+OBJC_EXPORT void *NXMapMember(NXMapTable *table, const void *key, void **value);
+    /* return original table key or NX_MAPNOTAKEY.  If key is found, value is set */
+       
+OBJC_EXPORT void *NXMapGet(NXMapTable *table, const void *key);
+    /* return original corresponding value or NULL.  When NULL need be stored as value, NXMapMember can be used to test for presence */
+       
+OBJC_EXPORT void *NXMapInsert(NXMapTable *table, const void *key, const void *value);
+    /* override preexisting pair; Return previous value or NULL. */
+       
+OBJC_EXPORT void *NXMapRemove(NXMapTable *table, const void *key);
+    /* previous value or NULL is returned */
+       
+/* Iteration over all elements of a table consists in setting up an iteration state and then to progress until all entries have been visited.  An example of use for counting elements in a table is:
+    unsigned   count = 0;
+    const MyKey        *key;
+    const MyValue      *value;
+    NXMapState state = NXInitMapState(table);
+    while(NXNextMapState(table, &state, &key, &value)) {
+       count++;
+    }
+*/
+
+typedef struct {int index;} NXMapState;
+    /* callers should not rely on actual contents of the struct */
+
+OBJC_EXPORT NXMapState NXInitMapState(NXMapTable *table);
+
+OBJC_EXPORT int NXNextMapState(NXMapTable *table, NXMapState *state, const void **key, const void **value);
+    /* returns 0 when all elements have been visited */
+
+/***************       Conveniences            ***************/
+
+OBJC_EXPORT const NXMapTablePrototype NXPtrValueMapPrototype;
+    /* hashing is pointer/integer hashing;
+      isEqual is identity;
+      free is no-op. */
+OBJC_EXPORT const NXMapTablePrototype NXStrValueMapPrototype;
+    /* hashing is string hashing;
+      isEqual is strcmp;
+      free is no-op. */
+OBJC_EXPORT const NXMapTablePrototype NXObjectMapPrototype;
+    /* for objects; uses methods: hash, isEqual:, free, all for key. */
+
+#endif /* _OBJC_MAPTABLE_H_ */
diff --git a/runtime/maptable.m b/runtime/maptable.m
new file mode 100644 (file)
index 0000000..50e9647
--- /dev/null
@@ -0,0 +1,419 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*     maptable.m
+       Copyright 1990-1996 NeXT Software, Inc.
+       Created by Bertrand Serlet, August 1990
+ */
+
+#if defined(WIN32)
+    #include <winnt-pdo.h>
+#endif
+
+#import "objc-private.h"
+#import "maptable.h"
+
+#import <string.h>
+#import <stdlib.h>
+#import <stdio.h>
+#import <objc/Object.h>
+#import <objc/hashtable2.h>
+
+#if defined(NeXT_PDO)
+    #import <pdo.h>
+#endif
+
+/******                Macros and utilities    ****************************/
+
+#if defined(DEBUG)
+    #define INLINE     
+#else
+    #define INLINE inline
+#endif
+
+typedef struct _MapPair {
+    const void *key;
+    const void *value;
+} MapPair;
+
+static unsigned log2(unsigned x) { return (x<2) ? 0 : log2(x>>1)+1; };
+
+static INLINE unsigned exp2m1(unsigned x) { return (1 << x) - 1; };
+
+/* iff necessary this modulo can be optimized since the nbBuckets is of the form 2**n-1 */
+static INLINE unsigned bucketOf(NXMapTable *table, const void *key) {
+    unsigned   hash = (table->prototype->hash)(table, key);
+    unsigned   xored = (hash & 0xffff) ^ (hash >> 16);
+    return ((xored * 65521) + hash) % table->nbBuckets;
+}
+
+static INLINE int isEqual(NXMapTable *table, const void *key1, const void *key2) {
+    return (key1 == key2) ? 1 : (table->prototype->isEqual)(table, key1, key2);
+}
+
+static INLINE unsigned nextIndex(NXMapTable *table, unsigned index) {
+    return (index+1 >= table->nbBuckets) ? 0 : index+1;
+}
+
+static INLINE void *allocBuckets(void *z, unsigned nb) {
+    MapPair    *pairs = malloc_zone_malloc(z, (nb * sizeof(MapPair)));
+    MapPair    *pair = pairs;
+    while (nb--) { pair->key = NX_MAPNOTAKEY; pair->value = NULL; pair++; }
+    return pairs;
+}
+
+/*****         Global data and bootstrap       **********************/
+
+static int isEqualPrototype (const void *info, const void *data1, const void *data2) {
+    NXHashTablePrototype        *proto1 = (NXHashTablePrototype *) data1;
+    NXHashTablePrototype        *proto2 = (NXHashTablePrototype *) data2;
+
+    return (proto1->hash == proto2->hash) && (proto1->isEqual == proto2->isEqual) && (proto1->free == proto2->free) && (proto1->style == proto2->style);
+    };
+
+static uarith_t hashPrototype (const void *info, const void *data) {
+    NXHashTablePrototype        *proto = (NXHashTablePrototype *) data;
+
+    return NXPtrHash(info, proto->hash) ^ NXPtrHash(info, proto->isEqual) ^ NXPtrHash(info, proto->free) ^ (uarith_t) proto->style;
+    };
+
+static NXHashTablePrototype protoPrototype = {
+    hashPrototype, isEqualPrototype, NXNoEffectFree, 0
+};
+
+static NXHashTable *prototypes = NULL;
+       /* table of all prototypes */
+
+/****          Fundamentals Operations                 **************/
+
+NXMapTable *NXCreateMapTableFromZone(NXMapTablePrototype prototype, unsigned capacity, void *z) {
+    NXMapTable                 *table = malloc_zone_malloc(z, sizeof(NXMapTable));
+    NXMapTablePrototype                *proto;
+    if (! prototypes) prototypes = NXCreateHashTable(protoPrototype, 0, NULL);
+    if (! prototype.hash || ! prototype.isEqual || ! prototype.free || prototype.style) {
+       _NXLogError("*** NXCreateMapTable: invalid creation parameters\n");
+       return NULL;
+    }
+    proto = NXHashGet(prototypes, &prototype); 
+    if (! proto) {
+       proto = malloc(sizeof(NXMapTablePrototype));
+       *proto = prototype;
+       (void)NXHashInsert(prototypes, proto);
+    }
+    table->prototype = proto; table->count = 0;
+    table->nbBuckets = exp2m1(log2(capacity)+1);
+    table->buckets = allocBuckets(z, table->nbBuckets);
+    return table;
+}
+
+NXMapTable *NXCreateMapTable(NXMapTablePrototype prototype, unsigned capacity) {
+    return NXCreateMapTableFromZone(prototype, capacity, malloc_default_zone());
+}
+
+void NXFreeMapTable(NXMapTable *table) {
+    NXResetMapTable(table);
+    free(table->buckets);
+    free(table);
+}
+
+void NXResetMapTable(NXMapTable *table) {
+    MapPair    *pairs = table->buckets;
+    void       (*freeProc)(struct _NXMapTable *, void *, void *) = table->prototype->free;
+    unsigned   index = table->nbBuckets;
+    while (index--) {
+       if (pairs->key != NX_MAPNOTAKEY) {
+           freeProc(table, (void *)pairs->key, (void *)pairs->value);
+           pairs->key = NX_MAPNOTAKEY; pairs->value = NULL;
+       }
+       pairs++;
+    }
+    table->count = 0;
+}
+
+BOOL NXCompareMapTables(NXMapTable *table1, NXMapTable *table2) {
+    if (table1 == table2) return YES;
+    if (table1->count != table2->count) return NO;
+    else {
+       const void *key;
+       const void *value;
+       NXMapState      state = NXInitMapState(table1);
+       while (NXNextMapState(table1, &state, &key, &value)) {
+           if (NXMapMember(table2, key, (void**)&value) == NX_MAPNOTAKEY) return NO;
+       }
+       return YES;
+    }
+}
+
+unsigned NXCountMapTable(NXMapTable *table) { return table->count; }
+
+static int mapSearch = 0;
+static int mapSearchHit = 0;
+static int mapSearchLoop = 0;
+
+static INLINE void *_NXMapMember(NXMapTable *table, const void *key, void **value) {
+    MapPair    *pairs = table->buckets;
+    unsigned   index = bucketOf(table, key);
+    MapPair    *pair = pairs + index;
+    if (pair->key == NX_MAPNOTAKEY) return NX_MAPNOTAKEY;
+    mapSearch ++;
+    if (isEqual(table, pair->key, key)) {
+       *value = (void *)pair->value;
+       mapSearchHit ++;
+       return (void *)pair->key;
+    } else {
+       unsigned        index2 = index;
+       while ((index2 = nextIndex(table, index2)) != index) {
+           mapSearchLoop ++;
+           pair = pairs + index2;
+           if (pair->key == NX_MAPNOTAKEY) return NX_MAPNOTAKEY;
+           if (isEqual(table, pair->key, key)) {
+               *value = (void *)pair->value;
+               return (void *)pair->key;
+           }
+       }
+       return NX_MAPNOTAKEY;
+    }
+}
+
+void *NXMapMember(NXMapTable *table, const void *key, void **value) {
+    return _NXMapMember(table, key, value);
+}
+
+void *NXMapGet(NXMapTable *table, const void *key) {
+    void       *value;
+    return (_NXMapMember(table, key, &value) != NX_MAPNOTAKEY) ? value : NULL;
+}
+
+static int mapRehash = 0;
+static int mapRehashSum = 0;
+
+static void _NXMapRehash(NXMapTable *table) {
+    MapPair    *pairs = table->buckets;
+    MapPair    *pair = pairs;
+    unsigned   index = table->nbBuckets;
+    unsigned   oldCount = table->count;
+    table->nbBuckets += table->nbBuckets + 1; /* 2 times + 1 */
+    table->count = 0; 
+    table->buckets = allocBuckets(malloc_zone_from_ptr(table), table->nbBuckets);
+    mapRehash ++;
+    mapRehashSum += table->count;
+    while (index--) {
+       if (pair->key != NX_MAPNOTAKEY) {
+           (void)NXMapInsert(table, pair->key, pair->value);
+       }
+       pair++;
+    }
+    if (oldCount != table->count)
+       _NXLogError("*** maptable: count differs after rehashing; probably indicates a broken invariant: there are x and y such as isEqual(x, y) is TRUE but hash(x) != hash (y)\n");
+    free(pairs); 
+}
+
+static int mapInsert = 0;
+static int mapInsertHit = 0;
+static int mapInsertLoop = 0;
+
+void *NXMapInsert(NXMapTable *table, const void *key, const void *value) {
+    MapPair    *pairs = table->buckets;
+    unsigned   index = bucketOf(table, key);
+    MapPair    *pair = pairs + index;
+    if (key == NX_MAPNOTAKEY) {
+       _NXLogError("*** NXMapInsert: invalid key: -1\n");
+       return NULL;
+    }
+    mapInsert ++;
+    if (pair->key == NX_MAPNOTAKEY) {
+       mapInsertHit ++;
+       pair->key = key; pair->value = value;
+       table->count++;
+       return NULL;
+    }
+    if (isEqual(table, pair->key, key)) {
+       const void      *old = pair->value;
+       mapInsertHit ++;
+       if (old != value) pair->value = value;/* avoid writing unless needed! */
+       return (void *)old;
+    } else if (table->count == table->nbBuckets) {
+       /* no room: rehash and retry */
+       _NXMapRehash(table);
+       return NXMapInsert(table, key, value);
+    } else {
+       unsigned        index2 = index;
+       while ((index2 = nextIndex(table, index2)) != index) {
+           mapInsertLoop ++;
+           pair = pairs + index2;
+           if (pair->key == NX_MAPNOTAKEY) {
+    #if INSERT_TAIL
+              pair->key = key; pair->value = value;
+    #else
+              MapPair         current = {key, value};
+              index2 = index;
+              while (current.key != NX_MAPNOTAKEY) {
+                  MapPair             temp;
+                  pair = pairs + index2;
+                  temp = *pair;
+                  *pair = current;
+                  current = temp;
+                  index2 = nextIndex(table, index2);
+              }
+    #endif
+               table->count++;
+               if (table->count * 4 > table->nbBuckets * 3) _NXMapRehash(table);
+               return NULL;
+           }
+           if (isEqual(table, pair->key, key)) {
+               const void      *old = pair->value;
+               if (old != value) pair->value = value;/* avoid writing unless needed! */
+               return (void *)old;
+           }
+       }
+       /* no room: can't happen! */
+       _NXLogError("**** NXMapInsert: bug\n");
+       return NULL;
+    }
+}
+
+static int mapRemove = 0;
+
+void *NXMapRemove(NXMapTable *table, const void *key) {
+    MapPair    *pairs = table->buckets;
+    unsigned   index = bucketOf(table, key);
+    MapPair    *pair = pairs + index;
+    unsigned   chain = 1; /* number of non-nil pairs in a row */
+    int                found = 0;
+    const void *old = NULL;
+    if (pair->key == NX_MAPNOTAKEY) return NULL;
+    mapRemove ++;
+    /* compute chain */
+    {
+       unsigned        index2 = index;
+       if (isEqual(table, pair->key, key)) {found ++; old = pair->value; }
+       while ((index2 = nextIndex(table, index2)) != index) {
+           pair = pairs + index2;
+           if (pair->key == NX_MAPNOTAKEY) break;
+           if (isEqual(table, pair->key, key)) {found ++; old = pair->value; }
+           chain++;
+       }
+    }
+    if (! found) return NULL;
+    if (found != 1) _NXLogError("**** NXMapRemove: incorrect table\n");
+    /* remove then reinsert */
+    {
+       MapPair buffer[16];
+       MapPair *aux = (chain > 16) ? malloc(sizeof(MapPair)*(chain-1)) : buffer;
+       int     auxnb = 0;
+       int     nb = chain;
+       unsigned        index2 = index;
+       while (nb--) {
+           pair = pairs + index2;
+           if (! isEqual(table, pair->key, key)) aux[auxnb++] = *pair;
+           pair->key = NX_MAPNOTAKEY; pair->value = NULL;
+           index2 = nextIndex(table, index2);
+       }
+       table->count -= chain;
+       if (auxnb != chain-1) _NXLogError("**** NXMapRemove: bug\n");
+       while (auxnb--) NXMapInsert(table, aux[auxnb].key, aux[auxnb].value);
+       if (chain > 16) free(aux);
+    }
+    return (void *)old;
+}
+
+NXMapState NXInitMapState(NXMapTable *table) {
+    NXMapState state;
+    state.index = table->nbBuckets;
+    return state;
+}
+    
+int NXNextMapState(NXMapTable *table, NXMapState *state, const void **key, const void **value) {
+    MapPair    *pairs = table->buckets;
+    while (state->index--) {
+       MapPair *pair = pairs + state->index;
+       if (pair->key != NX_MAPNOTAKEY) {
+           *key = pair->key; *value = pair->value;
+           return YES;
+       }
+    }
+    return NO;
+}
+
+/****          Conveniences            *************************************/
+
+static unsigned _mapPtrHash(NXMapTable *table, const void *key) {
+    return (((uarith_t) key) >> ARITH_SHIFT) ^ ((uarith_t) key);
+}
+    
+static unsigned _mapStrHash(NXMapTable *table, const void *key) {
+    unsigned           hash = 0;
+    unsigned char      *s = (unsigned char *)key;
+    /* unsigned to avoid a sign-extend */
+    /* unroll the loop */
+    if (s) for (; ; ) { 
+       if (*s == '\0') break;
+       hash ^= *s++;
+       if (*s == '\0') break;
+       hash ^= *s++ << 8;
+       if (*s == '\0') break;
+       hash ^= *s++ << 16;
+       if (*s == '\0') break;
+       hash ^= *s++ << 24;
+    }
+    return hash;
+}
+    
+static unsigned _mapObjectHash(NXMapTable *table, const void *key) {
+    return [(id)key hash];
+}
+    
+static int _mapPtrIsEqual(NXMapTable *table, const void *key1, const void *key2) {
+    return key1 == key2;
+}
+
+static int _mapStrIsEqual(NXMapTable *table, const void *key1, const void *key2) {
+    if (key1 == key2) return YES;
+    if (! key1) return ! strlen ((char *) key2);
+    if (! key2) return ! strlen ((char *) key1);
+    if (((char *) key1)[0] != ((char *) key2)[0]) return NO;
+    return (strcmp((char *) key1, (char *) key2)) ? NO : YES;
+}
+    
+static int _mapObjectIsEqual(NXMapTable *table, const void *key1, const void *key2) {
+    return [(id)key1 isEqual:(id)key2];
+}
+    
+static void _mapNoFree(NXMapTable *table, void *key, void *value) {}
+
+static void _mapObjectFree(NXMapTable *table, void *key, void *value) {
+    [(id)key free];
+}
+
+const NXMapTablePrototype NXPtrValueMapPrototype = {
+    _mapPtrHash, _mapPtrIsEqual, _mapNoFree, 0
+};
+
+const NXMapTablePrototype NXStrValueMapPrototype = {
+    _mapStrHash, _mapStrIsEqual, _mapNoFree, 0
+};
+
+const NXMapTablePrototype NXObjectMapPrototype = {
+    _mapObjectHash, _mapObjectIsEqual, _mapObjectFree, 0
+};
+
diff --git a/runtime/objc-api.h b/runtime/objc-api.h
new file mode 100644 (file)
index 0000000..36ebc0f
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+// Copyright 1988-1996 NeXT Software, Inc.
+
+#if defined(WIN32)
+    #if defined(NSBUILDINGOBJC)
+        #define OBJC_EXPORT __declspec(dllexport) extern
+    #else
+        #if !defined(OBJC_EXPORT)
+            #define OBJC_EXPORT __declspec(dllimport) extern
+        #endif
+    #endif
+    #if !defined(OBJC_IMPORT)
+        #define OBJC_IMPORT __declspec(dllimport) extern
+    #endif
+#endif
+
+#if !defined(OBJC_EXPORT)
+    #define OBJC_EXPORT extern
+#endif
+
+#if !defined(OBJC_IMPORT)
+    #define OBJC_IMPORT extern
+#endif
+
+
+// obsolete
+#if !defined(NEXTPDO)
+    #if defined(WIN32)
+        #define NEXTPDO __declspec(dllimport) extern
+    #else
+        #define NEXTPDO extern
+    #endif
+#endif
diff --git a/runtime/objc-class.h b/runtime/objc-class.h
new file mode 100644 (file)
index 0000000..9a7b57c
--- /dev/null
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     objc-class.h
+ *     Copyright 1988-1996, NeXT Software, Inc.
+ */
+
+#ifndef _OBJC_CLASS_H_
+#define _OBJC_CLASS_H_
+
+#import <objc/objc.h>
+/* 
+ *     Class Template
+ */
+struct objc_class {                    
+       struct objc_class *isa; 
+       struct objc_class *super_class; 
+       const char *name;               
+       long version;
+       long info;
+       long instance_size;
+       struct objc_ivar_list *ivars;
+
+#if defined(Release3CompatibilityBuild)
+       struct objc_method_list *methods;
+#else
+       struct objc_method_list **methodLists;
+#endif
+
+       struct objc_cache *cache;
+       struct objc_protocol_list *protocols;
+};
+#define CLS_GETINFO(cls,infomask)      ((cls)->info & infomask)
+#define CLS_SETINFO(cls,infomask)      ((cls)->info |= infomask)
+
+#define CLS_CLASS              0x1L
+#define CLS_META               0x2L
+#define CLS_INITIALIZED                0x4L
+#define CLS_POSING             0x8L
+#define CLS_MAPPED             0x10L
+#define CLS_FLUSH_CACHE                0x20L
+#define CLS_GROW_CACHE         0x40L
+#define CLS_METHOD_ARRAY        0x100L
+/* 
+ *     Category Template
+ */
+typedef struct objc_category *Category;
+
+struct objc_category {
+       char *category_name;
+       char *class_name;
+       struct objc_method_list *instance_methods;
+       struct objc_method_list *class_methods;
+       struct objc_protocol_list *protocols;
+};
+/* 
+ *     Instance Variable Template
+ */
+typedef struct objc_ivar *Ivar;
+
+struct objc_ivar_list {
+       int ivar_count;
+#ifdef __alpha__
+       int space;
+#endif
+       struct objc_ivar {
+               char *ivar_name;
+               char *ivar_type;
+               int ivar_offset;
+#ifdef __alpha__
+               int space;
+#endif
+       } ivar_list[1];                 /* variable length structure */
+};
+
+OBJC_EXPORT Ivar object_setInstanceVariable(id, const char *name, void *);
+OBJC_EXPORT Ivar object_getInstanceVariable(id, const char *name, void **);
+
+/* 
+ *     Method Template
+ */
+typedef struct objc_method *Method;
+
+struct objc_method_list {
+#if defined(Release3CompatibilityBuild)
+        struct objc_method_list *method_next;
+#else
+       struct objc_method_list *obsolete;
+#endif
+
+       int method_count;
+#ifdef __alpha__
+       int space;
+#endif
+       struct objc_method {
+               SEL method_name;
+               char *method_types;
+                IMP method_imp;
+       } method_list[1];               /* variable length structure */
+};
+
+/* Protocol support */
+
+@class Protocol;
+
+struct objc_protocol_list {
+       struct objc_protocol_list *next;
+       int count;
+       Protocol *list[1];
+};
+
+/* Definitions of filer types */
+
+#define _C_ID          '@'
+#define _C_CLASS       '#'
+#define _C_SEL         ':'
+#define _C_CHR         'c'
+#define _C_UCHR                'C'
+#define _C_SHT         's'
+#define _C_USHT                'S'
+#define _C_INT         'i'
+#define _C_UINT                'I'
+#define _C_LNG         'l'
+#define _C_ULNG                'L'
+#define _C_FLT         'f'
+#define _C_DBL         'd'
+#define _C_BFLD                'b'
+#define _C_VOID                'v'
+#define _C_UNDEF       '?'
+#define _C_PTR         '^'
+#define _C_CHARPTR     '*'
+#define _C_ARY_B       '['
+#define _C_ARY_E       ']'
+#define _C_UNION_B     '('
+#define _C_UNION_E     ')'
+#define _C_STRUCT_B    '{'
+#define _C_STRUCT_E    '}'
+
+/* Structure for method cache - allocated/sized at runtime */
+
+typedef struct objc_cache *    Cache;
+
+#define CACHE_BUCKET_NAME(B)  ((B)->method_name)
+#define CACHE_BUCKET_IMP(B)   ((B)->method_imp)
+#define CACHE_BUCKET_VALID(B) (B)
+struct objc_cache {
+       unsigned int mask;            /* total = mask + 1 */
+       unsigned int occupied;        
+       Method buckets[1];
+};
+
+/* operations */
+OBJC_EXPORT id class_createInstance(Class, unsigned idxIvars);
+OBJC_EXPORT id class_createInstanceFromZone(Class, unsigned idxIvars, void *z);
+
+OBJC_EXPORT void class_setVersion(Class, int);
+OBJC_EXPORT int class_getVersion(Class);
+
+OBJC_EXPORT Ivar class_getInstanceVariable(Class, const char *);
+OBJC_EXPORT Method class_getInstanceMethod(Class, SEL);
+OBJC_EXPORT Method class_getClassMethod(Class, SEL);
+
+OBJC_EXPORT void class_addMethods(Class, struct objc_method_list *);
+OBJC_EXPORT void class_removeMethods(Class, struct objc_method_list *);
+
+OBJC_EXPORT Class class_poseAs(Class imposter, Class original);
+
+OBJC_EXPORT unsigned method_getNumberOfArguments(Method);
+OBJC_EXPORT unsigned method_getSizeOfArguments(Method);
+OBJC_EXPORT unsigned method_getArgumentInfo(Method m, int arg, const char **type, int *offset);
+OBJC_EXPORT const char * NSModulePathForClass (Class aClass);
+
+// usage for nextMethodList
+//
+// void *iterator = 0;
+// struct objc_method_list *mlist;
+// while ( mlist = class_nextMethodList( cls, &iterator ) )
+//    ;
+#define OBJC_NEXT_METHOD_LIST 1
+OBJC_EXPORT struct objc_method_list *class_nextMethodList(Class, void **);
+
+typedef void *marg_list;
+
+#if hppa
+
+#define marg_malloc(margs, method) \
+       do { \
+               unsigned int _sz = (7 + method_getSizeOfArguments(method)) & ~7; \
+               char *_ml = (char *)malloc(_sz + sizeof(marg_list)); \
+               void    **_z ; \
+               margs = (marg_list *)(_ml + _sz); \
+               _z = margs; \
+               *_z = (marg_list)_ml; \
+       } while (0)
+
+#define marg_free(margs) \
+       do { \
+               void    **_z = margs; \
+               free(*_z); \
+       } while (0)
+       
+#define marg_adjustedOffset(method, offset) \
+       ( (!offset) ? -(sizeof(id)) : offset)
+
+#else
+
+#if defined(__ppc__) || defined(ppc)
+#define marg_prearg_size       128
+#else
+#define marg_prearg_size       0
+#endif
+
+#define marg_malloc(margs, method) \
+       do { \
+               margs = (marg_list *)malloc (marg_prearg_size + ((7 + method_getSizeOfArguments(method)) & ~7)); \
+       } while (0)
+
+
+#define marg_free(margs) \
+       do { \
+               free(margs); \
+       } while (0)
+       
+#define marg_adjustedOffset(method, offset) \
+       (marg_prearg_size + offset)
+
+#endif /* hppa */
+
+
+#define marg_getRef(margs, offset, type) \
+       ( (type *)((char *)margs + marg_adjustedOffset(method,offset) ) )
+
+#define marg_getValue(margs, offset, type) \
+       ( *marg_getRef(margs, offset, type) )
+
+#define marg_setValue(margs, offset, type, value) \
+       ( marg_getValue(margs, offset, type) = (value) )
+
+/* Load categories and non-referenced classes from libraries. */
+#if defined(NeXT_PDO)
+#if defined(__hpux__) || defined(hpux)
+
+#define OBJC_REGISTER_SYMBOL(NAME) asm("._" #NAME "=0\n .globl ._" #NAME "\n")
+#define OBJC_REFERENCE_SYMBOL(NAME) asm(".SPACE $PRIVATE$\n\t.SUBSPA $DATA$\n\t.word ._" #NAME "\n\t.SPACE $TEXT$\n\t.SUBSPA $CODE$\n")
+#define OBJC_REGISTER_CATEGORY(NAME) asm("._" #NAME "=0\n .globl ._" #NAME "\n")
+#define OBJC_REFERENCE_CATEGORY(NAME) asm(".SPACE $PRIVATE$\n\t.SUBSPA $DATA$\n\t.word ._" #NAME "\n\t.SPACE $TEXT$\n\t.SUBSPA $CODE$\n")
+#define OBJC_REFERENCE_CLASS_CATEGORY(CL, CAT) asm(".SPACE $PRIVATE$\n\t.SUBSPA $DATA$\n\t.word .objc_category_name_" #CL "_" #CAT "\n\t.SPACE $TEXT$\n\t.SUBSPA $CODE$\n")
+#define OBJC_REFERENCE_CLASS(NAME) asm(".SPACE $PRIVATE$\n\t.SUBSPA $DATA$\n\t.word .objc_class_name_" #NAME "\n\t.SPACE $TEXT$\n\t.SUBSPA $CODE$\n")
+
+#elif defined(__osf__)
+
+#define OBJC_REGISTER_SYMBOL(NAME) asm(".globl ._" #NAME "\n\t.align 3\n._" #NAME ":\n\t.quad 0\n")
+#define OBJC_REFERENCE_SYMBOL(NAME) asm(".align 3\n\t.quad ._" #NAME "\n")
+#define OBJC_REGISTER_CATEGORY(NAME) asm(".globl ._" #NAME "\n\t.align 3\n._" #NAME ":\n\t.quad 0\n")
+#define OBJC_REFERENCE_CATEGORY(NAME) asm(".align 3\n\t.quad ._" #NAME "\n")
+#define OBJC_REFERENCE_CLASS_CATEGORY(CL, CAT) asm(".align 3\n\t.quad .objc_category_name_" #CL "_" #CAT "\n")
+#define OBJC_REFERENCE_CLASS(NAME) asm(".quad .objc_class_name_" #NAME "\n")
+
+#else  /* Solaris || SunOS */
+
+#define OBJC_REGISTER_SYMBOL(NAME) asm("._" #NAME "=0\n .globl ._" #NAME "\n")
+#define OBJC_REFERENCE_SYMBOL(NAME) asm(".global ._" #NAME "\n")
+#define OBJC_REGISTER_CATEGORY(NAME) asm("._" #NAME "=0\n .globl ._" #NAME "\n")
+#define OBJC_REFERENCE_CATEGORY(NAME) asm(".global ._" #NAME "\n")
+#define OBJC_REFERENCE_CLASS_CATEGORY(CL, CAT) asm(".global .objc_category_name_" #CL "_" #CAT "\n")
+#define OBJC_REFERENCE_CLASS(NAME) asm(".global .objc_class_name_" #NAME "\n")
+
+#endif /* __hpux__ || hpux */
+#endif /* NeXT_PDO */
+
+#endif /* _OBJC_CLASS_H_ */
diff --git a/runtime/objc-class.m b/runtime/objc-class.m
new file mode 100644 (file)
index 0000000..71b8c9e
--- /dev/null
@@ -0,0 +1,3249 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/***********************************************************************
+ *     objc-class.m
+ *     Copyright 1988-1997, Apple Computer, Inc.
+ *     Author: s. naroff
+ **********************************************************************/
+
+/***********************************************************************
+ * Imports.
+ **********************************************************************/
+
+#ifdef __MACH__
+       #import <mach/mach_interface.h>
+       #include <mach-o/ldsyms.h>
+       #include <mach-o/dyld.h>
+#endif
+
+#ifdef WIN32
+       #include <io.h>
+       #include <fcntl.h>
+       #include <winnt-pdo.h>
+#else
+       #include <sys/types.h>
+       #include <unistd.h>
+       #include <stdlib.h>
+       #include <sys/uio.h>
+       #ifdef __svr4__
+               #include <fcntl.h>
+       #else
+               #include <sys/fcntl.h>
+       #endif
+#endif 
+
+#if defined(__svr4__) || defined(__hpux__) || defined(hpux)
+       #import <pdo.h>
+#endif
+
+#import <objc/Object.h>
+#import <objc/objc-runtime.h>
+#import "objc-private.h"
+#import "hashtable2.h"
+#import "maptable.h"
+
+#include <sys/types.h>
+
+#include <CoreFoundation/CFDictionary.h>
+
+// Needed functions not in any header file
+size_t malloc_size (const void * ptr);
+
+// Needed kernel interface
+#import <mach/mach.h>
+#ifdef __MACH__
+#import <mach/thread_status.h>
+#endif
+
+// This is currently disabled in this file, because it is called a LOT here; turn it on when needed.
+#if 0 && defined(__MACH__)
+extern int ptrace(int, int, int, int); 
+// ObjC is assigned the range 0xb000 - 0xbfff for first parameter; this file 0xb300-0xb3ff
+#else
+#define ptrace(a, b, c, d) do {} while (0)
+#endif
+
+/***********************************************************************
+ * Conditionals.
+ **********************************************************************/
+
+// Define PRELOAD_SUPERCLASS_CACHES to cause method lookups to add the
+// method the appropriate superclass caches, in addition to the normal
+// encaching in the subclass where the method was messaged.  Doing so
+// will speed up messaging the same method from instances of the
+// superclasses, but also uses up valuable cache space for a speculative
+// purpose
+//#define PRELOAD_SUPERCLASS_CACHES
+
+/***********************************************************************
+ * Exports.
+ **********************************************************************/
+
+#ifdef OBJC_INSTRUMENTED
+enum {
+       CACHE_HISTOGRAM_SIZE    = 512
+};
+
+unsigned int   CacheHitHistogram [CACHE_HISTOGRAM_SIZE];
+unsigned int   CacheMissHistogram [CACHE_HISTOGRAM_SIZE];
+#endif
+
+/***********************************************************************
+ * Constants and macros internal to this module.
+ **********************************************************************/
+
+// INIT_CACHE_SIZE and INIT_META_CACHE_SIZE must be a power of two
+enum {
+       INIT_CACHE_SIZE_LOG2            = 2,
+       INIT_META_CACHE_SIZE_LOG2       = 2,
+       INIT_CACHE_SIZE                 = (1 << INIT_CACHE_SIZE_LOG2),
+       INIT_META_CACHE_SIZE            = (1 << INIT_META_CACHE_SIZE_LOG2)
+};
+
+// Amount of space required for count hash table buckets, knowing that
+// one entry is embedded in the cache structure itself
+#define TABLE_SIZE(count)      ((count - 1) * sizeof(Method))
+
+// Class state
+#define ISCLASS(cls)           ((((struct objc_class *) cls)->info & CLS_CLASS) != 0)
+#define ISMETA(cls)            ((((struct objc_class *) cls)->info & CLS_META) != 0)
+#define GETMETA(cls)           (ISMETA(cls) ? ((struct objc_class *) cls) : ((struct objc_class *) cls)->isa)
+#define ISINITIALIZED(cls)     ((GETMETA(cls)->info & CLS_INITIALIZED) != 0)
+#define MARKINITIALIZED(cls)   (GETMETA(cls)->info |= CLS_INITIALIZED)
+
+/***********************************************************************
+ * Types internal to this module.
+ **********************************************************************/
+
+#ifdef OBJC_INSTRUMENTED
+struct CacheInstrumentation
+{
+       unsigned int    hitCount;               // cache lookup success tally
+       unsigned int    hitProbes;              // sum entries checked to hit
+       unsigned int    maxHitProbes;           // max entries checked to hit
+       unsigned int    missCount;              // cache lookup no-find tally
+       unsigned int    missProbes;             // sum entries checked to miss
+       unsigned int    maxMissProbes;          // max entries checked to miss
+       unsigned int    flushCount;             // cache flush tally
+       unsigned int    flushedEntries;         // sum cache entries flushed
+       unsigned int    maxFlushedEntries;      // max cache entries flushed
+};
+typedef struct CacheInstrumentation    CacheInstrumentation;
+
+// Cache instrumentation data follows table, so it is most compatible
+#define CACHE_INSTRUMENTATION(cache)   (CacheInstrumentation *) &cache->buckets[cache->mask + 1];
+#endif
+
+/***********************************************************************
+ * Function prototypes internal to this module.
+ **********************************************************************/
+
+static Ivar            class_getVariable               (Class cls, const char * name);
+static void            flush_caches                    (Class cls, BOOL flush_meta);
+static void            addClassToOriginalClass (Class posingClass, Class originalClass);
+static void            _objc_addOrigClass              (Class origClass);
+static void            _freedHandler                   (id self, SEL sel); 
+static void            _nonexistentHandler             (id self, SEL sel);
+static void            class_initialize                (Class clsDesc);
+static void *  objc_malloc                             (int byteCount);
+static Cache   _cache_expand                   (Class cls);
+static int             LogObjCMessageSend              (BOOL isClassMethod, const char * objectsClass, const char * implementingClass, SEL selector);
+static void            _cache_fill                             (Class cls, Method smt, SEL sel);
+static void            _cache_flush                    (Class cls);
+static Method  _class_lookupMethod             (Class cls, SEL sel);
+static int             SubtypeUntil                    (const char * type, char end); 
+static const char *    SkipFirstType           (const char * type); 
+
+#ifdef OBJC_COLLECTING_CACHE
+static unsigned long   _get_pc_for_thread      (mach_port_t thread);
+static int             _collecting_in_critical (void);
+static void            _garbage_make_room              (void);
+static void            _cache_collect_free             (void * data, BOOL tryCollect);
+#endif
+
+static void            _cache_print                    (Cache cache);
+static unsigned int    log2                            (unsigned int x);
+static void            PrintCacheHeader                (void);
+#ifdef OBJC_INSTRUMENTED
+static void            PrintCacheHistogram             (char * title, unsigned int * firstEntry, unsigned int entryCount);
+#endif
+
+/***********************************************************************
+ * Static data internal to this module.
+ **********************************************************************/
+
+// When _class_uncache is non-zero, cache growth copies the existing
+// entries into the new (larger) cache.  When this flag is zero, new
+// (larger) caches start out empty.
+static int     _class_uncache          = 1;
+
+// When _class_slow_grow is non-zero, any given cache is actually grown
+// only on the odd-numbered times it becomes full; on the even-numbered
+// times, it is simply emptied and re-used.  When this flag is zero,
+// caches are grown every time.
+static int     _class_slow_grow        = 1;
+
+// Locks for cache access
+#ifdef OBJC_COLLECTING_CACHE
+// Held when adding an entry to the cache
+static OBJC_DECLARE_LOCK(cacheUpdateLock);
+
+// Held when freeing memory from garbage
+static OBJC_DECLARE_LOCK(cacheCollectionLock);
+#endif
+
+// Held when looking in, adding to, or freeing the cache.
+#ifdef OBJC_COLLECTING_CACHE
+// For speed, messageLock is not held by the method dispatch code.
+// Instead the cache freeing code checks thread PCs to ensure no
+// one is dispatching.  messageLock is held, though, during less
+// time critical operations.
+#endif
+OBJC_DECLARE_LOCK(messageLock);
+
+CFMutableDictionaryRef _classIMPTables = NULL;
+
+// When traceDuplicates is non-zero, _cacheFill checks whether the method
+// being encached is already there.  The number of times it finds a match
+// is tallied in cacheFillDuplicates.  When traceDuplicatesVerbose is
+// non-zero, each duplication is logged when found in this way.
+#ifdef OBJC_COLLECTING_CACHE
+static int     traceDuplicates         = 0;
+static int     traceDuplicatesVerbose  = 0;
+static int     cacheFillDuplicates     = 0;
+#endif 
+
+#ifdef OBJC_INSTRUMENTED
+// Instrumentation
+static unsigned int    LinearFlushCachesCount                  = 0;
+static unsigned int    LinearFlushCachesVisitedCount           = 0;
+static unsigned int    MaxLinearFlushCachesVisitedCount        = 0;
+static unsigned int    NonlinearFlushCachesCount               = 0;
+static unsigned int    NonlinearFlushCachesClassCount          = 0;
+static unsigned int    NonlinearFlushCachesVisitedCount        = 0;
+static unsigned int    MaxNonlinearFlushCachesVisitedCount     = 0;
+static unsigned int    IdealFlushCachesCount                   = 0;
+static unsigned int    MaxIdealFlushCachesCount                = 0;
+#endif
+
+// Method call logging
+typedef int    (*ObjCLogProc)(BOOL, const char *, const char *, SEL);
+
+static int                     totalCacheFills         = 0;
+static int                     objcMsgLogFD            = (-1);
+static ObjCLogProc     objcMsgLogProc          = &LogObjCMessageSend;
+static int                     objcMsgLogEnabled       = 0;
+
+// Error Messages
+static const char
+       _errNoMem[]                                     = "failed -- out of memory(%s, %u)",
+       _errAllocNil[]                          = "allocating nil object",
+       _errFreedObject[]                       = "message %s sent to freed object=0x%lx",
+       _errNonExistentObject[]         = "message %s sent to non-existent object=0x%lx",
+       _errBadSel[]                            = "invalid selector %s",
+       _errNotSuper[]                          = "[%s poseAs:%s]: target not immediate superclass",
+       _errNewVars[]                           = "[%s poseAs:%s]: %s defines new instance variables";
+
+/***********************************************************************
+ * Information about multi-thread support:
+ *
+ * Since we do not lock many operations which walk the superclass, method
+ * and ivar chains, these chains must remain intact once a class is published
+ * by inserting it into the class hashtable.  All modifications must be
+ * atomic so that someone walking these chains will always geta valid
+ * result.
+ ***********************************************************************/
+/***********************************************************************
+ * A static empty cache.  All classes initially point at this cache.
+ * When the first message is sent it misses in the cache, and when
+ * the cache is grown it checks for this case and uses malloc rather
+ * than realloc.  This avoids the need to check for NULL caches in the
+ * messenger.
+ ***********************************************************************/
+
+const struct objc_cache                emptyCache =
+{
+       0,                              // mask
+       0,                              // occupied
+       { NULL }                        // buckets
+};
+
+// Freed objects have their isa set to point to this dummy class.
+// This avoids the need to check for Nil classes in the messenger.
+static const struct objc_class freedObjectClass =
+{
+       Nil,                            // isa
+       Nil,                            // super_class
+       "FREED(id)",                    // name
+       0,                              // version
+       0,                              // info
+       0,                              // instance_size
+       NULL,                           // ivars
+       NULL,                           // methodLists
+       (Cache) &emptyCache,            // cache
+       NULL                            // protocols
+};
+
+static const struct objc_class nonexistentObjectClass =
+{
+       Nil,                            // isa
+       Nil,                            // super_class
+       "NONEXISTENT(id)",              // name
+       0,                              // version
+       0,                              // info
+       0,                              // instance_size
+       NULL,                           // ivars
+       NULL,                           // methodLists
+       (Cache) &emptyCache,            // cache
+       NULL                            // protocols
+};
+
+/***********************************************************************
+ * object_getClassName.
+ **********************************************************************/
+const char *   object_getClassName                (id          obj)
+{
+       // Even nil objects have a class name, sort of
+       if (obj == nil) 
+               return "nil";
+
+       // Retrieve name from object's class
+       return ((struct objc_class *) obj->isa)->name;
+}
+
+/***********************************************************************
+ * object_getIndexedIvars.
+ **********************************************************************/
+void *         object_getIndexedIvars             (id          obj)
+{
+       // ivars are tacked onto the end of the object
+       return ((char *) obj) + ((struct objc_class *) obj->isa)->instance_size;
+}
+
+
+/***********************************************************************
+ * _internal_class_createInstanceFromZone.  Allocate an instance of the
+ * specified class with the specified number of bytes for indexed
+ * variables, in the specified zone.  The isa field is set to the
+ * class, all other fields are zeroed.
+ **********************************************************************/
+static id      _internal_class_createInstanceFromZone (Class           aClass,
+                                               unsigned        nIvarBytes,
+                                               void *  z) 
+{
+       id                      obj; 
+       register unsigned       byteCount;
+
+       // Can't create something for nothing
+       if (aClass == Nil)
+       {
+               __objc_error ((id) aClass, _errAllocNil, 0);
+               return nil;
+       }
+
+       // Allocate and initialize
+       byteCount = ((struct objc_class *) aClass)->instance_size + nIvarBytes;
+       obj = (id) malloc_zone_calloc (z, 1, byteCount);
+       if (!obj)
+       {
+               __objc_error ((id) aClass, _errNoMem, ((struct objc_class *) aClass)->name, nIvarBytes);
+               return nil;
+       }
+       
+       // Set the isa pointer
+       obj->isa = aClass; 
+       return obj;
+} 
+
+/***********************************************************************
+ * _internal_class_createInstance.  Allocate an instance of the specified
+ * class with the specified number of bytes for indexed variables, in
+ * the default zone, using _internal_class_createInstanceFromZone.
+ **********************************************************************/
+static id      _internal_class_createInstance         (Class           aClass,
+                                               unsigned        nIvarBytes) 
+{
+       return _internal_class_createInstanceFromZone (aClass,
+                                       nIvarBytes,
+                                       malloc_default_zone ());
+} 
+
+id (*_poseAs)() = (id (*)())class_poseAs;
+id (*_alloc)(Class, unsigned) = _internal_class_createInstance;
+id (*_zoneAlloc)(Class, unsigned, void *) = _internal_class_createInstanceFromZone;
+
+/***********************************************************************
+ * class_createInstanceFromZone.  Allocate an instance of the specified
+ * class with the specified number of bytes for indexed variables, in
+ * the specified zone, using _zoneAlloc.
+ **********************************************************************/
+id     class_createInstanceFromZone   (Class           aClass,
+                                       unsigned        nIvarBytes,
+                                       void *  z) 
+{
+       // _zoneAlloc can be overridden, but is initially set to
+       // _internal_class_createInstanceFromZone
+       return (*_zoneAlloc) (aClass, nIvarBytes, z);
+} 
+
+/***********************************************************************
+ * class_createInstance.  Allocate an instance of the specified class with
+ * the specified number of bytes for indexed variables, using _alloc.
+ **********************************************************************/
+id     class_createInstance           (Class           aClass,
+                                       unsigned        nIvarBytes) 
+{
+       // _alloc can be overridden, but is initially set to
+       // _internal_class_createInstance
+       return (*_alloc) (aClass, nIvarBytes);
+} 
+
+/***********************************************************************
+ * class_setVersion.  Record the specified version with the class.
+ **********************************************************************/
+void   class_setVersion               (Class           aClass,
+                                       int             version)
+{
+       ((struct objc_class *) aClass)->version = version;
+}
+
+/***********************************************************************
+ * class_getVersion.  Return the version recorded with the class.
+ **********************************************************************/
+int    class_getVersion               (Class           aClass)
+{
+       return ((struct objc_class *) aClass)->version;
+}
+
+static void _addListIMPsToTable(CFMutableDictionaryRef table, struct objc_method_list *mlist, Class cls, void **iterator) {
+    int i;
+    struct objc_method_list *new_mlist;
+    if (!mlist) return;
+    /* Work from end of list so that categories override */
+    new_mlist = _class_inlinedNextMethodList(cls, iterator);
+    _addListIMPsToTable(table, new_mlist, cls, iterator);
+    for (i = 0; i < mlist->method_count; i++) {
+       CFDictionarySetValue(table, mlist->method_list[i].method_name, mlist->method_list[i].method_imp);
+    }
+}
+
+static void _addClassIMPsToTable(CFMutableDictionaryRef table, Class cls) {
+    struct objc_method_list *mlist;
+    void *iterator = 0;
+#ifdef INCLUDE_SUPER_IMPS_IN_IMP_TABLE
+    if (cls->super_class) {    /* Do superclass first so subclass overrides */
+       CFMutableDictionaryRef super_table = CFDictionaryGetValue(_classIMPTables, cls->super_class);
+       if (super_table) {
+           CFIndex cnt;
+           const void **keys, **values, *buffer1[128], *buffer2[128];
+           cnt = CFDictionaryGetCount(super_table);
+           keys = (cnt <= 128) ? buffer1 : CFAllocatorAllocate(NULL, cnt * sizeof(void *), 0);
+           values = (cnt <= 128) ? buffer2 : CFAllocatorAllocate(NULL, cnt * sizeof(void *), 0);
+           CFDictionaryGetKeysAndValues(super_table, keys, values);
+           while (cnt--) {
+               CFDictionarySetValue(table, keys[cnt], values[cnt]);
+           }
+           if (keys != buffer1) CFAllocatorDeallocate(NULL, keys);
+           if (values != buffer2) CFAllocatorDeallocate(NULL, values);
+       } else {
+           _addClassIMPsToTable(table, cls->super_class);
+       }
+    }
+#endif
+    mlist = _class_inlinedNextMethodList(cls, &iterator);
+    _addListIMPsToTable(table, mlist, cls, &iterator);
+}
+
+CFMutableDictionaryRef _getClassIMPTable(Class cls) {
+    CFMutableDictionaryRef table;
+    if (NULL == _classIMPTables) {
+       // maps Classes to mutable dictionaries
+       _classIMPTables = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+    }
+    table = (CFMutableDictionaryRef)CFDictionaryGetValue(_classIMPTables, cls);
+    // IMP table maps SELs to IMPS
+    if (NULL == table) {
+       table = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+       _addClassIMPsToTable(table, cls);
+       CFDictionaryAddValue(_classIMPTables, cls, table);
+    }
+    return table;
+}
+
+static inline Method _findNamedMethodInList(struct objc_method_list * mlist, const char *meth_name) {
+    int i;
+    if (!mlist) return NULL;
+    for (i = 0; i < mlist->method_count; i++) {
+       Method m = &mlist->method_list[i];
+       if (*((const char *)m->method_name) == *meth_name && 0 == strcmp((const char *)(m->method_name), meth_name)) {
+           return m;
+       }
+    }
+    return NULL;
+}
+
+/* These next three functions are the heart of ObjC method lookup. */
+static inline Method _findMethodInList(struct objc_method_list * mlist, SEL sel) {
+    int i;
+    if (!mlist) return NULL;
+    for (i = 0; i < mlist->method_count; i++) {
+       Method m = &mlist->method_list[i];
+       if (m->method_name == sel) {
+           return m;
+       }
+    }
+    return NULL;
+}
+
+static inline Method _findMethodInClass(Class cls, SEL sel) {
+    struct objc_method_list *mlist;
+    void *iterator = 0;
+    while ((mlist = _class_inlinedNextMethodList(cls, &iterator))) {
+       Method m = _findMethodInList(mlist, sel);
+       if (m) return m;
+    }
+    return NULL;
+}
+
+static inline Method _getMethod(Class cls, SEL sel) {
+    for (; cls; cls = cls->super_class) {
+        Method m = _findMethodInClass(cls, sel);
+       if (m) return m;
+    }
+    return NULL;
+}
+
+
+/***********************************************************************
+ * class_getInstanceMethod.  Return the instance method for the
+ * specified class and selector.
+ **********************************************************************/
+Method         class_getInstanceMethod        (Class           aClass,
+                                               SEL             aSelector)
+{
+       // Need both a class and a selector
+       if (!aClass || !aSelector)
+               return NULL;
+
+       // Go to the class
+       return _getMethod (aClass, aSelector);
+}
+
+/***********************************************************************
+ * class_getClassMethod.  Return the class method for the specified
+ * class and selector.
+ **********************************************************************/
+Method         class_getClassMethod           (Class           aClass,
+                                               SEL             aSelector)
+{
+       // Need both a class and a selector
+       if (!aClass || !aSelector)
+               return NULL;
+
+       // Go to the class or isa
+       return _getMethod (GETMETA(aClass), aSelector);
+}
+
+/***********************************************************************
+ * class_getVariable.  Return the named instance variable.
+ **********************************************************************/
+static Ivar    class_getVariable              (Class           cls,
+                                               const char *    name)
+{
+       struct objc_class *     thisCls;
+
+       // Outer loop - search the class and its superclasses
+       for (thisCls = cls; thisCls != Nil; thisCls = ((struct objc_class *) thisCls)->super_class)
+       {
+               int     index;
+               Ivar    thisIvar;
+
+               // Skip class having no ivars
+               if (!thisCls->ivars)
+                       continue;
+
+               // Inner loop - search the given class
+               thisIvar = &thisCls->ivars->ivar_list[0];
+               for (index = 0; index < thisCls->ivars->ivar_count; index += 1)
+               {
+                       // Check this ivar's name.  Be careful because the
+                       // compiler generates ivar entries with NULL ivar_name
+                       // (e.g. for anonymous bit fields).
+                       if ((thisIvar->ivar_name) &&
+                           (strcmp (name, thisIvar->ivar_name) == 0))
+                               return thisIvar;
+
+                       // Move to next ivar
+                       thisIvar += 1;
+               }
+       }
+
+       // Not found
+       return NULL;
+}
+
+/***********************************************************************
+ * class_getInstanceVariable.  Return the named instance variable.
+ *
+ * Someday add class_getClassVariable (). 
+ **********************************************************************/
+Ivar   class_getInstanceVariable              (Class           aClass,
+                                               const char *    name)
+{
+       // Must have a class and a name
+       if (!aClass || !name)
+               return NULL;
+
+       // Look it up
+       return class_getVariable (aClass, name);        
+}
+
+/***********************************************************************
+ * flush_caches.  Flush the instance and optionally class method caches
+ * of cls and all its subclasses.
+ *
+ * Specifying Nil for the class "all classes."
+ **********************************************************************/
+static void    flush_caches           (Class           cls,
+                                       BOOL            flush_meta)
+{
+       int             numClasses = 0, newNumClasses;
+       struct objc_class * *           classes = NULL;
+       int             i;
+       struct objc_class *             clsObject;
+#ifdef OBJC_INSTRUMENTED
+       unsigned int    classesVisited;
+       unsigned int    subclassCount;
+#endif
+
+       // Do nothing if class has no cache
+       if (cls && !((struct objc_class *) cls)->cache)
+               return;
+
+       newNumClasses = objc_getClassList((Class *)NULL, 0);
+       while (numClasses < newNumClasses) {
+               numClasses = newNumClasses;
+               classes = realloc(classes, sizeof(Class) * numClasses);
+               newNumClasses = objc_getClassList((Class *)classes, numClasses);
+       }
+       numClasses = newNumClasses;
+
+       // Handle nil and root instance class specially: flush all
+       // instance and class method caches.  Nice that this
+       // loop is linear vs the N-squared loop just below.     
+       if (!cls || !((struct objc_class *) cls)->super_class)
+       {
+#ifdef OBJC_INSTRUMENTED
+               LinearFlushCachesCount += 1;
+               classesVisited = 0;
+               subclassCount = 0;
+#endif
+               // Traverse all classes in the hash table
+               for (i = 0; i < numClasses; i++)
+               {
+                       struct objc_class *             metaClsObject;
+#ifdef OBJC_INSTRUMENTED
+                       classesVisited += 1;
+#endif
+                       clsObject = classes[i];
+                       
+                       // Skip class that is known not to be a subclass of this root
+                       // (the isa pointer of any meta class points to the meta class
+                       // of the root).
+                       // NOTE: When is an isa pointer of a hash tabled class ever nil?
+                       metaClsObject = ((struct objc_class *) clsObject)->isa;
+                       if (cls && metaClsObject && (((struct objc_class *) metaClsObject)->isa != ((struct objc_class *) metaClsObject)->isa))
+                               continue;
+
+#ifdef OBJC_INSTRUMENTED
+                       subclassCount += 1;
+#endif
+
+                       // Be careful of classes that do not yet have caches
+                       if (((struct objc_class *) clsObject)->cache)
+                               _cache_flush (clsObject);
+                       if (flush_meta && metaClsObject && ((struct objc_class *) metaClsObject)->cache)
+                               _cache_flush (((struct objc_class *) clsObject)->isa);
+               }
+#ifdef OBJC_INSTRUMENTED
+               LinearFlushCachesVisitedCount += classesVisited;
+               if (classesVisited > MaxLinearFlushCachesVisitedCount)
+                       MaxLinearFlushCachesVisitedCount = classesVisited;
+               IdealFlushCachesCount += subclassCount;
+               if (subclassCount > MaxIdealFlushCachesCount)
+                       MaxIdealFlushCachesCount = subclassCount;
+#endif
+
+               free(classes);
+               return;
+       }
+
+       // Outer loop - flush any cache that could now get a method from
+       // cls (i.e. the cache associated with cls and any of its subclasses).
+#ifdef OBJC_INSTRUMENTED
+       NonlinearFlushCachesCount += 1;
+       classesVisited = 0;
+       subclassCount = 0;
+#endif
+       for (i = 0; i < numClasses; i++)
+       {
+               struct objc_class *             clsIter;
+
+#ifdef OBJC_INSTRUMENTED
+               NonlinearFlushCachesClassCount += 1;
+#endif
+               clsObject = classes[i];
+
+               // Inner loop - Process a given class
+               clsIter = clsObject;
+               while (clsIter)
+               {
+
+#ifdef OBJC_INSTRUMENTED
+                       classesVisited += 1;
+#endif
+                       // Flush clsObject instance method cache if
+                       // clsObject is a subclass of cls, or is cls itself
+                       // Flush the class method cache if that was asked for
+                       if (clsIter == cls)
+                       {
+#ifdef OBJC_INSTRUMENTED
+                               subclassCount += 1;
+#endif
+                               _cache_flush (clsObject);
+                               if (flush_meta)
+                                       _cache_flush (clsObject->isa);
+                               
+                               break;
+
+                       }
+                       
+                       // Flush clsObject class method cache if cls is 
+                       // the meta class of clsObject or of one
+                       // of clsObject's superclasses
+                       else if (clsIter->isa == cls)
+                       {
+#ifdef OBJC_INSTRUMENTED
+                               subclassCount += 1;
+#endif
+                               _cache_flush (clsObject->isa);
+                               break;
+                       }
+                       
+                       // Move up superclass chain
+                       else if (ISINITIALIZED(clsIter))
+                               clsIter = clsIter->super_class;
+                       
+                       // clsIter is not initialized, so its cache
+                       // must be empty.  This happens only when
+                       // clsIter == clsObject, because
+                       // superclasses are initialized before
+                       // subclasses, and this loop traverses
+                       // from sub- to super- classes.
+                       else
+                               break;
+               }
+       }
+#ifdef OBJC_INSTRUMENTED
+       NonlinearFlushCachesVisitedCount += classesVisited;
+       if (classesVisited > MaxNonlinearFlushCachesVisitedCount)
+               MaxNonlinearFlushCachesVisitedCount = classesVisited;
+       IdealFlushCachesCount += subclassCount;
+       if (subclassCount > MaxIdealFlushCachesCount)
+               MaxIdealFlushCachesCount = subclassCount;
+#endif
+
+       // Relinquish access to class hash table
+       free(classes);
+}
+
+/***********************************************************************
+ * _objc_flush_caches.  Flush the caches of the specified class and any
+ * of its subclasses.  If cls is a meta-class, only meta-class (i.e.
+ * class method) caches are flushed.  If cls is an instance-class, both
+ * instance-class and meta-class caches are flushed.
+ **********************************************************************/
+void           _objc_flush_caches             (Class           cls)
+{
+       flush_caches (cls, YES);
+}
+
+/***********************************************************************
+ * do_not_remove_this_dummy_function.
+ **********************************************************************/
+void           do_not_remove_this_dummy_function          (void)
+{
+       (void) class_nextMethodList (NULL, NULL);
+}
+
+/***********************************************************************
+ * class_nextMethodList.
+ *
+ * usage:
+ * void *      iterator = 0;
+ * while (class_nextMethodList (cls, &iterator)) {...}
+ **********************************************************************/
+OBJC_EXPORT struct objc_method_list * class_nextMethodList (Class      cls,
+                                                           void **     it)
+{
+    return _class_inlinedNextMethodList(cls, it);
+}
+
+/***********************************************************************
+ * _dummy.
+ **********************************************************************/
+void           _dummy             (void)
+{
+       (void) class_nextMethodList (Nil, NULL);
+}
+
+/***********************************************************************
+ * class_addMethods.
+ *
+ * Formerly class_addInstanceMethods ()
+ **********************************************************************/
+void   class_addMethods       (Class                           cls,
+                               struct objc_method_list *       meths)
+{
+       // Insert atomically.
+       _objc_insertMethods (meths, &((struct objc_class *) cls)->methodLists);
+       
+       // Must flush when dynamically adding methods.  No need to flush
+       // all the class method caches.  If cls is a meta class, though,
+       // this will still flush it and any of its sub-meta classes.
+       flush_caches (cls, NO);
+}
+
+/***********************************************************************
+ * class_addClassMethods.
+ *
+ * Obsolete (for binary compatibility only).
+ **********************************************************************/
+void   class_addClassMethods  (Class                           cls,
+                               struct objc_method_list *       meths)
+{
+       class_addMethods (((struct objc_class *) cls)->isa, meths);
+}
+
+/***********************************************************************
+ * class_removeMethods.
+ **********************************************************************/
+void   class_removeMethods    (Class                           cls,
+                               struct objc_method_list *       meths)
+{
+       // Remove atomically.
+       _objc_removeMethods (meths, &((struct objc_class *) cls)->methodLists);
+       
+       // Must flush when dynamically removing methods.  No need to flush
+       // all the class method caches.  If cls is a meta class, though,
+       // this will still flush it and any of its sub-meta classes.
+       flush_caches (cls, NO); 
+}
+
+/***********************************************************************
+ * addClassToOriginalClass.  Add to a hash table of classes involved in
+ * a posing situation.  We use this when we need to get to the "original" 
+ * class for some particular name through the function objc_getOrigClass.
+ * For instance, the implementation of [super ...] will use this to be
+ * sure that it gets hold of the correct super class, so that no infinite
+ * loops will occur if the class it appears in is involved in posing.
+ *
+ * We use the classLock to guard the hash table.
+ *
+ * See tracker bug #51856.
+ **********************************************************************/
+
+static NXMapTable *    posed_class_hash = NULL;
+static NXMapTable *    posed_class_to_original_class_hash = NULL;
+
+static void    addClassToOriginalClass        (Class   posingClass,
+                                               Class   originalClass)
+{
+       // Install hash table when it is first needed
+       if (!posed_class_to_original_class_hash)
+       {
+               posed_class_to_original_class_hash =
+                       NXCreateMapTableFromZone (NXPtrValueMapPrototype,
+                                                 8,
+                                                 _objc_create_zone ());
+       }
+
+       // Add pose to hash table
+       NXMapInsert (posed_class_to_original_class_hash,
+                    posingClass,
+                    originalClass);
+}
+
+/***********************************************************************
+ * getOriginalClassForPosingClass.
+ **********************************************************************/
+Class  getOriginalClassForPosingClass  (Class  posingClass)
+{
+       return NXMapGet (posed_class_to_original_class_hash, posingClass);
+}
+
+/***********************************************************************
+ * objc_getOrigClass.
+ **********************************************************************/
+Class  objc_getOrigClass                  (const char *        name)
+{
+       struct objc_class *     ret;
+
+       // Look for class among the posers
+       ret = Nil;
+       OBJC_LOCK(&classLock);
+       if (posed_class_hash)
+               ret = (Class) NXMapGet (posed_class_hash, name);
+       OBJC_UNLOCK(&classLock);
+       if (ret)
+               return ret;
+
+       // Not a poser.  Do a normal lookup.
+       ret = objc_getClass (name);
+       if (!ret)
+               _objc_inform ("class `%s' not linked into application", name);
+
+       return ret;
+}
+
+/***********************************************************************
+ * _objc_addOrigClass.  This function is only used from class_poseAs.
+ * Registers the original class names, before they get obscured by 
+ * posing, so that [super ..] will work correctly from categories 
+ * in posing classes and in categories in classes being posed for.
+ **********************************************************************/
+static void    _objc_addOrigClass         (Class       origClass)
+{
+       OBJC_LOCK(&classLock);
+       
+       // Create the poser's hash table on first use
+       if (!posed_class_hash)
+       {
+               posed_class_hash = NXCreateMapTableFromZone (NXStrValueMapPrototype,
+                                                            8,
+                                                            _objc_create_zone ());
+       }
+
+       // Add the named class iff it is not already there (or collides?)
+       if (NXMapGet (posed_class_hash, ((struct objc_class *)origClass)->name) == 0)
+               NXMapInsert (posed_class_hash, ((struct objc_class *)origClass)->name, origClass);
+
+       OBJC_UNLOCK(&classLock);
+}
+
+/***********************************************************************
+ * class_poseAs.
+ *
+ * !!! class_poseAs () does not currently flush any caches.
+ **********************************************************************/
+Class          class_poseAs           (Class           imposter,
+                                       Class           original) 
+{
+       struct objc_class * clsObject;
+       char                    imposterName[256]; 
+       char *                  imposterNamePtr; 
+       NXHashTable *           class_hash;
+       NXHashState             state;
+       struct objc_class *                     copy;
+#ifdef OBJC_CLASS_REFS
+       unsigned int            hidx;
+       unsigned int            hdrCount;
+       header_info *           hdrVector;
+
+       // Get these now before locking, to minimize impact
+       hdrCount  = _objc_headerCount ();
+       hdrVector = _objc_headerVector (NULL);
+#endif
+
+       // Trivial case is easy
+       if (imposter == original) 
+               return imposter;
+
+       // Imposter must be an immediate subclass of the original
+       if (((struct objc_class *)imposter)->super_class != original)
+               return (Class) [(id) imposter error:_errNotSuper, 
+                               ((struct objc_class *)imposter)->name, ((struct objc_class *)original)->name];
+       
+       // Can't pose when you have instance variables (how could it work?)
+       if (((struct objc_class *)imposter)->ivars)
+               return (Class) [(id) imposter error:_errNewVars, ((struct objc_class *)imposter)->name, 
+                               ((struct objc_class *)original)->name, ((struct objc_class *)imposter)->name];
+
+       // Build a string to use to replace the name of the original class.
+       strcpy (imposterName, "_%"); 
+       strcat (imposterName, ((struct objc_class *)original)->name);
+       imposterNamePtr = objc_malloc (strlen (imposterName)+1);
+       strcpy (imposterNamePtr, imposterName);
+
+       // We lock the class hashtable, so we are thread safe with respect to
+       // calls to objc_getClass ().  However, the class names are not
+       // changed atomically, nor are all of the subclasses updated
+       // atomically.  I have ordered the operations so that you will
+       // never crash, but you may get inconsistent results....
+
+       // Register the original class so that [super ..] knows
+       // exactly which classes are the "original" classes.
+       _objc_addOrigClass (original);
+       _objc_addOrigClass (imposter);
+
+       OBJC_LOCK(&classLock);
+
+       class_hash = objc_getClasses ();
+
+       // Remove both the imposter and the original class.
+       NXHashRemove (class_hash, imposter);
+       NXHashRemove (class_hash, original);
+
+       // Copy the imposter, so that the imposter can continue
+       // its normal life in addition to changing the behavior of
+       // the original.  As a hack we don't bother to copy the metaclass.
+       // For some reason we modify the original rather than the copy.
+       copy = (*_zoneAlloc)(imposter->isa, sizeof(struct objc_class), _objc_create_zone());
+       memmove(copy, imposter, sizeof(struct objc_class));
+
+       NXHashInsert (class_hash, copy);
+       addClassToOriginalClass (imposter, copy);
+
+       // Mark the imposter as such
+       CLS_SETINFO(((struct objc_class *)imposter), CLS_POSING);
+       CLS_SETINFO(((struct objc_class *)imposter)->isa, CLS_POSING);
+
+       // Change the name of the imposter to that of the original class.
+       ((struct objc_class *)imposter)->name           = ((struct objc_class *)original)->name;
+       ((struct objc_class *)imposter)->isa->name = ((struct objc_class *)original)->isa->name;
+
+       // Also copy the version field to avoid archiving problems.
+       ((struct objc_class *)imposter)->version = ((struct objc_class *)original)->version;
+
+       // Change all subclasses of the original to point to the imposter.
+       state = NXInitHashState (class_hash);
+       while (NXNextHashState (class_hash, &state, (void **) &clsObject))
+       {
+               while  ((clsObject) && (clsObject != imposter) &&
+                       (clsObject != copy))
+                       {
+                       if (clsObject->super_class == original)
+                       {
+                               clsObject->super_class = imposter;
+                               clsObject->isa->super_class = ((struct objc_class *)imposter)->isa;
+                               // We must flush caches here!
+                               break;
+                       }
+                       
+                       clsObject = clsObject->super_class;
+               }
+       }
+
+#ifdef OBJC_CLASS_REFS
+       // Replace the original with the imposter in all class refs
+       // Major loop - process all headers
+       for (hidx = 0; hidx < hdrCount; hidx += 1)
+       {
+               Class *         cls_refs;
+               unsigned int    refCount;
+               unsigned int    index;
+               
+               // Get refs associated with this header
+               cls_refs = (Class *) _getObjcClassRefs ((headerType *) hdrVector[hidx].mhdr, &refCount);
+               if (!cls_refs || !refCount)
+                       continue;
+
+               // Minor loop - process this header's refs
+               cls_refs = (Class *) ((unsigned long) cls_refs + hdrVector[hidx].image_slide);
+               for (index = 0; index < refCount; index += 1)
+               {
+                       if (cls_refs[index] == original)
+                               cls_refs[index] = imposter;
+               }
+       }
+#endif // OBJC_CLASS_REFS
+
+       // Change the name of the original class.
+       ((struct objc_class *)original)->name       = imposterNamePtr + 1;
+       ((struct objc_class *)original)->isa->name = imposterNamePtr;
+       
+       // Restore the imposter and the original class with their new names.
+       NXHashInsert (class_hash, imposter);
+       NXHashInsert (class_hash, original);
+       
+       OBJC_UNLOCK(&classLock);
+       
+       return imposter;
+}
+
+/***********************************************************************
+ * _freedHandler.
+ **********************************************************************/
+static void    _freedHandler          (id              self,
+                                       SEL             sel) 
+{
+       __objc_error (self, _errFreedObject, SELNAME(sel), self);
+}
+
+/***********************************************************************
+ * _nonexistentHandler.
+ **********************************************************************/
+static void    _nonexistentHandler    (id              self,
+                                       SEL             sel)
+{
+       __objc_error (self, _errNonExistentObject, SELNAME(sel), self);
+}
+
+/***********************************************************************
+ * class_initialize.  Send the 'initialize' message on demand to any
+ * uninitialized class. Force initialization of superclasses first.
+ *
+ * Called only from _class_lookupMethodAndLoadCache (or itself).
+ *
+ * #ifdef OBJC_COLLECTING_CACHE
+ *    The messageLock can be in either state.
+ * #else
+ *    The messageLock is already assumed to be taken out.
+ *    It is temporarily released while the initialize method is sent. 
+ * #endif
+ **********************************************************************/
+static void    class_initialize               (Class           clsDesc)
+{
+       struct objc_class *     super;
+
+       // Skip if someone else beat us to it
+       if (ISINITIALIZED(((struct objc_class *)clsDesc)))
+               return;
+
+       // Force initialization of superclasses first
+       super = ((struct objc_class *)clsDesc)->super_class;
+       if ((super != Nil) && (!ISINITIALIZED(super)))
+               class_initialize (super);
+
+       // Initializing the super class might have initialized us,
+       // or another thread might have initialized us during this time.
+       if (ISINITIALIZED(((struct objc_class *)clsDesc)))
+               return;
+
+       // Mark the class initialized so it can receive the "initialize"
+       // message.  This solution to the catch-22 is the source of a
+       // bug: the class is able to receive messages *from anyone* now
+       // that it is marked, even though initialization is not complete.
+       MARKINITIALIZED(((struct objc_class *)clsDesc));
+
+#ifndef OBJC_COLLECTING_CACHE
+       // Release the message lock so that messages can be sent.
+       OBJC_UNLOCK(&messageLock);
+#endif
+
+       // Send the initialize method.
+       [(id)clsDesc initialize];
+
+#ifndef OBJC_COLLECTING_CACHE
+       // Re-acquire the lock
+       OBJC_LOCK(&messageLock);
+#endif
+
+       return;
+}
+
+/***********************************************************************
+ * _class_install_relationships.  Fill in the class pointers of a class
+ * that was loaded before some or all of the classes it needs to point to.
+ * The deal here is that the class pointer fields have been usurped to
+ * hold the string name of the pertinent class.  Our job is to look up
+ * the real thing based on those stored names.
+ **********************************************************************/
+void   _class_install_relationships           (Class   cls,
+                                               long    version)
+{
+       struct objc_class *             meta;
+       struct objc_class *             clstmp;
+
+       // Get easy access to meta class structure
+       meta = ((struct objc_class *)cls)->isa;
+       
+       // Set version in meta class strucure
+       meta->version = version;
+
+       // Install superclass based on stored name.  No name iff
+       // cls is a root class.
+       if (((struct objc_class *)cls)->super_class)
+       {
+               clstmp = objc_getClass ((const char *) ((struct objc_class *)cls)->super_class);
+               if (!clstmp)
+               {
+                       _objc_inform("failed objc_getClass(%s) for %s->super_class", (const char *)((struct objc_class *)cls)->super_class, ((struct objc_class *)cls)->name);
+                       goto Error;
+               }
+               
+               ((struct objc_class *)cls)->super_class = clstmp;
+       }
+
+       // Install meta's isa based on stored name.  Meta class isa
+       // pointers always point to the meta class of the root class
+       // (root meta class, too, it points to itself!).
+       clstmp = objc_getClass ((const char *) meta->isa);
+       if (!clstmp)
+       {
+               _objc_inform("failed objc_getClass(%s) for %s->isa->isa", (const char *) meta->isa, ((struct objc_class *)cls)->name);
+               goto Error;
+       }
+       
+       meta->isa = clstmp->isa;
+
+       // Install meta's superclass based on stored name.  No name iff
+       // cls is a root class.
+       if (meta->super_class)
+       {
+               // Locate instance class of super class
+               clstmp = objc_getClass ((const char *) meta->super_class);
+               if (!clstmp)
+               {
+                       _objc_inform("failed objc_getClass(%s) for %s->isa->super_class", (const char *)meta->super_class, ((struct objc_class *)cls)->name);
+                       goto Error;
+               }
+               
+               // Store meta class of super class
+               meta->super_class = clstmp->isa;
+       }
+
+       // cls is root, so `tie' the (root) meta class down to its
+       // instance class.  This way, class methods can come from
+       // the root instance class.
+       else
+               ((struct objc_class *)meta)->super_class = cls;
+
+       // Use common static empty cache instead of NULL
+       if (((struct objc_class *)cls)->cache == NULL)
+               ((struct objc_class *)cls)->cache = (Cache) &emptyCache;
+       if (((struct objc_class *)meta)->cache == NULL)
+               ((struct objc_class *)meta)->cache = (Cache) &emptyCache;
+
+       return;
+
+Error:
+       _objc_fatal ("please link appropriate classes in your program");
+}
+
+/***********************************************************************
+ * objc_malloc.
+ **********************************************************************/
+static void *          objc_malloc                (int         byteCount)
+{
+       void *          space;
+
+       space = malloc_zone_malloc (_objc_create_zone (), byteCount);
+       if (!space && byteCount)
+               _objc_fatal ("unable to allocate space");
+
+#ifdef WIN32
+       bzero (space, byteCount);
+#endif
+
+       return space;
+}
+
+
+/***********************************************************************
+ * class_respondsToMethod.
+ *
+ * Called from -[Object respondsTo:] and +[Object instancesRespondTo:]
+ **********************************************************************/
+BOOL   class_respondsToMethod         (Class           cls,
+                                       SEL             sel)
+{
+       struct objc_class *                             thisCls;
+       arith_t                         index;
+       arith_t                         mask;
+       Method *                        buckets;
+       Method                          meth;
+       
+       // No one responds to zero!
+       if (!sel) 
+               return NO;
+
+       // Synchronize access to caches
+       OBJC_LOCK(&messageLock);
+
+       // Look in the cache of the specified class
+       mask    = ((struct objc_class *)cls)->cache->mask;
+       buckets = ((struct objc_class *)cls)->cache->buckets;
+       index   = ((uarith_t) sel & mask);
+       while (CACHE_BUCKET_VALID(buckets[index])) {
+               if (CACHE_BUCKET_NAME(buckets[index]) == sel) {
+                       if (CACHE_BUCKET_IMP(buckets[index]) == &_objc_msgForward) {
+                               OBJC_UNLOCK(&messageLock);
+                               return NO;
+                       } else {
+                               OBJC_UNLOCK(&messageLock);
+                               return YES;
+                       }
+               }
+               
+               index += 1;
+               index &= mask;
+       }
+
+       // Handle cache miss
+       meth = _getMethod(cls, sel);
+       if (meth) {
+               OBJC_UNLOCK(&messageLock);
+               _cache_fill (cls, meth, sel);
+               return YES;
+       }
+       
+       // Not implememted.  Use _objc_msgForward.
+       {
+       Method  smt;
+
+       smt = malloc_zone_malloc (_objc_create_zone(), sizeof(struct objc_method));
+       smt->method_name        = sel;
+       smt->method_types       = "";
+       smt->method_imp         = &_objc_msgForward;
+       _cache_fill (cls, smt, sel);
+       }
+
+       OBJC_UNLOCK(&messageLock);
+       return NO;
+
+}
+
+
+/***********************************************************************
+ * class_lookupMethod.
+ *
+ * Called from -[Object methodFor:] and +[Object instanceMethodFor:]
+ **********************************************************************/
+
+IMP            class_lookupMethod             (Class           cls,
+                                               SEL             sel)
+{
+       Method *        buckets;
+       arith_t         index;
+       arith_t         mask;
+       IMP             result;
+       
+       // No one responds to zero!
+       if (!sel) 
+               [(id) cls error:_errBadSel, sel];
+
+       // Synchronize access to caches
+       OBJC_LOCK(&messageLock);
+
+       // Scan the cache
+       mask    = ((struct objc_class *)cls)->cache->mask;
+       buckets = ((struct objc_class *)cls)->cache->buckets;
+       index   = ((unsigned int) sel & mask);
+       while (CACHE_BUCKET_VALID(buckets[index]))
+       {
+               if (CACHE_BUCKET_NAME(buckets[index]) == sel)
+               {
+                       result = CACHE_BUCKET_IMP(buckets[index]);
+                       OBJC_UNLOCK(&messageLock);
+                       return result;
+               }
+               
+               index += 1;
+               index &= mask;
+       }
+
+       // Handle cache miss
+       result = _class_lookupMethodAndLoadCache (cls, sel);
+       OBJC_UNLOCK(&messageLock);
+       return result;
+}
+
+/***********************************************************************
+ * class_lookupMethodInMethodList.
+ *
+ * Called from objc-load.m and _objc_callLoads ()
+ **********************************************************************/
+IMP    class_lookupMethodInMethodList (struct objc_method_list *       mlist,
+                                       SEL                             sel)
+{
+    Method m = _findMethodInList(mlist, sel);
+    return (m ? m->method_imp : NULL);
+}
+
+IMP    class_lookupNamedMethodInMethodList(struct objc_method_list *mlist,
+                                       const char *meth_name)
+{
+    Method m = meth_name ? _findNamedMethodInList(mlist, meth_name) : NULL;
+    return (m ? m->method_imp : NULL);
+}
+
+/***********************************************************************
+ * _cache_create.
+ *
+ * Called from _cache_expand () and objc_addClass ()
+ **********************************************************************/
+Cache          _cache_create           (Class          cls)
+{
+       Cache           new_cache;
+       int                     slotCount;
+       int                     index;
+
+       // Select appropriate size
+       slotCount = (ISMETA(cls)) ? INIT_META_CACHE_SIZE : INIT_CACHE_SIZE;
+
+       // Allocate table (why not check for failure?)
+#ifdef OBJC_INSTRUMENTED
+       new_cache = malloc_zone_malloc (_objc_create_zone(),
+                       sizeof(struct objc_cache) + TABLE_SIZE(slotCount)
+                        + sizeof(CacheInstrumentation));
+#else
+       new_cache = malloc_zone_malloc (_objc_create_zone(),
+                       sizeof(struct objc_cache) + TABLE_SIZE(slotCount));
+#endif
+
+       // Invalidate all the buckets
+       for (index = 0; index < slotCount; index += 1)
+               CACHE_BUCKET_VALID(new_cache->buckets[index]) = NULL;
+       
+       // Zero the valid-entry counter
+       new_cache->occupied = 0;
+       
+       // Set the mask so indexing wraps at the end-of-table
+       new_cache->mask = slotCount - 1;
+
+#ifdef OBJC_INSTRUMENTED
+       {
+       CacheInstrumentation *  cacheData;
+
+       // Zero out the cache dynamic instrumention data
+       cacheData = CACHE_INSTRUMENTATION(new_cache);
+       bzero ((char *) cacheData, sizeof(CacheInstrumentation));
+       }
+#endif
+
+       // Install the cache
+       ((struct objc_class *)cls)->cache = new_cache;
+
+       // Clear the cache flush flag so that we will not flush this cache
+       // before expanding it for the first time.
+       ((struct objc_class * )cls)->info &= ~(CLS_FLUSH_CACHE);
+
+       // Clear the grow flag so that we will re-use the current storage,
+       // rather than actually grow the cache, when expanding the cache
+       // for the first time
+       if (_class_slow_grow)
+               ((struct objc_class * )cls)->info &= ~(CLS_GROW_CACHE);
+
+       // Return our creation
+       return new_cache;
+}
+
+/***********************************************************************
+ * _cache_expand.
+ *
+ * #ifdef OBJC_COLLECTING_CACHE
+ *     The cacheUpdateLock is assumed to be taken at this point. 
+ * #endif
+ *
+ * Called from _cache_fill ()
+ **********************************************************************/
+static Cache           _cache_expand          (Class           cls)
+{
+       Cache           old_cache;
+       Cache           new_cache;
+       unsigned int    slotCount;
+       unsigned int    index;
+
+       // First growth goes from emptyCache to a real one
+       old_cache = ((struct objc_class *)cls)->cache;
+       if (old_cache == &emptyCache)
+               return _cache_create (cls);
+
+       // iff _class_slow_grow, trade off actual cache growth with re-using
+       // the current one, so that growth only happens every odd time
+       if (_class_slow_grow)
+       {
+               // CLS_GROW_CACHE controls every-other-time behavior.  If it
+               // is non-zero, let the cache grow this time, but clear the
+               // flag so the cache is reused next time
+               if ((((struct objc_class * )cls)->info & CLS_GROW_CACHE) != 0)
+                       ((struct objc_class * )cls)->info &= ~CLS_GROW_CACHE;
+
+               // Reuse the current cache storage this time
+               else
+               {
+                       // Clear the valid-entry counter
+                       old_cache->occupied = 0;
+
+                       // Invalidate all the cache entries
+                       for (index = 0; index < old_cache->mask + 1; index += 1)
+                       {
+                               // Remember what this entry was, so we can possibly
+                               // deallocate it after the bucket has been invalidated
+                               Method          oldEntry = old_cache->buckets[index];
+                               // Skip invalid entry
+                               if (!CACHE_BUCKET_VALID(old_cache->buckets[index]))
+                                       continue;
+
+                               // Invalidate this entry
+                               CACHE_BUCKET_VALID(old_cache->buckets[index]) = NULL;
+                                       
+                               // Deallocate "forward::" entry
+                               if (CACHE_BUCKET_IMP(oldEntry) == &_objc_msgForward)
+                               {
+#ifdef OBJC_COLLECTING_CACHE
+                                       _cache_collect_free (oldEntry, NO);
+#else
+                                       malloc_zone_free (_objc_create_zone(), oldEntry);
+#endif
+                               }
+                       }
+                       
+                       // Set the slow growth flag so the cache is next grown
+                       ((struct objc_class * )cls)->info |= CLS_GROW_CACHE;
+                       
+                       // Return the same old cache, freshly emptied
+                       return old_cache;
+               }
+               
+       }
+
+       // Double the cache size
+       slotCount = (old_cache->mask + 1) << 1;
+       
+       // Allocate a new cache table
+#ifdef OBJC_INSTRUMENTED
+       new_cache = malloc_zone_malloc (_objc_create_zone(),
+                       sizeof(struct objc_cache) + TABLE_SIZE(slotCount)
+                        + sizeof(CacheInstrumentation));
+#else
+       new_cache = malloc_zone_malloc (_objc_create_zone(),
+                       sizeof(struct objc_cache) + TABLE_SIZE(slotCount));
+#endif
+
+       // Zero out the new cache
+       new_cache->mask = slotCount - 1;
+       new_cache->occupied = 0;
+       for (index = 0; index < slotCount; index += 1)
+               CACHE_BUCKET_VALID(new_cache->buckets[index]) = NULL;
+
+#ifdef OBJC_INSTRUMENTED
+       // Propagate the instrumentation data
+       {
+       CacheInstrumentation *  oldCacheData;
+       CacheInstrumentation *  newCacheData;
+
+       oldCacheData = CACHE_INSTRUMENTATION(old_cache);
+       newCacheData = CACHE_INSTRUMENTATION(new_cache);
+       bcopy ((const char *)oldCacheData, (char *)newCacheData, sizeof(CacheInstrumentation));
+       }
+#endif
+
+       // iff _class_uncache, copy old cache entries into the new cache
+       if (_class_uncache == 0)
+       {
+               int     newMask;
+               
+               newMask = new_cache->mask;
+               
+               // Look at all entries in the old cache
+               for (index = 0; index < old_cache->mask + 1; index += 1)
+               {
+                       int     index2;
+
+                       // Skip invalid entry
+                       if (!CACHE_BUCKET_VALID(old_cache->buckets[index]))
+                               continue;
+                       
+                       // Hash the old entry into the new table
+                       index2 = ((unsigned int) CACHE_BUCKET_NAME(old_cache->buckets[index]) & newMask);
+                       
+                       // Find an available spot, at or following the hashed spot;
+                       // Guaranteed to not infinite loop, because table has grown
+                       for (;;)
+                       {
+                               if (!CACHE_BUCKET_VALID(new_cache->buckets[index2]))
+                               {
+                                       new_cache->buckets[index2] = old_cache->buckets[index];
+                                       break;
+                               }
+                                       
+                               index2 += 1;
+                               index2 &= newMask;
+                       }
+
+                       // Account for the addition
+                       new_cache->occupied += 1;
+               }
+       
+               // Set the cache flush flag so that we will flush this cache
+               // before expanding it again.
+               ((struct objc_class * )cls)->info |= CLS_FLUSH_CACHE;
+       }
+
+       // Deallocate "forward::" entries from the old cache
+       else
+       {
+               for (index = 0; index < old_cache->mask + 1; index += 1)
+               {
+                       if (CACHE_BUCKET_VALID(old_cache->buckets[index]) &&
+                               CACHE_BUCKET_IMP(old_cache->buckets[index]) == &_objc_msgForward)
+                       {
+#ifdef OBJC_COLLECTING_CACHE
+                               _cache_collect_free (old_cache->buckets[index], NO);
+#else
+                               malloc_zone_free (_objc_create_zone(), old_cache->buckets[index]);
+#endif
+                       }
+               }
+       }
+
+       // Install new cache
+       ((struct objc_class *)cls)->cache = new_cache;
+
+       // Deallocate old cache, try freeing all the garbage
+#ifdef OBJC_COLLECTING_CACHE
+       _cache_collect_free (old_cache, YES);
+#else
+       malloc_zone_free (_objc_create_zone(), old_cache);
+#endif
+       return new_cache;
+}
+
+/***********************************************************************
+ * instrumentObjcMessageSends/logObjcMessageSends.
+ **********************************************************************/
+static int     LogObjCMessageSend (BOOL                        isClassMethod,
+                                                               const char *    objectsClass,
+                                                               const char *    implementingClass,
+                                                               SEL                             selector)
+{
+       char    buf[ 1024 ];
+
+       // Create/open the log file     
+       if (objcMsgLogFD == (-1))
+       {
+               sprintf (buf, "/tmp/msgSends-%d", (int) getpid ());
+               objcMsgLogFD = open (buf, O_WRONLY | O_CREAT, 0666);
+       }
+
+       // Make the log entry
+       sprintf(buf, "%c %s %s %s\n",
+               isClassMethod ? '+' : '-',
+               objectsClass,
+               implementingClass,
+               (char *) selector);
+       
+       write (objcMsgLogFD, buf, strlen(buf));
+
+       // Tell caller to not cache the method
+       return 0;
+}
+
+void   instrumentObjcMessageSends       (BOOL          flag)
+{
+       int             enabledValue = (flag) ? 1 : 0;
+
+       // Shortcut NOP
+       if (objcMsgLogEnabled == enabledValue)
+               return;
+       
+       // If enabling, flush all method caches so we get some traces
+       if (flag)
+               flush_caches (Nil, YES);
+       
+       // Sync our log file
+       if (objcMsgLogFD != (-1))
+               fsync (objcMsgLogFD);
+
+       objcMsgLogEnabled = enabledValue;
+}
+
+void   logObjcMessageSends      (ObjCLogProc   logProc)
+{
+       if (logProc)
+       {
+               objcMsgLogProc = logProc;
+               objcMsgLogEnabled = 1;
+       }
+       else
+       {
+               objcMsgLogProc = logProc;
+               objcMsgLogEnabled = 0;
+       }
+
+       if (objcMsgLogFD != (-1))
+               fsync (objcMsgLogFD);
+}
+
+/***********************************************************************
+ * _cache_fill.  Add the specified method to the specified class' cache.
+ *
+ * Called only from _class_lookupMethodAndLoadCache and
+ * class_respondsToMethod.
+ *
+ * #ifdef OBJC_COLLECTING_CACHE
+ *     It doesn't matter if someone has the messageLock when we enter this
+ *     function.  This function will fail to do the update if someone else
+ *     is already updating the cache, i.e. they have the cacheUpdateLock.
+ * #else
+ *     The messageLock is already assumed to be taken out.
+ * #endif
+ **********************************************************************/
+
+static void    _cache_fill    (Class           cls,
+                                                               Method          smt,
+                                                               SEL                     sel)
+{
+       Cache                           cache;
+       Method *                        buckets;
+
+       arith_t                         index;
+       arith_t                         mask;
+       unsigned int            newOccupied;
+
+       // Keep tally of cache additions
+       totalCacheFills += 1;
+
+#ifdef OBJC_COLLECTING_CACHE
+       // Make sure only one thread is updating the cache at a time, but don't
+       // wait for concurrent updater to finish, because it might be a while, or
+       // a deadlock!  Instead, just leave the method out of the cache until
+       // next time.  This is nasty given that cacheUpdateLock is per task!
+       if (!OBJC_TRYLOCK(&cacheUpdateLock))
+               return;
+
+       // Set up invariants for cache traversals
+       cache   = ((struct objc_class *)cls)->cache;
+       mask    = cache->mask;
+       buckets = cache->buckets;
+
+       // Check for duplicate entries, if we're in the mode
+       if (traceDuplicates)
+       {
+               int     index2;
+               
+               // Scan the cache
+               for (index2 = 0; index2 < mask + 1; index2 += 1)
+               {
+                       // Skip invalid or non-duplicate entry
+                       if ((!CACHE_BUCKET_VALID(buckets[index2])) ||
+                           (strcmp ((char *) CACHE_BUCKET_NAME(buckets[index2]), (char *) smt->method_name) != 0))
+                               continue;
+
+                       // Tally duplication, but report iff wanted
+                       cacheFillDuplicates += 1;
+                       if (traceDuplicatesVerbose)
+                       {
+                               _objc_inform  ("Cache fill duplicate #%d: found %x adding %x: %s\n",
+                                                               cacheFillDuplicates,
+                                                               (unsigned int) CACHE_BUCKET_NAME(buckets[index2]),
+                                                               (unsigned int) smt->method_name,
+                                                               (char *) smt->method_name);
+                       }
+               }
+       }
+
+       // Do nothing if entry is already placed.  This re-check is needed
+       // only in the OBJC_COLLECTING_CACHE code, because the probe is
+       // done un-sync'd.
+       index   = ((unsigned int) sel & mask);
+       while (CACHE_BUCKET_VALID(buckets[index]))
+       {
+               if (CACHE_BUCKET_NAME(buckets[index]) == sel)
+               {
+                       OBJC_UNLOCK(&cacheUpdateLock);
+                       return;
+               }
+               
+               index += 1;
+               index &= mask;
+       }
+
+#else // not OBJC_COLLECTING_CACHE
+       cache   = ((struct objc_class *)cls)->cache;
+       mask    = cache->mask;
+#endif
+
+       // Use the cache as-is if it is less than 3/4 full
+       newOccupied = cache->occupied + 1;
+       if ((newOccupied * 4) <= (mask + 1) * 3)
+               cache->occupied = newOccupied;
+       
+       // Cache is getting full
+       else
+       {
+               // Flush the cache
+               if ((((struct objc_class * )cls)->info & CLS_FLUSH_CACHE) != 0)
+                       _cache_flush (cls);
+               
+               // Expand the cache
+               else
+               {
+                       cache = _cache_expand (cls);
+                       mask  = cache->mask;
+               }
+               
+               // Account for the addition
+               cache->occupied += 1;
+       }
+       
+       // Insert the new entry.  This can be done by either:
+       //      (a) Scanning for the first unused spot.  Easy!
+       //      (b) Opening up an unused spot by sliding existing
+       //          entries down by one.  The benefit of this
+       //          extra work is that it puts the most recently
+       //          loaded entries closest to where the selector
+       //          hash starts the search.
+       //
+       // The loop is a little more complicated because there
+       // are two kinds of entries, so there have to be two ways
+       // to slide them.
+       buckets = cache->buckets;
+       index   = ((unsigned int) sel & mask);
+       for (;;)
+       {
+               // Slide existing entries down by one
+               Method          saveMethod;
+               
+               // Copy current entry to a local
+               saveMethod = buckets[index];
+               
+               // Copy previous entry (or new entry) to current slot
+               buckets[index] = smt;
+               
+               // Done if current slot had been invalid
+               if (saveMethod == NULL)
+                       break;
+               
+               // Prepare to copy saved value into next slot
+               smt = saveMethod;
+
+               // Move on to next slot
+               index += 1;
+               index &= mask;
+       }
+
+#ifdef OBJC_COLLECTING_CACHE
+       OBJC_UNLOCK(&cacheUpdateLock);
+#endif
+}
+
+/***********************************************************************
+ * _cache_flush.  Invalidate all valid entries in the given class' cache,
+ * and clear the CLS_FLUSH_CACHE in the cls->info.
+ *
+ * Called from flush_caches ().
+ **********************************************************************/
+static void    _cache_flush            (Class          cls)
+{
+       Cache                   cache;
+       unsigned int    index;
+       
+       // Locate cache.  Ignore unused cache.
+       cache = ((struct objc_class *)cls)->cache;
+       if (cache == &emptyCache)
+               return;
+
+#ifdef OBJC_INSTRUMENTED
+       {
+       CacheInstrumentation *  cacheData;
+
+       // Tally this flush
+       cacheData = CACHE_INSTRUMENTATION(cache);
+       cacheData->flushCount += 1;
+       cacheData->flushedEntries += cache->occupied;
+       if (cache->occupied > cacheData->maxFlushedEntries)
+               cacheData->maxFlushedEntries = cache->occupied;
+       }
+#endif
+       
+       // Traverse the cache
+       for (index = 0; index <= cache->mask; index += 1)
+       {
+               // Remember what this entry was, so we can possibly
+               // deallocate it after the bucket has been invalidated
+               Method          oldEntry = cache->buckets[index];
+
+               // Invalidate this entry
+               CACHE_BUCKET_VALID(cache->buckets[index]) = NULL;
+
+               // Deallocate "forward::" entry
+               if (oldEntry && oldEntry->method_imp == &_objc_msgForward)
+#ifdef OBJC_COLLECTING_CACHE
+                       _cache_collect_free (oldEntry, NO);
+#else
+                       malloc_zone_free (_objc_create_zone(), oldEntry);
+#endif
+       }
+       
+       // Clear the valid-entry counter
+       cache->occupied = 0;
+
+       // Clear the cache flush flag so that we will not flush this cache
+       // before expanding it again.
+       ((struct objc_class * )cls)->info &= ~CLS_FLUSH_CACHE;
+}
+
+/***********************************************************************
+ * _objc_getFreedObjectClass.  Return a pointer to the dummy freed
+ * object class.  Freed objects get their isa pointers replaced with
+ * a pointer to the freedObjectClass, so that we can catch usages of
+ * the freed object.
+ **********************************************************************/
+Class          _objc_getFreedObjectClass          (void)
+{
+       return (Class) &freedObjectClass;
+}
+
+/***********************************************************************
+ * _objc_getNonexistentClass.  Return a pointer to the dummy nonexistent
+ * object class.  This is used when, for example, mapping the class
+ * refs for an image, and the class can not be found, so that we can
+ * catch later uses of the non-existent class.
+ **********************************************************************/
+Class          _objc_getNonexistentClass          (void)
+{
+       return (Class) &nonexistentObjectClass;
+}
+
+/***********************************************************************
+ * _class_lookupMethodAndLoadCache.
+ *
+ * Called only from objc_msgSend, objc_msgSendSuper and class_lookupMethod.
+ **********************************************************************/
+IMP    _class_lookupMethodAndLoadCache    (Class       cls,
+                                                                               SEL             sel)
+{
+       struct objc_class *     curClass;
+       Method  smt;
+       BOOL    calledSingleThreaded;
+       IMP             methodPC;
+
+       ptrace(0xb300, 0, 0, 0);
+       
+       // Check for freed class
+       if (cls == &freedObjectClass)
+               return (IMP) _freedHandler;
+       
+       // Check for nonexistent class
+       if (cls == &nonexistentObjectClass)
+               return (IMP) _nonexistentHandler;
+       
+#ifndef OBJC_COLLECTING_CACHE
+       // Control can get here via the single-threaded message dispatcher,
+       // but class_initialize can cause application to go multithreaded.  Notice 
+       // whether this is the case, so we can leave the messageLock unlocked
+       // on the way out, just as the single-threaded message dispatcher
+       // expects.  Note that the messageLock locking in classinitialize is
+       // appropriate in this case, because there are more than one thread now.
+       calledSingleThreaded = (_objc_multithread_mask != 0);
+#endif
+
+       ptrace(0xb301, 0, 0, 0);
+       
+       // Lazy initialization.  This unlocks and relocks messageLock,
+       // so cache information we might already have becomes invalid.
+       if (!ISINITIALIZED(cls))
+               class_initialize (objc_getClass (((struct objc_class *)cls)->name));
+       
+       ptrace(0xb302, 0, 0, 0);
+
+       // Outer loop - search the caches and method lists of the
+       // class and its super-classes
+       methodPC = NULL;
+       for (curClass = cls; curClass; curClass = ((struct objc_class * )curClass)->super_class)
+       {
+               Method *                                        buckets;
+               arith_t                                         idx;
+               arith_t                                         mask;
+               arith_t                                         methodCount;
+               struct objc_method_list *mlist;
+               void *iterator = 0;
+#ifdef PRELOAD_SUPERCLASS_CACHES
+               struct objc_class *                                             curClass2;
+#endif
+
+               ptrace(0xb303, 0, 0, 0);
+       
+               mask    = curClass->cache->mask;
+               buckets = curClass->cache->buckets;
+
+               // Minor loop #1 - check cache of given class
+               for (idx = ((uarith_t) sel & mask);
+                        CACHE_BUCKET_VALID(buckets[idx]);
+                        idx = (++idx & mask))
+               {
+                       // Skip entries until selector matches
+                       if (CACHE_BUCKET_NAME(buckets[idx]) != sel)
+                               continue;
+
+                       // Found the method.  Add it to the cache(s)
+                       // unless it was found in the cache of the
+                       // class originally being messaged.
+                       //
+                       // NOTE: The method is usually not found
+                       // the original class' cache, because
+                       // objc_msgSend () has already looked.
+                       // BUT, if sending this method resulted in
+                       // a +initialize on the class, and +initialize
+                       // sends the same method, the method will
+                       // indeed now be in the cache.  Calling
+                       // _cache_fill with a buckets[idx] from the
+                       // cache being filled results in a crash
+                       // if the cache has to grow, because the
+                       // buckets[idx] address is no longer valid. 
+                       if (curClass != cls)
+                       {
+#ifdef PRELOAD_SUPERCLASS_CACHES
+                               for (curClass2 = cls; curClass2 != curClass; curClass2 = curClass2->super_class)
+                                       _cache_fill (curClass2, buckets[idx], sel);
+                               _cache_fill (curClass, buckets[idx], sel);
+#else
+                               _cache_fill (cls, buckets[idx], sel);
+#endif
+                       }
+
+                       // Return the implementation address
+                       methodPC = CACHE_BUCKET_IMP(buckets[idx]);
+                       break;
+               }
+
+               ptrace(0xb304, (int)methodPC, 0, 0);
+       
+               // Done if that found it
+               if (methodPC)
+                       break;
+
+               smt = _findMethodInClass(curClass, sel);
+
+               if (smt) {
+                       // If logging is enabled, log the message send and let
+                       // the logger decide whether to encache the method.
+                       if ((objcMsgLogEnabled == 0) ||
+                       (objcMsgLogProc (CLS_GETINFO(((struct objc_class * )curClass),CLS_META) ? YES : NO,
+                                               ((struct objc_class *)cls)->name,
+                                               curClass->name, sel)))
+                       {
+                               // Cache the method implementation
+#ifdef PRELOAD_SUPERCLASS_CACHES
+                               for (curClass2 = cls; curClass2 != curClass; curClass2 = curClass2->super_class)
+                                       _cache_fill (curClass2, smt, sel);
+                               _cache_fill (curClass, smt, sel);
+#else
+                               _cache_fill (cls, smt, sel);
+#endif
+                       }
+                       // Return the implementation
+                       methodPC = smt->method_imp;
+               }
+
+               ptrace(0xb305, (int)methodPC, 0, 0);
+       
+               // Done if that found it
+               if (methodPC)
+                       break;
+       }
+
+       ptrace(0xb306, (int)methodPC, 0, 0);
+       
+       if (methodPC == NULL)
+       {
+               // Class and superclasses do not respond -- use forwarding
+               smt = malloc_zone_malloc (_objc_create_zone(), sizeof(struct objc_method));
+               smt->method_name        = sel;
+               smt->method_types       = "";
+               smt->method_imp         = &_objc_msgForward;
+               _cache_fill (cls, smt, sel);
+               methodPC = &_objc_msgForward;
+       }
+       
+#ifndef OBJC_COLLECTING_CACHE
+       // Unlock the lock
+       if (calledSingleThreaded)
+               OBJC_UNLOCK(&messageLock);
+#endif
+
+       ptrace(0xb30f, (int)methodPC, 0, 0);
+       
+       return methodPC;
+}
+
+/***********************************************************************
+ * SubtypeUntil.
+ *
+ * Delegation.
+ **********************************************************************/
+static int     SubtypeUntil           (const char *    type,
+                                       char            end) 
+{
+       int             level = 0;
+       const char *    head = type;
+       
+       // 
+       while (*type)
+       {
+               if (!*type || (!level && (*type == end)))
+                       return (int)(type - head);
+               
+               switch (*type)
+               {
+                       case ']': case '}': case ')': level--; break;
+                       case '[': case '{': case '(': level += 1; break;
+               }
+               
+               type += 1;
+       }
+       
+       _objc_fatal ("Object: SubtypeUntil: end of type encountered prematurely\n");
+       return 0;
+}
+
+/***********************************************************************
+ * SkipFirstType.
+ **********************************************************************/
+static const char *    SkipFirstType      (const char *        type) 
+{
+       while (1)
+       {
+               switch (*type++)
+               {
+                       case 'O':       /* bycopy */
+                       case 'n':       /* in */
+                       case 'o':       /* out */
+                       case 'N':       /* inout */
+                       case 'r':       /* const */
+                       case 'V':       /* oneway */
+                       case '^':       /* pointers */
+                               break;
+                       
+                       /* arrays */
+                       case '[':
+                               while ((*type >= '0') && (*type <= '9'))
+                                       type += 1;
+                               return type + SubtypeUntil (type, ']') + 1;
+                       
+                       /* structures */
+                       case '{':
+                               return type + SubtypeUntil (type, '}') + 1;
+                       
+                       /* unions */
+                       case '(':
+                               return type + SubtypeUntil (type, ')') + 1;
+                       
+                       /* basic types */
+                       default: 
+                               return type;
+               }
+       }
+}
+
+/***********************************************************************
+ * method_getNumberOfArguments.
+ **********************************************************************/
+unsigned       method_getNumberOfArguments        (Method      method)
+{
+       const char *            typedesc;
+       unsigned                nargs;
+       
+       // First, skip the return type
+       typedesc = method->method_types;
+       typedesc = SkipFirstType (typedesc);
+       
+       // Next, skip stack size
+       while ((*typedesc >= '0') && (*typedesc <= '9')) 
+               typedesc += 1;
+       
+       // Now, we have the arguments - count how many
+       nargs = 0;
+       while (*typedesc)
+       {
+               // Traverse argument type
+               typedesc = SkipFirstType (typedesc);
+               
+               // Traverse (possibly negative) argument offset
+               if (*typedesc == '-')
+                       typedesc += 1;
+               while ((*typedesc >= '0') && (*typedesc <= '9')) 
+                       typedesc += 1;
+               
+               // Made it past an argument
+               nargs += 1;
+       }
+       
+       return nargs;
+}
+
+/***********************************************************************
+ * method_getSizeOfArguments.
+ **********************************************************************/
+#ifndef __alpha__
+unsigned       method_getSizeOfArguments       (Method         method)
+{
+       const char *            typedesc;
+       unsigned                stack_size;
+#if defined(__ppc__) || defined(ppc)
+       unsigned                trueBaseOffset;
+       unsigned                foundBaseOffset;
+#endif
+       
+       // Get our starting points
+       stack_size = 0;
+       typedesc = method->method_types;
+
+       // Skip the return type
+#if defined (__ppc__) || defined(ppc)
+       // Struct returns cause the parameters to be bumped
+       // by a register, so the offset to the receiver is
+       // 4 instead of the normal 0.
+       trueBaseOffset = (*typedesc == '{') ? 4 : 0;
+#endif
+       typedesc = SkipFirstType (typedesc);    
+       
+       // Convert ASCII number string to integer
+       while ((*typedesc >= '0') && (*typedesc <= '9')) 
+               stack_size = (stack_size * 10) + (*typedesc++ - '0');
+#if defined (__ppc__) || defined(ppc)
+       // NOTE: This is a temporary measure pending a compiler fix.
+       // Work around PowerPC compiler bug wherein the method argument
+       // string contains an incorrect value for the "stack size."
+       // Generally, the size is reported 4 bytes too small, so we apply
+       // that fudge factor.  Unfortunately, there is at least one case
+       // where the error is something other than -4: when the last
+       // parameter is a double, the reported stack is much too high
+       // (about 32 bytes).  We do not attempt to detect that case.
+       // The result of returning a too-high value is that objc_msgSendv
+       // can bus error if the destination of the marg_list copying
+       // butts up against excluded memory.
+       // This fix disables itself when it sees a correctly built
+       // type string (i.e. the offset for the Id is correct).  This
+       // keeps us out of lockstep with the compiler.
+
+       // skip the '@' marking the Id field
+       typedesc = SkipFirstType (typedesc);
+
+       // pick up the offset for the Id field
+       foundBaseOffset = 0;
+       while ((*typedesc >= '0') && (*typedesc <= '9')) 
+               foundBaseOffset = (foundBaseOffset * 10) + (*typedesc++ - '0');
+
+       // add fudge factor iff the Id field offset was wrong
+       if (foundBaseOffset != trueBaseOffset)
+               stack_size += 4;
+#endif
+
+       return stack_size;
+}
+
+#else // __alpha__
+// XXX Getting the size of a type is done all over the place
+// (Here, Foundation, remote project)! - Should unify
+
+unsigned int   getSizeOfType   (const char * type, unsigned int * alignPtr);
+
+unsigned       method_getSizeOfArguments          (Method      method)
+{
+       const char *    type;
+       int             size;
+       int             index;
+       int             align;
+       int             offset;
+       unsigned        stack_size;
+       int             nargs;
+       
+       nargs           = method_getNumberOfArguments (method);
+       stack_size      = (*method->method_types == '{') ? sizeof(void *) : 0;
+       
+       for (index = 0; index < nargs; index += 1)
+       {
+               (void) method_getArgumentInfo (method, index, &type, &offset);
+               size = getSizeOfType (type, &align);
+               stack_size += ((size + 7) & ~7);
+       }
+       
+       return stack_size;
+}
+#endif // __alpha__
+
+/***********************************************************************
+ * method_getArgumentInfo.
+ **********************************************************************/
+unsigned       method_getArgumentInfo         (Method          method,
+                                               int             arg, 
+                                               const char **   type,
+                                               int *           offset)
+{
+       const char *    typedesc           = method->method_types;
+       unsigned        nargs              = 0;
+       unsigned        self_offset        = 0;
+       BOOL            offset_is_negative = NO;
+       
+       // First, skip the return type
+       typedesc = SkipFirstType (typedesc);
+       
+       // Next, skip stack size
+       while ((*typedesc >= '0') && (*typedesc <= '9')) 
+               typedesc += 1;
+       
+       // Now, we have the arguments - position typedesc to the appropriate argument
+       while (*typedesc && nargs != arg)
+       {
+       
+               // Skip argument type
+               typedesc = SkipFirstType (typedesc);
+               
+               if (nargs == 0)
+               {
+                       // Skip negative sign in offset
+                       if (*typedesc == '-')
+                       {
+                               offset_is_negative = YES;
+                               typedesc += 1;
+                       }
+                       else
+                               offset_is_negative = NO;
+       
+                       while ((*typedesc >= '0') && (*typedesc <= '9')) 
+                               self_offset = self_offset * 10 + (*typedesc++ - '0');
+                       if (offset_is_negative) 
+                               self_offset = -(self_offset);
+               
+               }
+               
+               else
+               {
+                       // Skip (possibly negative) argument offset
+                       if (*typedesc == '-') 
+                               typedesc += 1;
+                       while ((*typedesc >= '0') && (*typedesc <= '9')) 
+                               typedesc += 1;
+               }
+               
+               nargs += 1;
+       }
+       
+       if (*typedesc)
+       {
+               unsigned arg_offset = 0;
+               
+               *type    = typedesc;
+               typedesc = SkipFirstType (typedesc);
+               
+               if (arg == 0)
+               {
+#ifdef hppa
+                       *offset = -sizeof(id);
+#else
+                       *offset = 0;
+#endif // hppa                 
+               }
+               
+               else
+               {
+                       // Pick up (possibly negative) argument offset
+                       if (*typedesc == '-')
+                       {
+                               offset_is_negative = YES;
+                               typedesc += 1;
+                       }
+                       else
+                               offset_is_negative = NO;
+
+                       while ((*typedesc >= '0') && (*typedesc <= '9')) 
+                               arg_offset = arg_offset * 10 + (*typedesc++ - '0');
+                       if (offset_is_negative) 
+                               arg_offset = - arg_offset;
+               
+#ifdef hppa
+                       // For stacks which grow up, since margs points
+                       // to the top of the stack or the END of the args, 
+                       // the first offset is at -sizeof(id) rather than 0.
+                       self_offset += sizeof(id);
+#endif
+                       *offset = arg_offset - self_offset;
+               }
+       
+       }
+       
+       else
+       {
+               *type   = 0;
+               *offset = 0;
+       }
+       
+       return nargs;
+}
+
+/***********************************************************************
+ * _objc_create_zone.
+ **********************************************************************/
+
+void *         _objc_create_zone                  (void)
+{
+       static void *_objc_z = (void *)0xffffffff;
+       if ( _objc_z == (void *)0xffffffff ) {
+            char *s = getenv("OBJC_USE_OBJC_ZONE");
+            if ( s ) {
+                if ( (*s == '1') || (*s == 'y') || (*s == 'Y') ) {
+                    _objc_z = malloc_create_zone(vm_page_size, 0);
+                    malloc_set_zone_name(_objc_z, "ObjC");
+                }
+            }
+            if ( _objc_z == (void *)0xffffffff ) {
+                _objc_z = malloc_default_zone();
+            }
+       }
+       return _objc_z;
+}
+
+/***********************************************************************
+ * cache collection.
+ **********************************************************************/
+#ifdef OBJC_COLLECTING_CACHE
+
+static unsigned long   _get_pc_for_thread     (mach_port_t     thread)
+#ifdef hppa
+{
+               struct hp_pa_frame_thread_state         state;
+               unsigned int count = HPPA_FRAME_THREAD_STATE_COUNT;
+               thread_get_state (thread, HPPA_FRAME_THREAD_STATE, (thread_state_t)&state, &count);
+               return state.ts_pcoq_front;
+}
+#elif defined(sparc)
+{
+               struct sparc_thread_state_regs          state;
+               unsigned int count = SPARC_THREAD_STATE_REGS_COUNT;
+               thread_get_state (thread, SPARC_THREAD_STATE_REGS, (thread_state_t)&state, &count);
+               return state.regs.r_pc;
+}
+#elif defined(__i386__) || defined(i386)
+{
+               i386_thread_state_t                     state;
+               unsigned int count = i386_THREAD_STATE_COUNT;
+               thread_get_state (thread, i386_THREAD_STATE, (thread_state_t)&state, &count);
+               return state.eip;
+}
+#elif defined(m68k)
+{
+               struct m68k_thread_state_regs           state;
+               unsigned int count = M68K_THREAD_STATE_REGS_COUNT;
+               thread_get_state (thread, M68K_THREAD_STATE_REGS, (thread_state_t)&state, &count);
+               return state.pc;
+}
+#elif defined(__ppc__) || defined(ppc)
+{
+               struct ppc_thread_state                 state;
+               unsigned int count = PPC_THREAD_STATE_COUNT;
+               thread_get_state (thread, PPC_THREAD_STATE, (thread_state_t)&state, &count);
+               return state.srr0;
+}      
+#else
+{
+       #error _get_pc_for_thread () not implemented for this architecture
+}
+#endif
+
+/***********************************************************************
+ * _collecting_in_critical.
+ **********************************************************************/
+OBJC_EXPORT unsigned long      objc_entryPoints[];
+OBJC_EXPORT unsigned long      objc_exitPoints[];
+
+static int     _collecting_in_critical         (void)
+{
+       thread_act_port_array_t         threads;
+       unsigned                        number;
+       unsigned                        count;
+       kern_return_t           ret;
+       int                                     result;
+       mach_port_t mythread = pthread_mach_thread_np(pthread_self());
+       
+       // Get a list of all the threads in the current task
+       ret = task_threads (mach_task_self (), &threads, &number);
+       if (ret != KERN_SUCCESS)
+       {
+               _objc_inform ("objc: task_thread failed\n");
+               exit (1);
+       }
+       
+       // Check whether any thread is in the cache lookup code
+       result = 0;
+       for (count = 0; !result && (count < number); count += 1)
+       {
+               int                             region;
+               unsigned long   pc;
+       
+               // Don't bother checking ourselves
+               if (threads[count] == mythread)
+                       continue;
+               
+               // Find out where thread is executing
+               pc = _get_pc_for_thread (threads[count]);
+       
+               // Check whether it is in the cache lookup code
+               for (region = 0; !result && (objc_entryPoints[region] != 0); region += 1)
+               {
+                       if ((pc >= objc_entryPoints[region]) &&
+                               (pc <= objc_exitPoints[region]))
+                               result = 1;
+               }
+       }
+       // Deallocate the port rights for the threads
+       for (count = 0; count < number; count++) {
+               mach_port_deallocate(mach_task_self (), threads[count]);
+       }
+       
+       // Deallocate the thread list
+       vm_deallocate (mach_task_self (), (vm_address_t) threads, sizeof(threads) * number);
+       
+       // Return our finding
+       return result;
+}
+
+/***********************************************************************
+ * _garbage_make_room.  Ensure that there is enough room for at least
+ * one more ref in the garbage.
+ **********************************************************************/
+
+// amount of memory represented by all refs in the garbage
+static int garbage_byte_size   = 0;
+
+// do not empty the garbage until garbage_byte_size gets at least this big
+static int garbage_threshold   = 1024;
+
+// table of refs to free
+static void **garbage_refs     = 0;
+
+// current number of refs in garbage_refs
+static int garbage_count       = 0;
+
+// capacity of current garbage_refs
+static int garbage_max         = 0;
+
+// capacity of initial garbage_refs
+enum {
+       INIT_GARBAGE_COUNT      = 128
+};
+
+static void    _garbage_make_room              (void)
+{
+       static int      first = 1;
+       volatile void * tempGarbage;
+
+       // Create the collection table the first time it is needed
+       if (first)
+       {
+               first           = 0;
+               garbage_refs    = malloc_zone_malloc (_objc_create_zone(),
+                                               INIT_GARBAGE_COUNT * sizeof(void *));
+               garbage_max     = INIT_GARBAGE_COUNT;
+       }
+       
+       // Double the table if it is full
+       else if (garbage_count == garbage_max)
+       {
+               tempGarbage     = malloc_zone_realloc ((void *) _objc_create_zone(),
+                                               (void *) garbage_refs,
+                                               (size_t) garbage_max * 2 * sizeof(void *));
+               garbage_refs    = (void **) tempGarbage;
+               garbage_max     *= 2;
+       }
+}
+
+/***********************************************************************
+ * _cache_collect_free.  Add the specified malloc'd memory to the list
+ * of them to free at some later point.
+ **********************************************************************/
+static void    _cache_collect_free    (void *          data,
+                                                                       BOOL            tryCollect)
+{
+       static char *report_garbage = (char *)0xffffffff;
+
+       if ((char *)0xffffffff == report_garbage) {     
+               // Check whether to log our activity
+               report_garbage = getenv ("OBJC_REPORT_GARBAGE");
+       }
+
+       // Synchronize
+       OBJC_LOCK(&cacheCollectionLock);
+       
+       // Insert new element in garbage list
+       // Note that we do this even if we end up free'ing everything
+       _garbage_make_room ();  
+       garbage_byte_size += malloc_size (data);
+       garbage_refs[garbage_count++] = data;
+       
+       // Log our progress
+       if (tryCollect && report_garbage)
+               _objc_inform ("total of %d bytes of garbage ...", garbage_byte_size);
+       
+       // Done if caller says not to empty or the garbage is not full
+       if (!tryCollect || (garbage_byte_size < garbage_threshold))
+       {
+               OBJC_UNLOCK(&cacheCollectionLock);
+               if (tryCollect && report_garbage)
+                       _objc_inform ("below threshold\n");
+               
+               return;
+       }
+       
+       // Synchronize garbage collection with messageLock holders
+       if (OBJC_TRYLOCK(&messageLock))
+       {
+               // Synchronize garbage collection with cache lookers
+               if (!_collecting_in_critical ())
+               {
+                       // Log our progress
+                       if (tryCollect && report_garbage)
+                               _objc_inform ("collecting!\n");
+                       
+                       // Dispose all refs now in the garbage
+                       while (garbage_count)
+                               free (garbage_refs[--garbage_count]);
+                       
+                       // Clear the total size indicator
+                       garbage_byte_size = 0;
+               }
+               
+               // Someone is actively looking in the cache
+               else if (tryCollect && report_garbage)
+                       _objc_inform ("in critical region\n");
+               
+               OBJC_UNLOCK(&messageLock);
+       }
+       
+       // Someone already holds messageLock
+       else if (tryCollect && report_garbage)
+               _objc_inform ("messageLock taken\n");
+       
+       OBJC_UNLOCK(&cacheCollectionLock);
+}
+#endif // OBJC_COLLECTING_CACHE
+
+
+/***********************************************************************
+ * _cache_print.
+ **********************************************************************/
+static void    _cache_print           (Cache           cache)
+{
+       unsigned int    index;
+       unsigned int    count;
+       
+       count = cache->mask + 1;
+       for (index = 0; index < count; index += 1)
+               if (CACHE_BUCKET_VALID(cache->buckets[index]))
+               {
+                       if (CACHE_BUCKET_IMP(cache->buckets[index]) == &_objc_msgForward)
+                               printf ("does not recognize: \n");
+                       printf ("%s\n", (const char *) CACHE_BUCKET_NAME(cache->buckets[index]));
+               }
+}
+
+/***********************************************************************
+ * _class_printMethodCaches.
+ **********************************************************************/
+void   _class_printMethodCaches       (Class           cls)
+{
+       if (((struct objc_class *)cls)->cache == &emptyCache)
+               printf ("no instance-method cache for class %s\n", ((struct objc_class *)cls)->name);
+       
+       else
+       {
+               printf ("instance-method cache for class %s:\n", ((struct objc_class *)cls)->name);
+               _cache_print (((struct objc_class *)cls)->cache);
+       }
+       
+       if (((struct objc_class * )((struct objc_class * )cls)->isa)->cache == &emptyCache)
+               printf ("no class-method cache for class %s\n", ((struct objc_class *)cls)->name);
+       
+       else
+       {
+               printf ("class-method cache for class %s:\n", ((struct objc_class *)cls)->name);
+               _cache_print (((struct objc_class * )((struct objc_class * )cls)->isa)->cache);
+       }
+}
+
+/***********************************************************************
+ * log2.
+ **********************************************************************/
+static unsigned int    log2           (unsigned int    x)
+{
+       unsigned int    log;
+
+       log = 0;
+       while (x >>= 1)
+               log += 1;
+
+       return log;
+}
+
+/***********************************************************************
+ * _class_printDuplicateCacheEntries.
+ **********************************************************************/
+void   _class_printDuplicateCacheEntries          (BOOL        detail) 
+{
+       NXHashTable *   class_hash;
+       NXHashState     state;
+       struct objc_class *             cls;
+       unsigned int    duplicates;
+       unsigned int    index1;
+       unsigned int    index2;
+       unsigned int    mask;
+       unsigned int    count;
+       unsigned int    isMeta;
+       Cache           cache;
+               
+
+       printf ("Checking for duplicate cache entries \n");
+
+       // Outermost loop - iterate over all classes
+       class_hash = objc_getClasses ();
+       state      = NXInitHashState (class_hash);
+       duplicates = 0;
+       while (NXNextHashState (class_hash, &state, (void **) &cls))
+       {       
+               // Control loop - do given class' cache, then its isa's cache
+               for (isMeta = 0; isMeta <= 1; isMeta += 1)
+               {
+                       // Select cache of interest and make sure it exists
+                       cache = isMeta ? cls->isa->cache : ((struct objc_class *)cls)->cache;
+                       if (cache == &emptyCache)
+                               continue;
+                       
+                       // Middle loop - check each entry in the given cache
+                       mask  = cache->mask;
+                       count = mask + 1;
+                       for (index1 = 0; index1 < count; index1 += 1)
+                       {
+                               // Skip invalid entry
+                               if (!CACHE_BUCKET_VALID(cache->buckets[index1]))
+                                       continue;
+                               
+                               // Inner loop - check that given entry matches no later entry
+                               for (index2 = index1 + 1; index2 < count; index2 += 1)
+                               {
+                                       // Skip invalid entry
+                                       if (!CACHE_BUCKET_VALID(cache->buckets[index2]))
+                                               continue;
+
+                                       // Check for duplication by method name comparison
+                                       if (strcmp ((char *) CACHE_BUCKET_NAME(cache->buckets[index1]),
+                                                   (char *) CACHE_BUCKET_NAME(cache->buckets[index2])) == 0)
+                                       {
+                                               if (detail)
+                                                       printf ("%s %s\n", ((struct objc_class *)cls)->name, (char *) CACHE_BUCKET_NAME(cache->buckets[index1]));
+                                               duplicates += 1;
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       }
+       
+       // Log the findings
+       printf ("duplicates = %d\n", duplicates);
+       printf ("total cache fills = %d\n", totalCacheFills);
+}
+
+/***********************************************************************
+ * PrintCacheHeader.
+ **********************************************************************/
+static void    PrintCacheHeader        (void)
+{
+#ifdef OBJC_INSTRUMENTED
+       printf ("Cache  Cache  Slots  Avg    Max   AvgS  MaxS  AvgS  MaxS  TotalD   AvgD  MaxD  TotalD   AvgD  MaxD  TotD  AvgD  MaxD\n");
+       printf ("Size   Count  Used   Used   Used  Hit   Hit   Miss  Miss  Hits     Prbs  Prbs  Misses   Prbs  Prbs  Flsh  Flsh  Flsh\n");
+       printf ("-----  -----  -----  -----  ----  ----  ----  ----  ----  -------  ----  ----  -------  ----  ----  ----  ----  ----\n");
+#else
+       printf ("Cache  Cache  Slots  Avg    Max   AvgS  MaxS  AvgS  MaxS\n");
+       printf ("Size   Count  Used   Used   Used  Hit   Hit   Miss  Miss\n");
+       printf ("-----  -----  -----  -----  ----  ----  ----  ----  ----\n");
+#endif
+}
+
+/***********************************************************************
+ * PrintCacheInfo.
+ **********************************************************************/
+static void            PrintCacheInfo (unsigned int    cacheSize,
+                                       unsigned int    cacheCount,
+                                       unsigned int    slotsUsed,
+                                       float           avgUsed,
+                                       unsigned int    maxUsed,
+                                       float           avgSHit,
+                                       unsigned int    maxSHit,
+                                       float           avgSMiss,
+                                       unsigned int    maxSMiss
+#ifdef OBJC_INSTRUMENTED
+                                       , unsigned int  totDHits,
+                                       float           avgDHit,
+                                       unsigned int    maxDHit,
+                                       unsigned int    totDMisses,
+                                       float           avgDMiss,
+                                       unsigned int    maxDMiss,
+                                       unsigned int    totDFlsh,
+                                       float           avgDFlsh,
+                                       unsigned int    maxDFlsh
+#endif
+                                               )
+{
+#ifdef OBJC_INSTRUMENTED
+       printf ("%5u  %5u  %5u  %5.1f  %4u  %4.1f  %4u  %4.1f  %4u  %7u  %4.1f  %4u  %7u  %4.1f  %4u  %4u  %4.1f  %4u\n",
+#else
+       printf ("%5u  %5u  %5u  %5.1f  %4u  %4.1f  %4u  %4.1f  %4u\n",
+#endif
+                       cacheSize, cacheCount, slotsUsed, avgUsed, maxUsed, avgSHit, maxSHit, avgSMiss, maxSMiss
+#ifdef OBJC_INSTRUMENTED
+                       , totDHits, avgDHit, maxDHit, totDMisses, avgDMiss, maxDMiss, totDFlsh, avgDFlsh, maxDFlsh
+#endif
+       );
+
+}
+
+#ifdef OBJC_INSTRUMENTED
+/***********************************************************************
+ * PrintCacheHistogram.  Show the non-zero entries from the specified
+ * cache histogram.
+ **********************************************************************/
+static void    PrintCacheHistogram    (char *          title,
+                                       unsigned int *  firstEntry,
+                                       unsigned int    entryCount)
+{
+       unsigned int    index;
+       unsigned int *  thisEntry;
+
+       printf ("%s\n", title);
+       printf ("    Probes    Tally\n");
+       printf ("    ------    -----\n");
+       for (index = 0, thisEntry = firstEntry;
+            index < entryCount;
+            index += 1, thisEntry += 1)
+       {
+               if (*thisEntry == 0)
+                       continue;
+
+               printf ("    %6d    %5d\n", index, *thisEntry);
+       }
+}
+#endif
+
+/***********************************************************************
+ * _class_printMethodCacheStatistics.
+ **********************************************************************/
+
+#define MAX_LOG2_SIZE          32
+#define MAX_CHAIN_SIZE         100
+
+void           _class_printMethodCacheStatistics               (void)
+{
+       unsigned int    isMeta;
+       unsigned int    index;
+       NXHashTable *   class_hash;
+       NXHashState     state;
+       struct objc_class *             cls;
+       unsigned int    totalChain;
+       unsigned int    totalMissChain;
+       unsigned int    maxChain;
+       unsigned int    maxMissChain;
+       unsigned int    classCount;
+       unsigned int    negativeEntryCount;
+       unsigned int    cacheExpandCount;
+       unsigned int    cacheCountBySize[2][MAX_LOG2_SIZE]        = {{0}};
+       unsigned int    totalEntriesBySize[2][MAX_LOG2_SIZE]      = {{0}};
+       unsigned int    maxEntriesBySize[2][MAX_LOG2_SIZE]        = {{0}};
+       unsigned int    totalChainBySize[2][MAX_LOG2_SIZE]        = {{0}};
+       unsigned int    totalMissChainBySize[2][MAX_LOG2_SIZE]    = {{0}};
+       unsigned int    totalMaxChainBySize[2][MAX_LOG2_SIZE]     = {{0}};
+       unsigned int    totalMaxMissChainBySize[2][MAX_LOG2_SIZE] = {{0}};
+       unsigned int    maxChainBySize[2][MAX_LOG2_SIZE]          = {{0}};
+       unsigned int    maxMissChainBySize[2][MAX_LOG2_SIZE]      = {{0}};
+       unsigned int    chainCount[MAX_CHAIN_SIZE]                = {0};
+       unsigned int    missChainCount[MAX_CHAIN_SIZE]            = {0};
+#ifdef OBJC_INSTRUMENTED
+       unsigned int    hitCountBySize[2][MAX_LOG2_SIZE]          = {{0}};
+       unsigned int    hitProbesBySize[2][MAX_LOG2_SIZE]         = {{0}};
+       unsigned int    maxHitProbesBySize[2][MAX_LOG2_SIZE]      = {{0}};
+       unsigned int    missCountBySize[2][MAX_LOG2_SIZE]         = {{0}};
+       unsigned int    missProbesBySize[2][MAX_LOG2_SIZE]        = {{0}};
+       unsigned int    maxMissProbesBySize[2][MAX_LOG2_SIZE]     = {{0}};
+       unsigned int    flushCountBySize[2][MAX_LOG2_SIZE]        = {{0}};
+       unsigned int    flushedEntriesBySize[2][MAX_LOG2_SIZE]    = {{0}};
+       unsigned int    maxFlushedEntriesBySize[2][MAX_LOG2_SIZE] = {{0}};
+#endif
+
+       printf ("Printing cache statistics\n");
+       
+       // Outermost loop - iterate over all classes
+       class_hash              = objc_getClasses ();
+       state                   = NXInitHashState (class_hash);
+       classCount              = 0;
+       negativeEntryCount      = 0;
+       cacheExpandCount        = 0;
+       while (NXNextHashState (class_hash, &state, (void **) &cls))
+       {
+               // Tally classes
+               classCount += 1;
+
+               // Control loop - do given class' cache, then its isa's cache
+               for (isMeta = 0; isMeta <= 1; isMeta += 1)
+               {
+                       Cache           cache;
+                       unsigned int    mask;
+                       unsigned int    log2Size;
+                       unsigned int    entryCount;
+
+                       // Select cache of interest
+                       cache = isMeta ? cls->isa->cache : ((struct objc_class *)cls)->cache;
+                       
+                       // Ignore empty cache... should we?
+                       if (cache == &emptyCache)
+                               continue;
+
+                       // Middle loop - do each entry in the given cache
+                       mask            = cache->mask;
+                       entryCount      = 0;
+                       totalChain      = 0;
+                       totalMissChain  = 0;
+                       maxChain        = 0;
+                       maxMissChain    = 0;
+                       for (index = 0; index < mask + 1; index += 1)
+                       {
+                               Method *                        buckets;
+                               Method                          method;
+                               uarith_t                        hash;
+                               uarith_t                        methodChain;
+                               uarith_t                        methodMissChain;
+                               uarith_t                        index2;
+                                                               
+                               // If entry is invalid, the only item of
+                               // interest is that future insert hashes 
+                               // to this entry can use it directly.
+                               buckets = cache->buckets;
+                               if (!CACHE_BUCKET_VALID(buckets[index]))
+                               {
+                                       missChainCount[0] += 1;
+                                       continue;
+                               }
+
+                               method  = buckets[index];
+                               
+                               // Tally valid entries
+                               entryCount += 1;
+                               
+                               // Tally "forward::" entries
+                               if (CACHE_BUCKET_IMP(method) == &_objc_msgForward)
+                                       negativeEntryCount += 1;
+                               
+                               // Calculate search distance (chain length) for this method
+                               hash        = (uarith_t) CACHE_BUCKET_NAME(method);
+                               methodChain = ((index - hash) & mask);
+                               
+                               // Tally chains of this length
+                               if (methodChain < MAX_CHAIN_SIZE)
+                                       chainCount[methodChain] += 1;
+                               
+                               // Keep sum of all chain lengths
+                               totalChain += methodChain;
+                               
+                               // Record greatest chain length
+                               if (methodChain > maxChain)
+                                       maxChain = methodChain;
+                               
+                               // Calculate search distance for miss that hashes here
+                               index2  = index;
+                               while (CACHE_BUCKET_VALID(buckets[index2]))
+                               {
+                                       index2 += 1;
+                                       index2 &= mask;
+                               }
+                               methodMissChain = ((index2 - index) & mask);
+                               
+                               // Tally miss chains of this length
+                               if (methodMissChain < MAX_CHAIN_SIZE)
+                                       missChainCount[methodMissChain] += 1;
+
+                               // Keep sum of all miss chain lengths in this class
+                               totalMissChain += methodMissChain;
+
+                               // Record greatest miss chain length
+                               if (methodMissChain > maxMissChain)
+                                       maxMissChain = methodMissChain;
+                       }
+
+                       // Factor this cache into statistics about caches of the same
+                       // type and size (all caches are a power of two in size)
+                       log2Size                                                 = log2 (mask + 1);
+                       cacheCountBySize[isMeta][log2Size]                      += 1;
+                       totalEntriesBySize[isMeta][log2Size]                    += entryCount;
+                       if (entryCount > maxEntriesBySize[isMeta][log2Size])
+                               maxEntriesBySize[isMeta][log2Size]               = entryCount;
+                       totalChainBySize[isMeta][log2Size]                      += totalChain;
+                       totalMissChainBySize[isMeta][log2Size]                  += totalMissChain;
+                       totalMaxChainBySize[isMeta][log2Size]                   += maxChain;
+                       totalMaxMissChainBySize[isMeta][log2Size]               += maxMissChain;
+                       if (maxChain > maxChainBySize[isMeta][log2Size])
+                               maxChainBySize[isMeta][log2Size]                 = maxChain;
+                       if (maxMissChain > maxMissChainBySize[isMeta][log2Size])
+                               maxMissChainBySize[isMeta][log2Size]             = maxMissChain;
+#ifdef OBJC_INSTRUMENTED
+                       {
+                       CacheInstrumentation *  cacheData;
+
+                       cacheData = CACHE_INSTRUMENTATION(cache);
+                       hitCountBySize[isMeta][log2Size]                        += cacheData->hitCount;
+                       hitProbesBySize[isMeta][log2Size]                       += cacheData->hitProbes;
+                       if (cacheData->maxHitProbes > maxHitProbesBySize[isMeta][log2Size])
+                               maxHitProbesBySize[isMeta][log2Size]             = cacheData->maxHitProbes;
+                       missCountBySize[isMeta][log2Size]                       += cacheData->missCount;
+                       missProbesBySize[isMeta][log2Size]                      += cacheData->missProbes;
+                       if (cacheData->maxMissProbes > maxMissProbesBySize[isMeta][log2Size])
+                               maxMissProbesBySize[isMeta][log2Size]            = cacheData->maxMissProbes;
+                       flushCountBySize[isMeta][log2Size]                      += cacheData->flushCount;
+                       flushedEntriesBySize[isMeta][log2Size]                  += cacheData->flushedEntries;
+                       if (cacheData->maxFlushedEntries > maxFlushedEntriesBySize[isMeta][log2Size])
+                               maxFlushedEntriesBySize[isMeta][log2Size]        = cacheData->maxFlushedEntries;
+                       }
+#endif
+                       // Caches start with a power of two number of entries, and grow by doubling, so
+                       // we can calculate the number of times this cache has expanded
+                       if (isMeta)
+                               cacheExpandCount += log2Size - INIT_META_CACHE_SIZE_LOG2;
+                       else
+                               cacheExpandCount += log2Size - INIT_CACHE_SIZE_LOG2;
+
+               }
+       }
+
+       {
+       unsigned int    cacheCountByType[2] = {0};
+       unsigned int    totalCacheCount     = 0;
+       unsigned int    totalEntries        = 0;
+       unsigned int    maxEntries          = 0;
+       unsigned int    totalSlots          = 0;
+#ifdef OBJC_INSTRUMENTED
+       unsigned int    totalHitCount       = 0;
+       unsigned int    totalHitProbes      = 0;
+       unsigned int    maxHitProbes        = 0;
+       unsigned int    totalMissCount      = 0;
+       unsigned int    totalMissProbes     = 0;
+       unsigned int    maxMissProbes       = 0;
+       unsigned int    totalFlushCount     = 0;
+       unsigned int    totalFlushedEntries = 0;
+       unsigned int    maxFlushedEntries   = 0;
+#endif
+       
+       totalChain      = 0;
+       maxChain        = 0;
+       totalMissChain  = 0;
+       maxMissChain    = 0;
+       
+       // Sum information over all caches
+       for (isMeta = 0; isMeta <= 1; isMeta += 1)
+       {
+               for (index = 0; index < MAX_LOG2_SIZE; index += 1)
+               {
+                       cacheCountByType[isMeta] += cacheCountBySize[isMeta][index];
+                       totalEntries       += totalEntriesBySize[isMeta][index];
+                       totalSlots         += cacheCountBySize[isMeta][index] * (1 << index);
+                       totalChain         += totalChainBySize[isMeta][index];
+                       if (maxEntriesBySize[isMeta][index] > maxEntries)
+                               maxEntries  = maxEntriesBySize[isMeta][index];
+                       if (maxChainBySize[isMeta][index] > maxChain)
+                               maxChain    = maxChainBySize[isMeta][index];
+                       totalMissChain     += totalMissChainBySize[isMeta][index];
+                       if (maxMissChainBySize[isMeta][index] > maxMissChain)
+                               maxMissChain = maxMissChainBySize[isMeta][index];
+#ifdef OBJC_INSTRUMENTED
+                       totalHitCount      += hitCountBySize[isMeta][index];
+                       totalHitProbes     += hitProbesBySize[isMeta][index];
+                       if (maxHitProbesBySize[isMeta][index] > maxHitProbes)
+                               maxHitProbes = maxHitProbesBySize[isMeta][index];
+                       totalMissCount     += missCountBySize[isMeta][index];
+                       totalMissProbes    += missProbesBySize[isMeta][index];
+                       if (maxMissProbesBySize[isMeta][index] > maxMissProbes)
+                               maxMissProbes = maxMissProbesBySize[isMeta][index];
+                       totalFlushCount    += flushCountBySize[isMeta][index];
+                       totalFlushedEntries += flushedEntriesBySize[isMeta][index];
+                       if (maxFlushedEntriesBySize[isMeta][index] > maxFlushedEntries)
+                               maxFlushedEntries = maxFlushedEntriesBySize[isMeta][index];
+#endif
+               }
+
+               totalCacheCount += cacheCountByType[isMeta];
+       }
+
+       // Log our findings
+       printf ("There are %u classes\n", classCount);
+
+       for (isMeta = 0; isMeta <= 1; isMeta += 1)
+       {
+               // Number of this type of class
+               printf    ("\nThere are %u %s-method caches, broken down by size (slot count):\n",
+                               cacheCountByType[isMeta],
+                               isMeta ? "class" : "instance");
+
+               // Print header
+               PrintCacheHeader ();
+
+               // Keep format consistent even if there are caches of this kind
+               if (cacheCountByType[isMeta] == 0)
+               {
+                       printf ("(none)\n");
+                       continue;
+               }
+
+               // Usage information by cache size
+               for (index = 0; index < MAX_LOG2_SIZE; index += 1)
+               {
+                       unsigned int    cacheCount;
+                       unsigned int    cacheSlotCount;
+                       unsigned int    cacheEntryCount;
+                       
+                       // Get number of caches of this type and size
+                       cacheCount = cacheCountBySize[isMeta][index];
+                       if (cacheCount == 0)
+                               continue;
+                       
+                       // Get the cache slot count and the total number of valid entries
+                       cacheSlotCount  = (1 << index);
+                       cacheEntryCount = totalEntriesBySize[isMeta][index];
+
+                       // Give the analysis
+                       PrintCacheInfo (cacheSlotCount,
+                                       cacheCount,
+                                       cacheEntryCount,
+                                       (float) cacheEntryCount / (float) cacheCount,
+                                       maxEntriesBySize[isMeta][index],
+                                       (float) totalChainBySize[isMeta][index] / (float) cacheEntryCount,
+                                       maxChainBySize[isMeta][index],
+                                       (float) totalMissChainBySize[isMeta][index] / (float) (cacheCount * cacheSlotCount),
+                                       maxMissChainBySize[isMeta][index]
+#ifdef OBJC_INSTRUMENTED
+                                       , hitCountBySize[isMeta][index],
+                                       hitCountBySize[isMeta][index] ? 
+                                           (float) hitProbesBySize[isMeta][index] / (float) hitCountBySize[isMeta][index] : 0.0,
+                                       maxHitProbesBySize[isMeta][index],
+                                       missCountBySize[isMeta][index],
+                                       missCountBySize[isMeta][index] ? 
+                                           (float) missProbesBySize[isMeta][index] / (float) missCountBySize[isMeta][index] : 0.0,
+                                       maxMissProbesBySize[isMeta][index],
+                                       flushCountBySize[isMeta][index],
+                                       flushCountBySize[isMeta][index] ? 
+                                           (float) flushedEntriesBySize[isMeta][index] / (float) flushCountBySize[isMeta][index] : 0.0,
+                                       maxFlushedEntriesBySize[isMeta][index]
+#endif
+                                    );
+               }
+       }
+
+       // Give overall numbers
+       printf ("\nCumulative:\n");
+       PrintCacheHeader ();
+       PrintCacheInfo (totalSlots,
+                       totalCacheCount,
+                       totalEntries,
+                       (float) totalEntries / (float) totalCacheCount,
+                       maxEntries,
+                       (float) totalChain / (float) totalEntries,
+                       maxChain,
+                       (float) totalMissChain / (float) totalSlots,
+                        maxMissChain
+#ifdef OBJC_INSTRUMENTED
+                       , totalHitCount,
+                       totalHitCount ? 
+                           (float) totalHitProbes / (float) totalHitCount : 0.0,
+                       maxHitProbes,
+                       totalMissCount,
+                       totalMissCount ? 
+                           (float) totalMissProbes / (float) totalMissCount : 0.0,
+                       maxMissProbes,
+                       totalFlushCount,
+                       totalFlushCount ? 
+                           (float) totalFlushedEntries / (float) totalFlushCount : 0.0,
+                       maxFlushedEntries
+#endif
+                               );
+
+       printf ("\nNumber of \"forward::\" entries: %d\n", negativeEntryCount);
+       printf ("Number of cache expansions: %d\n", cacheExpandCount);
+#ifdef OBJC_INSTRUMENTED
+       printf ("flush_caches:   total calls  total visits  average visits  max visits  total classes  visits/class\n");
+       printf ("                -----------  ------------  --------------  ----------  -------------  -------------\n");
+       printf ("  linear        %11u  %12u  %14.1f  %10u  %13u  %12.2f\n",
+                       LinearFlushCachesCount,
+                       LinearFlushCachesVisitedCount,
+                       LinearFlushCachesCount ?
+                           (float) LinearFlushCachesVisitedCount / (float) LinearFlushCachesCount : 0.0,
+                       MaxLinearFlushCachesVisitedCount,
+                       LinearFlushCachesVisitedCount,
+                       1.0);
+       printf ("  nonlinear     %11u  %12u  %14.1f  %10u  %13u  %12.2f\n",
+                       NonlinearFlushCachesCount,
+                       NonlinearFlushCachesVisitedCount,
+                       NonlinearFlushCachesCount ?
+                           (float) NonlinearFlushCachesVisitedCount / (float) NonlinearFlushCachesCount : 0.0,
+                       MaxNonlinearFlushCachesVisitedCount,
+                       NonlinearFlushCachesClassCount,
+                       NonlinearFlushCachesClassCount ? 
+                           (float) NonlinearFlushCachesVisitedCount / (float) NonlinearFlushCachesClassCount : 0.0);
+       printf ("  ideal         %11u  %12u  %14.1f  %10u  %13u  %12.2f\n",
+                       LinearFlushCachesCount + NonlinearFlushCachesCount,
+                       IdealFlushCachesCount,
+                       LinearFlushCachesCount + NonlinearFlushCachesCount ?
+                           (float) IdealFlushCachesCount / (float) (LinearFlushCachesCount + NonlinearFlushCachesCount) : 0.0,
+                       MaxIdealFlushCachesCount,
+                       LinearFlushCachesVisitedCount + NonlinearFlushCachesClassCount,
+                       LinearFlushCachesVisitedCount + NonlinearFlushCachesClassCount ? 
+                           (float) IdealFlushCachesCount / (float) (LinearFlushCachesVisitedCount + NonlinearFlushCachesClassCount) : 0.0);
+
+       PrintCacheHistogram ("\nCache hit histogram:",  &CacheHitHistogram[0],  CACHE_HISTOGRAM_SIZE);
+       PrintCacheHistogram ("\nCache miss histogram:", &CacheMissHistogram[0], CACHE_HISTOGRAM_SIZE);
+#endif
+
+#if 0
+       printf ("\nLookup chains:");
+       for (index = 0; index < MAX_CHAIN_SIZE; index += 1)
+       {
+               if (chainCount[index] != 0)
+                       printf ("  %u:%u", index, chainCount[index]);
+       }
+
+       printf ("\nMiss chains:");
+       for (index = 0; index < MAX_CHAIN_SIZE; index += 1)
+       {
+               if (missChainCount[index] != 0)
+                       printf ("  %u:%u", index, missChainCount[index]);
+       }
+
+       printf ("\nTotal memory usage for cache data structures: %lu bytes\n",
+                    totalCacheCount * (sizeof(struct objc_cache) - sizeof(Method)) +
+                       totalSlots * sizeof(Method) +
+                       negativeEntryCount * sizeof(struct objc_method));
+#endif
+       }
+}
+
+/***********************************************************************
+ * checkUniqueness.
+ **********************************************************************/
+void           checkUniqueness        (SEL             s1,
+                                       SEL             s2)
+{
+       if (s1 == s2)
+               return;
+       
+       if (s1 && s2 && (strcmp ((const char *) s1, (const char *) s2) == 0))
+               _NXLogError ("%p != %p but !strcmp (%s, %s)\n", s1, s2, (char *) s1, (char *) s2);
+}
+
diff --git a/runtime/objc-config.h b/runtime/objc-config.h
new file mode 100644 (file)
index 0000000..9b0b334
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+// Copyright 1988-1996 NeXT Software, Inc.
+// objc-config.h created by kthorup on Fri 24-Mar-1995
+
+// OBJC_INSTRUMENTED controls whether message dispatching is dynamically
+// monitored.  Monitoring introduces substantial overhead.
+// NOTE: To define this condition, do so in the build command, NOT by
+// uncommenting the line here.  This is because objc-class.h heeds this
+// condition, but objc-class.h can not #import this file (objc-config.h)
+// because objc-class.h is public and objc-config.h is not.
+//#define OBJC_INSTRUMENTED
+
+// OBJC_COLLECTING_CACHE controls whether the method dispatching caches
+// are lockless during dispatch.  This is a BIG speed win, but can be
+// implemented only when a thread can figure out the PCs of all the other
+// threads in the task.
+
+#if defined(hppa) || defined (__i386__) || defined (i386) || defined (m68k) || defined (__ppc__) || defined(ppc)
+    #if !defined(NeXT_PDO)
+        #define OBJC_COLLECTING_CACHE
+    #endif
+#endif
+
+// Turn on support for class refs
+#define OBJC_CLASS_REFS
+
+    #define __S(x) x
+
+#if defined(NeXT_PDO)
+    #define GENERIC_OBJC_FILE
+#endif
+
+// Get the nice macros for subroutine calling, etc.
+// Not available on all architectures.  Not needed
+// (by us) on some configurations.
+#if defined (__i386__) || defined (i386)
+    #import <architecture/i386/asm_help.h>
+#elif defined (__ppc__) || defined(ppc)
+    #import <architecture/ppc/asm_help.h>
+#elif (!defined(hppa) && !defined(sparc)) || !defined(NeXT_PDO)
+    #error We need asm_help.h for this architecture
+#endif
diff --git a/runtime/objc-errors.m b/runtime/objc-errors.m
new file mode 100644 (file)
index 0000000..0718b91
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     objc-errors.m
+ *     Copyright 1988-1996, NeXT Software, Inc.
+ */
+
+/*
+       NXLogObjcError was snarfed from "logErrorInc.c" in the kit.
+  
+       Contains code for writing error messages to stderr or syslog.
+  
+       This code is included in errors.m in the kit, and in pbs.c
+       so pbs can use it also.
+*/
+
+#if defined(WIN32)
+    #import <winnt-pdo.h>
+    #import <windows.h>
+    #import <sys/types.h>
+    #import <sys/stat.h>
+    #import <io.h>
+    #define syslog(a, b, c)    fprintf(stderr, b, c)
+#else 
+    #import <syslog.h>
+#endif
+
+    #if defined(NeXT_PDO)
+        #if !defined(WIN32)
+            #include   <syslog.h>      // major head banging in attempt to find syslog
+            #import    <stdarg.h>
+            #include   <unistd.h>      // close
+        #endif
+        #import        <fcntl.h>       // file open flags
+    #endif
+
+#import "objc-private.h"
+
+/*     
+ *     this routine handles errors that involve an object (or class).
+ */
+volatile void __objc_error(id rcv, const char *fmt, ...) 
+{ 
+       va_list vp; 
+
+       va_start(vp,fmt); 
+       (*_error)(rcv, fmt, vp); 
+       va_end(vp);
+       _objc_error (rcv, fmt, vp);     /* In case (*_error)() returns. */
+}
+
+/*
+ *     this routine is never called directly...it is only called indirectly
+ *     through "_error", which can be overriden by an application. It is
+ *     not declared static because it needs to be referenced in 
+ *     "objc-globaldata.m" (this file organization simplifies the shlib
+ *     maintenance problem...oh well). It is, however, a "private extern".
+ */
+volatile void _objc_error(id self, const char *fmt, va_list ap) 
+{ 
+    char bigBuffer[4*1024];
+
+    vsprintf (bigBuffer, fmt, ap);
+    _NXLogError ("objc: %s: %s", object_getClassName (self), bigBuffer);
+
+#if defined(WIN32)
+    RaiseException(0xdead, EXCEPTION_NONCONTINUABLE, 0, NULL);
+#else
+    abort();           /* generates a core file */
+#endif
+}
+
+/*     
+ *     this routine handles severe runtime errors...like not being able
+ *     to read the mach headers, allocate space, etc...very uncommon.
+ */
+volatile void _objc_fatal(const char *msg)
+{
+    _NXLogError("objc: %s\n", msg);
+#if defined(WIN32)
+    RaiseException(0xdead, EXCEPTION_NONCONTINUABLE, 0, NULL);
+#else
+    exit(1);
+#endif
+}
+
+/*
+ *     this routine handles soft runtime errors...like not being able
+ *      add a category to a class (because it wasn't linked in).
+ */
+void _objc_inform(const char *fmt, ...)
+{
+    va_list ap; 
+    char bigBuffer[4*1024];
+
+    va_start (ap,fmt); 
+    vsprintf (bigBuffer, fmt, ap);
+    _NXLogError ("objc: %s", bigBuffer);
+    va_end (ap);
+}
+
diff --git a/runtime/objc-file.m b/runtime/objc-file.m
new file mode 100644 (file)
index 0000000..795b7f7
--- /dev/null
@@ -0,0 +1,828 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+// Copyright 1988-1996 NeXT Software, Inc.
+
+#if defined(__APPLE__) && defined(__MACH__)
+#import "objc-private.h"
+#import <mach-o/ldsyms.h>
+#import <mach-o/dyld.h>
+#include <string.h>
+#include <stdlib.h>
+
+#import <crt_externs.h>
+
+/* prototype coming soon to <mach-o/getsect.h> */
+extern char *getsectdatafromheader(
+    struct mach_header *mhp,
+    char *segname,
+    char *sectname,
+    int *size);
+
+/* Returns an array of all the objc headers in the executable
+ * Caller is responsible for freeing.
+ */    
+headerType **_getObjcHeaders()
+{
+  const struct mach_header **headers;
+  headers = malloc(sizeof(struct mach_header *) * 2);
+  headers[0] = (const struct mach_header *)_NSGetMachExecuteHeader();
+  headers[1] = 0;
+  return (headerType**)headers;
+}
+
+Module _getObjcModules(headerType *head, int *nmodules)
+{
+  unsigned size;
+  void *mods = getsectdatafromheader((headerType *)head,
+                                     SEG_OBJC,
+                                    SECT_OBJC_MODULES,
+                                    &size);
+  *nmodules = size / sizeof(struct objc_module);
+  return (Module)mods;
+}
+
+SEL *_getObjcMessageRefs(headerType *head, int *nmess)
+{
+  unsigned size;
+  void *refs = getsectdatafromheader ((headerType *)head,
+                                 SEG_OBJC, "__message_refs", &size);
+  *nmess = size / sizeof(SEL);
+  return (SEL *)refs;
+}
+
+ProtocolTemplate *_getObjcProtocols(headerType *head, int *nprotos)
+{
+  unsigned size;
+  void *protos = getsectdatafromheader ((headerType *)head,
+                                SEG_OBJC, "__protocol", &size);
+  *nprotos = size / sizeof(ProtocolTemplate);
+  return (ProtocolTemplate *)protos;
+}
+
+NXConstantStringTemplate *_getObjcStringObjects(headerType *head, int *nstrs)
+{
+  *nstrs = 0;
+  return NULL;
+}
+
+Class *_getObjcClassRefs(headerType *head, int *nclasses)
+{
+  unsigned size;
+  void *classes = getsectdatafromheader ((headerType *)head,
+                                SEG_OBJC, "__cls_refs", &size);
+  *nclasses = size / sizeof(Class);
+  return (Class *)classes;
+}
+
+/* returns start of all objective-c info and the size of the data */
+void *_getObjcHeaderData(headerType *head, unsigned *size)
+{
+  struct segment_command *sgp;
+  unsigned long i;
+  
+  sgp = (struct segment_command *) ((char *)head + sizeof(headerType));
+  for(i = 0; i < ((headerType *)head)->ncmds; i++){
+      if(sgp->cmd == LC_SEGMENT)
+         if(strncmp(sgp->segname, "__OBJC", sizeof(sgp->segname)) == 0) {
+           *size = sgp->filesize;
+           return (void*)sgp;
+           }
+      sgp = (struct segment_command *)((char *)sgp + sgp->cmdsize);
+  }
+  *size = 0;
+  return nil;
+}
+
+static const headerType *_getExecHeader (void)
+{
+       return (const struct mach_header *)_NSGetMachExecuteHeader();
+}
+
+const char *_getObjcHeaderName(headerType *header)
+{
+    const headerType *execHeader;
+    const struct fvmlib_command *libCmd, *endOfCmds;
+    char **argv;
+#if !defined(NeXT_PDO)
+    extern char ***_NSGetArgv();
+    argv = *_NSGetArgv();
+#else
+    extern char **NXArgv;
+    argv = NXArgv;
+#endif
+       
+    if (header && ((headerType *)header)->filetype == MH_FVMLIB) {
+           execHeader = _getExecHeader();
+           for (libCmd = (const struct fvmlib_command *)(execHeader + 1),
+                 endOfCmds = ((void *)libCmd) + execHeader->sizeofcmds;
+                 libCmd < endOfCmds; ((void *)libCmd) += libCmd->cmdsize) {
+                   if ((libCmd->cmd == LC_LOADFVMLIB) && (libCmd->fvmlib.header_addr
+                           == (unsigned long)header)) {
+                           return (char *)libCmd
+                                   + libCmd->fvmlib.name.offset;
+                   }
+           }
+           return NULL;
+   } else {
+      unsigned long i, n = _dyld_image_count();
+      for( i = 0; i < n ; i++ ) {
+         if ( _dyld_get_image_header(i) == header )
+            return _dyld_get_image_name(i);
+      }
+      return argv[0];
+   }
+}
+
+#elif defined(hpux) || defined(__hpux__)
+
+/* 
+ *      Objective-C runtime information module.
+ *      This module is specific to hp-ux a.out format files.
+ */
+
+#import <pdo.h>        // place where padding_bug would be
+#include <a.out.h>
+#include "objc-private.h"
+
+OBJC_EXPORT int __argc_value;
+OBJC_EXPORT char **__argv_value;
+int NXArgc = 0;
+char **NXArgv = NULL;
+
+OBJC_EXPORT unsigned SEG_OBJC_CLASS_START;
+OBJC_EXPORT unsigned SEG_OBJC_METACLASS_START;
+OBJC_EXPORT unsigned SEG_OBJC_CAT_CLS_METH_START;
+OBJC_EXPORT unsigned SEG_OBJC_CAT_INST_METH_START;
+OBJC_EXPORT unsigned SEG_OBJC_CLS_METH_START;
+OBJC_EXPORT unsigned SEG_OBJC_INST_METHODS_START;
+OBJC_EXPORT unsigned SEG_OBJC_MESSAGE_REFS_START;
+OBJC_EXPORT unsigned SEG_OBJC_SYMBOLS_START;
+OBJC_EXPORT unsigned SEG_OBJC_CATEGORY_START;
+OBJC_EXPORT unsigned SEG_OBJC_PROTOCOL_START;
+OBJC_EXPORT unsigned SEG_OBJC_CLASS_VARS_START;
+OBJC_EXPORT unsigned SEG_OBJC_INSTANCE_VARS_START;
+OBJC_EXPORT unsigned SEG_OBJC_MODULES_START;
+OBJC_EXPORT unsigned SEG_OBJC_STRING_OBJECT_START;
+OBJC_EXPORT unsigned SEG_OBJC_CLASS_NAMES_START;
+OBJC_EXPORT unsigned SEG_OBJC_METH_VAR_NAMES_START;
+OBJC_EXPORT unsigned SEG_OBJC_METH_VAR_TYPES_START;
+OBJC_EXPORT unsigned SEG_OBJC_CLS_REFS_START;
+
+OBJC_EXPORT unsigned SEG_OBJC_CLASS_END;
+OBJC_EXPORT unsigned SEG_OBJC_METACLASS_END;
+OBJC_EXPORT unsigned SEG_OBJC_CAT_CLS_METH_END;
+OBJC_EXPORT unsigned SEG_OBJC_CAT_INST_METH_END;
+OBJC_EXPORT unsigned SEG_OBJC_CLS_METH_END;
+OBJC_EXPORT unsigned SEG_OBJC_INST_METHODS_END;
+OBJC_EXPORT unsigned SEG_OBJC_MESSAGE_REFS_END;
+OBJC_EXPORT unsigned SEG_OBJC_SYMBOLS_END;
+OBJC_EXPORT unsigned SEG_OBJC_CATEGORY_END;
+OBJC_EXPORT unsigned SEG_OBJC_PROTOCOL_END;
+OBJC_EXPORT unsigned SEG_OBJC_CLASS_VARS_END;
+OBJC_EXPORT unsigned SEG_OBJC_INSTANCE_VARS_END;
+OBJC_EXPORT unsigned SEG_OBJC_MODULES_END;
+OBJC_EXPORT unsigned SEG_OBJC_STRING_OBJECT_END;
+OBJC_EXPORT unsigned SEG_OBJC_CLASS_NAMES_END;
+OBJC_EXPORT unsigned SEG_OBJC_METH_VAR_NAMES_END;
+OBJC_EXPORT unsigned SEG_OBJC_METH_VAR_TYPES_END;
+OBJC_EXPORT unsigned SEG_OBJC_CLS_REFS_END;
+
+typedef struct _simple_header_struct {
+       char *  subspace_name   ;
+       void *  start_address   ;
+       void *  end_address     ;
+       } simple_header_struct ;
+
+static simple_header_struct our_objc_header[] = {
+       { "$$OBJC_CLASS$$",             &SEG_OBJC_CLASS_START,          &SEG_OBJC_CLASS_END },
+       { "$$OBJC_METACLASS$$",         &SEG_OBJC_METACLASS_START,      &SEG_OBJC_METACLASS_END },
+       { "$$OBJC_CAT_CLS_METH$$",      &SEG_OBJC_CAT_CLS_METH_START,   &SEG_OBJC_CAT_CLS_METH_END },
+       { "$$OBJC_CAT_INST_METH$$",     &SEG_OBJC_CAT_INST_METH_START,  &SEG_OBJC_CAT_INST_METH_END },
+       { "$$OBJC_CLS_METH$$",          &SEG_OBJC_CLS_METH_START,       &SEG_OBJC_CLS_METH_END },
+       { "$$OBJC_INST_METHODS$$",      &SEG_OBJC_INST_METHODS_START,   &SEG_OBJC_INST_METHODS_END },
+       { "$$OBJC_MESSAGE_REFS$$",      &SEG_OBJC_MESSAGE_REFS_START,   &SEG_OBJC_MESSAGE_REFS_END },
+       { "$$OBJC_SYMBOLS$$",           &SEG_OBJC_SYMBOLS_START,        &SEG_OBJC_SYMBOLS_END },
+       { "$$OBJC_CATEGORY$$",          &SEG_OBJC_CATEGORY_START,       &SEG_OBJC_CATEGORY_END },
+       { "$$OBJC_PROTOCOL$$",          &SEG_OBJC_PROTOCOL_START,       &SEG_OBJC_PROTOCOL_END },
+       { "$$OBJC_CLASS_VARS$$",        &SEG_OBJC_CLASS_VARS_START,     &SEG_OBJC_CLASS_VARS_END },
+       { "$$OBJC_INSTANCE_VARS$$",     &SEG_OBJC_INSTANCE_VARS_START,  &SEG_OBJC_INSTANCE_VARS_END },
+       { "$$OBJC_MODULES$$",           &SEG_OBJC_MODULES_START,        &SEG_OBJC_MODULES_END },
+       { "$$OBJC_STRING_OBJECT$$",     &SEG_OBJC_STRING_OBJECT_START,  &SEG_OBJC_STRING_OBJECT_END },
+       { "$$OBJC_CLASS_NAMES$$",       &SEG_OBJC_CLASS_NAMES_START,    &SEG_OBJC_CLASS_NAMES_END },
+       { "$$OBJC_METH_VAR_NAMES$$",    &SEG_OBJC_METH_VAR_TYPES_START, &SEG_OBJC_METH_VAR_NAMES_END },
+       { "$$OBJC_METH_VAR_TYPES$$",    &SEG_OBJC_METH_VAR_TYPES_START, &SEG_OBJC_METH_VAR_TYPES_END },
+       { "$$OBJC_CLS_REFS$$",          &SEG_OBJC_CLS_REFS_START,       &SEG_OBJC_CLS_REFS_END },
+       { NULL, NULL, NULL }
+       };
+
+/* Returns an array of all the objc headers in the executable (and shlibs)
+ * Caller is responsible for freeing.
+ */
+headerType **_getObjcHeaders()
+{
+
+  /* Will need to fill in with any shlib info later as well.  Need more
+   * info on this.
+   */
+  
+  /*
+   *   this is truly ugly, hpux does not map in the header so we have to
+   *   try and find it and map it in.  their crt0 has some global vars
+   *    that hold argv[0] which we will use to find the executable file
+   */
+
+  headerType **hdrs = (headerType**)malloc(2 * sizeof(headerType*));
+  NXArgv = __argv_value;
+  NXArgc = __argc_value;
+  hdrs[0] = &our_objc_header;
+  hdrs[1] = 0;
+  return hdrs;
+}
+
+// I think we are getting the address of the table (ie the table itself) 
+//     isn't that expensive ?
+static void *getsubspace(headerType *objchead, char *sname, unsigned *size)
+{
+       simple_header_struct *table = (simple_header_struct *)objchead;
+       int i = 0;
+
+       while (  table[i].subspace_name){
+               if (!strcmp(table[i].subspace_name, sname)){
+                       *size = table[i].end_address - table[i].start_address;
+                       return table[i].start_address;
+               }
+               i++;
+       }
+       *size = 0;
+       return nil;
+}
+
+Module _getObjcModules(headerType *head, int *nmodules)
+{
+  unsigned size;
+  void *mods = getsubspace(head,"$$OBJC_MODULES$$",&size);
+  *nmodules = size / sizeof(struct objc_module);
+  return (Module)mods;
+}
+
+SEL *_getObjcMessageRefs(headerType *head, int *nmess)
+{
+  unsigned size;
+  void *refs = getsubspace (head,"$$OBJC_MESSAGE_REFS$$", &size);
+  *nmess = size / sizeof(SEL);
+  return (SEL *)refs;
+}
+
+struct proto_template *_getObjcProtocols(headerType *head, int *nprotos)
+{
+  unsigned size;
+  char *p;
+  char *end;
+  char *start;
+
+  start = getsubspace (head,"$$OBJC_PROTOCOL$$", &size);
+
+#ifdef PADDING_BUG
+  /*
+   * XXX: Look for padding of 4 zero bytes and remove it.
+   * XXX: Depends upon first four bytes of a proto_template never being 0.
+   * XXX: Somebody should check to see if this is really the case.
+   */
+  end = start + size;
+  for (p = start; p < end; p += sizeof(struct proto_template)) {
+      if (!p[0] && !p[1] && !p[2] && !p[3]) {
+          memcpy(p, p + sizeof(long), (end - p) - sizeof(long));
+          end -= sizeof(long);
+      }
+  }
+  size = end - start;
+#endif
+  *nprotos = size / sizeof(struct proto_template);
+  return ((struct proto_template *)start);
+}
+
+NXConstantStringTemplate *_getObjcStringObjects(headerType *head, int *nstrs)
+{
+  unsigned size;
+  void *str = getsubspace (head,"$$OBJC_STRING_OBJECT$$", &size);
+  *nstrs = size / sizeof(NXConstantStringTemplate);
+  return (NXConstantStringTemplate *)str;
+}
+
+Class *_getObjcClassRefs(headerType *head, int *nclasses)
+{
+  unsigned size;
+  void *classes = getsubspace (head,"$$OBJC_CLS_REFS$$", &size);
+  *nclasses = size / sizeof(Class);
+  return (Class *)classes;
+}
+
+/* returns start of all objective-c info and the size of the data */
+void *_getObjcHeaderData(headerType *head, unsigned *size)
+{
+#warning _getObjcHeaderData not implemented yet
+  *size = 0;
+  return nil;
+}
+
+
+const char *_getObjcHeaderName(headerType *header)
+{
+  return "oh poo";
+}
+
+#else
+
+/* 
+ *      Objective-C runtime information module.
+ *      This module is generic for all object format files.
+ */
+
+#import <pdo.h>
+#import <Protocol.h>
+#import "objc-private.h"
+#if defined(WIN32)
+    #import <stdlib.h>
+#endif
+
+int            NXArgc = 0;
+char   **      NXArgv = NULL;
+
+
+char ***_NSGetArgv(void)
+{
+       return &NXArgv;
+}
+
+int *_NSGetArgc(void)
+{
+       return &NXArgc;
+
+}
+
+#if defined(WIN32)
+    OBJC_EXPORT char ***_environ_dll;
+#elif defined(NeXT_PDO)
+    OBJC_EXPORT char ***environ;
+#endif
+
+char ***_NSGetEnviron(void)
+{
+#if defined(WIN32)
+       return (char ***)_environ_dll;
+#elif defined(NeXT_PDO)
+       return (char ***)&environ;
+#else
+        #warning "_NSGetEnviron() is unimplemented for this architecture"
+       return (char ***)NULL;
+#endif
+}
+
+
+#if !defined(__hpux__) && !defined(hpux) && !defined(__osf__) 
+    const char OBJC_METH_VAR_NAME_FORWARD[10]="forward::";
+#else
+    OBJC_EXPORT char OBJC_METH_VAR_NAME_FORWARD[];
+#endif
+
+static objcSectionStruct objcHeaders = {0,0,sizeof(objcModHeader)};
+objcModHeader *CMH = 0;  // Current Module Header
+
+int _objcModuleCount() {
+   return objcHeaders.count;
+}
+
+const char *_objcModuleNameAtIndex(int i) {
+   if ( i < 0 || i >= objcHeaders.count)
+      return NULL;
+   return ((objcModHeader*)objcHeaders.data + i)->name;
+}
+
+static inline void allocElements (objcSectionStruct *ptr, int nelmts)
+{
+    if (ptr->data == 0) {
+        ptr->data = (void*)malloc ((ptr->count+nelmts) * ptr->size);
+    } else {
+        volatile void *tempData = (void *)realloc(ptr->data, (ptr->count+nelmts) * ptr->size);
+        ptr->data = (void **)tempData;
+    }
+
+    bzero((char*)ptr->data + ptr->count * ptr->size, ptr->size * nelmts);
+}
+
+OBJC_EXPORT void _objcInit(void);
+void objc_finish_header (void)
+{
+     _objcInit ();
+     CMH = (objcModHeader *)0;
+     // leaking like a stuck pig.
+}
+
+void objc_register_header_name (const char * name) {
+    if (name) {
+        CMH->name = malloc(strlen(name)+1);
+#if defined(WIN32) || defined(__svr4__)
+               bzero(CMH->name, (strlen(name)+1));
+#endif 
+        strcpy(CMH->name, name);
+    }
+}
+
+void objc_register_header (const char * name)
+{
+    if (CMH) {
+       // we've already registered a header (probably via __objc_execClass), 
+       // so just update the name.
+       if (CMH->name)
+         free(CMH->name);
+    } else {
+        allocElements (&objcHeaders, 1);
+        CMH = (objcModHeader *)objcHeaders.data + objcHeaders.count;
+        objcHeaders.count++;
+        bzero(CMH, sizeof(objcModHeader));
+
+        CMH->Modules.size       = sizeof(struct objc_module);
+        CMH->Classes.size       = sizeof(void *);
+        CMH->Protocols.size     = sizeof(void *);
+        CMH->StringObjects.size = sizeof(void *);
+    }
+    objc_register_header_name(name);
+}
+
+#if defined(DEBUG)
+void printModule(Module mod)
+{
+    printf("name=\"%s\", symtab=%x\n", mod->name, mod->symtab);
+}
+
+void dumpModules(void)
+{
+    int i,j;
+    Module mod;
+    objcModHeader *cmh;
+
+    printf("dumpModules(): found %d header(s)\n", objcHeaders.count);
+    for (j=0; j<objcHeaders.count; ++j) {
+               cmh = (objcModHeader *)objcHeaders.data + j;
+
+       printf("===%s, found %d modules\n", cmh->name, cmh->Modules.count);
+
+
+       mod = (Module)cmh->Modules.data;
+    
+       for (i=0; i<cmh->Modules.count; i++) {
+                   printf("\tname=\"%s\", symtab=%x, sel_ref_cnt=%d\n", mod->name, mod->symtab, (Symtab)(mod->symtab)->sel_ref_cnt);
+           mod++;
+       }
+    }
+}
+#endif  // DEBUG
+
+static inline void addObjcProtocols(struct objc_protocol_list * pl)
+{
+   if ( !pl )
+      return;
+   else {
+      int count = 0;
+      struct objc_protocol_list *list = pl;
+      while ( list ) {
+         count += list->count;
+         list = list->next;
+      }
+      allocElements( &CMH->Protocols, count );
+
+      list = pl;
+      while ( list ) {
+         int i = 0;
+         while ( i < list->count )
+            CMH->Protocols.data[ CMH->Protocols.count++ ] = (void*) list->list[i++];
+         list = list->next;
+      }
+
+      list = pl;
+      while ( list ) {
+         int i = 0;
+         while ( i < list->count )
+            addObjcProtocols( ((ProtocolTemplate*)list->list[i++])->protocol_list );
+         list = list->next;
+      }
+   }
+}
+
+static void
+_parseObjcModule(struct objc_symtab *symtab)
+{
+    int i=0, j=0, k;
+    SEL *refs = symtab->refs, sel;
+
+
+    // Add the selector references
+
+    if (refs)
+    {
+        symtab->sel_ref_cnt = 0;
+
+        while (*refs)
+        {
+            symtab->sel_ref_cnt++;
+            // don't touvh the VM page if not necessary
+            if ( (sel = sel_registerNameNoCopy ((const char *)*refs)) != *refs ) {
+                *refs = sel;
+            }
+            refs++;
+        }
+    }
+
+    // Walk through all of the ObjC Classes
+
+    if ((k = symtab->cls_def_cnt))
+      {
+       allocElements (&CMH->Classes, k);
+
+       for ( i=0, j = symtab->cls_def_cnt; i < j; i++ )
+         {
+           struct objc_class       *class;
+           unsigned loop;
+           
+           class  = (struct objc_class *)symtab->defs[i];
+           objc_addClass(class);
+           CMH->Classes.data[ CMH->Classes.count++ ] = (void*) class->name;
+           addObjcProtocols (class->protocols);
+
+            // ignore fixing up the selectors to be unique (for now; done lazily later)
+
+         }
+      }
+
+    // Walk through all of the ObjC Categories
+
+    if ((k = symtab->cat_def_cnt))
+      {
+       allocElements (&CMH->Classes, k);
+
+       for ( j += symtab->cat_def_cnt;
+            i < j;
+            i++ )
+         {
+           struct objc_category       *category;
+           
+           category  = (struct objc_category *)symtab->defs[i];
+           CMH->Classes.data[ CMH->Classes.count++ ] = 
+               (void*) category->class_name;
+
+           addObjcProtocols (category->protocols);
+
+            // ignore fixing the selectors to be unique
+            // this is now done lazily upon use
+           //_objc_inlined_fixup_selectors_in_method_list(category->instance_methods);
+           //_objc_inlined_fixup_selectors_in_method_list(category->class_methods);
+         }
+      }
+
+
+    // Walk through all of the ObjC Static Strings
+
+    if ((k = symtab->obj_defs))
+      {
+       allocElements (&CMH->StringObjects, k);
+
+       for ( j += symtab->obj_defs;
+            i < j;
+            i++ )
+         {
+           NXConstantStringTemplate *string = ( NXConstantStringTemplate *)symtab->defs[i];
+           CMH->StringObjects.data[ CMH->StringObjects.count++ ] = 
+               (void*) string;
+         }
+      }
+
+    // Walk through all of the ObjC Static Protocols
+
+    if ((k = symtab->proto_defs))
+      {
+       allocElements (&CMH->Protocols, k);
+
+       for ( j += symtab->proto_defs;
+            i < j;
+            i++ )
+         {
+           ProtocolTemplate *proto = ( ProtocolTemplate *)symtab->defs[i];
+            allocElements (&CMH->Protocols, 1);
+           CMH->Protocols.data[ CMH->Protocols.count++ ] = 
+               (void*) proto;
+
+           addObjcProtocols(proto->protocol_list);
+         }
+      }
+}
+
+// used only as a dll initializer on Windows and/or hppa (!)
+void __objc_execClass(Module mod)
+{
+    sel_registerName ((const char *)OBJC_METH_VAR_NAME_FORWARD);
+
+    if (CMH == 0) {
+           objc_register_header(NXArgv ? NXArgv[0] : "");
+    }
+
+    allocElements (&CMH->Modules, 1);
+
+    memcpy( (Module)CMH->Modules.data 
+                  + CMH->Modules.count,
+           mod,
+           sizeof(struct objc_module));
+    CMH->Modules.count++;
+
+    _parseObjcModule(mod->symtab);
+}
+
+const char * NSModulePathForClass(Class cls)
+{
+#if defined(WIN32)
+    int i, j, k;
+
+    for (i = 0; i < objcHeaders.count; i++) {
+       volatile objcModHeader *aHeader = (objcModHeader *)objcHeaders.data + i;
+       for (j = 0; j < aHeader->Modules.count; j++) {
+           Module mod = (void *)(aHeader->Modules.data) + j * aHeader->Modules.size;
+           struct objc_symtab *symtab = mod->symtab;
+           for (k = 0; k < symtab->cls_def_cnt; k++) {
+               if (cls == (Class)symtab->defs[k])
+                   return aHeader->name;
+           }
+       }
+    }
+#else
+    #warning "NSModulePathForClass is not fully implemented!"
+#endif
+    return NULL;
+}
+
+unsigned int _objc_goff_headerCount (void)
+{
+    return objcHeaders.count;
+}
+
+/* Build the header vector, of all headers seen so far. */
+
+struct header_info *_objc_goff_headerVector ()
+{
+  unsigned int hidx;
+  struct header_info *hdrVec;
+
+  hdrVec = malloc_zone_malloc (_objc_create_zone(),
+                         objcHeaders.count * sizeof (struct header_info));
+#if defined(WIN32) || defined(__svr4__)
+  bzero(hdrVec, (objcHeaders.count * sizeof (struct header_info)));
+#endif
+
+  for (hidx = 0; hidx < objcHeaders.count; hidx++)
+    {
+      objcModHeader *aHeader = (objcModHeader *)objcHeaders.data + hidx;
+      hdrVec[hidx].mhdr = (headerType**) aHeader;
+      hdrVec[hidx].mod_ptr = (Module)(aHeader->Modules.data);
+    }
+  return hdrVec;
+}
+
+
+#if defined(sparc)
+    int __NXArgc = 0;
+    char ** __NXArgv = 0;  
+#endif 
+
+/* Returns an array of all the objc headers in the executable (and shlibs)
+ * Caller is responsible for freeing.
+ */
+headerType **_getObjcHeaders()
+{
+                                                                  
+#if defined(__hpux__) || defined(hpux)
+    OBJC_EXPORT int __argc_value;
+    OBJC_EXPORT char ** __argv_value;
+#endif
+
+  /* Will need to fill in with any shlib info later as well.  Need more
+   * info on this.
+   */
+  
+  headerType **hdrs = (headerType**)malloc(2 * sizeof(headerType*));
+#if defined(WIN32) || defined(__svr4__)
+  bzero(hdrs, (2 * sizeof(headerType*)));
+#endif
+#if defined(__hpux__) || defined(hpux)
+  NXArgv = __argv_value;
+  NXArgc = __argc_value;
+#else /* __hpux__ || hpux */
+#if defined(sparc) 
+  NXArgv = __NXArgv;
+  NXArgc = __NXArgc;
+#endif /* sparc */
+#endif /* __hpux__ || hpux */
+
+  hdrs[0] = (headerType*)CMH;
+  hdrs[1] = 0;
+  return hdrs;
+}
+
+static objcModHeader *_getObjcModHeader(headerType *head)
+{
+       return (objcModHeader *)head;
+}
+Module _getObjcModules(headerType *head, int *size)
+{
+    objcModHeader *modHdr = _getObjcModHeader(head);
+    if (modHdr) {
+       *size = modHdr->Modules.count;
+       return (Module)(modHdr->Modules.data);
+    }
+    else {
+       *size = 0;
+       return (Module)0;
+    }
+}
+
+ProtocolTemplate **_getObjcProtocols(headerType *head, int *nprotos)
+{
+    objcModHeader *modHdr = _getObjcModHeader(head);
+
+    if (modHdr) {
+       *nprotos = modHdr->Protocols.count;
+       return (ProtocolTemplate **)modHdr->Protocols.data;
+    }
+    else {
+       *nprotos = 0;
+       return (ProtocolTemplate **)0;
+    }
+}
+
+
+NXConstantStringTemplate **_getObjcStringObjects(headerType *head, int *nstrs)
+{
+    objcModHeader *modHdr = _getObjcModHeader(head);
+
+    if (modHdr) {
+       *nstrs = modHdr->StringObjects.count;
+       return (NXConstantStringTemplate **)modHdr->StringObjects.data;
+    }
+    else {
+       *nstrs = 0;
+       return (NXConstantStringTemplate **)0;
+    }
+}
+
+Class *_getObjcClassRefs(headerType *head, int *nclasses)
+{
+    objcModHeader *modHdr = _getObjcModHeader(head);
+
+    if (modHdr) {
+       *nclasses = modHdr->Classes.count;
+       return (Class *)modHdr->Classes.data;
+    }
+    else {
+       *nclasses = 0;
+       return (Class *)0;
+    }
+}
+
+/* returns start of all objective-c info and the size of the data */
+void *_getObjcHeaderData(headerType *head, unsigned *size)
+{
+  *size = 0;
+  return NULL;
+}
+
+SEL *_getObjcMessageRefs(headerType *head, int *nmess)
+{
+  *nmess = 0;
+  return (SEL *)NULL;
+}
+
+const char *_getObjcHeaderName(headerType *header)
+{
+  return "InvalidHeaderName";
+}
+#endif
diff --git a/runtime/objc-load.h b/runtime/objc-load.h
new file mode 100644 (file)
index 0000000..b0e0836
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     objc-load.h
+ *     Copyright 1988-1996, NeXT Software, Inc.
+ */
+
+#ifndef _OBJC_LOAD_H_
+#define _OBJC_LOAD_H_
+
+#if !defined(NeXT_PDO)
+#import <objc/objc-class.h>
+
+#import <mach-o/loader.h>
+
+/* dynamically loading Mach-O object files that contain Objective-C code */
+
+OBJC_EXPORT long objc_loadModules (
+       char *modlist[], 
+       void *errStream,
+       void (*class_callback) (Class, Category),
+       /*headerType*/ struct mach_header **hdr_addr,
+       char *debug_file
+);
+OBJC_EXPORT int objc_loadModule (
+       char *  moduleName, 
+       void    (*class_callback) (Class, Category),
+       int *   errorCode);
+OBJC_EXPORT long objc_unloadModules(
+       void *errorStream,                              /* input (optional) */
+       void (*unloadCallback)(Class, Category)         /* input (optional) */
+);
+
+OBJC_EXPORT void objc_register_header_name(
+       char *name                                      /* input */
+);
+
+OBJC_EXPORT void objc_register_header(
+       char *name                                      /* input */
+);
+
+#endif NeXT_PDO
+#endif /* _OBJC_LOAD_H_ */
diff --git a/runtime/objc-load.m b/runtime/objc-load.m
new file mode 100644 (file)
index 0000000..68c0b4b
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *      
+ * @APPLE_LICENSE_HEADER_START@
+ *      
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */ 
+
+/*
+ *     objc-load.m
+ *     Copyright 1988-1996, NeXT Software, Inc.
+ *     Author: s. naroff
+ *
+ */
+
+#import "objc-private.h"
+#import <objc/objc-runtime.h>
+#import <objc/hashtable2.h>
+#import <objc/Object.h>
+#import <objc/Protocol.h>
+
+#if defined(__MACH__) || defined(WIN32)        
+#import <streams/streams.h>
+#endif 
+
+
+#if !defined(NeXT_PDO)
+    // MACH
+    #include <mach-o/dyld.h>
+#endif 
+
+#if defined(WIN32)
+    #import <winnt-pdo.h>
+    #import <windows.h>
+#endif
+
+#if defined(__svr4__)
+    #import <dlfcn.h>
+#endif
+
+#if defined(__hpux__) || defined(hpux)
+    #import "objc_hpux_register_shlib.c"
+#endif
+
+extern char *  getsectdatafromheader   (const headerType * mhp, const char * segname, const char * sectname,  int * size);
+
+/* Private extern */
+OBJC_EXPORT void (*callbackFunction)( Class, const char * );
+
+
+struct objc_method_list **get_base_method_list(Class cls) {
+    struct objc_method_list **ptr = ((struct objc_class * )cls)->methodLists;
+    if (!*ptr) return NULL;
+    while ( *ptr != 0 && *ptr != END_OF_METHODS_LIST ) { ptr++; }
+    --ptr;
+    return ptr;
+}
+
+
+#if defined(NeXT_PDO) // GENERIC_OBJ_FILE
+    void send_load_message_to_class(Class cls, void *header_addr)
+    {
+       struct objc_method_list **mlistp = get_base_method_list(cls->isa);
+       struct objc_method_list *mlist = mlistp ? *mlistp : NULL;
+       IMP load_method;
+
+       if (mlist) {
+               load_method = 
+                  class_lookupNamedMethodInMethodList(mlist, "finishLoading:");
+
+               /* go directly there, we do not want to accidentally send
+                  the finishLoading: message to one of its categories...
+               */
+               if (load_method)
+                       (*load_method)((id)cls, @selector(finishLoading:), 
+                               header_addr);
+       }
+    }
+
+    void send_load_message_to_category(Category cat, void *header_addr)
+    {
+       struct objc_method_list *mlist = cat->class_methods;
+       IMP load_method;
+       Class cls;
+
+       if (mlist) {
+               load_method = 
+                  class_lookupNamedMethodInMethodList(mlist, "finishLoading:");
+
+               cls = objc_getClass (cat->class_name);
+
+               /* go directly there, we do not want to accidentally send
+                  the finishLoading: message to one of its categories...
+               */
+               if (load_method)
+                       (*load_method)(cls, @selector(finishLoading:), 
+                               header_addr);
+       }
+    }
+#endif // GENERIC_OBJ_FILE
+
+/**********************************************************************************
+ * objc_loadModule.
+ *
+ * NOTE: Loading isn't really thread safe.  If a load message recursively calls
+ * objc_loadModules() both sets will be loaded correctly, but if the original
+ * caller calls objc_unloadModules() it will probably unload the wrong modules.
+ * If a load message calls objc_unloadModules(), then it will unload
+ * the modules currently being loaded, which will probably cause a crash.
+ *
+ * Error handling is still somewhat crude.  If we encounter errors while
+ * linking up classes or categories, we will not recover correctly.
+ *
+ * I removed attempts to lock the class hashtable, since this introduced
+ * deadlock which was hard to remove.  The only way you can get into trouble
+ * is if one thread loads a module while another thread tries to access the
+ * loaded classes (using objc_lookUpClass) before the load is complete.
+ **********************************************************************************/
+int            objc_loadModule    (const char *                        moduleName, 
+                                                       void                    (*class_callback) (Class, const char *categoryName),
+                                                       int *                   errorCode)
+{
+       int                                                             successFlag = 1;
+       int                                                             locErrorCode;
+#if defined(__MACH__)  
+       NSObjectFileImage                               objectFileImage;
+       NSObjectFileImageReturnCode             code;
+#endif
+#if defined(WIN32) || defined(__svr4__) || defined(__hpux__) || defined(hpux)
+       void *          handle;
+       void            (*save_class_callback) (Class, const char *) = load_class_callback;
+#endif
+
+       // So we don't have to check this everywhere
+       if (errorCode == NULL)
+               errorCode = &locErrorCode;
+
+#if defined(__MACH__)
+       if (moduleName == NULL)
+       {
+               *errorCode = NSObjectFileImageInappropriateFile;
+               return 0;
+       }
+
+       if (_dyld_present () == 0)
+       {
+               *errorCode = NSObjectFileImageFailure;
+               return 0;
+       }
+
+       callbackFunction = class_callback;
+       code = NSCreateObjectFileImageFromFile (moduleName, &objectFileImage);
+       if (code != NSObjectFileImageSuccess)
+       {
+               *errorCode = code;
+               return 0;
+       }
+
+#if !defined(__OBJC_DONT_USE_NEW_NSLINK_OPTION__)
+       if (NSLinkModule(objectFileImage, moduleName, NSLINKMODULE_OPTION_RETURN_ON_ERROR) == NULL) {
+           NSLinkEditErrors error;
+           int errorNum;
+           char *fileName, *errorString;
+           NSLinkEditError(&error, &errorNum, &fileName, &errorString);
+           // These errors may overlap with other errors that objc_loadModule returns in other failure cases.
+           *errorCode = error;
+           return 0;
+       }
+#else
+        (void)NSLinkModule(objectFileImage, moduleName, NSLINKMODULE_OPTION_NONE);
+#endif
+       callbackFunction = NULL;
+
+#else
+       // The PDO cases
+       if (moduleName == NULL)
+       {
+               *errorCode = 0;
+               return 0;
+       }
+
+       OBJC_LOCK(&loadLock);
+
+#if defined(WIN32) || defined(__svr4__) || defined(__hpux__) || defined(hpux)
+
+       load_class_callback = class_callback;
+
+#if defined(WIN32)
+       if ((handle = LoadLibrary (moduleName)) == NULL)
+       {
+               FreeLibrary(moduleName);
+               *errorCode = 0;
+               successFlag = 0;
+       }
+
+#elif defined(__svr4__)
+       handle = dlopen(moduleName, (RTLD_NOW | RTLD_GLOBAL));
+       if (handle == 0)
+       {
+               *errorCode = 0;
+               successFlag = 0;
+       }
+       else
+       {
+               objc_register_header(moduleName);
+               objc_finish_header();
+       }
+
+#else
+        handle = shl_load(moduleName, BIND_IMMEDIATE | BIND_VERBOSE, 0L);
+        if (handle == 0)
+        {
+                *errorCode = 0;
+                successFlag = 0;
+        }
+        else
+            ; // Don't do anything here: the shlib should have been built
+              // with the +I'objc_hpux_register_shlib' option
+#endif
+
+       load_class_callback = save_class_callback;
+
+#elif defined(NeXT_PDO) 
+       // NOTHING YET...
+       successFlag = 0;
+#endif // WIN32
+
+       OBJC_UNLOCK (&loadLock);
+
+#endif // MACH
+
+       return successFlag;
+}
+
+/**********************************************************************************
+ * objc_loadModules.
+ **********************************************************************************/
+    /* Lock for dynamic loading and unloading. */
+       static OBJC_DECLARE_LOCK (loadLock);
+#if defined(NeXT_PDO) // GENERIC_OBJ_FILE
+       void            (*load_class_callback) (Class, const char *);
+#endif 
+
+
+long   objc_loadModules   (char *                      modlist[], 
+                                                       void *                  errStream,
+                                                       void                    (*class_callback) (Class, const char *),
+                                                       headerType **   hdr_addr,
+                                                       char *                  debug_file)
+{
+       char **                         modules;
+       int                                     code;
+       int                                     itWorked;
+
+       if (modlist == 0)
+               return 0;
+
+       for (modules = &modlist[0]; *modules != 0; modules++)
+       {
+               itWorked = objc_loadModule (*modules, class_callback, &code);
+               if (itWorked == 0)
+               {
+#if defined(__MACH__) || defined(WIN32)        
+                       if (errStream)
+                               NXPrintf ((NXStream *) errStream, "objc_loadModules(%s) code = %d\n", *modules, code);
+#endif
+                       return 1;
+               }
+
+               if (hdr_addr)
+                       *(hdr_addr++) = 0;
+       }
+
+       return 0;
+}
+
+/**********************************************************************************
+ * objc_unloadModules.
+ *
+ * NOTE:  Unloading isn't really thread safe.  If an unload message calls
+ * objc_loadModules() or objc_unloadModules(), then the current call
+ * to objc_unloadModules() will probably unload the wrong stuff.
+ **********************************************************************************/
+
+long   objc_unloadModules (void *                      errStream,
+                                                       void                    (*unload_callback) (Class, Category))
+{
+       headerType *    header_addr = 0;
+       int errflag = 0;
+
+        // TODO: to make unloading work, should get the current header
+
+       if (header_addr)
+       {
+                ; // TODO: unload the current header
+       }
+       else
+       {
+               errflag = 1;
+       }
+
+  return errflag;
+}
+
diff --git a/runtime/objc-moninit.c b/runtime/objc-moninit.c
new file mode 100644 (file)
index 0000000..02c6d90
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#ifdef moninitobjc
+#undef moninitobjc
+
+unsigned long *
+moninitobjc(unsigned long moncount_addr)
+{
+    extern void _NXLogError(const char *format, ...);
+    _NXLogError ("moninitobjc is obsoleted, refer to documentation for how to do profiling\n");
+    return (0);
+}
+
+#endif
diff --git a/runtime/objc-private.h b/runtime/objc-private.h
new file mode 100644 (file)
index 0000000..3b22986
--- /dev/null
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     objc-private.h
+ *     Copyright 1988-1996, NeXT Software, Inc.
+ */
+
+#if !defined(_OBJC_PRIVATE_H_)
+    #define _OBJC_PRIVATE_H_
+
+    #import <objc/objc-api.h>  // for OBJC_EXPORT
+
+    OBJC_EXPORT void checkUniqueness();
+
+    #import "objc-config.h"
+
+    #if defined(NeXT_PDO)
+        #define LITERAL_STRING_OBJECTS
+        #import <mach/cthreads_private.h>
+        #if defined(WIN32)
+           #import <winnt-pdo.h>
+           #import <ntunix.h>
+       #else
+            #import <pdo.h>    // for pdo_malloc and pdo_free defines
+            #import <sys/time.h>
+        #endif
+    #else
+        #import <pthread.h>
+        #define        mutex_alloc()   (pthread_mutex_t*)calloc(1, sizeof(pthread_mutex_t))
+        #define        mutex_init(m)   pthread_mutex_init(m, NULL)
+        #define        mutex_lock(m)   pthread_mutex_lock(m)
+        #define        mutex_try_lock(m) (! pthread_mutex_trylock(m))
+        #define        mutex_unlock(m) pthread_mutex_unlock(m)
+        #define        mutex_clear(m)
+        #define        mutex_t         pthread_mutex_t*
+        #define mutex          MUTEX_DEFINE_ERROR
+        #import <sys/time.h>
+    #endif
+
+    #import <stdlib.h>
+    #import <stdarg.h>
+    #import <stdio.h>
+    #import <string.h>
+    #import <ctype.h>
+
+    #import <objc/objc-runtime.h>
+
+    // This needs <...> -- malloc.h is not ours, really...
+    #import <objc/malloc.h>
+
+
+/* Opaque cookie used in _getObjc... routines.  File format independant.
+ * This is used in place of the mach_header.  In fact, when compiling
+ * for NEXTSTEP, this is really a (struct mach_header *).
+ *
+ * had been: typedef void *objc_header;
+ */
+#if defined(NeXT_PDO)
+    typedef void headerType;
+#else 
+    #import <mach-o/loader.h>
+    typedef struct mach_header headerType;
+#endif 
+
+#import <objc/Protocol.h>
+
+typedef struct _ProtocolTemplate { @defs(Protocol) } ProtocolTemplate;
+typedef struct _NXConstantStringTemplate {
+    Class isa;
+    void *characters;
+    unsigned int _length;
+} NXConstantStringTemplate;
+   
+#if defined(NeXT_PDO)
+    #define OBJC_CONSTANT_STRING_PTR NXConstantStringTemplate**
+    #define OBJC_CONSTANT_STRING_DEREF
+    #define OBJC_PROTOCOL_PTR ProtocolTemplate**
+    #define OBJC_PROTOCOL_DEREF -> 
+#elif defined(__MACH__)
+    #define OBJC_CONSTANT_STRING_PTR NXConstantStringTemplate*
+    #define OBJC_CONSTANT_STRING_DEREF &
+    #define OBJC_PROTOCOL_PTR ProtocolTemplate*
+    #define OBJC_PROTOCOL_DEREF .
+#endif
+
+// both
+OBJC_EXPORT headerType **      _getObjcHeaders();
+OBJC_EXPORT Module             _getObjcModules(headerType *head, int *nmodules);
+OBJC_EXPORT Class *            _getObjcClassRefs(headerType *head, int *nclasses);
+OBJC_EXPORT void *             _getObjcHeaderData(headerType *head, unsigned *size);
+OBJC_EXPORT const char *       _getObjcHeaderName(headerType *head);
+
+#if defined(NeXT_PDO) // GENERIC_OBJ_FILE
+    OBJC_EXPORT ProtocolTemplate ** _getObjcProtocols(headerType *head, int *nprotos);
+    OBJC_EXPORT NXConstantStringTemplate **_getObjcStringObjects(headerType *head, int *nstrs);
+#elif defined(__MACH__)
+    OBJC_EXPORT ProtocolTemplate * _getObjcProtocols(headerType *head, int *nprotos);
+    OBJC_EXPORT NXConstantStringTemplate *_getObjcStringObjects(headerType *head, int *nstrs);
+    OBJC_EXPORT SEL *          _getObjcMessageRefs(headerType *head, int *nmess);
+#endif 
+
+    #define END_OF_METHODS_LIST ((struct objc_method_list*)-1)
+
+    struct header_info
+    {
+      const headerType *       mhdr;
+      Module                           mod_ptr;
+      unsigned int                     mod_count;
+      unsigned long                    image_slide;
+      unsigned int                     objcSize;
+    };
+    typedef struct header_info header_info;
+    OBJC_EXPORT header_info *_objc_headerVector (const headerType * const *machhdrs);
+    OBJC_EXPORT unsigned int _objc_headerCount (void);
+    OBJC_EXPORT void _objc_addHeader (const headerType *header, unsigned long vmaddr_slide);
+
+    OBJC_EXPORT int _objcModuleCount();
+    OBJC_EXPORT const char *_objcModuleNameAtIndex(int i);
+    OBJC_EXPORT Class objc_getOrigClass (const char *name);
+
+    extern struct objc_method_list **get_base_method_list(Class cls);
+
+
+    OBJC_EXPORT const char *__S(_nameForHeader) (const headerType*);
+
+    /* initialize */
+    OBJC_EXPORT void _sel_resolve_conflicts(headerType * header, unsigned long slide);
+    OBJC_EXPORT void _class_install_relationships(Class, long);
+    OBJC_EXPORT void _objc_add_category(Category, int);
+    OBJC_EXPORT void *_objc_create_zone(void);
+
+    OBJC_EXPORT SEL sel_registerNameNoCopy(const char *str);
+
+    /* selector fixup in method lists */
+
+    #define _OBJC_FIXED_UP ((void *)1771)
+
+    static inline struct objc_method_list *_objc_inlined_fixup_selectors_in_method_list(struct objc_method_list *mlist)
+    {
+        unsigned i, size;
+        Method method;
+        struct objc_method_list *old_mlist; 
+        
+        if ( ! mlist ) return (struct objc_method_list *)0;
+        if ( mlist->obsolete != _OBJC_FIXED_UP ) {
+            old_mlist = mlist;
+            size = sizeof(struct objc_method_list) - sizeof(struct objc_method) + old_mlist->method_count * sizeof(struct objc_method);
+            mlist = malloc_zone_malloc(_objc_create_zone(), size);
+            memmove(mlist, old_mlist, size);
+            for ( i = 0; i < mlist->method_count; i += 1 ) {
+                method = &mlist->method_list[i];
+                method->method_name =
+                    sel_registerNameNoCopy((const char *)method->method_name);
+            }
+            mlist->obsolete = _OBJC_FIXED_UP;
+        }
+        return mlist;
+    }
+
+    /* method lookup */
+    /* --  inline version of class_nextMethodList(Class, void **)  -- */
+
+    static inline struct objc_method_list *_class_inlinedNextMethodList(Class cls, void **it)
+    {
+        struct objc_method_list ***iterator;
+
+        iterator = (struct objc_method_list***)it;
+        if (*iterator == NULL) {
+            *iterator = &((((struct objc_class *) cls)->methodLists)[0]);
+        }
+        else (*iterator) += 1;
+        // Check for list end
+        if ((**iterator == NULL) || (**iterator == END_OF_METHODS_LIST)) {
+            *it = nil;
+            return NULL;
+        }
+        
+        **iterator = _objc_inlined_fixup_selectors_in_method_list(**iterator);
+        
+        // Return method list pointer
+        return **iterator;
+    }
+
+    OBJC_EXPORT BOOL class_respondsToMethod(Class, SEL);
+    OBJC_EXPORT IMP class_lookupMethod(Class, SEL);
+    OBJC_EXPORT IMP class_lookupMethodInMethodList(struct objc_method_list *mlist, SEL sel);
+    OBJC_EXPORT IMP class_lookupNamedMethodInMethodList(struct objc_method_list *mlist, const char *meth_name);
+    OBJC_EXPORT void _objc_insertMethods( struct objc_method_list *mlist, struct objc_method_list ***list );
+    OBJC_EXPORT void _objc_removeMethods( struct objc_method_list *mlist, struct objc_method_list ***list );
+
+    /* message dispatcher */
+    OBJC_EXPORT Cache _cache_create(Class);
+    OBJC_EXPORT IMP _class_lookupMethodAndLoadCache(Class, SEL);
+    OBJC_EXPORT id _objc_msgForward (id self, SEL sel, ...);
+
+    /* errors */
+    OBJC_EXPORT volatile void __S(_objc_fatal)(const char *message);
+    OBJC_EXPORT volatile void _objc_error(id, const char *, va_list);
+    OBJC_EXPORT volatile void __objc_error(id, const char *, ...);
+    OBJC_EXPORT void _objc_inform(const char *fmt, ...);
+    OBJC_EXPORT void _NXLogError(const char *format, ...);
+
+    /* magic */
+    OBJC_EXPORT Class _objc_getFreedObjectClass (void);
+    OBJC_EXPORT const struct objc_cache emptyCache;
+    OBJC_EXPORT void _objc_flush_caches (Class cls);
+    
+    /* locking */
+    #if defined(NeXT_PDO)
+        #if defined(WIN32)
+            #define MUTEX_TYPE long
+            #define OBJC_DECLARE_LOCK(MUTEX) MUTEX_TYPE MUTEX = 0L;
+        #elif defined(sparc)
+            #define MUTEX_TYPE long
+            #define OBJC_DECLARE_LOCK(MUTEX) MUTEX_TYPE MUTEX = 0L;
+        #elif defined(__alpha__)
+            #define MUTEX_TYPE long
+            #define OBJC_DECLARE_LOCK(MUTEX) MUTEX_TYPE MUTEX = 0L;
+        #elif defined(__hpux__) || defined(hpux)
+            typedef struct { int a; int b; int c; int d; } __mutex_struct;
+            #define MUTEX_TYPE __mutex_struct
+            #define OBJC_DECLARE_LOCK(MUTEX) MUTEX_TYPE MUTEX = { 1, 1, 1, 1 };
+        #else // unknown pdo platform
+            #define MUTEX_TYPE long
+            #define OBJC_DECLARE_LOCK(MUTEX) struct mutex MUTEX = { 0 };
+        #endif // WIN32
+        OBJC_EXPORT MUTEX_TYPE classLock;
+        OBJC_EXPORT MUTEX_TYPE messageLock;
+    #else
+        #define MUTEX_TYPE pthread_mutex_t*
+        #define OBJC_DECLARE_LOCK(MTX) pthread_mutex_t MTX = PTHREAD_MUTEX_INITIALIZER
+        OBJC_EXPORT pthread_mutex_t classLock;
+        OBJC_EXPORT pthread_mutex_t messageLock;
+    #endif // NeXT_PDO
+
+    OBJC_EXPORT int _objc_multithread_mask;
+
+    // _objc_msgNil is actually (unsigned dummy, id, SEL) for i386;
+    // currently not implemented for any sparc or hppa platforms
+    OBJC_EXPORT void (*_objc_msgNil)(id, SEL);
+
+    typedef struct {
+       long addressOffset;
+       long selectorOffset;
+    } FixupEntry;
+
+    static inline int selEqual( SEL s1, SEL s2 ) {
+       OBJC_EXPORT int rocketLaunchingDebug;
+       if ( rocketLaunchingDebug )
+          checkUniqueness(s1, s2);
+       return (s1 == s2);
+    }
+
+        #if defined(OBJC_COLLECTING_CACHE)
+            #define OBJC_LOCK(MUTEX)   mutex_lock (MUTEX)
+            #define OBJC_UNLOCK(MUTEX) mutex_unlock (MUTEX)
+            #define OBJC_TRYLOCK(MUTEX)        mutex_try_lock (MUTEX)
+        #elif defined(NeXT_PDO)
+            #if !defined(WIN32)
+                /* Where are these defined?  NT should probably be using them! */
+                OBJC_EXPORT void _objc_private_lock(MUTEX_TYPE*);
+                OBJC_EXPORT void _objc_private_unlock(MUTEX_TYPE*);
+
+                /* I don't think this should be commented out for NT, should it? */
+                #define OBJC_LOCK(MUTEX)               \
+                    do {if (!_objc_multithread_mask)   \
+                    _objc_private_lock(MUTEX);} while(0)
+                #define OBJC_UNLOCK(MUTEX)             \
+                    do {if (!_objc_multithread_mask)   \
+                    _objc_private_unlock(MUTEX);} while(0)
+            #else
+                #define OBJC_LOCK(MUTEX)               \
+                    do {if (!_objc_multithread_mask)   \
+                    if( *MUTEX == 0 ) *MUTEX = 1;} while(0)
+                #define OBJC_UNLOCK(MUTEX)             \
+                    do {if (!_objc_multithread_mask)   \
+                    *MUTEX = 0;} while(0)
+            #endif // WIN32
+
+        #else // not NeXT_PDO
+            #define OBJC_LOCK(MUTEX)                   \
+              do                                       \
+                {                                      \
+                  if (!_objc_multithread_mask)         \
+               mutex_lock (MUTEX);                     \
+                }                                      \
+              while (0)
+
+            #define OBJC_UNLOCK(MUTEX)                 \
+              do                                       \
+                {                                      \
+                  if (!_objc_multithread_mask)         \
+               mutex_unlock (MUTEX);                   \
+                }                                      \
+              while (0)
+        #endif /* OBJC_COLLECTING_CACHE */
+
+#if !defined(SEG_OBJC)
+#define SEG_OBJC        "__OBJC"        /* objective-C runtime segment */
+#endif
+
+#if defined(NeXT_PDO)
+    // GENERIC_OBJ_FILE
+    void send_load_message_to_category(Category cat, void *header_addr); 
+    void send_load_message_to_class(Class cls, void *header_addr);
+#endif
+
+#if !defined(__MACH__)
+typedef struct _objcSectionStruct {
+    void     **data;                   /* Pointer to array  */
+    int      count;                    /* # of elements     */
+    int      size;                     /* sizeof an element */
+} objcSectionStruct;
+
+typedef struct _objcModHeader {
+    char *            name;
+    objcSectionStruct Modules;
+    objcSectionStruct Classes;
+    objcSectionStruct Methods;
+    objcSectionStruct Protocols;
+    objcSectionStruct StringObjects;
+} objcModHeader;
+#endif
+
+
+static __inline__ int _objc_strcmp(const unsigned char *s1, const unsigned char *s2) {
+    int a, b, idx = 0;
+    for (;;) {
+       a = s1[idx];
+       b = s2[idx];
+        if (a != b || 0 == a) break;
+        idx++;
+    }
+    return a - b;
+}       
+
+static __inline__ unsigned int _objc_strhash(const unsigned char *s) {
+    unsigned int hash = 0;
+    for (;;) {
+       int a = *s++;
+       if (0 == a) break;
+       hash += (hash << 8) + a;
+    }
+    return hash;
+}
+
+#endif /* _OBJC_PRIVATE_H_ */
+
diff --git a/runtime/objc-runtime.h b/runtime/objc-runtime.h
new file mode 100644 (file)
index 0000000..59b1f6f
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     objc-runtime.h
+ *     Copyright 1988-1996, NeXT Software, Inc.
+ */
+
+#ifndef _OBJC_RUNTIME_H_
+#define _OBJC_RUNTIME_H_
+
+#ifndef NeXT_PDO
+#import <stdarg.h>
+#endif
+#import <objc/objc.h>
+#import <objc/objc-class.h>
+
+typedef struct objc_symtab *Symtab;
+
+struct objc_symtab {
+       unsigned long   sel_ref_cnt;
+       SEL             *refs;          
+       unsigned short  cls_def_cnt;
+       unsigned short  cat_def_cnt;
+#ifdef NeXT_PDO
+       arith_t        obj_defs;
+       arith_t        proto_defs;
+#endif
+       void            *defs[1];       /* variable size */
+};
+
+typedef struct objc_module *Module;
+
+struct objc_module {
+       unsigned long   version;
+       unsigned long   size;
+       const char      *name;
+       Symtab          symtab; 
+};
+
+#ifdef __cplusplus
+extern "Objective-C" {
+#endif
+struct objc_super {
+       id receiver;
+       Class class;
+};
+#ifdef __cplusplus
+}
+#endif
+
+/* kernel operations */
+
+OBJC_EXPORT id objc_getClass(const char *name);
+OBJC_EXPORT id objc_getMetaClass(const char *name);
+OBJC_EXPORT id objc_msgSend(id self, SEL op, ...);
+#if defined(WINNT) || defined(__cplusplus)
+// The compiler on NT is broken when dealing with structure-returns.
+// Help out the compiler group by tweaking the prototype.
+OBJC_EXPORT id objc_msgSend_stret(id self, SEL op, ...);
+#else
+OBJC_EXPORT void objc_msgSend_stret(void * stretAddr, id self, SEL op, ...);
+#endif
+OBJC_EXPORT id objc_msgSendSuper(struct objc_super *super, SEL op, ...);
+#if defined(WINNT) || defined(__cplusplus)
+// The compiler on NT is broken when dealing with structure-returns.
+// Help out the compiler group by tweaking the prototype.
+OBJC_EXPORT id objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...);
+#else
+OBJC_EXPORT void objc_msgSendSuper_stret(void * stretAddr, struct objc_super *super, SEL op, ...);
+#endif
+
+/* forwarding operations */
+
+OBJC_EXPORT id objc_msgSendv(id self, SEL op, unsigned arg_size, marg_list arg_frame);
+OBJC_EXPORT void objc_msgSendv_stret(void * stretAddr, id self, SEL op, unsigned arg_size, marg_list arg_frame);
+
+/* 
+    getting all the classes in the application...
+    
+    int objc_getClassList(buffer, bufferLen)
+       classes is an array of Class values (which are pointers)
+               which will be filled by the function; if this
+               argument is NULL, no copying is done, only the
+               return value is returned
+       bufferLen is the number of Class values the given buffer
+               can hold; if the buffer is not large enough to
+               hold all the classes, the buffer is filled to
+               the indicated capacity with some arbitrary subset
+               of the known classes, which could be different
+               from call to call
+       returns the number of classes, which is the number put
+               in the buffer if the buffer was large enough,
+               or the length the buffer should have been
+
+    int numClasses = 0, newNumClasses = objc_getClassList(NULL, 0);
+    Class *classes = NULL;
+    while (numClasses < newNumClasses) {
+        numClasses = newNumClasses;
+        classes = realloc(classes, sizeof(Class) * numClasses);
+        newNumClasses = objc_getClassList(classes, numClasses);
+    }
+    // now, can use the classes list; if NULL, there are no classes
+    free(classes);
+
+*/
+OBJC_EXPORT int objc_getClassList(Class *buffer, int bufferLen);
+
+#define OBSOLETE_OBJC_GETCLASSES 1
+#if OBSOLETE_OBJC_GETCLASSES
+OBJC_EXPORT void *objc_getClasses(void);
+#endif
+
+OBJC_EXPORT id objc_lookUpClass(const char *name);
+OBJC_EXPORT void objc_addClass(Class myClass);
+
+/* customizing the error handling for objc_getClass/objc_getMetaClass */
+
+OBJC_EXPORT void objc_setClassHandler(int (*)(const char *));
+
+/* Making the Objective-C runtime thread safe. */
+OBJC_EXPORT void objc_setMultithreaded (BOOL flag);
+
+/* overriding the default object allocation and error handling routines */
+
+OBJC_EXPORT id (*_alloc)(Class, unsigned int);
+OBJC_EXPORT id (*_copy)(id, unsigned int);
+OBJC_EXPORT id (*_realloc)(id, unsigned int);
+OBJC_EXPORT id (*_dealloc)(id);
+OBJC_EXPORT id (*_zoneAlloc)(Class, unsigned int, void *);
+OBJC_EXPORT id (*_zoneRealloc)(id, unsigned int, void *);
+OBJC_EXPORT id (*_zoneCopy)(id, unsigned int, void *);
+
+#if defined(NeXT_PDO)
+    OBJC_EXPORT void   (*_error)();
+#else
+    OBJC_EXPORT void   (*_error)(id, const char *, va_list);
+#endif
+
+#if defined(WIN32)
+/* This seems like a strange place to put this, but there's really
+   no very appropriate place! */
+OBJC_EXPORT const char* NSRootDirectory(void);
+#endif 
+
+#endif /* _OBJC_RUNTIME_H_ */
diff --git a/runtime/objc-runtime.m b/runtime/objc-runtime.m
new file mode 100644 (file)
index 0000000..4d1b9ce
--- /dev/null
@@ -0,0 +1,1896 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/***********************************************************************
+ * objc-runtime.m
+ * Copyright 1988-1996, NeXT Software, Inc.
+ * Author:     s. naroff
+ *
+ **********************************************************************/
+
+/***********************************************************************
+ * Imports.
+ **********************************************************************/
+
+#if defined(WIN32)
+#include <winnt-pdo.h>
+#endif
+
+#if defined(NeXT_PDO)
+#import <pdo.h>                // for pdo_malloc and pdo_free defines
+#elif defined(__MACH__)
+#include <mach-o/ldsyms.h>
+#include <mach-o/dyld.h>
+#include <mach/vm_statistics.h>
+#endif
+
+#import <objc/objc-runtime.h>
+#import <objc/hashtable2.h>
+#import "maptable.h"
+#import "objc-private.h"
+#import <objc/Object.h>
+#import <objc/Protocol.h>
+
+#if !defined(WIN32)
+#include <sys/time.h>
+#include <sys/resource.h>
+#endif
+
+OBJC_EXPORT Class              _objc_getNonexistentClass       (void);
+
+#if defined(NeXT_PDO) // GENERIC_OBJ_FILE
+OBJC_EXPORT void               (*load_class_callback)          (Class, Category);
+OBJC_EXPORT unsigned int       _objc_goff_headerCount          (void);
+OBJC_EXPORT header_info *      _objc_goff_headerVector         (void);
+#endif 
+
+OBJC_EXPORT Class              getOriginalClassForPosingClass  (Class);
+
+#if defined(WIN32) || defined(__svr4__)
+// Current Module Header
+extern objcModHeader *         CMH;
+#endif
+
+/***********************************************************************
+ * Constants and macros internal to this module.
+ **********************************************************************/
+
+/* Turn on support for literal string objects. */
+#define LITERAL_STRING_OBJECTS
+
+/***********************************************************************
+ * Types internal to this module.
+ **********************************************************************/
+
+typedef struct _objc_unresolved_category
+{
+       struct _objc_unresolved_category *      next;
+       struct objc_category *                  cat;
+       long                                    version;
+} _objc_unresolved_category;
+
+typedef struct _PendingClass
+{
+       struct objc_class * *                   ref;
+       struct objc_class *                     classToSetUp;
+       const char *            nameof_superclass;
+       int                     version;
+       struct _PendingClass *  next;
+} PendingClass;
+
+/***********************************************************************
+ * Exports.
+ **********************************************************************/
+
+// Mask which specifies whether we are multi-threaded or not.
+// A value of (-1) means single-threaded, 0 means multi-threaded. 
+int            _objc_multithread_mask = (-1);
+
+// Function to call when message sent to nil object.
+void           (*_objc_msgNil)(id, SEL) = NULL;
+
+// Function called after class has been fixed up (MACH only)
+void           (*callbackFunction)(Class, const char *) = 0;
+
+// Prototype for function passed to 
+typedef void (*NilObjectMsgCallback) (id nilObject, SEL selector);
+
+// Lock for class hashtable
+OBJC_DECLARE_LOCK (classLock);
+
+// Condition for logging load progress
+int            rocketLaunchingDebug = -1;
+
+/***********************************************************************
+ * Function prototypes internal to this module.
+ **********************************************************************/
+
+static unsigned                        classHash                                                       (void * info, struct objc_class * data);
+static int                             classIsEqual                                            (void * info, struct objc_class * name, struct objc_class * cls);
+static int                             _objc_defaultClassHandler                       (const char * clsName);
+static void                            _objcTweakMethodListPointerForClass     (struct objc_class * cls);
+static void                            __objc_add_category                                     (struct objc_category * category, int version);
+static void                            _objc_resolve_categories_for_class      (struct objc_class * cls);
+static void                            _objc_register_category                         (struct objc_category * cat, long version);
+static void                            _objc_add_categories_from_image         (header_info * hi);
+#if defined(__MACH__)
+static const header_info * _headerForClass                                     (struct objc_class * cls);
+#endif
+static void                            checkForPendingClassReferences          (struct objc_class * cls);
+static PendingClass *  newPending                                                      (void);
+static NXMapTable *            pendingClassRefsMapTable                        (void);
+static NXHashTable *   _objc_get_classes_from_image            (NXHashTable * clsHash, header_info * hi);
+static void                            _objc_fixup_string_objects_for_image(header_info * hi);
+static void                            _objc_map_class_refs_for_image          (header_info * hi);
+static void                            map_selrefs                                                     (SEL * sels, unsigned int cnt);
+static void                            map_method_descs                                        (struct objc_method_description_list * methods);
+static void                            _objc_fixup_protocol_objects_for_image  (header_info * hi);
+#if defined(__MACH__)
+static void                            _objc_bindModuleContainingCategory(Category cat);
+static void                            _objc_bindModuleContainingClass(struct objc_class * cls);
+#endif
+static const char *    libraryNameForMachHeader                                (const headerType * themh);
+static void                            _objc_fixup_selector_refs                       (const header_info * hi);
+static void                            _objc_call_loads_for_image                      (header_info * header);
+#if defined(__MACH__)
+static void                            _objc_map_image_callback                        (headerType * mh, unsigned long vmaddr_slide);
+static void                            _objc_link_module_callback                      (NSModule mod);
+static void                            _objc_unlink_module_callback            (NSModule mod);
+#endif
+
+#if defined(__MACH__)
+extern int ptrace(int, int, int, int);
+// ObjC is assigned the range 0xb000 - 0xbfff for first parameter
+#else
+#define ptrace(a, b, c, d) do {} while (0)
+#endif
+
+/***********************************************************************
+ * Static data internal to this module.
+ **********************************************************************/
+
+// System vectors created at runtime by reading the `__OBJC' segments 
+// that are a part of the application.
+// We do not lock these variables, since they are only set during startup. 
+static header_info *   header_vector = 0;
+static unsigned int            header_count = 0;
+static unsigned int            header_vector_size = 0;
+
+// Hash table of classes
+static NXHashTable *           class_hash = 0;
+static NXHashTablePrototype    classHashPrototype = 
+{
+       (unsigned (*) (const void *, const void *))                     classHash, 
+       (int (*)(const void *, const void *, const void *))     classIsEqual, 
+       NXNoEffectFree, 0
+};
+
+// Function pointer objc_getClass calls through when class is not found
+static int                     (*objc_classHandler) (const char *) = _objc_defaultClassHandler;
+
+// Category and class registries
+static NXMapTable *            category_hash = NULL;
+
+
+static int                                             map_selectors_pended            = 0;
+
+static NXMapTable *            pendingClassRefsMap = 0;
+
+/***********************************************************************
+ * objc_dump_class_hash.  Log names of all known classes.
+ **********************************************************************/
+void   objc_dump_class_hash           (void)
+{
+       NXHashTable *   table;
+       unsigned                count;
+       struct objc_class *     *               data;
+       NXHashState             state;
+       
+       table = class_hash;
+       count = 0;
+       state = NXInitHashState (table);
+       while (NXNextHashState (table, &state, (void **) &data))
+               printf ("class %d: %s\n", ++count, (*data)->name);
+}
+
+/***********************************************************************
+ * classHash.
+ **********************************************************************/
+static unsigned                classHash              (void *          info,
+                                                                               struct objc_class *             data) 
+{
+       // Nil classes hash to zero
+       if (!data)
+               return 0;
+       
+       // Call through to real hash function
+       return _objc_strhash ((unsigned char *) ((struct objc_class *) data)->name);
+}
+
+/***********************************************************************
+ * classIsEqual.  Returns whether the class names match.  If we ever
+ * check more than the name, routines like objc_lookUpClass have to
+ * change as well.
+ **********************************************************************/
+static int             classIsEqual           (void *          info,
+                                                                               struct objc_class *             name,
+                                                                               struct objc_class *             cls) 
+{
+       // Standard string comparison
+       return ((name->name[0] == cls->name[0]) &&
+               (strcmp (name->name, cls->name) == 0));
+}
+
+/***********************************************************************
+ * _objc_init_class_hash.  Return the class lookup table, create it if
+ * necessary.
+ **********************************************************************/
+void   _objc_init_class_hash          (void)
+{
+       // Do nothing if class hash table already exists
+       if (class_hash)
+               return;
+       
+       // Provide a generous initial capacity to cut down on rehashes
+       // at launch time.  A smallish Foundation+AppKit program will have
+       // about 520 classes.  Larger apps (like IB or WOB) have more like
+       // 800 classes.  Some customers have massive quantities of classes.
+       // Foundation-only programs aren't likely to notice the ~6K loss.
+       class_hash = NXCreateHashTableFromZone (classHashPrototype,
+                                               1024,
+                                               nil,
+                                               _objc_create_zone ());
+}
+
+/***********************************************************************
+ * objc_getClassList.  Return the known classes.
+ **********************************************************************/
+int objc_getClassList(Class *buffer, int bufferLen) {
+       NXHashState state;
+       struct objc_class * class;
+       int cnt, num;
+
+       OBJC_LOCK(&classLock);
+       num = NXCountHashTable(class_hash);
+       if (NULL == buffer) {
+               OBJC_UNLOCK(&classLock);
+               return num;
+       }
+       cnt = 0;
+       state = NXInitHashState(class_hash);
+       while (cnt < num && NXNextHashState(class_hash, &state, (void **)&class)) {
+               buffer[cnt++] = class;
+       }
+       OBJC_UNLOCK(&classLock);
+       return num;
+}
+
+/***********************************************************************
+ * objc_getClasses.  Return class lookup table.
+ *
+ * NOTE: This function is very dangerous, since you cannot safely use
+ * the hashtable without locking it, and the lock is private! 
+ **********************************************************************/
+void *         objc_getClasses        (void)
+{
+#if defined(NeXT_PDO)
+       // Make sure a hash table exists
+       if (!class_hash)
+               _objc_init_class_hash ();
+#endif
+
+       // Return the class lookup hash table
+       return class_hash;
+}
+
+/***********************************************************************
+ * _objc_defaultClassHandler.  Default objc_classHandler.  Does nothing.
+ **********************************************************************/
+static int     _objc_defaultClassHandler      (const char *    clsName)
+{
+       // Return zero so objc_getClass doesn't bother re-searching
+       return 0;
+}
+
+/***********************************************************************
+ * objc_setClassHandler.  Set objc_classHandler to the specified value.
+ *
+ * NOTE: This should probably deal with userSuppliedHandler being NULL,
+ * because the objc_classHandler caller does not check... it would bus
+ * error.  It would make sense to handle NULL by restoring the default
+ * handler.  Is anyone hacking with this, though?
+ **********************************************************************/
+void   objc_setClassHandler    (int    (*userSuppliedHandler) (const char *))
+{
+       objc_classHandler = userSuppliedHandler;
+}
+
+/***********************************************************************
+ * objc_getClass.  Return the id of the named class.  If the class does
+ * not exist, call the objc_classHandler routine with the class name.
+ * If the objc_classHandler returns a non-zero value, try once more to
+ * find the class.  Default objc_classHandler always returns zero.
+ * objc_setClassHandler is how someone can install a non-default routine.
+ **********************************************************************/
+id             objc_getClass          (const char *    aClassName)
+{ 
+       struct objc_class       cls;
+       id                                      ret;
+
+       // Synchronize access to hash table
+       OBJC_LOCK (&classLock);
+       
+       // Check the hash table
+       cls.name = aClassName;
+       ret = (id) NXHashGet (class_hash, &cls);
+       OBJC_UNLOCK (&classLock);
+       
+       // If not found, go call objc_classHandler and try again
+       if (!ret && (*objc_classHandler)(aClassName))
+       {
+               OBJC_LOCK (&classLock);
+               ret = (id) NXHashGet (class_hash, &cls);
+               OBJC_UNLOCK (&classLock);
+       }
+
+       return ret;
+}
+
+/***********************************************************************
+ * objc_lookUpClass.  Return the id of the named class.
+ *
+ * Formerly objc_getClassWithoutWarning ()
+ **********************************************************************/
+id             objc_lookUpClass       (const char *    aClassName)
+{ 
+       struct objc_class       cls;
+       id                                      ret;
+       
+       // Synchronize access to hash table
+       OBJC_LOCK (&classLock);
+
+       // Check the hash table
+       cls.name = aClassName;
+       ret = (id) NXHashGet (class_hash, &cls);
+       
+       // Desynchronize
+       OBJC_UNLOCK (&classLock);
+       return ret;
+}
+
+/***********************************************************************
+ * objc_getMetaClass.  Return the id of the meta class the named class.
+ **********************************************************************/
+id             objc_getMetaClass       (const char *   aClassName) 
+{ 
+       struct objc_class *     cls;
+       
+       cls = objc_getClass (aClassName);
+       if (!cls)
+       {
+               _objc_inform ("class `%s' not linked into application", aClassName);
+               return Nil;
+       }
+
+       return cls->isa;
+}
+
+/***********************************************************************
+ * objc_addClass.  Add the specified class to the table of known classes,
+ * after doing a little verification and fixup.
+ **********************************************************************/
+void           objc_addClass           (Class          cls) 
+{
+       // Synchronize access to hash table
+       OBJC_LOCK (&classLock);
+       
+       // Make sure both the class and the metaclass have caches!
+       // Clear all bits of the info fields except CLS_CLASS and CLS_META.
+       // Normally these bits are already clear but if someone tries to cons
+       // up their own class on the fly they might need to be cleared.
+       if (((struct objc_class *)cls)->cache == NULL)
+       {
+               ((struct objc_class *)cls)->cache = (Cache) &emptyCache;
+               ((struct objc_class *)cls)->info = CLS_CLASS;
+       }
+       
+       if (((struct objc_class *)cls)->isa->cache == NULL)
+       {
+               ((struct objc_class *)cls)->isa->cache = (Cache) &emptyCache;
+               ((struct objc_class *)cls)->isa->info = CLS_META;
+       }
+       
+       // Add the class to the table
+       (void) NXHashInsert (class_hash, cls);
+
+       // Desynchronize
+       OBJC_UNLOCK (&classLock);
+}
+
+/***********************************************************************
+ * _objcTweakMethodListPointerForClass.
+ **********************************************************************/
+static void    _objcTweakMethodListPointerForClass     (struct objc_class *    cls)
+{
+       struct objc_method_list *       originalList;
+       const int                                       initialEntries = 4;
+       int                                                     mallocSize;
+       struct objc_method_list **      ptr;
+       
+       // Remember existing list
+       originalList = (struct objc_method_list *) cls->methodLists;
+       
+       // Allocate and zero a method list array
+       mallocSize   = sizeof(struct objc_method_list *) * initialEntries;
+       ptr          = (struct objc_method_list **) malloc_zone_calloc (_objc_create_zone (), 1, mallocSize);
+       
+       // Insert the existing list into the array
+       ptr[initialEntries - 1] = END_OF_METHODS_LIST;
+       ptr[0] = originalList;
+       
+       // Replace existing list with array
+       ((struct objc_class *)cls)->methodLists = ptr;
+       ((struct objc_class *)cls)->info |= CLS_METHOD_ARRAY;
+       
+       // Do the same thing to the meta-class
+       if (((((struct objc_class *)cls)->info & CLS_CLASS) != 0) && cls->isa)
+               _objcTweakMethodListPointerForClass (cls->isa);
+}
+
+/***********************************************************************
+ * _objc_insertMethods.
+ **********************************************************************/
+void   _objc_insertMethods    (struct objc_method_list *       mlist,
+                                                               struct objc_method_list ***     list)
+{
+       struct objc_method_list **                      ptr;
+       volatile struct objc_method_list **     tempList;
+       int                                                                     endIndex;
+       int                                                                     oldSize;
+       int                                                                     newSize;
+       
+       // Locate unused entry for insertion point
+       ptr = *list;
+       while ((*ptr != 0) && (*ptr != END_OF_METHODS_LIST))
+               ptr += 1;
+       
+       // If array is full, double it
+       if (*ptr == END_OF_METHODS_LIST)
+       {
+               // Calculate old and new dimensions
+               endIndex = ptr - *list;
+               oldSize  = (endIndex + 1) * sizeof(void *);
+               newSize  = oldSize + sizeof(struct objc_method_list *); // only increase by 1
+               
+               // Replace existing array with copy twice its size
+               tempList = (struct objc_method_list **) malloc_zone_realloc ((void *) _objc_create_zone (),
+                                                                                                                  (void *) *list,
+                                                                                                                      (size_t) newSize);
+               *list = tempList;
+               
+               // Zero out addition part of new array
+               bzero (&((*list)[endIndex]), newSize - oldSize);
+               
+               // Place new end marker
+               (*list)[(newSize/sizeof(void *)) - 1] = END_OF_METHODS_LIST;
+               
+               // Insertion point corresponds to old array end
+               ptr = &((*list)[endIndex]);
+       }
+       
+       // Right shift existing entries by one 
+       bcopy (*list, (*list) + 1, ((void *) ptr) - ((void *) *list));
+       
+       // Insert at method list at beginning of array
+       **list = mlist;
+}
+
+/***********************************************************************
+ * _objc_removeMethods.
+ **********************************************************************/
+void   _objc_removeMethods    (struct objc_method_list *       mlist,
+                                                               struct objc_method_list ***     list)
+{
+       struct objc_method_list **      ptr;
+        // Locate list in the array 
+        ptr = *list;
+        while (*ptr != mlist) {
+                // fix for radar # 2538790
+                if ( *ptr == END_OF_METHODS_LIST ) return;
+                ptr += 1;
+        }
+        // Remove this entry 
+        *ptr = 0;
+  
+        // Left shift the following entries
+        while (*(++ptr) != END_OF_METHODS_LIST)
+                *(ptr-1) = *ptr;
+        *(ptr-1) = 0;
+}
+
+/***********************************************************************
+ * __objc_add_category.  Install the specified category's methods and
+ * protocols into the class it augments.
+ **********************************************************************/
+static inline void     __objc_add_category    (struct objc_category *  category,
+                                                                                       int                                             version)
+{
+       struct objc_class *     cls;
+       
+       // Locate the class that the category will extend
+       cls = (struct objc_class *) objc_getClass (category->class_name);
+       if (!cls)
+       {
+               _objc_inform ("unable to add category %s...\n", category->category_name);
+               _objc_inform ("class `%s' not linked into application\n", category->class_name);
+               return;
+       }
+
+       // Augment instance methods
+       if (category->instance_methods)
+               _objc_insertMethods (category->instance_methods, &cls->methodLists);
+
+       // Augment class methods
+       if (category->class_methods)
+               _objc_insertMethods (category->class_methods, &cls->isa->methodLists);
+
+       // Augment protocols
+       if ((version >= 5) && category->protocols)
+       {
+               if (cls->isa->version >= 5)
+               {
+                       category->protocols->next = cls->protocols;
+                       cls->protocols            = category->protocols;
+                       cls->isa->protocols       = category->protocols;
+               }
+               else
+               {
+                       _objc_inform ("unable to add protocols from category %s...\n", category->category_name);
+                       _objc_inform ("class `%s' must be recompiled\n", category->class_name);
+               }
+       }
+       
+#if defined(NeXT_PDO) // GENERIC_OBJ_FILE
+       // Call back
+       if (load_class_callback)
+               (*load_class_callback) (cls, 0);
+       
+       // Call +finishLoading:: from the category's method list
+       send_load_message_to_category (category, (void *) header_vector[0].mhdr);
+#endif
+}
+
+/***********************************************************************
+ * _objc_add_category.  Install the specified category's methods into
+ * the class it augments, and flush the class' method cache.
+ *
+ * Private extern used by objc_loadModules ()
+ **********************************************************************/
+void   _objc_add_category     (struct objc_category *  category,
+                                                               int                                             version)
+{
+       // Install the category's methods into its intended class
+       __objc_add_category (category, version);
+       
+       // Flush caches so category's methods can get called
+       _objc_flush_caches (objc_lookUpClass (category->class_name));
+}
+
+/***********************************************************************
+ * _objc_resolve_categories_for_class.  Install all categories intended
+ * for the specified class, in reverse order from the order in which we
+ * found the categories in the image.
+ **********************************************************************/
+static void    _objc_resolve_categories_for_class  (struct objc_class *        cls)
+{
+       _objc_unresolved_category *     cat;
+       _objc_unresolved_category *     next;
+       
+       // Nothing to do if there are no categories at all
+       if (!category_hash)
+               return;
+       
+       // Locate and remove first element in category list
+       // associated with this class
+       cat = NXMapRemove (category_hash, cls->name);
+       
+       // Traverse the list of categories, if any, registered for this class
+       while (cat)
+       {
+               // Install the category
+               _objc_add_category (cat->cat, cat->version);
+               
+               // Delink and reclaim this registration
+               next = cat->next;
+               free (cat);
+               cat = next;
+       }
+}
+
+/***********************************************************************
+ * _objc_register_category.  Add the specified category to the registry
+ * of categories to be installed later (once we know for sure which
+ * classes we have).  If there are multiple categories on a given class,
+ * they will be processed in reverse order from the order in which they
+ * were found in the image.
+ **********************************************************************/
+static void _objc_register_category    (struct objc_category * cat,
+                                                                               long                                    version)
+{
+       _objc_unresolved_category *     new_cat;
+       _objc_unresolved_category *     old;
+       
+       
+       // If the category's class exists, just add the category
+       if (objc_lookUpClass (cat->class_name))
+       {
+               _objc_add_category (cat, version);
+               return;
+       }
+       
+       // Create category lookup table if needed
+       if (!category_hash)
+               category_hash = NXCreateMapTableFromZone (NXStrValueMapPrototype,
+                                                         128,
+                                                         _objc_create_zone ());
+       
+       // Locate an existing category, if any, for the class.  This is linked
+       // after the new entry, so list is LIFO.
+       old = NXMapGet (category_hash, cat->class_name);
+       
+       // Register the category to be fixed up later
+       new_cat = malloc_zone_malloc (_objc_create_zone (),
+                               sizeof(_objc_unresolved_category));
+       new_cat->next    = old;
+       new_cat->cat     = cat;
+       new_cat->version = version;
+       (void) NXMapInsert (category_hash, cat->class_name , new_cat);
+}
+
+/***********************************************************************
+ * _objc_add_categories_from_image.
+ **********************************************************************/
+static void _objc_add_categories_from_image (header_info *  hi)
+{
+       Module          mods;
+       unsigned int    midx;
+       
+       // Major loop - process all modules in the header
+       mods = (Module) ((unsigned long) hi->mod_ptr + hi->image_slide);
+
+//     ptrace(0xb120, hi->mod_count, 0, 0);
+
+       for (midx = 0; midx < hi->mod_count; midx += 1)
+       {
+               unsigned int    index; 
+               unsigned int    total; 
+               
+               // Nothing to do for a module without a symbol table
+               if (mods[midx].symtab == NULL)
+                       continue;
+               
+               // Total entries in symbol table (class entries followed
+               // by category entries)
+               total = mods[midx].symtab->cls_def_cnt +
+                       mods[midx].symtab->cat_def_cnt;
+               
+#if defined(__MACH__)
+               if ((hi->mhdr->filetype == MH_DYLIB) ||
+                   (hi->mhdr->filetype == MH_BUNDLE))
+               {
+                       void ** defs;
+                       
+                       defs = mods[midx].symtab->defs;
+
+//                     ptrace(0xb121, midx, mods[midx].symtab->cls_def_cnt, mods[midx].symtab->cat_def_cnt);
+
+                       for (index = 0; index < mods[midx].symtab->cls_def_cnt; index += 1)
+                               _objc_bindModuleContainingClass (defs[index]);
+                       
+                       for (index = mods[midx].symtab->cls_def_cnt; index < total; index += 1)
+                               _objc_bindModuleContainingCategory (defs[index]);
+
+//                     ptrace(0xb122, midx, 0, 0);
+               }
+#endif 
+               
+//             ptrace(0xb123, midx, mods[midx].symtab->cat_def_cnt, 0);
+
+               // Minor loop - register all categories from given module
+               for (index = mods[midx].symtab->cls_def_cnt; index < total; index += 1)
+               {
+                       _objc_register_category (mods[midx].symtab->defs[index],
+                                                mods[midx].version);
+               }
+
+//             ptrace(0xb124, midx, 0, 0);
+       }
+
+//     ptrace(0xb12f, 0, 0, 0);
+}
+
+#if defined(__MACH__)
+/***********************************************************************
+ * _headerForClass.
+ **********************************************************************/
+static const header_info *  _headerForClass     (struct objc_class *   cls)
+{
+       const struct segment_command *  objcSeg;
+       unsigned int                                    hidx;
+       unsigned int                                    size;
+       unsigned long                                   vmaddrPlus;
+       
+       // Check all headers in the vector
+       for (hidx = 0; hidx < header_count; hidx += 1)
+       {
+               // Locate header data, if any
+               objcSeg = _getObjcHeaderData ((headerType *) header_vector[hidx].mhdr, &size);
+               if (!objcSeg)
+                       continue;
+
+               // Is the class in this header?
+               vmaddrPlus = (unsigned long) objcSeg->vmaddr + header_vector[hidx].image_slide;
+               if ((vmaddrPlus <= (unsigned long) cls) &&
+                   ((unsigned long) cls < (vmaddrPlus + size)))
+                       return &(header_vector[hidx]);
+       }
+       
+       // Not found
+       return 0;
+}
+#endif // __MACH__
+
+/***********************************************************************
+ * _nameForHeader.
+ **********************************************************************/
+const char *   _nameForHeader         (const headerType *      header)
+{
+       return _getObjcHeaderName ((headerType *) header);
+}
+
+/***********************************************************************
+ * checkForPendingClassReferences.  Complete any fixups registered for
+ * this class.
+ **********************************************************************/
+static void    checkForPendingClassReferences         (struct objc_class *     cls)
+{
+       PendingClass *  pending;
+
+       // Nothing to do if there are no pending classes
+       if (!pendingClassRefsMap)
+               return;
+       
+       // Get pending list for this class
+       pending = NXMapGet (pendingClassRefsMap, cls->name);
+       if (!pending)
+               return;
+       
+       // Remove the list from the table
+       (void) NXMapRemove (pendingClassRefsMap, cls->name);
+       
+       // Process all elements in the list
+       while (pending)
+       {
+               PendingClass *  next;
+               
+               // Remember follower for loop
+               next = pending->next;
+               
+               // Fill in a pointer to Class 
+               // (satisfies caller of objc_pendClassReference)
+               if (pending->ref)
+                       *pending->ref = objc_getClass (cls->name);
+
+               // Fill in super, isa, cache, and version for the class
+               // and its meta-class
+               // (satisfies caller of objc_pendClassInstallation)
+               // NOTE: There must be no more than one of these for
+               // any given classToSetUp
+               if (pending->classToSetUp)
+               {
+                       struct objc_class *     fixCls;
+               
+                       // Locate the Class to be fixed up
+                       fixCls = pending->classToSetUp;
+                       
+                       // Set up super class fields with names to be replaced by pointers
+                       fixCls->super_class      = (struct objc_class *) pending->nameof_superclass;
+                       fixCls->isa->super_class = (struct objc_class *) pending->nameof_superclass;
+                       
+                       // Fix up class pointers, version, and cache pointers
+                       _class_install_relationships (fixCls, pending->version);
+               }
+               
+               // Reclaim the element
+               free (pending);
+               
+               // Move on
+               pending = next;
+       }
+}
+
+/***********************************************************************
+ * newPending.  Allocate and zero a PendingClass structure.
+ **********************************************************************/
+static inline PendingClass *   newPending             (void)
+{
+       PendingClass *  pending;
+       
+       pending = (PendingClass *) malloc_zone_calloc (_objc_create_zone (), 1, sizeof(PendingClass));
+       
+       return pending;
+}
+
+/***********************************************************************
+ * pendingClassRefsMapTable.  Return a pointer to the lookup table for
+ * pending classes.
+ **********************************************************************/
+static inline NXMapTable *     pendingClassRefsMapTable    (void)
+{
+       // Allocate table if needed
+       if (!pendingClassRefsMap)
+               pendingClassRefsMap = NXCreateMapTableFromZone (NXStrValueMapPrototype, 10, _objc_create_zone ());
+       
+       // Return table pointer
+       return pendingClassRefsMap;
+}
+
+/***********************************************************************
+ * objc_pendClassReference.  Register the specified class pointer (ref)
+ * to be filled in later with a pointer to the class having the specified
+ * name.
+ **********************************************************************/
+void   objc_pendClassReference        (const char *    className,
+                                                                               struct objc_class * *           ref)
+{
+       NXMapTable *            table;
+       PendingClass *          pending;
+       
+       // Create and/or locate pending class lookup table
+       table = pendingClassRefsMapTable ();
+
+       // Create entry containing the class reference
+       pending = newPending ();
+       pending->ref = ref;
+       
+       // Link new entry into head of list of entries for this class
+       pending->next = NXMapGet (pendingClassRefsMap, className);
+       
+       // (Re)place entry list in the table
+       (void) NXMapInsert (table, className, pending);
+}
+
+/***********************************************************************
+ * objc_pendClassInstallation.  Register the specified class to have its
+ * super class pointers filled in later because the superclass is not
+ * yet found.
+ **********************************************************************/
+void   objc_pendClassInstallation     (struct objc_class *     cls,
+                                                                               int             version)
+{
+       NXMapTable *            table;
+       PendingClass *          pending;
+       
+       // Create and/or locate pending class lookup table
+       table = pendingClassRefsMapTable ();
+
+       // Create entry referring to this class
+       pending = newPending ();
+       pending->classToSetUp      = cls;
+       pending->nameof_superclass = (const char *) cls->super_class;
+       pending->version           = version;
+       
+       // Link new entry into head of list of entries for this class
+       pending->next              = NXMapGet (pendingClassRefsMap, cls->super_class);
+       
+       // (Re)place entry list in the table
+       (void) NXMapInsert (table, cls->super_class, pending);
+}
+
+/***********************************************************************
+ * _objc_get_classes_from_image.  Install all classes contained in the
+ * specified image.
+ **********************************************************************/
+static NXHashTable *   _objc_get_classes_from_image   (NXHashTable *   clsHash,
+                                                                                                               header_info *   hi)
+{
+       unsigned int    index;
+       unsigned int    midx;
+       Module                  mods;
+       
+       // Major loop - process all modules in the image
+       mods = (Module) ((unsigned long) hi->mod_ptr + hi->image_slide);
+       for (midx = 0; midx < hi->mod_count; midx += 1)
+       {
+               // Skip module containing no classes
+               if (mods[midx].symtab == NULL)
+                       continue;
+               
+               // Minor loop - process all the classes in given module
+               for (index = 0; index < mods[midx].symtab->cls_def_cnt; index += 1)
+               {
+               struct objc_class *     oldCls;
+               struct objc_class *     newCls;
+                       
+                       // Locate the class description pointer
+                       newCls = mods[midx].symtab->defs[index];
+                       
+                       // Convert old style method list to the new style
+                       _objcTweakMethodListPointerForClass (newCls);
+
+                       oldCls = NXHashInsert (clsHash, newCls);
+
+                       // Non-Nil oldCls is a class that NXHashInsert just
+                       // bumped from table because it has the same name
+                       // as newCls
+                       if (oldCls)
+                       {
+#if defined(__MACH__)
+                               const header_info *     oldHeader;
+                               const header_info *     newHeader;
+                               const char *            oldName;
+                               const char *            newName;
+
+                               // Log the duplication
+                               oldHeader = _headerForClass (oldCls);
+                               newHeader = _headerForClass (newCls);
+                               oldName   = _nameForHeader  (oldHeader->mhdr);
+                               newName   = _nameForHeader  (newHeader->mhdr);
+                               _objc_inform ("Both %s and %s have implementations of class %s.",
+                                                               oldName, newName, oldCls->name);                                   
+                               _objc_inform ("Using implementation from %s.", newName);
+#endif
+
+                               // Use the chosen class
+                               // NOTE: Isn't this a NOP?
+                               newCls = objc_lookUpClass (oldCls->name);
+                       }
+                       
+                       // Unless newCls was a duplicate, and we chose the
+                       // existing one instead, set the version in the meta-class
+                       if (newCls != oldCls)
+                               newCls->isa->version = mods[midx].version;
+
+                       // Install new categories intended for this class
+                       // NOTE: But, if we displaced an existing "isEqual"
+                       // class, the categories have already been installed
+                       // on an old class and are gone from the registry!!
+                       _objc_resolve_categories_for_class (newCls);
+                       
+                       // Resolve (a) pointers to the named class, and/or
+                       // (b) the super_class, cache, and version
+                       // fields of newCls and its meta-class
+                       // NOTE: But, if we displaced an existing "isEqual"
+                       // class, this has already been done... with an
+                       // old-now-"unused" class!!
+                       checkForPendingClassReferences (newCls);
+                       
+#if defined(NeXT_PDO) // GENERIC_OBJ_FILE
+                       // Invoke registered callback
+                       if (load_class_callback)
+                               (*load_class_callback) (newCls, 0);
+                       
+                       // Call +finishLoading:: from the class' method list
+                       send_load_message_to_class (newCls, (headerType *) hi->mhdr);
+#endif
+               }
+       }
+       
+       // Return the table the caller passed
+       return clsHash;
+}
+
+/***********************************************************************
+ * _objc_fixup_string_objects_for_image.  Initialize the isa pointers
+ * of all NSConstantString objects.
+ **********************************************************************/
+static void    _objc_fixup_string_objects_for_image   (header_info *   hi)
+{
+       unsigned int                            size;
+       OBJC_CONSTANT_STRING_PTR        section;
+       struct objc_class *                                             constantStringClass;
+       unsigned int                            index;
+       
+       // Locate section holding string objects
+       section = _getObjcStringObjects ((headerType *) hi->mhdr, &size);
+       if (!section || !size)
+               return;
+       section = (OBJC_CONSTANT_STRING_PTR) ((unsigned long) section + hi->image_slide);
+#if defined(NeXT_PDO) // GENERIC_OBJ_FILE
+       if (!(*section))
+               return;
+#endif
+
+       // Luckily NXConstantString is the same size as NSConstantString
+       constantStringClass = objc_getClass ("NSConstantString");
+       
+       // Process each string object in the section
+       for (index = 0; index < size; index += 1)
+       {
+               struct objc_class * *           isaptr;
+               
+               isaptr = (struct objc_class * *) OBJC_CONSTANT_STRING_DEREF section[index];
+               if (*isaptr == 0)
+                       *isaptr = constantStringClass;
+       }
+}
+
+/***********************************************************************
+ * _objc_map_class_refs_for_image.  Convert the class ref entries from
+ * a class name string pointer to a class pointer.  If the class does
+ * not yet exist, the reference is added to a list of pending references
+ * to be fixed up at a later date.
+ **********************************************************************/
+static void _objc_map_class_refs_for_image (header_info * hi)
+{
+       struct objc_class * *                   cls_refs;
+       unsigned int    size;
+       unsigned int    index;
+       
+       // Locate class refs in image
+       cls_refs = _getObjcClassRefs ((headerType *) hi->mhdr, &size);
+       if (!cls_refs)
+               return;
+       cls_refs = (struct objc_class * *) ((unsigned long) cls_refs + hi->image_slide);
+       
+       // Process each class ref
+       for (index = 0; index < size; index += 1)
+       {
+               const char *    ref;
+               struct objc_class *             cls;
+               
+               // Get ref to convert from name string to class pointer
+               ref = (const char *) cls_refs[index];
+               
+               // Get pointer to class of this name
+               cls = (struct objc_class *)objc_lookUpClass (ref);
+               
+               // If class isn't there yet, use pending mechanism
+               if (!cls)
+               {
+                       // Register this ref to be set later
+                       objc_pendClassReference (ref, &cls_refs[index]);
+                       
+                       // Use place-holder class
+                       cls_refs[index] = _objc_getNonexistentClass ();
+               }
+               
+               // Replace name string pointer with class pointer
+               else
+                       cls_refs[index] = cls;
+       }
+}
+
+/***********************************************************************
+ * map_selrefs.  Register each selector in the specified array.  If a
+ * given selector is already registered, update this array to point to
+ * the registered selector string.
+ **********************************************************************/
+static inline void     map_selrefs    (SEL *                   sels,
+                                                                       unsigned int    cnt)
+{ 
+       unsigned int    index;
+       
+       // Process each selector
+       for (index = 0; index < cnt; index += 1)
+       {
+               SEL     sel;
+               
+               // Lookup pointer to uniqued string
+               sel = sel_registerNameNoCopy ((const char *) sels[index]);
+
+               // Replace this selector with uniqued one (avoid
+               // modifying the VM page if this would be a NOP)
+               if (sels[index] != sel)
+                       sels[index] = sel;
+       }
+}
+
+
+/***********************************************************************
+ * map_method_descs.  For each method in the specified method list,
+ * replace the name pointer with a uniqued selector.
+ **********************************************************************/
+static void  map_method_descs (struct objc_method_description_list * methods)
+{
+       unsigned int    index;
+       
+       // Process each method
+       for (index = 0; index < methods->count; index += 1)
+       {
+               struct objc_method_description *        method;
+               SEL                                     sel;
+               
+               // Get method entry to fix up
+               method = &methods->list[index];
+
+               // Lookup pointer to uniqued string
+               sel = sel_registerNameNoCopy ((const char *) method->name);
+
+               // Replace this selector with uniqued one (avoid
+               // modifying the VM page if this would be a NOP)
+               if (method->name != sel)
+                       method->name = sel;
+       }                 
+}
+
+/***********************************************************************
+ * _fixup.
+ **********************************************************************/
+@interface Protocol(RuntimePrivate)
++ _fixup: (OBJC_PROTOCOL_PTR)protos numElements: (int) nentries;
+@end
+
+/***********************************************************************
+ * _objc_fixup_protocol_objects_for_image.  For each protocol in the
+ * specified image, selectorize the method names and call +_fixup.
+ **********************************************************************/
+static void _objc_fixup_protocol_objects_for_image (header_info * hi)
+{
+       unsigned int            size;
+       OBJC_PROTOCOL_PTR       protos;
+       unsigned int            index;
+       
+       // Locate protocals in the image
+       protos = (OBJC_PROTOCOL_PTR) _getObjcProtocols ((headerType *) hi->mhdr, &size);
+       if (!protos)
+               return;
+       
+       // Apply the slide bias
+       protos = (OBJC_PROTOCOL_PTR) ((unsigned long) protos + hi->image_slide);
+       
+       // Process each protocol
+       for (index = 0; index < size; index += 1)
+       {
+               // Selectorize the instance methods
+               if (protos[index] OBJC_PROTOCOL_DEREF instance_methods)
+                       map_method_descs (protos[index] OBJC_PROTOCOL_DEREF instance_methods);
+               
+               // Selectorize the class methods
+               if (protos[index] OBJC_PROTOCOL_DEREF class_methods)
+                       map_method_descs (protos[index] OBJC_PROTOCOL_DEREF class_methods);
+       }
+       
+       // Invoke Protocol class method to fix up the protocol
+       [Protocol _fixup:(OBJC_PROTOCOL_PTR)protos numElements:size];
+}
+
+/***********************************************************************
+ * _objc_headerVector.  Build the header vector, sorting it as
+ * _objc_map_selectors () expects.
+ **********************************************************************/
+header_info *  _objc_headerVector (const headerType * const *  machhdrs)
+{
+       unsigned int    hidx;
+       header_info *   hdrVec;
+       
+#if defined(__MACH__) // not GENERIC_OBJ_FILE
+       // Take advatage of our previous work
+       if (header_vector)
+               return header_vector;
+#else // GENERIC_OBJ_FILE
+       // If no headers specified, vectorize generically
+       if (!machhdrs)
+               return _objc_goff_headerVector ();
+       
+       // Start from scratch
+       header_count = 0;
+#endif
+       
+       // Count headers
+       for (hidx = 0; machhdrs[hidx]; hidx += 1)
+               header_count += 1;
+
+       header_vector_size = header_count * 3; // very big
+
+       // Allocate vector large enough to have entries for all of them
+       hdrVec = malloc_zone_malloc  (_objc_create_zone (),
+                               header_vector_size * sizeof(header_info));
+       if (!hdrVec)
+               _objc_fatal ("unable to allocate module vector");
+       
+       // Fill vector entry for each header
+       for (hidx = 0; hidx < header_count; hidx += 1)
+       {
+               int     size;
+#if defined(__MACH__)
+               const struct segment_command *  objcSeg = NULL;
+#endif
+       
+               hdrVec[hidx].mhdr        = machhdrs[hidx];
+               hdrVec[hidx].image_slide = 0;
+               hdrVec[hidx].mod_ptr     = _getObjcModules ((headerType *) machhdrs[hidx], &size);
+               hdrVec[hidx].mod_count   = size;
+               hdrVec[hidx].objcSize    = 0;
+       
+#if defined(__MACH__) // not GENERIC_OBJ_FILE
+               objcSeg = (struct segment_command *) _getObjcHeaderData ((headerType *) machhdrs[hidx], &size);
+               if (objcSeg)
+                       hdrVec[hidx].objcSize = ((struct segment_command *) objcSeg)->filesize;
+#endif
+       }
+       
+       return hdrVec;
+}
+
+#if defined(__MACH__)
+void _objc_bindModuleContainingList() {
+/* We define this for backwards binary compat with things which should not
+ * have been using it (cough OmniWeb), but now it does nothing for them.
+ */
+}
+
+/***********************************************************************
+ * _objc_bindModuleContainingCategory.  Bind the module containing the
+ * category.
+ **********************************************************************/
+static void  _objc_bindModuleContainingCategory   (Category    cat)
+{
+       char *                  class_name;
+       char *                  category_name;
+       char *                  name;
+        char                    tmp_buf[128];
+        unsigned int            name_len;
+
+       // Bind ".objc_category_name_<classname>_<categoryname>",
+       // where <classname> is the class name with the leading
+       // '%'s stripped.
+       class_name    = cat->class_name;
+       category_name = cat->category_name;
+        name_len      = strlen(class_name) + strlen(category_name) + 30;
+        if ( name_len > 128 )
+           name = malloc(name_len);
+        else
+            name = tmp_buf;
+       while (*class_name == '%')
+               class_name += 1;
+       strcpy (name, ".objc_category_name_");
+       strcat (name, class_name);
+       strcat (name, "_");
+       strcat (name, category_name);
+       if (NSIsSymbolNameDefined(name)) _dyld_lookup_and_bind_objc(name, 0, 0);
+        if ( name != tmp_buf )
+            free(name);
+}
+
+/***********************************************************************
+ * _objc_bindModuleContainingClass.  Bind the module containing the
+ * class.
+ **********************************************************************/
+static void _objc_bindModuleContainingClass (struct objc_class * cls)
+{
+       struct objc_method_list *       mList;
+       const char *    class_name;
+       char *                  name;
+        char                    tmp_buf[128];
+        unsigned int            name_len;
+       
+       // Use the real class behind the poser
+       if (CLS_GETINFO (cls, CLS_POSING))
+               cls = getOriginalClassForPosingClass (cls);
+
+       // Bind ".objc_class_name_<classname>", where <classname>
+       // is the class name with the leading '%'s stripped.
+       class_name = cls->name;
+        name_len   = strlen(class_name) + 20;
+        if ( name_len > 128 )
+           name = malloc(name_len);
+        else
+            name = tmp_buf;
+       while (*class_name == '%')
+               class_name += 1;
+       strcpy (name, ".objc_class_name_");
+       strcat (name, class_name);
+       if (NSIsSymbolNameDefined(name)) _dyld_lookup_and_bind_objc(name, 0, 0);
+        if ( name != tmp_buf )
+            free(name);
+}
+#endif // __MACH__
+       
+/***********************************************************************
+ * _objc_headerCount.  Return the currently known number of `__OBJC'
+ * segments that are a part of the application
+ **********************************************************************/
+unsigned int   _objc_headerCount              (void)
+{
+#if defined(__MACH__) // not GENERIC_OBJ_FILE
+       return header_count;
+#else
+       return _objc_goff_headerCount ();
+#endif
+}
+
+/***********************************************************************
+ * _objc_addHeader.
+ *
+ * NOTE: Yet another wildly inefficient routine.
+ **********************************************************************/
+void   _objc_addHeader        (const headerType *      header,
+                                                               unsigned long           vmaddr_slide)
+{
+       // Account for addition
+       header_count += 1;
+       
+       // Create vector table if needed
+       if (header_vector == 0)
+       {
+               header_vector_size = 100;
+               header_vector = malloc_zone_malloc (_objc_create_zone (), 
+                                             header_vector_size * sizeof(header_info));
+#if defined(WIN32) || defined(__svr4__)
+               bzero (header_vector, (header_vector_size * sizeof(header_info)));
+#endif
+       }
+       
+       
+       // Malloc a new vector table one bigger than before
+       else if (header_count > header_vector_size)
+       {
+               void *  old;
+       
+               header_vector_size *= 2;        
+               old = (void *) header_vector;
+               header_vector = malloc_zone_malloc (_objc_create_zone (),
+                                             header_vector_size * sizeof(header_info));
+       
+#if defined(WIN32) || defined(__svr4__)
+               bzero (header_vector, (header_vector_size * sizeof(header_info)));
+#endif
+               memcpy ((void *) header_vector, old, (header_count - 1) * sizeof(header_info));
+               malloc_zone_free (_objc_create_zone (), old);
+       }
+       
+       // Set up the new vector entry
+       header_vector[header_count - 1].mhdr            = header;
+       header_vector[header_count - 1].mod_ptr         = NULL;
+       header_vector[header_count - 1].mod_count       = 0;
+       header_vector[header_count - 1].image_slide     = vmaddr_slide;
+       header_vector[header_count - 1].objcSize        = 0;
+}
+
+/***********************************************************************
+ * libraryNameForMachHeader.
+**********************************************************************/
+static const char *    libraryNameForMachHeader  (const headerType * themh)
+{
+#if defined(NeXT_PDO)
+       return "";
+#else
+       unsigned long   index;
+       unsigned long   imageCount;
+       headerType *    mh;
+       
+       // Search images for matching type
+       imageCount = _dyld_image_count ();
+       for (index = 0; index < imageCount ; index += 1)
+       {
+               // Return name of image with matching type
+               mh = _dyld_get_image_header (index);
+               if (mh == themh)
+                       return _dyld_get_image_name (index);
+       }
+       
+       // Not found
+       return 0;
+#endif
+}
+
+/***********************************************************************
+ * _objc_fixup_selector_refs.  Register all of the selectors in each
+ * image, and fix them all up.
+ *
+ **********************************************************************/
+static void _objc_fixup_selector_refs   (const header_info *   hi)
+{
+       unsigned int            midx;
+       unsigned int            size;
+       OBJC_PROTOCOL_PTR       protos;
+       Module                  mods;
+       unsigned int            index;
+#if defined(__MACH__)
+       SEL *                   messages_refs;
+#endif // __MACH__
+       
+       mods = (Module) ((unsigned long) hi->mod_ptr + hi->image_slide);
+
+       if ( rocketLaunchingDebug )
+       {
+               printf ("uniquing selectors for %s\n", libraryNameForMachHeader(hi->mhdr));
+               printf ("   uniquing message_refs\n");
+       }
+       
+#if defined(__MACH__)
+       // Fix up message refs
+       messages_refs = (SEL *) _getObjcMessageRefs ((headerType *) hi->mhdr, &size);
+       if (messages_refs)
+       {
+               messages_refs = (SEL *) ((unsigned long) messages_refs + hi->image_slide);
+               map_selrefs (messages_refs, size);
+       }
+#endif // __MACH__
+
+        
+#if !defined(__MACH__)
+       // This is redundant with the fixup done in _objc_fixup_protocol_objects_for_image()
+       // in a little while, at least on MACH.
+
+       // Fix up protocols
+       protos = (OBJC_PROTOCOL_PTR) _getObjcProtocols ((headerType *) hi->mhdr, &size);
+       if (protos)
+       {
+               protos = (OBJC_PROTOCOL_PTR)((unsigned long)protos + hi->image_slide);
+               
+               for (index = 0; index < size; index += 1)
+               {
+                       // Fix up instance method names
+                       if (protos[index] OBJC_PROTOCOL_DEREF instance_methods)
+                               map_method_descs (protos[index] OBJC_PROTOCOL_DEREF instance_methods);
+                       
+                       // Fix up class method names
+                       if (protos[index] OBJC_PROTOCOL_DEREF class_methods)
+                               map_method_descs (protos[index] OBJC_PROTOCOL_DEREF class_methods);
+               }
+       }
+#endif
+}
+
+
+/***********************************************************************
+ * _objc_call_loads_for_image.
+ **********************************************************************/
+static void _objc_call_loads_for_image (header_info * header)
+{
+       struct objc_class *                     cls;
+       struct objc_class * *           pClass;
+       Category *                      pCategory;
+       IMP                                                     load_method;
+       unsigned int                            nModules;
+       unsigned int                            nClasses;
+       unsigned int                            nCategories;
+       struct objc_symtab *            symtab;
+       struct objc_module *            module;
+       
+       // Major loop - process all modules named in header
+       module = (struct objc_module *) ((unsigned long) header->mod_ptr + header->image_slide);
+       for (nModules = header->mod_count; nModules; nModules -= 1, module += 1)
+       {
+               symtab = module->symtab;
+               if (symtab == NULL)
+                       continue;
+               
+               // Minor loop - call the +load from each class in the given module
+               for (nClasses = symtab->cls_def_cnt, pClass = (Class *) symtab->defs;
+                    nClasses;
+                    nClasses -= 1, pClass += 1)
+               {
+                       struct objc_method_list **mlistp;
+                       cls = (struct objc_class *)*pClass;
+                       mlistp = get_base_method_list(cls->isa);
+                       if (cls->isa->methodLists && mlistp)
+                       {
+                               // Look up the method manually (vs messaging the class) to bypass
+                               // +initialize and cache fill on class that is not even loaded yet
+                               load_method = class_lookupNamedMethodInMethodList (*mlistp, "load");
+                               if (load_method)
+                                       (*load_method) ((id) cls, @selector(load));
+                       }
+               }
+               
+               // Minor loop - call the +load from augmented class of
+               // each category in the given module
+               for (nCategories = symtab->cat_def_cnt,
+                       pCategory = (Category *) &symtab->defs[symtab->cls_def_cnt];
+                    nCategories;
+                    nCategories -= 1, pCategory += 1)
+               {
+                       struct objc_method_list *       methods;
+                       
+                       cls = objc_getClass ((*pCategory)->class_name);
+                       methods = (*pCategory)->class_methods;
+                       if (methods)
+                       {
+                               load_method = class_lookupNamedMethodInMethodList (methods, "load");
+                               if (load_method)
+                                       (*load_method) ((id) cls, @selector(load));
+                       }
+               }
+       }
+}
+
+/***********************************************************************
+ * objc_setMultithreaded.
+ **********************************************************************/
+void objc_setMultithreaded (BOOL flag)
+{
+       if (flag == YES)
+               _objc_multithread_mask = 0;
+       else
+               _objc_multithread_mask = (-1);
+}
+
+/* Library initializer called by dyld. */
+void __initialize_objc(void) {
+       int hidx;
+
+#if defined(NeXT_PDO)
+       const headerType * const *      headers;
+
+        if ( rocketLaunchingDebug == -1 ) {
+           if ( getenv("OBJC_UNIQUE_DEBUG") ) rocketLaunchingDebug = 1;
+            else rocketLaunchingDebug = 0;
+        }
+
+       // Get architecture dependent module headers
+       headers = (const headerType * const *) _getObjcHeaders ();
+       if (headers)
+       {
+               // Create vector from these headers
+               header_vector = _objc_headerVector (headers);
+               if (header_vector) 
+               {
+                       // Load classes from all images in the vector
+                       for (hidx = 0; hidx < header_count; hidx += 1)
+                               (void) _objc_get_classes_from_image (class_hash, &header_vector[hidx]);
+               }
+       }
+#endif
+#if defined(__MACH__)
+       static int _done = 0;
+       extern void __CFInitialize(void);
+
+       /* Protect against multiple invocations, as all library
+        * initializers should. */
+       if (0 != _done) return;
+       _done = 1;
+
+       ptrace(0xb000, 0, 0, 0);
+
+       // make sure CF is initialized before we go further;
+       // someday this can be removed, as it'll probably be automatic
+       __CFInitialize();
+
+       // Create the class lookup table
+       _objc_init_class_hash ();
+       
+//     ptrace(0xb001, 0, 0, 0);
+
+       // Get our configuration
+        if ( rocketLaunchingDebug == -1 ) {
+            if ( getenv("OBJC_UNIQUE_DEBUG") ) rocketLaunchingDebug = 1;
+            else rocketLaunchingDebug = 0;
+        }
+
+//     ptrace(0xb003, 0, 0, 0);
+
+       map_selectors_pended = 1;
+
+// XXXXX BEFORE HERE *NO* PAGES ARE STOMPED ON
+
+       // Register our image mapping routine with dyld so it
+       // gets invoked when an image is added.  This also invokes
+       // the callback right now on any images already present.
+       _dyld_register_func_for_add_image (&_objc_map_image_callback);
+       
+// XXXXX BEFORE HERE *ALL* PAGES ARE STOMPED ON
+
+       map_selectors_pended  = 0;
+       
+//     ptrace(0xb005, 0, 0, 0);
+               
+       // Register module link callback with dyld
+       _dyld_register_func_for_link_module (&_objc_link_module_callback);
+
+       // Register callback with dyld
+       _dyld_register_func_for_unlink_module (&_objc_unlink_module_callback);
+#endif // MACH
+
+//     ptrace(0xb006, header_count, 0, 0);
+
+       // Install relations on classes that were found
+       for (hidx = 0; hidx < header_count; hidx += 1)
+       {
+               int                     nModules;
+               int                     index;
+               struct objc_module *    module;
+               struct objc_class *     cls;
+               
+               module = (struct objc_module *) ((unsigned long) header_vector[hidx].mod_ptr + header_vector[hidx].image_slide);
+               for (nModules = header_vector[hidx].mod_count; nModules; nModules -= 1)
+               {
+                       for (index = 0; index < module->symtab->cls_def_cnt; index += 1)
+                       {
+                               cls = (struct objc_class *) module->symtab->defs[index];
+                               _class_install_relationships (cls, module->version);
+                       }
+
+                       module += 1;
+               }
+
+//             ptrace(0xb007, hidx, header_vector[hidx].mod_count, 0);
+               
+       }
+       
+//     ptrace(0xb008, header_count, 0, 0);
+               
+       for (hidx = 0; hidx < header_count; hidx += 1)
+       {
+#if !defined(__MACH__)
+               (void)_objc_add_categories_from_image (&header_vector[hidx]);
+               (void) _objc_fixup_selector_refs (&header_vector[hidx]);
+#endif
+               // Initialize the isa pointers of all NXConstantString objects
+               (void)_objc_fixup_string_objects_for_image (&header_vector[hidx]);
+
+               // Convert class refs from name pointers to ids
+               (void)_objc_map_class_refs_for_image (&header_vector[hidx]);
+       }
+
+//     ptrace(0xb00a, 0, 0, 0);
+               
+       // For each image selectorize the method names and +_fixup each of
+       // protocols in the image
+       for (hidx = 0; hidx < header_count; hidx += 1)
+               _objc_fixup_protocol_objects_for_image (&header_vector[hidx]);
+       
+#if defined(WIN32) || defined(__svr4__)
+       CMH = (objcModHeader *) 0;
+#endif
+
+       ptrace(0xb00f, 0, 0, 0);        // end of ObjC init
+}
+
+void _objcInit(void) {
+       static int _done = 0;
+       int hidx;
+        /* Protect against multiple invocations, as all library
+         * initializers should. */
+        if (0 != _done) return;
+        _done = 1;
+       ptrace(0xb010, 0, 0, 0);        // marks call to _objcInit
+       __initialize_objc();
+       /* We delay this until here, because dyld cannot detect and
+        * properly order calls to ObjC initializers amongst the
+        * calls to module and library initializers. */
+       for (hidx = 0; hidx < header_count; hidx += 1)
+               _objc_call_loads_for_image (&header_vector[hidx]);
+       ptrace(0xb01f, 0, 0, 0);        // marks call to _objcInit
+}
+
+#if defined(__MACH__)
+/***********************************************************************
+ * _objc_map_image.
+ **********************************************************************/
+static void    _objc_map_image(headerType *    mh,
+                                               unsigned long   vmaddr_slide)
+{
+        static int dumpClasses = -1;
+       header_info *                                   hInfo;
+       const struct segment_command *  objcSeg;
+       unsigned int                                    size;
+       
+        if ( dumpClasses == -1 ) {
+            if ( getenv("OBJC_DUMP_CLASSES") ) dumpClasses = 1;
+            else dumpClasses = 0;
+        }
+
+       ptrace(0xb100, 0, 0, 0);
+
+       // Add this header to the header_vector
+       _objc_addHeader (mh, vmaddr_slide);
+       
+//     ptrace(0xb101, 0, 0, 0);
+
+       // Touch up the vector entry we just added (yuck)
+       hInfo = &(header_vector[header_count-1]);
+       hInfo->mod_ptr     = (Module) _getObjcModules ((headerType *) hInfo->mhdr, &size);
+       hInfo->mod_count   = size;
+       objcSeg = (struct segment_command *) _getObjcHeaderData ((headerType *) mh, &size);
+       if (objcSeg)
+               hInfo->objcSize = objcSeg->filesize;
+       else
+               hInfo->objcSize = 0;
+       
+//     ptrace(0xb102, 0, 0, 0);
+
+       // Register any categories and/or classes and/or selectors this image contains
+       _objc_add_categories_from_image (hInfo);
+
+//     ptrace(0xb103, 0, 0, 0);
+
+       class_hash = _objc_get_classes_from_image (class_hash, hInfo);
+
+//     ptrace(0xb104, 0, 0, 0);
+
+       _objc_fixup_selector_refs (hInfo);
+       
+//     ptrace(0xb105, 0, 0, 0);
+
+       // Log all known class names, if asked
+       if ( dumpClasses )
+       {
+               printf ("classes...\n");
+               objc_dump_class_hash ();
+       }
+       
+       if (!map_selectors_pended)
+       {
+               int                     nModules;
+               int                     index;
+               struct objc_module *    module;
+               
+               // Major loop - process each module
+               module = (struct objc_module *) ((unsigned long) hInfo->mod_ptr + hInfo->image_slide);
+
+//             ptrace(0xb106, hInfo->mod_count, 0, 0);
+
+               for (nModules = hInfo->mod_count; nModules; nModules -= 1)
+               {
+                       // Minor loop - process each class in a given module
+                       for (index = 0; index < module->symtab->cls_def_cnt; index += 1)
+                       {
+                               struct objc_class * cls;
+                               
+                               // Locate the class description
+                               cls = (struct objc_class *) module->symtab->defs[index];
+                               
+                               // If there is no superclass or the superclass can be found,
+                               // install this class, and invoke the expected callback
+                               if (!((struct objc_class *)cls)->super_class || objc_lookUpClass ((char *) ((struct objc_class *)cls)->super_class))
+                               {
+                                       _class_install_relationships (cls, module->version);
+                                       if (callbackFunction)
+                                               (*callbackFunction) (cls, 0);
+                               }
+                               
+                               // Super class can not be found yet, arrange for this class to
+                               // be filled in later
+                               else
+                               {
+                                       objc_pendClassInstallation (cls, module->version);
+                                       ((struct objc_class *)cls)->super_class      = _objc_getNonexistentClass ();
+                                       ((struct objc_class *)cls)->isa->super_class = _objc_getNonexistentClass ();
+                               }
+                       }
+
+                       // Move on
+                       module += 1;
+               }
+               
+//             ptrace(0xb108, 0, 0, 0);
+
+               // Initialize the isa pointers of all NXConstantString objects
+               _objc_fixup_string_objects_for_image (hInfo);
+
+//             ptrace(0xb109, 0, 0, 0);
+
+               // Convert class refs from name pointers to ids
+               _objc_map_class_refs_for_image (hInfo);
+
+//             ptrace(0xb10a, 0, 0, 0);
+
+               // Selectorize the method names and +_fixup each of
+               // protocols in the image
+               _objc_fixup_protocol_objects_for_image (hInfo);
+
+//             ptrace(0xb10b, 0, 0, 0);
+
+               // Call +load on all classes and categorized classes
+               _objc_call_loads_for_image (hInfo);
+
+//             ptrace(0xb10c, 0, 0, 0);
+       }
+       
+       ptrace(0xb10f, 0, 0, 0);
+}
+
+static volatile int handling_in_progress = 0;
+static volatile int pended_callbacks_count = 0;
+static volatile struct {
+       headerType *    mh;
+       unsigned long   vmaddr_slide;
+} pended_callbacks[250] = {{0, 0}};
+
+static void    _objc_map_image_callback       (headerType *    mh,
+                                               unsigned long   vmaddr_slide)
+{
+       pended_callbacks[pended_callbacks_count].mh = mh;
+       pended_callbacks[pended_callbacks_count].vmaddr_slide = vmaddr_slide;
+       pended_callbacks_count++;
+       if (0 != handling_in_progress) return;
+       handling_in_progress = 1;
+       while (0 < pended_callbacks_count) {
+               pended_callbacks_count--;
+               _objc_map_image(pended_callbacks[pended_callbacks_count].mh, pended_callbacks[pended_callbacks_count].vmaddr_slide);
+       }
+       handling_in_progress = 0;
+}
+
+#endif // __MACH__
+
+#if defined(__MACH__)
+/***********************************************************************
+ * _objc_link_module_callback.  Callback installed with
+ * _dyld_register_func_for_link_module.
+ *
+ * NOTE: Why does this exist?  The old comment said "This will install
+ * class relations for the executable and dylibs."  Hmm.
+ **********************************************************************/
+static void    _objc_link_module_callback     (NSModule        mod)
+{
+}
+
+/***********************************************************************
+ * _objc_unlink_module_callback.  Callback installed with
+ * _dyld_register_func_for_unlink_module.
+ **********************************************************************/
+static void    _objc_unlink_module_callback   (NSModule        mod)
+{
+       _objc_fatal ("unlinking is not supported in this version of Objective C\n");
+}
+#endif // __MACH__
+
+#if defined(WIN32)
+#import <stdlib.h>
+/***********************************************************************
+ * NSRootDirectory.  Returns the value of the root directory that the
+ * product was installed to.
+ **********************************************************************/
+const char *   NSRootDirectory        (void)
+{
+       static char *root = (char *)0;
+
+        if ( ! root ) {
+            char *p = getenv("NEXT_ROOT");
+            if ( p ) {
+                root = malloc_zone_malloc(malloc_default_zone(), strlen(p)+1);
+                (void)strcpy(root, p);
+            }
+            else root = "";
+        }
+       return (const char *)root;
+}
+#endif 
+
+/***********************************************************************
+ * objc_setNilObjectMsgHandler.
+ **********************************************************************/
+void  objc_setNilObjectMsgHandler   (NilObjectMsgCallback  nilObjMsgCallback)
+{
+       _objc_msgNil = nilObjMsgCallback;
+}
+
+/***********************************************************************
+ * objc_getNilObjectMsgHandler.
+ **********************************************************************/
+NilObjectMsgCallback  objc_getNilObjectMsgHandler   (void)
+{
+       return _objc_msgNil;
+}
+
+#if defined(NeXT_PDO)
+// so we have a symbol for libgcc2.c when running PDO
+arith_t                _objcInit_addr = (arith_t) _objcInit;
+#endif
+
diff --git a/runtime/objc-sel.m b/runtime/objc-sel.m
new file mode 100644 (file)
index 0000000..59c476b
--- /dev/null
@@ -0,0 +1,13686 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/*
+ *     Utilities for registering and looking up selectors.  The sole
+ *     purpose of the selector tables is a registry whereby there is
+ *     exactly one address (selector) associated with a given string
+ *     (method name).
+ */
+
+#include <objc/objc.h>
+#include <CoreFoundation/CFSet.h>
+#import "objc-private.h"
+
+#define NUM_BUILTIN_SELS 13528
+/* base-2 log of greatest power of 2 < NUM_BUILTIN_SELS */
+#define LG_NUM_BUILTIN_SELS 13
+extern const char * const _objc_builtin_selectors[NUM_BUILTIN_SELS];
+
+static const char *_objc_empty_selector = "";
+
+static SEL _objc_search_builtins(const char *key) {
+    int c, idx, lg = LG_NUM_BUILTIN_SELS;
+    const char *s;
+
+#if defined(DUMP_SELECTORS)
+    if (NULL != key) printf("\t\"%s\",\n", key);
+#endif
+    /* The builtin table contains only sels starting with '[A-z]' */
+    if (!key) return (SEL)0;
+    if ('\0' == *key) return (SEL)_objc_empty_selector;
+    if (*key < 'A' || 'z' < *key) return (SEL)0;
+    s = _objc_builtin_selectors[-1 + (1 << lg)];
+    c = _objc_strcmp(s, key);
+    if (c == 0) return (SEL)s;
+    idx = (c < 0) ? NUM_BUILTIN_SELS - (1 << lg) : -1;
+    while (--lg >= 0) {
+       s = _objc_builtin_selectors[idx + (1 << lg)];
+       c = _objc_strcmp(s, key);
+       if (c == 0) return (SEL)s;
+       if (c < 0) idx += (1 << lg);
+    }
+    return (SEL)0;
+}
+
+static OBJC_DECLARE_LOCK(_objc_selector_lock);
+static CFMutableSetRef _objc_selectors = NULL;
+
+static Boolean _objc_equal_selector(const void *v1, const void *v2) {
+    if (v1 == v2) return TRUE;
+    if ((!v1 && v2) || (v1 && !v2)) return FALSE;
+    return ((*(char *)v1 == *(char *)v2) && (0 == _objc_strcmp(v1, v2))) ? TRUE : FALSE;
+}
+
+static CFHashCode _objc_hash_selector(const void *v) {
+    if (!v) return 0;
+    return (CFHashCode)_objc_strhash(v);
+}
+
+const char *sel_getName(SEL sel) {
+    return sel ? (const char *)sel : "<null selector>";
+}
+
+
+BOOL sel_isMapped(SEL name) {
+    SEL result;
+    const void *value;
+    
+    if (NULL == name) return NO;
+    result = _objc_search_builtins((const char *)name);
+    if ((SEL)0 != result) return YES;
+    OBJC_LOCK(&_objc_selector_lock);
+    if (_objc_selectors && CFSetGetValueIfPresent(_objc_selectors, name, &value)) {
+        result = (SEL)value;
+    }
+    OBJC_UNLOCK(&_objc_selector_lock);
+    return ((SEL)0 != (SEL)result) ? YES : NO;
+}
+
+static SEL __sel_registerName(const char *name, int copy) {
+    SEL result = 0;
+    const void *value;
+    if (NULL == name) return (SEL)0;
+    result = _objc_search_builtins(name);
+    if ((SEL)0 != result) return result;
+    OBJC_LOCK(&_objc_selector_lock);
+    if (!_objc_selectors || !CFSetGetValueIfPresent(_objc_selectors, name, &value)) {
+       if (!_objc_selectors) {
+           CFSetCallBacks cb = {0, NULL, NULL, NULL,
+               _objc_equal_selector, _objc_hash_selector};
+           _objc_selectors = CFSetCreateMutable(kCFAllocatorDefault, 0, &cb);
+           CFSetAddValue(_objc_selectors, (void *)NULL);
+       }
+        //if (copy > 1) printf("registering %s for sel_getUid\n",name);
+       value = copy ? strcpy(malloc(strlen(name) + 1), name) : name;
+       CFSetAddValue(_objc_selectors, (void *)value);
+#if defined(DUMP_UNKNOWN_SELECTORS)
+       printf("\t\"%s\",\n", value);
+#endif
+    }
+    result = (SEL)value;
+    OBJC_UNLOCK(&_objc_selector_lock);
+    return result;
+}
+
+SEL sel_registerName(const char *name) {
+    return __sel_registerName(name, 1);
+}
+
+SEL sel_registerNameNoCopy(const char *name) {
+    return __sel_registerName(name, 0);
+}
+
+// 2001/1/24
+// the majority of uses of this function (which used to return NULL if not found)
+// did not check for NULL, so, in fact, never return NULL
+//
+SEL sel_getUid(const char *name) {
+    return __sel_registerName(name, 2);
+}
+
+/* Last update: cjk - 16 October 2000
+ * To construct this list, I enabled the code in the search function which
+ * is marked DUMP_SELECTORS, and launched a few apps with stdout redirected
+ * to files in /tmp, and ran the files through this script:
+ *     cat file1 file2 file3 | sort -u > result
+ *
+ * Then I hand-edited the result file to clean it up. To do updates, I've
+ * just dumped the selectors that end up in the side CFSet (see the macro
+ * DUMP_UNKNOWN_SELECTORS).
+ *
+ * This left me with 13528 selectors, which was nicely close to but under
+ * 2^14 for the binary search.
+ */
+static const char * const _objc_builtin_selectors[NUM_BUILTIN_SELS] = {
+       "AMPMDesignation",
+       "ASCIIByteSet",
+       "ASCIICharacterSet",
+       "BMPRepresentation",
+       "DIBRepresentation",
+       "DLLPaths",
+       "DPSContext",
+       "EPSOperationWithView:insideRect:toData:",
+       "EPSOperationWithView:insideRect:toData:printInfo:",
+       "EPSOperationWithView:insideRect:toPath:printInfo:",
+       "EPSRepresentation",
+       "IBYellowColor",
+       "IBeamCursor",
+       "IMAPMessage",
+       "IMAPStore",
+       "Message",
+       "MessageFlags",
+       "MessageStore",
+       "NSArray",
+       "NSDate",
+       "NSMutableArray",
+       "NSObject",
+       "NSString",
+       "OSIconTypesList",
+       "OSInitialBuildToolList",
+       "OSList",
+       "OSPrefixesList",
+       "PDFOperationWithView:insideRect:toData:",
+       "PDFOperationWithView:insideRect:toData:printInfo:",
+       "PDFOperationWithView:insideRect:toPath:printInfo:",
+       "PDFRepresentation",
+       "PICTRepresentation",
+       "QTMovie",
+       "RTF",
+       "RTFD",
+       "RTFDFileWrapper",
+       "RTFDFileWrapperFromRange:documentAttributes:",
+       "RTFDFromRange:",
+       "RTFDFromRange:documentAttributes:",
+       "RTFFromRange:",
+       "RTFFromRange:documentAttributes:",
+       "TIFFRepresentation",
+       "TIFFRepresentationOfImageRepsInArray:",
+       "TIFFRepresentationOfImageRepsInArray:usingCompression:factor:",
+       "TIFFRepresentationUsingCompression:factor:",
+       "TOCMessageFromMessage:",
+       "URL",
+       "URL:resourceDataDidBecomeAvailable:",
+       "URL:resourceDidFailLoadingWithReason:",
+       "URLFromPasteboard:",
+       "URLHandle:resourceDataDidBecomeAvailable:",
+       "URLHandle:resourceDidFailLoadingWithReason:",
+       "URLHandleClassForURL:",
+       "URLHandleResourceDidBeginLoading:",
+       "URLHandleResourceDidCancelLoading:",
+       "URLHandleResourceDidFinishLoading:",
+       "URLHandleResourceLoadCancelled:",
+       "URLHandleUsingCache:",
+       "URLRelativeToBaseURL:",
+       "URLResourceDidCancelLoading:",
+       "URLResourceDidFinishLoading:",
+       "URLWithString:",
+       "URLWithString:relativeToURL:",
+       "URLs",
+       "URLsFromRunningOpenPanel",
+       "UTF8String",
+       "_AEDesc",
+       "_BMPRepresentation:",
+       "_CFResourceSpecifier",
+       "_CGSadjustWindows",
+       "_CGSinsertWindow:withPriority:",
+       "_CGSremoveWindow:",
+       "_DIBRepresentation",
+       "_RTFDFileWrapper",
+       "_RTFWithSelector:range:documentAttributes:",
+       "_TOCMessageForMessage:",
+       "_URL",
+       "__matrix",
+       "__numberWithString:type:",
+       "__swatchColors",
+       "_abbreviationForAbsoluteTime:",
+       "_abortLength:offset:",
+       "_aboutToDisptachEvent",
+       "_absoluteAdvancementForGlyph:",
+       "_absoluteBoundingRectForGlyph:",
+       "_absoluteURLPath",
+       "_acceptCurrentCompletion",
+       "_acceptableRowAboveKeyInVisibleRect:",
+       "_acceptableRowAboveRow:minRow:",
+       "_acceptableRowAboveRow:tryBelowPoint:",
+       "_acceptableRowBelowKeyInVisibleRect:",
+       "_acceptableRowBelowRow:maxRow:",
+       "_acceptableRowBelowRow:tryAbovePoint:",
+       "_acceptsMarkedText",
+       "_accountBeingViewed",
+       "_accountContainingEmailAddress:matchingAddress:fullUserName:",
+       "_accountWithPath:",
+       "_acquireLockFile:",
+       "_actOnKeyDown:",
+       "_actionCellInitWithCoder:",
+       "_activate",
+       "_activateHelpModeBasedOnEvent:",
+       "_activateServer",
+       "_activateWindows",
+       "_addAttachedList:withName:",
+       "_addBindingsToDictionary:",
+       "_addCell:atIndex:",
+       "_addColor:",
+       "_addCornerDirtyRectForRect:list:count:",
+       "_addCpuType:andSubType:andSize:",
+       "_addCurrentDirectoryToRecents",
+       "_addCursorRect:cursor:forView:",
+       "_addDragTypesTo:",
+       "_addDrawerWithView:",
+       "_addEntryNamed:",
+       "_addFeature:toBoxes:andButtons:",
+       "_addFrameworkDependenciesToArray:",
+       "_addHeartBeatClientView:",
+       "_addImage:named:",
+       "_addInstance:",
+       "_addInternalRedToTextAttributesOfNegativeValues",
+       "_addItem:toTable:",
+       "_addItemWithName:owner:",
+       "_addItemsToSpaButtonFromArray:enabled:",
+       "_addListItemsToArray:",
+       "_addMessageDatasToBeAppendedLater:",
+       "_addMessageToMap:",
+       "_addMessagesToIndex:",
+       "_addMultipleToTypingAttributes:",
+       "_addNewFonts:",
+       "_addObject:forKey:",
+       "_addObject:withName:",
+       "_addObjectToList:",
+       "_addObserver:notificationNamesAndSelectorNames:object:onlyIfSelectorIsImplemented:",
+       "_addOneRepFrom:toRep:",
+       "_addPath:forVariant:dir:table:",
+       "_addPathSegment:point:",
+       "_addPathsListsToList:keep:table:doingExtras:",
+       "_addPrintFiltersToPopUpButton:",
+       "_addRecipientsForKey:toArray:",
+       "_addRepsFrom:toRep:",
+       "_addScriptsFromLibrarySubFolders:toMenu:",
+       "_addSpellingAttributeForRange:",
+       "_addSubview:",
+       "_addThousandSeparators:withBuffer:",
+       "_addThousandSeparatorsToFormat:withBuffer:",
+       "_addToFavorites:",
+       "_addToFontCollection:",
+       "_addToFontFavorites:",
+       "_addToGroups:",
+       "_addToTypingAttributes:value:",
+       "_addWindow:",
+       "_addedTab:atIndex:",
+       "_addressBookChanged:",
+       "_addressBookConfigurationChanged:",
+       "_adjustCharacterIndicesForRawGlyphRange:byDelta:",
+       "_adjustControls:andSetColor:",
+       "_adjustDynamicDepthLimit",
+       "_adjustFocusRingSize:",
+       "_adjustFontSize",
+       "_adjustForGrowBox",
+       "_adjustLength",
+       "_adjustMovieToView",
+       "_adjustPathForRoot:",
+       "_adjustPort",
+       "_adjustSelectionForItemEntry:numberOfRows:",
+       "_adjustToMode",
+       "_adjustWidth:ofEditor:",
+       "_adjustWidthBy:",
+       "_adjustWindowToScreen",
+       "_aggregateArrayOfEvents:withSignatureTag:",
+       "_aggregatedEvents:withSignatureTag:class:",
+       "_alignCoords",
+       "_alignedTitleRectWithRect:",
+       "_allFrameworkDependencies",
+       "_allSubclassDescriptionsForClassDescrition:",
+       "_allocAndInitPrivateIvars",
+       "_allocAuxiliary:",
+       "_allocProjectNameForProjNum:",
+       "_allocString:",
+       "_allowsContextMenus",
+       "_allowsTearOffs",
+       "_altContents",
+       "_alternateDown::::",
+       "_analyze",
+       "_animateSheet",
+       "_animationIdler:",
+       "_animationThread",
+       "_announce",
+       "_anticipateRelease",
+       "_appHasOpenNSWindow",
+       "_appIcon",
+       "_appWillFinishLaunching:",
+       "_appendAddedHeaderKey:value:toData:",
+       "_appendArcSegmentWithCenter:radius:angle1:angle2:",
+       "_appendCString:",
+       "_appendEntry:",
+       "_appendEvent:",
+       "_appendHeaderKey:value:toData:",
+       "_appendKey:option:value:inKeyNode:",
+       "_appendMessage:toFile:andTableOfContents:",
+       "_appendMessages:unsuccessfulOnes:mboxName:tableOfContents:",
+       "_appendRequiredType:",
+       "_appendStringInKeyNode:key:value:",
+       "_appendStrings:",
+       "_appleScriptComponentInstanceOpeningIfNeeded:",
+       "_appleScriptConnectionDidClose",
+       "_applicationDidBecomeActive",
+       "_applicationDidLaunch:",
+       "_applicationDidResignActive",
+       "_applicationDidTerminate:",
+       "_applicationWillLaunch:",
+       "_apply:context:",
+       "_applyMarkerSettingsFromParagraphStyle:toCharacterRange:",
+       "_applyValues:context:",
+       "_applyValues:toObject:",
+       "_appropriateWindowForDocModalPanel",
+       "_aquaColorVariantChanged",
+       "_archiveToFile:",
+       "_argument",
+       "_argumentInfoAtIndex:",
+       "_argumentNameForAppleEventCode:",
+       "_argumentTerminologyDictionary:",
+       "_arrayByTranslatingAEList:",
+       "_arrayOfIMAPFlagsForFlags:",
+       "_asIconHasAlpha",
+       "_assertSafeMultiThreadedAccess:",
+       "_assertSafeMultiThreadedReadAccess:",
+       "_assignObjectIds",
+       "_atsFontID",
+       "_attachColorList:systemList:",
+       "_attachSheetWindow:",
+       "_attachToSupermenuView:",
+       "_attachedCell",
+       "_attachedSheet",
+       "_attachedSupermenuView",
+       "_attachmentFileWrapperDescription:",
+       "_attachmentSizesRun",
+       "_attributeTerminologyDictionary:",
+       "_attributedStringForDrawing",
+       "_attributedStringForEditing",
+       "_attributedStringValue:invalid:",
+       "_attributesAllKeys",
+       "_attributesAllValues",
+       "_attributesAllocated",
+       "_attributesAreEqualToAttributesInAttributedString:",
+       "_attributesCount",
+       "_attributesDealloc",
+       "_attributesDictionary",
+       "_attributesInit",
+       "_attributesInitWithCapacity:",
+       "_attributesInitWithDictionary:copyItems:",
+       "_attributesKeyEnumerator",
+       "_attributesObjectEnumerator",
+       "_attributesObjectForKey:",
+       "_attributesRemoveObjectForKey:",
+       "_attributesSetObject:forKey:",
+       "_attributes_fastAllKeys",
+       "_autoExpandItem:",
+       "_autoPositionMask",
+       "_autoResizeState",
+       "_autoSaveNameWithPrefix",
+       "_autoSizeView:::::",
+       "_autoscrollDate",
+       "_autoscrollDelay",
+       "_autoscrollForDraggingInfo:timeDelta:",
+       "_auxStorage",
+       "_availableFontSetNames",
+       "_avoidsActivation",
+       "_awakeFromPlist:",
+       "_backgroundColor",
+       "_backgroundFetchCompleted",
+       "_backgroundFileLoadCompleted:",
+       "_backgroundImage",
+       "_backgroundTransparent",
+       "_backingCGSFont",
+       "_backingType",
+       "_barberImage:",
+       "_beginDraggingColumn:",
+       "_beginHTMLChangeForMarkedText",
+       "_beginListeningForApplicationStatusChanges",
+       "_beginListeningForDeviceStatusChanges",
+       "_beginMark",
+       "_beginProcessingMultipleMessages",
+       "_beginScrolling",
+       "_beginUnarchivingPrintInfo",
+       "_bestRepresentation:device:bestWidth:checkFlag:",
+       "_bitBlitSourceRect:toDestinationRect:",
+       "_blinkCaret:",
+       "_blockHeartBeat:",
+       "_blueControlTintColor",
+       "_bodyWasDecoded:",
+       "_bodyWasEncoded:",
+       "_bodyWillBeDecoded:",
+       "_bodyWillBeEncoded:",
+       "_bodyWillBeForwarded:",
+       "_borderInset",
+       "_borderView",
+       "_bottomFrameRect",
+       "_bottomLeftFrameRect",
+       "_bottomLeftResizeCursor",
+       "_bottomRightFrameRect",
+       "_bottomRightResizeCursor",
+       "_boundingRectForGlyphRange:inTextContainer:fast:fullLineRectsOnly:",
+       "_boundsForContentSubviews",
+       "_brightColorFromPoint:fullBrightness:",
+       "_buildCache",
+       "_buildCursor:cursorData:",
+       "_buildIMAPAppendDataForMessage:",
+       "_bulletCharacter",
+       "_bulletStringForString:",
+       "_bumpSelectedItem:",
+       "_bundleForClassPresentInAppKit:",
+       "_bundleLoaded",
+       "_button",
+       "_buttonBezelColors",
+       "_buttonCellInitWithCoder:",
+       "_buttonImageSource",
+       "_buttonType",
+       "_buttonWidth",
+       "_bytesAreVM",
+       "_cacheMessageBodiesAndUpdateIndex:",
+       "_cacheMessageBodiesAsynchronously:",
+       "_cacheMessageBodiesToDisk:",
+       "_cacheRepresentation:",
+       "_cacheRepresentation:stayFocused:",
+       "_cacheSimpleChild",
+       "_cacheUserKeyEquivalentInfo",
+       "_cachedGlobalWindowNum",
+       "_cachedHTMLString",
+       "_calcAndSetFilenameTitle",
+       "_calcApproximateBytesRepresented",
+       "_calcBoxSize:buttons:",
+       "_calcFrameOfColumns",
+       "_calcHeights:num:margin:operation:helpedBy:",
+       "_calcMarginSize:operation:",
+       "_calcNumVisibleColumnsAndColumnSize",
+       "_calcNumericIndicatorSizeWithUnitAbbreviation:",
+       "_calcOutlineColumnWidth",
+       "_calcRowsAndColumnsInView:boxSize:numBoxes:rows:columns:",
+       "_calcScrollArrowHeight",
+       "_calcTextRect:",
+       "_calcTrackRect:andAdjustRect:",
+       "_calcWidths:num:margin:operation:helpedBy:",
+       "_calculatePageRectsWithOperation:pageSize:layoutAssuredComplete:",
+       "_calculateTotalScaleForPrintingWithOperation:",
+       "_calibratedColorOK",
+       "_callImplementor:context:chars:glyphs:stringBuffer:font:",
+       "_canAcceptRichText",
+       "_canBecomeDefaultButtonCell",
+       "_canChangeRulerMarkers",
+       "_canDrawOutsideLineHeight",
+       "_canDrawOutsideOfItsBounds",
+       "_canHide",
+       "_canImportGraphics",
+       "_canOptimizeDrawing",
+       "_canUseCompositing",
+       "_canUseKeyEquivalentForMenuItem:",
+       "_cancelAutoExpandTimer",
+       "_cancelEvent:",
+       "_cancelKey:",
+       "_cancelPerformSelectors",
+       "_cancelRootEvent:",
+       "_capitalizedKeyForKey:",
+       "_capitalizedStringWithFlags:",
+       "_captureInput",
+       "_captureVisibleIntoLiveResizeCache",
+       "_caseCopyAux::flags:",
+       "_caseCopyAux:flags:",
+       "_cellContentRectForUsedSize:inFrame:",
+       "_cellForRow:browser:browserColumn:",
+       "_cellFrame",
+       "_cellFurthestFrom:andCol:",
+       "_cellInitWithCoder:",
+       "_centerForCFCenter:",
+       "_centerInnerBounds:",
+       "_centerScanPoint:",
+       "_centerTitle:inRect:",
+       "_centeredScrollRectToVisible:forceCenter:",
+       "_cfBundle",
+       "_cfCenter",
+       "_cfNumberType",
+       "_cfTypeID",
+       "_cffireDate",
+       "_cffireTime",
+       "_cgsEventRecord",
+       "_cgsEventTime",
+       "_cgsevent",
+       "_changeAllDrawersKeyState",
+       "_changeDictionaries:",
+       "_changeDisplayToMessage:",
+       "_changeDrawerKeyState",
+       "_changeFontList:",
+       "_changeIntAttribute:by:range:",
+       "_changeJustMain",
+       "_changeKeyAndMainLimitedOK:",
+       "_changeKeyState",
+       "_changeLanguage:",
+       "_changeReadStatusTo:",
+       "_changeSelectionWithEvent:",
+       "_changeSpellingFromMenu:",
+       "_changeSpellingToWord:",
+       "_changeWasDone:",
+       "_changeWasRedone:",
+       "_changeWasUndone:",
+       "_changed:",
+       "_changingSelectionWithKeyboard",
+       "_charRangeIsHighlightOptimizable:fromOldCharRange:",
+       "_characterCannotBeRendered:",
+       "_characterRangeCurrentlyInAndAfterContainer:",
+       "_characterRangeForPoint:inRect:ofView:",
+       "_charsetForStringEncoding:",
+       "_checkFile:container:",
+       "_checkForFat:",
+       "_checkForMessageClear:",
+       "_checkForSimpleTrackingMode",
+       "_checkForTerminateAfterLastWindowClosed:",
+       "_checkHeader",
+       "_checkInName:onHost:andPid:forUser:",
+       "_checkInSizeBuffer",
+       "_checkLoaded:rect:highlight:",
+       "_checkNewMail:",
+       "_checkOutColumnOrigins",
+       "_checkOutColumnWidths",
+       "_checkOutRowHeights",
+       "_checkOutRowOrigins",
+       "_checkSpellingForRange:excludingRange:",
+       "_checkType:",
+       "_child",
+       "_childEvent",
+       "_childSatisfyingTestSelector:withObject:afterItem:",
+       "_childSatisfyingTestSelector:withObject:beforeItem:",
+       "_chooseApplicationSheetDidEnd:returnCode:contextInfo:",
+       "_chooseBrowserItem:",
+       "_chooseDir:andTable:for:as:",
+       "_chooseFace:",
+       "_chooseFamily:",
+       "_chooseGuess:",
+       "_choosePrintFilter:",
+       "_chooseSize:",
+       "_chosenSpellServer:",
+       "_chunkAndFindMisspelledWordInString:language:learnedDictionaries:wordCount:usingSpellServer:",
+       "_classDescriptionForAppleEventCode:",
+       "_classDescriptionForName:inSuite:",
+       "_classTerminologyDictionary",
+       "_cleanUpStaleAttachments",
+       "_cleanupAndAuthenticate:sequence:conversation:invocation:raise:",
+       "_cleanupHelpForQuit",
+       "_clearCellFrame",
+       "_clearChangedThisTransaction:",
+       "_clearControlTintColor",
+       "_clearCurrentAttachmentSettings",
+       "_clearDirtyRectsForTree",
+       "_clearDocFontsUsed",
+       "_clearDragMargins",
+       "_clearEditingTextView:",
+       "_clearFocusForView",
+       "_clearKeyCell",
+       "_clearLastLoadedDateAndFontSet",
+       "_clearModalWindowLevel",
+       "_clearMouseTracking",
+       "_clearMouseTrackingForCell:",
+       "_clearPageFontsUsed",
+       "_clearPressedButtons",
+       "_clearRectsFromCharacterIndex:",
+       "_clearSelectedCell",
+       "_clearSheetFontsUsed",
+       "_clearSpellingForRange:",
+       "_clearTemporaryAttributes",
+       "_clearTemporaryAttributesForCharacterRange:changeInLength:",
+       "_clearTrackingRects",
+       "_clickedCharIndex",
+       "_clientConnectionDied:",
+       "_clientImageMapURLStringForLocation:inFrame:",
+       "_clientsCreatingIfNecessary:",
+       "_clipViewAncestor",
+       "_cloneFont:withFlag:",
+       "_close",
+       "_close:",
+       "_closeButtonOrigin",
+       "_closeDocumentsStartingWith:shouldClose:closeAllContext:",
+       "_closeSheet:andMoveParent:",
+       "_collapseAllAutoExpandedItems",
+       "_collapseAutoExpandedItems:",
+       "_collapseButtonOrigin",
+       "_collapseItem:collapseChildren:clearExpandState:",
+       "_collapseItemEntry:collapseChildren:clearExpandState:",
+       "_collectLinkChildren:into:parentPath:",
+       "_collectMainChildren:into:parentInode:parentPath:",
+       "_colorByTranslatingRGBColor:",
+       "_colorForHexNumber:",
+       "_colorForName:",
+       "_colorFromPoint:",
+       "_colorListNamed:forDeviceType:",
+       "_colorWellAcceptedColor:",
+       "_colorWellCommonAwake",
+       "_colorizedImage:color:",
+       "_columnAtLocation:",
+       "_columnClosestToColumn:whenMoved:",
+       "_columnRangeForDragImage",
+       "_columnSeparationWidth",
+       "_commandDescriptionForAppleEventClass:andEventCode:",
+       "_commandTerminologyDictionary",
+       "_commonAwake",
+       "_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:",
+       "_commonFontInit",
+       "_commonInit",
+       "_commonInitFrame:styleMask:backing:defer:",
+       "_commonInitIvarBlock",
+       "_commonInitState",
+       "_commonNewScroll:",
+       "_commonSecureTextFieldInit",
+       "_compactMessageAtIndex:",
+       "_compare::checkCase:",
+       "_compareDuration:",
+       "_compareWidthWithSuperview",
+       "_compatibility_canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:",
+       "_compatibility_doSavePanelSave:delegate:didSaveSelector:contextInfo:",
+       "_compatibility_shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:",
+       "_compatibleWithRulebookVersion:",
+       "_complete:",
+       "_completeName:",
+       "_completeNoRecursion:",
+       "_completeRefaultingOfGID:object:",
+       "_componentsSeparatedBySet:",
+       "_composite:delta:fromRect:toPoint:",
+       "_compositeAndUnlockCachedImage",
+       "_compositeImage",
+       "_compositePointInRuler",
+       "_compositeToPoint:fromRect:operation:fraction:",
+       "_compositeToPoint:operation:fraction:",
+       "_compressIfNeeded",
+       "_computeBounds",
+       "_computeDisplayedLabelForRect:",
+       "_computeDisplayedSizeOfString:",
+       "_computeExecutablePath",
+       "_computeInv",
+       "_computeMinimumDisplayedLabel",
+       "_computeMinimumDisplayedLabelForWidth:",
+       "_computeMinimumDisplayedLabelSize",
+       "_computeNominalDisplayedLabelSize",
+       "_computeParams",
+       "_computeSynchronizationStatus",
+       "_concatInvertToAffineTransform:",
+       "_concreteFontInit",
+       "_concreteFontInit:",
+       "_concreteInputContextClass",
+       "_configureAsMainMenu",
+       "_configureAsSeparatorItem",
+       "_configureCell:forItemAtIndex:",
+       "_configureComposeWindowForType:message:",
+       "_configureSoundPopup",
+       "_configureTornOffMessageWindowForMessage:",
+       "_confirmSaveSheetDidEnd:returnCode:contextInfo:",
+       "_confirmSize:",
+       "_conflictsDirectlyWithTextStyleFromArray:",
+       "_conflictsIndirectlyWithTextStyleFromArray:",
+       "_conformsToProtocolNamed:",
+       "_consistencyCheck:",
+       "_consistencyError:startAtZeroError:cacheError:inconsistentBlockError:",
+       "_constrainPoint:withEvent:",
+       "_constructDeletedList",
+       "_containedInSingleColumnClipView",
+       "_containerDescription",
+       "_containerObservesTextViewFrameChanges",
+       "_containerTextViewFrameChanged:",
+       "_containsChar:",
+       "_containsCharFromSet:",
+       "_containsColorForTextAttributesOfNegativeValues",
+       "_containsIdenticalObjectsInArray:",
+       "_containsPath:",
+       "_containsString:",
+       "_contentToFrameMaxXWidth",
+       "_contentToFrameMaxXWidth:",
+       "_contentToFrameMaxYHeight",
+       "_contentToFrameMaxYHeight:",
+       "_contentToFrameMinXWidth",
+       "_contentToFrameMinXWidth:",
+       "_contentToFrameMinYHeight",
+       "_contentToFrameMinYHeight:",
+       "_contentView",
+       "_contentViewBoundsChanged:",
+       "_contents",
+       "_contextAuxiliary",
+       "_contextMenuEvent",
+       "_contextMenuImpl",
+       "_contextMenuTarget",
+       "_contextMenuTargetForEvent:",
+       "_controlColor",
+       "_controlMenuKnownAbsent:",
+       "_controlTintChanged:",
+       "_convertDataToString:",
+       "_convertPersistentItem:",
+       "_convertPoint:fromAncestor:",
+       "_convertPoint:toAncestor:",
+       "_convertPointFromSuperview:test:",
+       "_convertPointToSuperview:",
+       "_convertRect:fromAncestor:",
+       "_convertRect:toAncestor:",
+       "_convertRectFromSuperview:test:",
+       "_convertRectToSuperview:",
+       "_convertStringToData:",
+       "_convertToChildArray",
+       "_convertToNSRect:",
+       "_convertToQDRect:",
+       "_convertToText:",
+       "_copyDataFrom:",
+       "_copyDescription",
+       "_copyDevice:",
+       "_copyDir:dst:dstDir:name:nameLen:exists:isNFS:srcTail:dstTail:bomInode:",
+       "_copyDragCursor",
+       "_copyFile:dst:dstDir:name:isNFS:cpuTypes:",
+       "_copyFromDir:toDir:srcTail:dstTail:dirBomInode:dstDirExisted:",
+       "_copyLink:dst:dstDir:name:isNFS:",
+       "_copyMutableSetFromToManyArray:",
+       "_copyToFaxPanelPageMode:firstPage:lastPage:",
+       "_copyToTree:fromCursor:toCursor:",
+       "_copyToUnicharBuffer:saveLength:",
+       "_correct:",
+       "_correctGrammarGroups:andRules:",
+       "_correctGroups:inArray:",
+       "_count",
+       "_countDisplayedDescendantsOfItem:",
+       "_countForArray:",
+       "_countLinksTo:",
+       "_countUnreadAndDeleted",
+       "_counterpart",
+       "_coveredCharSet",
+       "_crackPoint:",
+       "_crackRect:",
+       "_createAuxData",
+       "_createBackingStore",
+       "_createCachedImage:",
+       "_createCells",
+       "_createColumn:",
+       "_createImage:::",
+       "_createImpl:",
+       "_createKeyValueBindingForKey:name:bindingType:",
+       "_createLock:",
+       "_createMainBodyPart",
+       "_createMenuMapLock",
+       "_createMovieController",
+       "_createNewFolderAtPath:",
+       "_createNewMailboxAtPath:",
+       "_createOptionBoxes:andButtons:",
+       "_createPartFromFileWrapper:",
+       "_createPartFromHTMLAttachment:",
+       "_createPartFromTextAttachment:",
+       "_createPattern",
+       "_createPatternFromRect:",
+       "_createPopUpMenu",
+       "_createPrinter:includeUnavailable:",
+       "_createScrollViewAndWindow",
+       "_createStatusItemControlInWindow:",
+       "_createStatusItemWindow",
+       "_createSubstringWithRange:",
+       "_createSurface",
+       "_createWakeupPort",
+       "_creteCachedImageLockIfNeeded",
+       "_crosshairCursor",
+       "_currentActivation",
+       "_currentAttachmentIndex",
+       "_currentAttachmentRect",
+       "_currentClient",
+       "_currentColorIndex",
+       "_currentSelection",
+       "_cursorRectCursor",
+       "_cycleFreeSpace",
+       "_darkBlueColor",
+       "_dataSourceRespondsToWriteDragRows",
+       "_dataSourceSetValue:forColumn:row:",
+       "_dataSourceValueForColumn:row:",
+       "_deactivate",
+       "_deactivateWindows",
+       "_deallocAuxiliary",
+       "_deallocCursorRects",
+       "_deallocHardCore:",
+       "_debugLoggingLevel",
+       "_decimalIsNotANumber:",
+       "_decimalPoint",
+       "_declareExtraTypesForTypeArray:",
+       "_decodeAndRecordObjectWithCoder:",
+       "_decodeByte",
+       "_decodeDepth",
+       "_decodeHeaderKey:fromData:offset:",
+       "_decodeHeaderKeysFromData:",
+       "_decodeMatrixWithCoder:",
+       "_decodeNewPtr:label:usingTable:lastLabel:atCursor:",
+       "_decodeWithoutNameWithCoder:",
+       "_decompressIfNeeded",
+       "_deepDescription",
+       "_deepDescriptionsWithPrefix:prefixUnit:targetArray:",
+       "_deepRootLevelEventsFromEvents:intoArray:",
+       "_defaultButtonCycleTime",
+       "_defaultButtonIndicatorFrameForRect:",
+       "_defaultEditingContextNowInitialized:",
+       "_defaultFontSet",
+       "_defaultGlyphForChar:",
+       "_defaultKnobColor",
+       "_defaultPathForKey:withFallbackKey:defaultValue:",
+       "_defaultPathToRouteMessagesTo",
+       "_defaultPrinterIsFax:",
+       "_defaultProgressIndicatorColor",
+       "_defaultSelectedKnobColor",
+       "_defaultSelectionColor",
+       "_defaultSharedEditingContext",
+       "_defaultSharedEditingContextWasInitialized:",
+       "_defaultTableHeaderReverseSortImage",
+       "_defaultTableHeaderSortImage",
+       "_defaultType",
+       "_delayedUpdateSwatch:",
+       "_delegate:handlesKey:",
+       "_delegateValidation:object:uiHandled:",
+       "_delegateWillDisplayCell:forColumn:row:",
+       "_delegateWillDisplayOutlineCell:forColumn:row:",
+       "_deleteAllCharactersFromSet:",
+       "_deleteAttachments:",
+       "_deleteBack:flatteningStructures:",
+       "_deleteDictionaries:",
+       "_deleteFontCollection:",
+       "_deleteMessages",
+       "_deleteRow:atIndex:givingSizeToIndex:",
+       "_demoteLeader:newLeader:",
+       "_descStringForFont:",
+       "_descriptionFileName",
+       "_descriptorByTranslatingArray:desiredDescriptorType:",
+       "_descriptorByTranslatingColor:desiredDescriptorType:",
+       "_descriptorByTranslatingNumber:desiredDescriptorType:",
+       "_descriptorByTranslatingString:desiredDescriptorType:",
+       "_descriptorByTranslatingTextStorage:desiredDescriptorType:",
+       "_deselectAll",
+       "_deselectAllExcept::andDraw:",
+       "_deselectColumn:",
+       "_deselectRowRange:",
+       "_deselectsWhenMouseLeavesDuringDrag",
+       "_desiredKeyEquivalent",
+       "_desiredKeyEquivalentModifierMask",
+       "_destinationStorePathForMessage:",
+       "_destroyRealWindow:",
+       "_destroyRealWindowIfNotVisible:",
+       "_destroyStream",
+       "_destroyWakeupPort",
+       "_detachFromLabelledItem",
+       "_detachSheetWindow",
+       "_detectTrackingMenuChangeWithScreenPoint:",
+       "_determineDropCandidateForDragInfo:",
+       "_deviceClosePath",
+       "_deviceCurveToPoint:controlPoint1:controlPoint2:",
+       "_deviceLineToPoint:",
+       "_deviceMoveToPoint:",
+       "_dictionary",
+       "_dictionaryByTranslatingAERecord:",
+       "_dictionaryForPropertyList:",
+       "_dictionaryWithNamedObjects",
+       "_didChange",
+       "_didEndCloseSheet:returnCode:closeContext:",
+       "_didMountDeviceAtPath:",
+       "_didNSOpenOrPrint",
+       "_didUnmountDeviceAtPath:",
+       "_dimmedImage:",
+       "_direction",
+       "_directoryPathForNode:context:",
+       "_dirtyFlags",
+       "_dirtyRect",
+       "_dirtyRectUncoveredFromOldDocFrame:byNewDocFrame:",
+       "_disableCompositing",
+       "_disableEnablingKeyEquivalentForDefaultButtonCell",
+       "_disableMovedPosting",
+       "_disablePosting",
+       "_disableResizedPosting",
+       "_disableSecurity:",
+       "_disableSelectionPosting",
+       "_discardCursorRectsForView:",
+       "_discardEventsWithMask:eventTime:",
+       "_discardTrackingRect:",
+       "_displayChanged",
+       "_displayFilteredResultsRespectingSortOrder:showList:",
+       "_displayName",
+       "_displayName:",
+       "_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:",
+       "_displaySomeWindowsIfNeeded:",
+       "_displayStringForFont:",
+       "_displayedLabel",
+       "_disposeBackingStore",
+       "_disposeMovieController",
+       "_disposeSurface",
+       "_disposeTextObjects",
+       "_distanceForVerticalArrowKeyMovement",
+       "_doAnimation",
+       "_doAttachDrawer",
+       "_doAutoscroll:",
+       "_doAutoscrolling",
+       "_doAutoselectEdge",
+       "_doCloneInReceiver:withInsertionContainer:key:index:",
+       "_doCloseDrawer",
+       "_doCommandBySelector:forInputManager:",
+       "_doCompletionWindowPlacement:",
+       "_doDetachDrawer",
+       "_doExpansion:",
+       "_doHide",
+       "_doImageDragUsingRows:event:pasteboard:source:slideBack:",
+       "_doInvokeServiceIn:msg:pb:userData:error:unhide:",
+       "_doLayoutTabs:",
+       "_doLayoutWithFullContainerStartingAtGlyphIndex:nextGlyphIndex:",
+       "_doListCommand::",
+       "_doMailViewerResizing",
+       "_doModalLoop:peek:",
+       "_doMoveInReceiver:withInsertionContainer:key:index:",
+       "_doOpenDrawer",
+       "_doOpenFile:ok:tryTemp:",
+       "_doOpenUntitled",
+       "_doOptimizedLayoutStartingAtGlyphIndex:forSoftLayoutHole:inTextContainer:lineLimit:nextGlyphIndex:",
+       "_doOrderWindow:relativeTo:findKey:",
+       "_doOrderWindow:relativeTo:findKey:forCounter:force:",
+       "_doOrderWindow:relativeTo:findKey:forCounter:force:isModal:",
+       "_doPageArea:finishPage:helpedBy:pageLabel:",
+       "_doPositionDrawer",
+       "_doPositionDrawerAndSize:parentFrame:",
+       "_doPositionDrawerAndSize:parentFrame:stashSize:",
+       "_doPostedModalLoopMsg:",
+       "_doPreview:",
+       "_doPrintFile:ok:",
+       "_doRemoveDrawer",
+       "_doResizeDrawerWithDelta:fromFrame:",
+       "_doRotationOnly",
+       "_doScroller:",
+       "_doScroller:hitPart:multiplier:",
+       "_doSetAccessoryView:topView:bottomView:oldView:",
+       "_doSetParentWindow:",
+       "_doSlideDrawerWithDelta:",
+       "_doSomeBackgroundLayout",
+       "_doStartDrawer",
+       "_doStopDrawer",
+       "_doTiming",
+       "_doUidFetch:withRange:processResultsUsingSelector:expect:destFile:keepInMemory:intoArray:",
+       "_doUidFetch:withRange:processResultsUsingSelector:expect:intoArray:",
+       "_doUnhideWithoutActivation",
+       "_doUpdateServicesMenu:",
+       "_doUserParagraphStyleLineHeight:fixed:",
+       "_doUserPathWithOp:",
+       "_docController:shouldTerminate:",
+       "_document",
+       "_document:shouldClose:contextInfo:",
+       "_documentClassNames",
+       "_documentWindow",
+       "_doesOwnRealWindow",
+       "_doesRule:containExpression:inHeaders:caseSensitive:",
+       "_doneTyping:",
+       "_dosetTitle:andDefeatWrap:",
+       "_dotPrefix:suffix:",
+       "_doubleClickedList:",
+       "_doubleHit:",
+       "_dragCanBeginFromVerticalMouseMotion",
+       "_dragFile:fromRect:slideBack:event:showAsModified:",
+       "_dragImageSize",
+       "_dragLocalSource",
+       "_dragShouldBeginFromMouseDown:",
+       "_dragUntilMouseUp:accepted:",
+       "_drawAnimationStep",
+       "_drawBackgroundForGlyphRange:atPoint:parameters:",
+       "_drawBorder:inRect:",
+       "_drawBottomFrameRect:",
+       "_drawBottomLeftFrameRect:",
+       "_drawBottomRightFrameRect:",
+       "_drawCellAt::insideOnly:",
+       "_drawCenteredVerticallyInRect:",
+       "_drawColumn:",
+       "_drawColumnHeaderRange:",
+       "_drawColumnSeparatorsInRect:",
+       "_drawContents:faceColor:textColor:inView:",
+       "_drawDefaultButtonIndicatorWithFrame:inView:",
+       "_drawDialogSides:",
+       "_drawDone:success:",
+       "_drawDragImageInRect:",
+       "_drawDropHighlight",
+       "_drawDropHighlightBetweenUpperRow:andLowerRow:atOffset:",
+       "_drawDropHighlightOffScreenIndicatorPointingLeftAtOffset:",
+       "_drawDropHighlightOffScreenIndicatorPointingUp:atOffset:",
+       "_drawDropHighlightOnRow:",
+       "_drawEndCapInRect:",
+       "_drawFrame",
+       "_drawFrame:",
+       "_drawFrameInterior:clip:",
+       "_drawFrameRects:",
+       "_drawFrameShadowAndFlushContext:",
+       "_drawFromRect:toRect:operation:alpha:compositing:",
+       "_drawGlyphsForGlyphRange:atPoint:parameters:",
+       "_drawGrowBoxWithClip:",
+       "_drawHeaderFillerInRect:",
+       "_drawHeaderOfColumn:",
+       "_drawKeyViewOutline:",
+       "_drawKeyboardFocusRingWithFrame:",
+       "_drawKeyboardFocusRingWithFrame:inView:",
+       "_drawKeyboardUILoop",
+       "_drawLeftFrameRect:",
+       "_drawMatrix",
+       "_drawMenuFrame:",
+       "_drawMiniWindow:",
+       "_drawNumericIndicator",
+       "_drawOptimizedRectFills",
+       "_drawProgressArea",
+       "_drawRect:clip:",
+       "_drawRect:liveResizeCacheCoveredArea:",
+       "_drawRect:withOpaqueAncestor:",
+       "_drawRemainderArea",
+       "_drawRepresentation:",
+       "_drawResizeIndicators:",
+       "_drawRightFrameRect:",
+       "_drawStandardPopUpBorderWithFrame:inView:",
+       "_drawTabViewItem:inRect:",
+       "_drawThemeBackground",
+       "_drawThemeContents:highlighted:inView:",
+       "_drawThemePopUpBorderWithFrame:inView:withBezel:",
+       "_drawThemeProgressArea:",
+       "_drawThemeTab:inRect:",
+       "_drawTitleBar:active:",
+       "_drawTitleStringIn:withColor:",
+       "_drawTitlebar:",
+       "_drawTitlebarLines:inRect:clippedByRect:",
+       "_drawTitlebarPattern:inRect:clippedByRect:forKey:alignment:",
+       "_drawTitledFrame:",
+       "_drawTopFrameRect:",
+       "_drawTopLeftFrameRect:",
+       "_drawTopRightFrameRect:",
+       "_drawViewBackgroundInRect:",
+       "_drawWinTab:inRect:tabColor:shadowColor:",
+       "_drawWindowsGaugeRects:",
+       "_drawerIsOpen",
+       "_drawerTransform",
+       "_drawerVelocity",
+       "_drawingLastColumn",
+       "_drawingSubthreadWillDie:",
+       "_drawsBackground",
+       "_dumpBitmapRepresentation:",
+       "_dumpBookSegments",
+       "_dumpGlobalResources:",
+       "_dumpLocalizedResources:",
+       "_dumpSetRepresentation:",
+       "_dynamicColorsChanged:",
+       "_editing",
+       "_editorResized",
+       "_ejectRemovableDevice:",
+       "_enable:service:",
+       "_enableCompositing",
+       "_enableEnablingKeyEquivalentForDefaultButtonCell",
+       "_enableItems",
+       "_enableLeaf:container:",
+       "_enableLogging:",
+       "_enableMovedPosting",
+       "_enablePosting",
+       "_enableResizedPosting",
+       "_enableSecurity:",
+       "_enableSelectionPostingAndPost",
+       "_encodeByte:",
+       "_encodeDepth:",
+       "_encodeDictionary:forKey:",
+       "_encodeMapTable:forTypes:withCoder:",
+       "_encodeObjects:forKey:",
+       "_encodeValue:forKey:",
+       "_encodeWithoutNameWithCoder:",
+       "_encodedHeadersIncludingFromSpace:",
+       "_encodedValuesForControls:",
+       "_encodingCantBeStoredInEightBitCFString",
+       "_encodingForHFSAttachments",
+       "_endCompletion:",
+       "_endDragging",
+       "_endHTMLChange",
+       "_endHTMLChangeForMarkedText",
+       "_endListeningForApplicationStatusChanges",
+       "_endListeningForDeviceStatusChanges",
+       "_endLiveResize",
+       "_endLiveResizeForAllDrawers",
+       "_endMyEditing",
+       "_endOfParagraphAtIndex:",
+       "_endProcessingMultipleMessages",
+       "_endRunMethod",
+       "_endScrolling",
+       "_endTabWidth",
+       "_endUnarchivingPrintInfo",
+       "_enqueueEndOfEventNotification",
+       "_ensureCapacity:",
+       "_ensureLayoutCompleteToEndOfCharacterRange:",
+       "_ensureMinAndMaxSizesConsistentWithBounds",
+       "_enteredTrackingRect",
+       "_entriesAreAcceptable",
+       "_enumModuleComplete:",
+       "_enumerateForMasking:data:",
+       "_eoDeallocHackMethod",
+       "_eoNowMultiThreaded:",
+       "_errorStringForResponse:forCommand:",
+       "_eventDelegate",
+       "_eventDescriptionForEventType:",
+       "_eventHandlerForEventClass:andEventID:",
+       "_eventInTitlebar:",
+       "_eventRef",
+       "_eventRelativeToWindow:",
+       "_eventWithCGSEvent:",
+       "_exchangeDollarInString:withString:",
+       "_existsForArray:",
+       "_exit",
+       "_exitedTrackingRect",
+       "_expand",
+       "_expandItemEntry:expandChildren:",
+       "_expandPanel:",
+       "_expandRep:",
+       "_exportLinkRec:",
+       "_extendedCharRangeForInvalidation:editedCharRange:",
+       "_extraWidthForCellHeight:",
+       "_fastAllKeys",
+       "_fastCStringContents",
+       "_fastDotPathString",
+       "_fastHighlightGlyphRange:withinSelectedGlyphRange:",
+       "_favoritesChanged:",
+       "_fetchColorTable:",
+       "_fetchCommandForMessageSkeletons",
+       "_fetchSectionUsingCommand:forUid:destFile:keepInMemory:",
+       "_fetchUnreadCounts:children:",
+       "_fetchUserInfoForMailboxAtPath:",
+       "_fileButtonOrigin",
+       "_fileExtensions",
+       "_fileOperation:source:destination:files:",
+       "_fileOperationCompleted:",
+       "_filenameEncodingHint",
+       "_filenameFromSubject:inDirectory:ofType:",
+       "_fillBackground:withAlternateColor:",
+       "_fillBuffer",
+       "_fillFloatArray:",
+       "_fillGlyphHoleAtIndex:desiredNumberOfCharacters:",
+       "_fillGrayRect:with:",
+       "_fillLayoutHoleAtIndex:desiredNumberOfLines:",
+       "_fillSizeFields:convertToPoints:",
+       "_fillSizesForAttributes:withTextStorage:startingWithOffset:",
+       "_fillSpellCheckerPopupButton:",
+       "_fillsClipViewHeight",
+       "_fillsClipViewWidth",
+       "_filterTypes",
+       "_finalScrollingOffsetFromEdge",
+       "_finalSlideLocation",
+       "_finalize",
+       "_findButtonImageForState:",
+       "_findCoercerFromClass:toClass:",
+       "_findColorListNamed:forDeviceType:",
+       "_findColorNamed:inList:startingAtIndex:searchingBackward:usingLocalName:ignoreCase:substring:",
+       "_findDictOrBitmapSetNamed:",
+       "_findDragTargetFrom:",
+       "_findFirstOne::",
+       "_findFont:size:matrix:flag:",
+       "_findMisspelledWordInString:language:learnedDictionaries:wordCount:countOnly:",
+       "_findNext:",
+       "_findNextOrPrev:",
+       "_findParentWithLevel:beginingAtItem:childEncountered:",
+       "_findRemovableDevices:",
+       "_findSystemImageNamed:",
+       "_findTableViewUnderView:",
+       "_findTypeForPropertyListDecoding:",
+       "_findWindowUsingCache:",
+       "_findWindowUsingDockItemRef:",
+       "_finishHitTracking:",
+       "_finishMessagingClients:",
+       "_finishPrintFilter:filter:",
+       "_finishedMakingConnections",
+       "_firstHighlightedCell",
+       "_firstPassGlyphRangeForBoundingRect:inTextContainer:hintGlyphRange:okToFillHoles:",
+       "_firstPassGlyphRangeForBoundingRect:inTextContainer:okToFillHoles:",
+       "_firstSelectableRow",
+       "_firstSelectableRowInMatrix:inColumn:",
+       "_firstTextViewChanged",
+       "_fixCommandAlphaShifts",
+       "_fixHeaderAndCornerViews",
+       "_fixKeyViewForView:",
+       "_fixSelectionAfterChangeInCharacterRange:changeInLength:",
+       "_fixSharedData",
+       "_fixStringForShell",
+       "_fixTargetsForMenu:",
+       "_fixTitleUI:",
+       "_fixup:numElements:",
+       "_flattenTypingStyles:useMatch:",
+       "_floating",
+       "_flushAEDesc",
+       "_flushAllMessageData",
+       "_flushAndAlign:",
+       "_flushCurrentEdits",
+       "_flushNotificationQueue",
+       "_focusFromView:withThread:",
+       "_focusInto:withClip:",
+       "_focusOnCache:",
+       "_focusRingFrameForFrame:",
+       "_fondID",
+       "_fontCollectionWithName:",
+       "_fontFamilyFromCanonicalFaceArray:",
+       "_fontInfoServerDied:",
+       "_fontSetWithName:",
+       "_fontStyleName:",
+       "_fontWithName:scale:skew:oblique:translation:",
+       "_fontWithName:size:matrix:",
+       "_forNode:processProject:",
+       "_forceArchsToDisk",
+       "_forceClassInitialization",
+       "_forceDisplayToBeCorrectForViewsWithUnlaidGlyphs",
+       "_forceEditingCharacters:",
+       "_forceFixAttributes",
+       "_forceFlushWindowToScreen",
+       "_forceLoadSuites:",
+       "_forceReloadFavorites",
+       "_forceSetColor:",
+       "_forceUserInit",
+       "_forget:",
+       "_forgetData:",
+       "_forgetDependentBoldCopy",
+       "_forgetDependentFixedCopy",
+       "_forgetDependentItalicCopy",
+       "_forgetDependentUnderlineCopy",
+       "_forgetObjectWithGlobalID:",
+       "_forgetSpellingFromMenu:",
+       "_forgetWord:inDictionary:",
+       "_formHit:",
+       "_formMethodForValue:",
+       "_formatObjectValue:invalid:",
+       "_forwardMessage",
+       "_frameDidDrawTitle",
+       "_frameDocumentWithHTMLString:url:",
+       "_frameOfColumns",
+       "_frameOfOutlineCellAtRow:",
+       "_freeCache:",
+       "_freeClients",
+       "_freeDirTable:",
+       "_freeEnumerator:",
+       "_freeImage",
+       "_freeLength:offset:",
+       "_freeNode:",
+       "_freeNodes",
+       "_freeOldPrinterInfo",
+       "_freePostings",
+       "_freeRepresentation:",
+       "_freeServicesMenu:",
+       "_fromScreenCommonCode:",
+       "_fullDescription:",
+       "_fullLabel",
+       "_fullPathForService:",
+       "_fullUpdateOfIndex",
+       "_gatherFocusStateInto:upTo:withThread:",
+       "_gaugeImage:",
+       "_genBaseMatrix",
+       "_generatePSCodeHelpedBy:operation:",
+       "_generateTextStorage",
+       "_genericDragCursor",
+       "_getAppleShareVolumes",
+       "_getBracketedStringFromBuffer:",
+       "_getBrowser:browserColumn:",
+       "_getBytesAsData:maxLength:filledLength:encoding:allowLossyConversion:range:remainingRange:",
+       "_getCacheWindow:andRect:forRep:",
+       "_getCharactersAsStringInRange:",
+       "_getContents:",
+       "_getContents:andLength:",
+       "_getConvertedDataForType:",
+       "_getConvertedDataFromPasteboard:",
+       "_getCounterpart",
+       "_getCursorBitmap",
+       "_getData:encoding:",
+       "_getDocInfoForKey:",
+       "_getDrawingRow:andCol:",
+       "_getEightBitRGBMeshedBitmap:rowBytes:extraSample:reverseScanLines:removeAlpha:",
+       "_getFSRefForApplicationName:",
+       "_getFSRefForPath:",
+       "_getFSRefForServiceName:",
+       "_getFSSpecForPath:",
+       "_getFatInfo:forPath:",
+       "_getFatInfoFromMachO:fileDesc:",
+       "_getFocusRingFrame",
+       "_getGaugeFrame",
+       "_getGlobalWindowNumber:andRect:forRepresentation:",
+       "_getGlyphIndex:forWindowPoint:pinnedPoint:preferredTextView:partialFraction:",
+       "_getHiddenList",
+       "_getLocalPoint:",
+       "_getMatchingRow:forString:inMatrix:startingAtRow:prefixMatch:caseSensitive:",
+       "_getMessageSummaries",
+       "_getNewMailInAccountMenuItem",
+       "_getNodeForKey:inTable:",
+       "_getOrCreatePathsListFor:dir:table:",
+       "_getPartStruct:numberOfParts:withInnerBounds:",
+       "_getPosition:",
+       "_getPositionFromServer",
+       "_getPrinterList:",
+       "_getProgressFrame",
+       "_getRemainderFrame",
+       "_getReply",
+       "_getRidOfCacheAndMarkYourselfAsDirty",
+       "_getRow:andCol:ofCell:atRect:",
+       "_getRow:column:nearPoint:",
+       "_getServiceMenuEntryInfo:menuName:itemName:enabled:",
+       "_getSize:",
+       "_getSum:ofFile:",
+       "_getTextColor:backgroundColor:",
+       "_getTiffImage:ownedBy:",
+       "_getTiffImage:ownedBy:asImageRep:",
+       "_getUndoManager:",
+       "_getValue:forKey:",
+       "_getValue:forObj:",
+       "_getValue:forType:",
+       "_getValuesWithName:andAttributes:",
+       "_getVolumes:",
+       "_getWindowCache:add:",
+       "_giveUpFirstResponder:",
+       "_globalIDChanged:",
+       "_globalIDForLocalObject:",
+       "_globalWindowNum",
+       "_glyphAtIndex:characterIndex:glyphInscription:isValidIndex:",
+       "_glyphDescription",
+       "_glyphDrawsOutsideLineHeight:",
+       "_glyphGenerator",
+       "_glyphIndexForCharacterIndex:startOfRange:okToFillHoles:",
+       "_glyphInfoAtIndex:",
+       "_glyphRangeForBoundingRect:inTextContainer:fast:okToFillHoles:",
+       "_glyphRangeForCharacterRange:actualCharacterRange:okToFillHoles:",
+       "_goneMultiThreaded",
+       "_goneSingleThreaded",
+       "_gotoFavorite:",
+       "_grammarTableKey",
+       "_graphiteControlTintColor",
+       "_gray136Color",
+       "_gray170Color",
+       "_gray204Color",
+       "_gray221Color",
+       "_grestore",
+       "_growBoxRect",
+       "_growCachedRectArrayToSize:",
+       "_gsave",
+       "_guaranteeMinimumWidth:",
+       "_guess:",
+       "_handCursor",
+       "_handleActivityEnded",
+       "_handleClickOnURLString:",
+       "_handleCommand:",
+       "_handleCursorUpdate:",
+       "_handleError:delta:fromRect:toPoint:",
+       "_handleInvalidPath:",
+       "_handleMessage:from:socket:",
+       "_handleMouseUpWithEvent:",
+       "_handleNewActivity:",
+       "_handleSpecialAppleEvent:withReplyEvent:",
+       "_handleText:",
+       "_hasActiveAppearance",
+       "_hasActiveControls",
+       "_hasAttributedStringValue",
+       "_hasBezelBorder",
+       "_hasCursorRects",
+       "_hasCursorRectsForView:",
+       "_hasCustomColor",
+       "_hasDefaultButtonIndicator",
+       "_hasEditableCell",
+       "_hasImage",
+       "_hasImageMap",
+       "_hasParameter:forKeyword:",
+       "_hasSeparateArrows",
+       "_hasShadow",
+       "_hasSourceFile:context:",
+       "_hasTabs",
+       "_hasTitle",
+       "_hasWindowRef",
+       "_hasgState",
+       "_hashMarkDictionary",
+       "_hashMarkDictionaryForDocView:measurementUnitToBoundsConversionFactor:stepUpCycle:stepDownCycle:minimumHashSpacing:minimumLabelSpacing:",
+       "_hashMarkDictionaryForDocumentView:measurementUnitName:",
+       "_headerCellRectOfColumn:",
+       "_headerCellSizeOfColumn:",
+       "_headerData",
+       "_headerIdentifiersForKey:",
+       "_headerLevelForMarker:",
+       "_headerSizeOfColumn:",
+       "_headerValueForKey:",
+       "_headerValueForKey:fromData:",
+       "_headersRequiredForRouting",
+       "_heartBeatBufferWindow",
+       "_heartBeatThread:",
+       "_hello:",
+       "_helpBundleForObject:",
+       "_helpKeyForObject:",
+       "_helpWindow",
+       "_hide",
+       "_hideAllDrawers",
+       "_hideDropShadow",
+       "_hideHODWindow",
+       "_hideMenu:",
+       "_hideSheet",
+       "_hideStatus",
+       "_highlightCell:atRow:column:andDraw:",
+       "_highlightColor",
+       "_highlightColumn:clipRect:",
+       "_highlightRow:clipRect:",
+       "_highlightTabColor",
+       "_highlightTextColor",
+       "_highlightsWithHighlightRect",
+       "_hints",
+       "_hitTest:dragTypes:",
+       "_horizontalAdjustmentForItalicAngleAtHeight:",
+       "_horizontalResizeCursor",
+       "_horizontalScrollerSeparationHeight",
+       "_hostWithHostEntry:",
+       "_hostWithHostEntry:name:",
+       "_hoverAreaIsSameAsLast:",
+       "_htmlDocumentClass",
+       "_htmlString",
+       "_htmlTree",
+       "_html_findString:selectedRange:options:wrap:",
+       "_iconRef",
+       "_ignore:",
+       "_ignoreClick:",
+       "_ignoreSpellingFromMenu:",
+       "_image",
+       "_imageCellWithState:",
+       "_imageForDragAndDropCharRange:withOrigin:",
+       "_imageFromItemTitle:",
+       "_imageFromNewResourceLocation:",
+       "_imageNamed:",
+       "_imageRectWithRect:",
+       "_imageSizeWithSize:",
+       "_imagesFromIcon:inApp:zone:",
+       "_imagesHaveAlpha",
+       "_imagesWithData:zone:",
+       "_immutableStringCharacterSetWithArray:",
+       "_impl",
+       "_importLinkRec:",
+       "_inLiveResize",
+       "_inResize:",
+       "_inTSMPreProcess",
+       "_includeObject:container:",
+       "_incorporateMailFromIncoming",
+       "_index",
+       "_indexOfAttachment:",
+       "_indexOfFirstGlyphInTextContainer:okToFillHoles:",
+       "_indexOfMessageWithUid:startingIndex:endingIndex:",
+       "_indexOfPopupItemForLanguage:",
+       "_indexValueForListItem:",
+       "_indicatePrefix:",
+       "_indicatorImage",
+       "_indicatorImageForCellHeight:",
+       "_infoForFile:inColumn:isDir:isAutomount:info:",
+       "_init",
+       "_initAllFamBrowser",
+       "_initAsDefault:",
+       "_initCollectionBrowser",
+       "_initContent:styleMask:backing:defer:contentView:",
+       "_initContent:styleMask:backing:defer:counterpart:",
+       "_initContent:styleMask:backing:defer:screen:contentView:",
+       "_initData",
+       "_initFavoritesBrowser",
+       "_initFavoritesList:",
+       "_initFlippableViewCacheLock",
+       "_initFocusSelection",
+       "_initFontSetMatrix:withNames:",
+       "_initFromGlobalWindow:inRect:",
+       "_initFromGlobalWindow:inRect:styleMask:",
+       "_initInStatusBar:withLength:withPriority:",
+       "_initInfoDictionary",
+       "_initJobVars",
+       "_initLocks",
+       "_initNominalMappings",
+       "_initPaperNamePopUp",
+       "_initPathView",
+       "_initPrior298WithCoder:",
+       "_initPrior299WithCoder:",
+       "_initPrivData",
+       "_initRegion:ofLength:atAddress:",
+       "_initRemoteWithSignature:",
+       "_initServicesMenu:",
+       "_initSubviews",
+       "_initSubviewsForBodyDocument",
+       "_initSubviewsForFramesetDocument",
+       "_initSubviewsForRawDocument",
+       "_initThreeColumnBrowser",
+       "_initUnitsPopUp",
+       "_initWithArray:",
+       "_initWithAttributedString:isRich:",
+       "_initWithCGSEvent:eventRef:",
+       "_initWithContentSize:preferredEdge:",
+       "_initWithDIB:",
+       "_initWithData:",
+       "_initWithData:charsetHint:",
+       "_initWithData:fileType:",
+       "_initWithData:tiff:imageNumber:",
+       "_initWithDataOfUnknownEncoding:",
+       "_initWithDictionary:",
+       "_initWithDictionary:defaults:",
+       "_initWithEnd:offset:affinity:",
+       "_initWithHostEntry:name:",
+       "_initWithIconRef:includeThumbnail:",
+       "_initWithImageReader:",
+       "_initWithImpl:uniquedFileName:docInfo:imageData:parentWrapper:",
+       "_initWithItems:",
+       "_initWithMessage:sender:subject:dateReceived:",
+       "_initWithName:",
+       "_initWithName:fromPath:forDeviceType:lazy:",
+       "_initWithName:host:process:bundle:serverClass:keyBindings:",
+       "_initWithName:propertyList:",
+       "_initWithParagraphStyle:",
+       "_initWithPickers:",
+       "_initWithPlist:",
+       "_initWithRTFSelector:argument:documentAttributes:",
+       "_initWithRetainedCFSocket:protocolFamily:socketType:protocol:",
+       "_initWithSelectionTree:",
+       "_initWithSet:",
+       "_initWithSharedBitmap:rect:",
+       "_initWithSharedKitWindow:rect:",
+       "_initWithSize:depth:separate:alpha:allowDeep:",
+       "_initWithStart:offset:affinity:",
+       "_initWithStart:offset:end:offset:affinity:",
+       "_initWithStartRoot:index:endRoot:index:",
+       "_initWithThemeType:",
+       "_initWithURLFunnel:options:documentAttributes:",
+       "_initWithWindow:",
+       "_initWithWindowNumber:",
+       "_initWithoutAEDesc",
+       "_initialOffset",
+       "_initialize:::",
+       "_initializeArchiverMappings",
+       "_initializeMenu:target:selector:",
+       "_initializePanel:path:name:relativeToWindow:",
+       "_initializeRegisteredDefaults",
+       "_initializeUserInfoDict",
+       "_inputClientChangedStatus:inputClient:",
+       "_inputManagerInNextScript:",
+       "_insert:projNum:keyBuf:",
+       "_insertGlyphs:elasticAttributes:count:atGlyphIndex:characterIndex:",
+       "_insertItemInSortedOrderWithTitle:action:keyEquivalent:",
+       "_insertNodesForAttributes:underNode:",
+       "_insertObject:withGlobalID:",
+       "_insertObjectInSortOrder:",
+       "_insertProject:",
+       "_insertStatusItemWindow:withPriority:",
+       "_insertText:forInputManager:",
+       "_insertionGlyphIndexForDrag:",
+       "_insertionOrder",
+       "_insertionPointDisabled",
+       "_insetRect:",
+       "_inspectedHTMLView",
+       "_installOpenRecentsMenu",
+       "_installRulerAccViewForParagraphStyle:ruler:enabled:",
+       "_instantiateProjectNamed:inDirectory:appendProjectExtension:",
+       "_intValue",
+       "_internalFontList",
+       "_internalIndicesOfObjectsByEvaluatingWithContainer:count:",
+       "_internalThreadId",
+       "_intersectsBitVectorMaybeCompressed:",
+       "_invalidLabelSize",
+       "_invalidate",
+       "_invalidateBlinkTimer:",
+       "_invalidateCache",
+       "_invalidateConnectionsAsNecessary:",
+       "_invalidateDictionary:newTime:",
+       "_invalidateDisplayIfNeeded",
+       "_invalidateFocus",
+       "_invalidateGStatesForTree",
+       "_invalidateGlyphsForCharacterRange:editedCharacterRange:changeInLength:actualCharacterRange:",
+       "_invalidateGlyphsForExtendedCharacterRange:changeInLength:",
+       "_invalidateImageTypeCaches",
+       "_invalidateInsertionPoint",
+       "_invalidateLayoutForExtendedCharacterRange:isSoft:",
+       "_invalidateLiveResizeCachedImage",
+       "_invalidateMatrices",
+       "_invalidateObject:withGlobalID:",
+       "_invalidateObjectWithGlobalID:",
+       "_invalidateObjectsWithGlobalIDs:",
+       "_invalidateTabsCache",
+       "_invalidateTimers",
+       "_invalidateTitleCellSize",
+       "_invalidateTitleCellWidth",
+       "_invalidateUsageForTextContainersInRange:",
+       "_invalidatedAllObjectsInStore:",
+       "_invalidatedAllObjectsInSubStore:",
+       "_invertedIndex",
+       "_invokeActionByKeyForCurrentlySelectedItem",
+       "_invokeEditorNamed:forItem:",
+       "_isAbsolute",
+       "_isActivated",
+       "_isAncestorOf:",
+       "_isAnimatingDefaultCell",
+       "_isButtonBordered",
+       "_isCString",
+       "_isCached",
+       "_isCanonEncoding",
+       "_isClosable",
+       "_isCtrlAltForHelpDesired",
+       "_isDaylightSavingTimeForAbsoluteTime:",
+       "_isDeactPending",
+       "_isDeadkey",
+       "_isDecomposable",
+       "_isDefaultFace",
+       "_isDefaultFavoritesObject:inContainer:",
+       "_isDialog",
+       "_isDocWindow",
+       "_isDoingHide",
+       "_isDoingOpenFile",
+       "_isDoingUnhide",
+       "_isDraggable",
+       "_isDrawingToHeartBeatWindow",
+       "_isEditing",
+       "_isEditingTextView:",
+       "_isEmptyMovie",
+       "_isEnabled",
+       "_isEventProcessingDisabled",
+       "_isFakeFixedPitch",
+       "_isFatFile:size:",
+       "_isFaxTypeString:",
+       "_isFilePackage:",
+       "_isFilePackageExtension:",
+       "_isFirstResponderASubview",
+       "_isFontUnavailable:",
+       "_isGrabber",
+       "_isHidden",
+       "_isImageCache",
+       "_isImagedByWindowServer",
+       "_isInUse",
+       "_isInsideImageMapForEvent:inFrame:",
+       "_isInternalFontName:",
+       "_isKeyWindow",
+       "_isLicensedForFeature:",
+       "_isLink:",
+       "_isLoaded",
+       "_isMenuMnemonicString:",
+       "_isMiniaturizable",
+       "_isPoint:inDragZoneOfRow:",
+       "_isPrintFilterDeviceDependent:",
+       "_isRecyclable",
+       "_isResizable",
+       "_isReturnStructInRegisters",
+       "_isRuleValid:",
+       "_isRunningAppModal",
+       "_isRunningDocModal",
+       "_isRunningModal",
+       "_isRunningOnAppKitThread",
+       "_isScriptingEnabled",
+       "_isScrolling",
+       "_isSettingMarkedText",
+       "_isSheet",
+       "_isTerminating",
+       "_isThreadedAnimationLooping",
+       "_isUpdated",
+       "_isUsedByCell",
+       "_isUtility",
+       "_isValid",
+       "_isViewingMessage",
+       "_isVisibleUsingCache:",
+       "_itemAdded:",
+       "_itemChanged:",
+       "_itemForView:",
+       "_itemHit:",
+       "_itemInStatusBar:withLength:withPriority:",
+       "_itemRemoved:",
+       "_itemsFromRows:",
+       "_ivars",
+       "_justOrderOut",
+       "_keyArray",
+       "_keyBindingManager",
+       "_keyBindingMonitor",
+       "_keyEquivalentGlyphWidth",
+       "_keyEquivalentModifierMask:matchesModifierFlags:",
+       "_keyEquivalentModifierMaskMatchesModifierFlags:",
+       "_keyEquivalentSizeWithFont:",
+       "_keyEquivalentUniquingDescriptionForMenu:",
+       "_keyForAppleEventCode:",
+       "_keyListForKeyNode:",
+       "_keyPath:",
+       "_keyRowOrSelectedRowOfMatrix:inColumn:",
+       "_keyWindow",
+       "_keyboardFocusRingFrameForRect:",
+       "_keyboardIsOldNeXT",
+       "_keyboardModifyRow:column:withEvent:",
+       "_keyboardUIActionForEvent:",
+       "_kitNewObjectSetVersion:",
+       "_kitOldObjectSetVersion:",
+       "_kludgeScrollBarForColumn:",
+       "_knowsPagesFirst:last:",
+       "_kvcMapForClass:",
+       "_labelCell",
+       "_labelRectForTabRect:forItem:",
+       "_langList",
+       "_lastDragDestinationOperation",
+       "_lastDraggedEventFollowing:",
+       "_lastDraggedOrUpEventFollowing:",
+       "_lastEventRecordTime",
+       "_lastKeyView",
+       "_lastLeftHit",
+       "_lastOnScreenContext",
+       "_lastRightHit",
+       "_launchLDAPQuery:",
+       "_launchPrintFilter:file:deviceDependent:",
+       "_launchService:andWait:",
+       "_launchSpellChecker:",
+       "_layoutBoxesOnView:boxSize:boxes:buttons:rows:columns:",
+       "_layoutTabs",
+       "_ldapScope",
+       "_leading",
+       "_learn:",
+       "_learnOrForgetOrInvalidate:word:dictionary:language:ephemeral:",
+       "_learnSpellingFromMenu:",
+       "_learnWord:inDictionary:",
+       "_leftEdgeOfSelection:hasGlyphRange:",
+       "_leftFrameRect",
+       "_leftGroupRect",
+       "_lengthForSize:",
+       "_lightBlueColor",
+       "_lightWeightRecursiveDisplayInRect:",
+       "_lightYellowColor",
+       "_lineFragmentDescription:",
+       "_link:toBuddy:",
+       "_linkDragCursor",
+       "_listingForPath:listAllChildren:",
+       "_liveResizeCachedImage",
+       "_liveResizeCachedImageIsValid",
+       "_loadActiveTable:",
+       "_loadAllEmailAddresses",
+       "_loadAllFamiliesBrowser:",
+       "_loadAttributes",
+       "_loadBundle",
+       "_loadBundles",
+       "_loadBundlesFromPath:",
+       "_loadColFamilies:",
+       "_loadColorLists",
+       "_loadColorSyncFrameworkIfNeeded",
+       "_loadColors",
+       "_loadData",
+       "_loadDeadKeyData",
+       "_loadFaces",
+       "_loadFamilies",
+       "_loadFamiliesFromDict:",
+       "_loadFontFiles",
+       "_loadFontSets",
+       "_loadHTMLFrameworkIfNeeded",
+       "_loadHTMLMessage:",
+       "_loadHTMLString",
+       "_loadImageFromTIFF:imageNumber:",
+       "_loadImageInfoFromTIFF:",
+       "_loadImageWithName:",
+       "_loadKeyboardBindings",
+       "_loadMailAccounts",
+       "_loadMailboxCacheForMailboxesAtPath:listAllChildren:",
+       "_loadMailboxListingIntoCache:attributes:withPrefix:",
+       "_loadMatrix:withElements:makeLeaves:",
+       "_loadMessageIntoTextView",
+       "_loadNibFile:nameTable:withZone:ownerBundle:",
+       "_loadPanelAccessoryNib",
+       "_loadPickerBundlesIn:expectLibraryLayout:",
+       "_loadRecentsIfNecessary",
+       "_loadSeenFileFromDisk",
+       "_loadServersList",
+       "_loadServicesMenuData",
+       "_loadSizes",
+       "_loadSpecialPathsForSortingChildMailboxes",
+       "_loadSuitesForExistingBundles",
+       "_loadSuitesForLoadedBundle:",
+       "_loadSystemScreenColorList",
+       "_loadTextView",
+       "_loadTypeObject:",
+       "_loadedCellAtRow:column:inMatrix:",
+       "_localObjectForGlobalID:",
+       "_localizedColorListName",
+       "_localizedKeyForKey:language:",
+       "_localizedNameForColorWithName:",
+       "_localizedNameForListOrColorNamed:",
+       "_localizedTypeString:",
+       "_locationForPopUpMenuWithFrame:",
+       "_locationOfColumn:",
+       "_locationOfPoint:",
+       "_locationOfRow:",
+       "_lockCachedImage",
+       "_lockFirstResponder",
+       "_lockFocusNoRecursion",
+       "_lockFocusOnRep:",
+       "_lockForReading",
+       "_lockForWriting",
+       "_lockName",
+       "_lockQuickDrawPort",
+       "_lockUnlockCachedImage:",
+       "_lockViewHierarchyForDrawing",
+       "_lockViewHierarchyForDrawingWithExceptionHandler:",
+       "_lockViewHierarchyForModification",
+       "_logUnavailableFont:",
+       "_longLongValue",
+       "_lookingBackward:fromPosition:inNode:seesWhitespace:whichIsASpaceCharacter:",
+       "_lookingBackwardSeesWhitespace:whichIsASpaceCharacter:",
+       "_lookingForwardSeesWhitespace:whichIsASpaceCharacter:",
+       "_lookup:",
+       "_loopHit:row:col:",
+       "_magnify:",
+       "_mailboxNameForAccountRelativePath:",
+       "_mailboxNameForName:",
+       "_mainStatusChanged:",
+       "_mainWindow",
+       "_maintainCell",
+       "_makeCellForMenuItemAtIndex:",
+       "_makeCursors",
+       "_makeDictionaryWithCapacity:",
+       "_makeDownCellKey",
+       "_makeEditable::::",
+       "_makeEnumFor:withMode:",
+       "_makeHODWindowsPerform:",
+       "_makeKeyNode:inKeyNode:",
+       "_makeLeftCellKey",
+       "_makeMiniView",
+       "_makeModalWindowsPerform:",
+       "_makeNewFontCollection:",
+       "_makeNewListFrom:",
+       "_makeNewSizeLegal:",
+       "_makeNextCellKey",
+       "_makeNextCellOrViewKey",
+       "_makePathEnumFor:withMode:andInode:",
+       "_makePathEnumForMasking:inode:",
+       "_makePreviousCellKey",
+       "_makePreviousCellOrViewKey",
+       "_makeRightCellKey",
+       "_makeRootNode",
+       "_makeScalePopUpButton",
+       "_makeSelfMutable",
+       "_makeSpecialFontName:size:matrix:bit:",
+       "_makeTable:inNode:",
+       "_makeUpCellKey",
+       "_makingFirstResponderForMouseDown",
+       "_mapActiveTableAt:",
+       "_markEndOfEvent:",
+       "_markEndWithLastEvent:",
+       "_markSelectionIsChanging",
+       "_markSelfAsDirtyForBackgroundLayout:",
+       "_markUsedByCell",
+       "_markerAreaRect",
+       "_markerForHeaderLevel:",
+       "_markerHitTest:",
+       "_masterPathFor:",
+       "_matchesCharacter:",
+       "_matchesTextStyleFromArray:",
+       "_maxRuleAreaRect",
+       "_maxTitlebarTitleRect",
+       "_maxWidth",
+       "_maxXBorderRect",
+       "_maxXResizeRect",
+       "_maxXTitlebarBorderThickness",
+       "_maxXTitlebarButtonsWidth",
+       "_maxXTitlebarDecorationMinWidth",
+       "_maxXTitlebarDragWidth",
+       "_maxXTitlebarLinesRectWithTitleCellRect:",
+       "_maxXTitlebarResizeRect",
+       "_maxXWindowBorderWidth",
+       "_maxXWindowBorderWidth:",
+       "_maxXmaxYResizeRect",
+       "_maxXminYResizeRect",
+       "_maxYBorderRect",
+       "_maxYResizeRect",
+       "_maxYTitlebarDragHeight",
+       "_maxYmaxXResizeRect",
+       "_maxYminXResizeRect",
+       "_maybeScrollMenu",
+       "_maybeSubstitutePopUpButton",
+       "_mboxData",
+       "_measuredContents",
+       "_menu",
+       "_menuBarShouldSpanScreen",
+       "_menuCellInitWithCoder:",
+       "_menuChanged",
+       "_menuDidSendAction:",
+       "_menuImpl",
+       "_menuItemDictionaries",
+       "_menuName",
+       "_menuPanelInitWithCoder:",
+       "_menuScrollAmount",
+       "_menuScrollingOffset",
+       "_menuWillSendAction:",
+       "_menusWithName:",
+       "_mergeEntry:at:",
+       "_mergeFromBom:usingListOfPathsLists:",
+       "_mergeFromTable:toDir:toTable:",
+       "_mergeGlyphHoles",
+       "_mergeLayoutHoles",
+       "_mergeObject:withChanges:",
+       "_mergeValue:forKey:",
+       "_mergeVariantListsIntoTree:",
+       "_messageBeingViewed",
+       "_messageForUid:",
+       "_messageSetForNumbers:",
+       "_messageSetForRange:",
+       "_mightHaveSpellingAttributes",
+       "_minLinesWidthWithSpace",
+       "_minParentWindowContentSize",
+       "_minSize",
+       "_minSizeForDrawers",
+       "_minXBorderRect",
+       "_minXLocOfOutlineColumn",
+       "_minXResizeRect",
+       "_minXTitleOffset",
+       "_minXTitlebarBorderThickness",
+       "_minXTitlebarButtonsWidth",
+       "_minXTitlebarDecorationMinWidth",
+       "_minXTitlebarDecorationMinWidth:",
+       "_minXTitlebarDragWidth",
+       "_minXTitlebarLinesRectWithTitleCellRect:",
+       "_minXTitlebarResizeRect",
+       "_minXWindowBorderWidth",
+       "_minXWindowBorderWidth:",
+       "_minXmaxYResizeRect",
+       "_minXminYResizeRect",
+       "_minYBorderRect",
+       "_minYResizeRect",
+       "_minYWindowBorderHeight",
+       "_minYWindowBorderHeight:",
+       "_minYmaxXResizeRect",
+       "_minYminXResizeRect",
+       "_miniaturizedOrCanBecomeMain",
+       "_minimizeToDock",
+       "_minimumSizeNeedForTabItemLabel:",
+       "_mkdirs:",
+       "_modifySelectionWithEvent:onColumn:",
+       "_monitorKeyBinding:flags:",
+       "_monitorStoreForChanges",
+       "_mostCompatibleCharset:",
+       "_mouseActivationInProgress",
+       "_mouseDownListmode:",
+       "_mouseDownNonListmode:",
+       "_mouseDownSimpleTrackingMode:",
+       "_mouseHit:row:col:",
+       "_mouseInGroup:",
+       "_mouseLoop::::::",
+       "_mouseMoved:",
+       "_moveCursor",
+       "_moveDown:",
+       "_moveDownAndModifySelection:",
+       "_moveDownWithEvent:",
+       "_moveGapAndMergeWithBlockRange:",
+       "_moveGapToBlockIndex:",
+       "_moveInDirection:",
+       "_moveLeftWithEvent:",
+       "_moveParent:andOpenSheet:",
+       "_moveRightWithEvent:",
+       "_moveUp:",
+       "_moveUpAndModifySelection:",
+       "_moveUpWithEvent:",
+       "_movieIdle",
+       "_mutableCopyFromSnapshot",
+       "_mutableParagraphStyle",
+       "_mutableStringClass",
+       "_mutate",
+       "_mutateTabStops",
+       "_name",
+       "_nameForPaperSize:",
+       "_nameOfDictionaryForDocumentTag:",
+       "_needRedrawOnWindowChangedKeyState",
+       "_needToThinForArchs:numArchs:",
+       "_needsDisplayfromColumn:",
+       "_needsDisplayfromRow:",
+       "_needsOutline",
+       "_needsToUseHeartBeatWindow",
+       "_nestedEventsOfClass:type:",
+       "_newButtonOfClass:withNormalIconNamed:alternateIconNamed:action:",
+       "_newChangesFromInvalidatingObjectsWithGlobalIDs:",
+       "_newColorName:",
+       "_newData:",
+       "_newDictionary:",
+       "_newDictionaryForProperties",
+       "_newDocumentWithHTMLString:",
+       "_newFirstResponderAfterResigning",
+       "_newFolder:",
+       "_newImageName:",
+       "_newLazyIconRefRepresentation:ofSize:",
+       "_newLazyRepresentation:::",
+       "_newList:",
+       "_newListName:",
+       "_newNode:",
+       "_newObjectForPath:",
+       "_newReplicatePath:ref:atPath:ref:operation:fileMap:handler:",
+       "_newRepresentation:",
+       "_newScroll:",
+       "_newSubstringFromRange:zone:",
+       "_newSubstringWithRange:zone:",
+       "_newUncommittedChangesForObject:",
+       "_newUncommittedChangesForObject:fromSnapshot:",
+       "_newWithName:fromPath:forDeviceType:",
+       "_nextEvent",
+       "_nextEventAfterHysteresisFromPoint:",
+       "_nextInputManagerInScript:",
+       "_nextReferenceName",
+       "_nextToken",
+       "_nextValidChild:ofParent:",
+       "_nextValidChildLink:ofParent:",
+       "_nextValidChildObject:ofParentInode:andParentPath:",
+       "_nextValidChildPath:ofParentInode:andParentPath:childInode:isDirectory:",
+       "_nextValidChildPath:ofParentInode:andParentPath:childInode:isDirectory:isFile:",
+       "_nibName",
+       "_noVerticalAutosizing",
+       "_nominalChars",
+       "_nominalGlyphs",
+       "_nominalSizeNeedForTabItemLabel:",
+       "_normalListmodeDown::::",
+       "_noteLengthAndSelectedRange:",
+       "_notifyEdited:range:changeInLength:invalidatedRange:",
+       "_notifyIM:withObject:",
+       "_numberByTranslatingNumericDescriptor:",
+       "_numberOfGlyphs",
+       "_numberOfNominalMappings",
+       "_numberOfTitlebarLines",
+       "_numberStringForValueObject:withBuffer:andNegativeFlag:",
+       "_numericIndicatorCell",
+       "_nxeventTime",
+       "_obeysHiddenBit",
+       "_objectBasedChangeInfoForGIDInfo:",
+       "_objectForPropertyList:",
+       "_objectInSortedArrayWithName:",
+       "_objectValue:forString:",
+       "_objectWithName:",
+       "_objectsChangedInStore:",
+       "_objectsChangedInSubStore:",
+       "_objectsForPropertyList:",
+       "_objectsFromParenthesizedString:spacesSeparateItems:intoArray:",
+       "_objectsInitializedInSharedContext:",
+       "_observeUndoManagerNotifications",
+       "_offset",
+       "_okToDisplayFeature:",
+       "_oldFirstResponderBeforeBecoming",
+       "_oldPlaceWindow:",
+       "_oldSignaturesPath",
+       "_onDevicePathOfPaths:",
+       "_open",
+       "_open:",
+       "_open:fromImage:withName:",
+       "_openDictionaries:",
+       "_openDrawer",
+       "_openDrawerOnEdge:",
+       "_openFile:",
+       "_openFile:withApplication:asService:andWait:andDeactivate:",
+       "_openFileWithoutUI:",
+       "_openFileWrapper:atPath:withAppSpec:",
+       "_openList:",
+       "_openList:fromFile:",
+       "_openRegion:ofLength:atAddress:",
+       "_openUntitled",
+       "_openUserFavorites",
+       "_openVersionOfIndexPath:",
+       "_openableFileExtensions",
+       "_operationInfo",
+       "_optimizeHighlightForCharRange:charRange:fullSelectionCharRange:oldSelectionFullCharRange:",
+       "_optimizeOk:directPath:",
+       "_optimizedRectFill:gray:",
+       "_orderFrontHelpWindow",
+       "_orderFrontModalWindow:relativeToWindow:",
+       "_orderFrontRelativeToWindow:",
+       "_orderOutAndCalcKeyWithCounter:",
+       "_orderOutHelpWindow",
+       "_orderOutHelpWindowAfterEventMask:",
+       "_orderOutRelativeToWindow:",
+       "_orderedWindowsWithPanels:",
+       "_originPointInRuler",
+       "_ownedByPopUp",
+       "_ownerChanged",
+       "_owningPopUp",
+       "_packedGlyphs:range:length:",
+       "_pageDownWithEvent:",
+       "_pageUpWithEvent:",
+       "_pagesPerSheetFromLayoutList",
+       "_panelInitWithCoder:",
+       "_parseArchivedList:",
+       "_parseCompilerDescription:into:",
+       "_parseCompilersDescriptions",
+       "_parseGenericFetchResponse:expect:",
+       "_parseMenuString:menuName:itemName:",
+       "_parseMessageSkeleton:expect:",
+       "_parsePantoneLikeList:fileName:",
+       "_parseParenthesizedStringUsingScanner:spacesSeparateItems:intoArray:",
+       "_parseReleaseTwoList:",
+       "_parseReturnedLine:containsLiteral:",
+       "_pasteItems:",
+       "_pasteboardWithName:",
+       "_path:matchesPattern:",
+       "_pathForResource:ofType:inDirectory:forRegion:",
+       "_pathTo:",
+       "_pathsForResourcesOfType:inDirectory:forRegion:",
+       "_patternListFromListOfPathsLists:",
+       "_pendFlagsChangedUids:trueFlags:falseFlags:",
+       "_pendingActCount",
+       "_performDragFromMouseDown:",
+       "_persistentStateKey",
+       "_pickedButton:",
+       "_pickedJobFeatureButton:",
+       "_pickedOptions:",
+       "_pinDocRect",
+       "_pixelFormatAuxiliary",
+       "_placeEntry:at:",
+       "_placeHelpWindowNear:",
+       "_placement",
+       "_plainFontNameForFont:",
+       "_plainString",
+       "_platformExitInformation",
+       "_playSelectedSound",
+       "_plistRepresentation",
+       "_pmPageFormat",
+       "_pmPrintSession",
+       "_pmPrintSettings",
+       "_pointForTopOfBeginningOfCharRange:",
+       "_pointFromColor:",
+       "_pointInPicker:",
+       "_popAccountMailbox",
+       "_popState",
+       "_popUpButton",
+       "_popUpButtonCellInstances",
+       "_popUpContextMenu:withEvent:forView:",
+       "_popUpItemAction:",
+       "_popUpMenuCurrentlyInvokingAction",
+       "_popUpMenuWithEvent:forView:",
+       "_portNumber",
+       "_position",
+       "_positionAllDrawers",
+       "_positionSheetOnRect:",
+       "_positionWindow",
+       "_posixPathComponentsWithPath:",
+       "_postAsapNotificationsForMode:",
+       "_postAtStart:",
+       "_postAtStartCore:",
+       "_postBoundsChangeNotification",
+       "_postCheckpointNotification",
+       "_postColumnDidMoveNotificationFromColumn:toColumn:",
+       "_postColumnDidResizeNotificationWithOldWidth:",
+       "_postEventHandling",
+       "_postFrameChangeNotification",
+       "_postIdleNotificationsForMode:",
+       "_postInit",
+       "_postInitWithCoder:signature:valid:wireSignature:target:selector:argCount:",
+       "_postInvalidCursorRects",
+       "_postItemDidCollapseNotification:",
+       "_postItemDidExpandNotification:",
+       "_postItemWillCollapseNotification:",
+       "_postItemWillExpandNotification:",
+       "_postMailAccountsHaveChanged",
+       "_postNotificationWithMangledName:object:userInfo:",
+       "_postSelectionDidChangeNotification",
+       "_postSelectionIsChangingAndMark:",
+       "_postSubthreadEvents",
+       "_postWindowNeedsDisplay",
+       "_postingDisabled",
+       "_potentialMaxSize",
+       "_potentialMinSize",
+       "_preEventHandling",
+       "_preInitSetMatrix:fontSize:",
+       "_preInitWithCoder:signature:valid:wireSignature:target:selector:argCount:",
+       "_preciseDuration",
+       "_preciseDurationWithoutSubevents",
+       "_preferredOrderForFetchingMessageBodies:",
+       "_preferredRowsToDisplay",
+       "_prefersTrackingWhenDisabled",
+       "_preflightSelection:",
+       "_prepareEventGrouping",
+       "_prepareHelpWindow:locationHint:",
+       "_preparePrintStream",
+       "_prepareSavePanel",
+       "_prepareToMessageClients",
+       "_previousNextTab:loop:",
+       "_primitiveInvalidateDisplayForGlyphRange:",
+       "_primitiveSetNextKeyView:",
+       "_primitiveSetPreviousKeyView:",
+       "_printAndPaginateWithOperation:helpedBy:",
+       "_printFile:",
+       "_printFontCollection",
+       "_printNode:context:",
+       "_printPackagePath",
+       "_printPagesWithOperation:helpedBy:",
+       "_printerWithType:",
+       "_prior299InitObject:withCoder:",
+       "_processDeletedObjects",
+       "_processEndOfEventNotification:",
+       "_processEndOfEventObservers:",
+       "_processGlobalIDChanges:",
+       "_processHeaders",
+       "_processInitializedObjectsInSharedContext:",
+       "_processKeyboardUIKey:",
+       "_processNeXTMailAttachmentHeaders:",
+       "_processNewData:",
+       "_processNotificationQueue",
+       "_processObjectStoreChanges:",
+       "_processOwnedObjectsUsingChangeTable:deleteTable:",
+       "_processRecentChanges",
+       "_processRequest:",
+       "_processRequest:named:usingPasteboard:",
+       "_processResponseFromSelectCommand:forMailbox:errorMessage:",
+       "_processSynchronizedDeallocation",
+       "_procid",
+       "_promoteGlyphStoreToFormat:",
+       "_promptUserForPassword",
+       "_promulgateSelection:",
+       "_propagateDirtyRectsToOpaqueAncestors",
+       "_propertyDictionaryForKey:",
+       "_propertyDictionaryInitializer",
+       "_propertyList",
+       "_provideAllPromisedData",
+       "_provideNewViewFor:initialViewRequest:",
+       "_provideTotalScaleFactorForPrintOperation:",
+       "_pruneEventTree:",
+       "_pullsDown",
+       "_pushSet:",
+       "_pushState",
+       "_qualifierArrayFromDictionary:",
+       "_queueRequestForThread:invocation:conversation:sequence:coder:",
+       "_radioHit:row:col:",
+       "_raiseIfNotLicencedForFeature:message:",
+       "_randomUnsignedLessThan:",
+       "_rangeByEstimatingAttributeFixingForRange:",
+       "_rangeByTrimmingWhitespaceFromRange:",
+       "_rangeForMoveDownFromRange:verticalDistance:desiredDistanceIntoContainer:selectionAffinity:",
+       "_rangeForMoveUpFromRange:verticalDistance:desiredDistanceIntoContainer:selectionAffinity:",
+       "_rangeOfPrefixFittingWidth:withAttributes:",
+       "_rangeOfPrefixFittingWidth:withFont:",
+       "_rangeOfSuffixFittingWidth:withAttributes:",
+       "_rangeOfSuffixFittingWidth:withFont:",
+       "_ranges",
+       "_rawAddColor:key:",
+       "_rawDefaultGlyphForChar:",
+       "_rawKeyEquivalent",
+       "_rawKeyEquivalentModifierMask",
+       "_rawSetSelectedIndex:",
+       "_readAndRetainFileNamed:makeCompact:",
+       "_readArgument:dataStream:",
+       "_readArguments:dataStream:",
+       "_readAttribute:dataStream:",
+       "_readAttributes:",
+       "_readBasicMetricsForSize:allowFailure:",
+       "_readBytesIntoStringOrData:length:",
+       "_readClass:",
+       "_readClassesInSuite:dataStream:",
+       "_readColorIntoRange:fromPasteboard:",
+       "_readCommand:dataStream:",
+       "_readCommands:dataStream:suiteID:",
+       "_readElement:dataStream:",
+       "_readElements:",
+       "_readFilenamesIntoRange:fromPasteboard:",
+       "_readFilesystemForChildrenAtFullPath:",
+       "_readFontIntoRange:fromPasteboard:",
+       "_readImageIntoRange:fromPasteboard:",
+       "_readLine",
+       "_readLineIntoDataOrString:",
+       "_readMultilineResponseWithMaxSize:intoMutableData:",
+       "_readPersistentExpandItems",
+       "_readPersistentTableColumns",
+       "_readPluralNameForCode:fromDict:dataStream:",
+       "_readRTFDIntoRange:fromPasteboard:",
+       "_readRTFIntoRange:fromPasteboard:",
+       "_readRecord",
+       "_readResponseRange:isContinuation:",
+       "_readRulerIntoRange:fromPasteboard:",
+       "_readStringIntoRange:fromPasteboard:",
+       "_readSuites:",
+       "_readSynonym:inSuite:dataStream:",
+       "_readSynonymsInSuite:dataStream:",
+       "_readUntilResultCodeForCommandNumber:",
+       "_readVersion0:",
+       "_realCloneFont:withFlag:",
+       "_realControlTint",
+       "_realControlTintForView:",
+       "_realCopyPSCodeInside:helpedBy:",
+       "_realCreateContext",
+       "_realDestroyContext",
+       "_realDoModalLoop:peek:",
+       "_realDraggingDelegate",
+       "_realHeartBeatThreadContext",
+       "_realPrintPSCode:helpedBy:doPanel:forFax:",
+       "_realPrintPSCode:helpedBy:doPanel:forFax:preloaded:",
+       "_reallocColors:",
+       "_reallyChooseGuess:",
+       "_reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:",
+       "_reallySave:",
+       "_reallyUpdateTextViewerToSelection",
+       "_reattachSubviews:",
+       "_rebuildOrUpdateServicesMenu:",
+       "_rebuildTableOfContentsSynchronously",
+       "_recacheButtonColors",
+       "_recacheLabelText",
+       "_recacheLabelledItem",
+       "_recalculateTitleWidth",
+       "_recalculateUsageForTextContainerAtIndex:",
+       "_receiveHandlerRef",
+       "_recentDocumentsLimit",
+       "_recentFolders",
+       "_reconfigureAnimationState:",
+       "_rectArrayForRange:withinSelectionRange:rangeIsCharRange:singleRectOnly:fullLineRectsOnly:inTextContainer:rectCount:rangeWithinContainer:glyphsDrawOutsideLines:",
+       "_rectForAttachment:",
+       "_rectOfColumnRange:",
+       "_rectOfRowRange:",
+       "_rectToDisplayForItemAtIndex:",
+       "_rectValueByTranslatingQDRectangle:",
+       "_rectsForBounds:",
+       "_recurWithContext:chars:glyphs:stringBuffer:font:",
+       "_recursiveBreakKeyViewLoop",
+       "_recursiveDisplayAllDirtyWithLockFocus:visRect:",
+       "_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:",
+       "_recursiveEnableItems",
+       "_recursiveFindDefaultButtonCell",
+       "_recursiveSetDefaultKeyViewLoop",
+       "_recursivelyAddItemsInMenu:toTable:",
+       "_recursivelyRemoveFullPath:",
+       "_recursivelyRemoveItemsInMenu:fromTable:",
+       "_redirectedHandle",
+       "_redisplayFromRow:",
+       "_reflectDocumentViewBoundsChange",
+       "_reflectFont:",
+       "_refresh:",
+       "_refreshAfterAddingAddressBook:",
+       "_refreshArchInfo",
+       "_refreshWindows",
+       "_regionsArray",
+       "_registerAllDrawersForDraggedTypesIfNeeded",
+       "_registerBundleForNotifications",
+       "_registerClearStateWithUndoManager",
+       "_registerDragTypes:",
+       "_registerDragTypesIfNeeded",
+       "_registerForApplicationNotifications",
+       "_registerForCompletion:",
+       "_registerForStoreNotifications",
+       "_registerMailtoHandler:",
+       "_registerMenuForKeyEquivalentUniquing:",
+       "_registerMenuItemForKeyEquivalentUniquing:",
+       "_registerServicesMenu:withSendTypes:andReturnTypes:addToList:",
+       "_registerSynonym:forClassName:inSuite:",
+       "_registerUndoObject:",
+       "_registerUnitWithName:abbreviation:unitToPointsConversionFactor:stepUpCycle:stepDownCycle:",
+       "_registerWithDock",
+       "_registerWithDockIfNeeded",
+       "_registrationDictionaryForUnitNamed:",
+       "_relativeURLPath",
+       "_releaseEvents",
+       "_releaseInput",
+       "_releaseKVCMaps",
+       "_releaseLiveResizeCachedImage",
+       "_releaseUndoManager",
+       "_releaseWireCount:",
+       "_reloadChildrenOfFolderAtPath:",
+       "_reloadFontInfoIfNecessary:",
+       "_remainingString",
+       "_remove:",
+       "_remove:andAddMultipleToTypingAttributes:",
+       "_removeAFileWithPath:cursor:maskFunction:maskData:",
+       "_removeAlignmentOnChildren",
+       "_removeAllDrawersImmediately:",
+       "_removeAllItemsInGetNewMailInAccountMenu",
+       "_removeBottom",
+       "_removeButtons",
+       "_removeColor:",
+       "_removeCursorRect:cursor:forView:",
+       "_removeFrameUsingName:domain:",
+       "_removeFromFontCollection",
+       "_removeFromFontCollection:",
+       "_removeFromFontFavorites:",
+       "_removeFromGroups:",
+       "_removeFromKeyViewLoop",
+       "_removeFromLinkGroup:",
+       "_removeFromWindowsMenu:",
+       "_removeFullPath:",
+       "_removeHardLinkWithPath:cursor:",
+       "_removeHeartBeartClientView:",
+       "_removeHelpKeyForObject:",
+       "_removeHiddenWindow:",
+       "_removeInstance:",
+       "_removeInternalRedFromTextAttributesOfNegativeValues",
+       "_removeItem:fromTable:",
+       "_removeItemsFromMenu:start:stop:",
+       "_removeLeaf:",
+       "_removeLeftoverIndexFiles",
+       "_removeLeftoversFromSeenFileUsingIDs:",
+       "_removeLink:",
+       "_removeLinkGroupContaining:",
+       "_removeLinkLeaf:links:",
+       "_removeList:",
+       "_removeLockFile:",
+       "_removeMainLeaf:",
+       "_removeMessagesFromIndex:",
+       "_removeNextPointersToMe",
+       "_removeNotifications",
+       "_removeObserver:notificationNamesAndSelectorNames:object:",
+       "_removeObserversForCompletion:",
+       "_removeOrRename:",
+       "_removeParentsForStyles:useMatch:",
+       "_removePreviousPointersToMe",
+       "_removeRectAtIndex:",
+       "_removeRectForAttachment:",
+       "_removeSoundMenuItems",
+       "_removeSpellingAttributeForRange:",
+       "_removeStaleFilesFromCacheDirectory",
+       "_removeStaleItem:",
+       "_removeStatusItemWindow:",
+       "_removeSubview:",
+       "_removeToolTip",
+       "_removeTrackingRect",
+       "_removeUsingListOfPathsLists:",
+       "_removeWindow:",
+       "_removeWindowFromCache:",
+       "_rename:",
+       "_rename:as:",
+       "_renameCollectionComplete:",
+       "_renameColor:",
+       "_renameFavoriteComplete:",
+       "_renameFontCollection:",
+       "_renameFontFavorite:",
+       "_renameList:",
+       "_renderPrintInfo:faxing:showPanels:",
+       "_renderStaleItems",
+       "_renderedImage",
+       "_renewDisplay",
+       "_reorderColumn:withEvent:",
+       "_repeatMultiplier:",
+       "_repeatTime",
+       "_replaceAccessoryView:with:topView:bottomView:",
+       "_replaceAllAppearancesOfString:withString:",
+       "_replaceChild:withChildren:",
+       "_replaceFirstAppearanceOfString:withString:",
+       "_replaceLastAppearanceOfString:withString:",
+       "_replaceObject:",
+       "_replaceObject:forKey:",
+       "_replaceObject:withObject:",
+       "_replaceStringOfLastLoadedMessage:newUid:",
+       "_replaceWithItem:addingStyles:removingStyles:",
+       "_replicate:",
+       "_replicatePath:atPath:operation:fileMap:handler:",
+       "_replyMessageToAll:",
+       "_replySequenceNumber:ok:",
+       "_replyToLaunch",
+       "_replyToOpen:",
+       "_requestNotification",
+       "_requiresCacheWithAlpha:",
+       "_reserved",
+       "_reset",
+       "_resetAllChanges",
+       "_resetAllChanges:",
+       "_resetAllDrawersDisableCounts",
+       "_resetAllDrawersPostingCounts",
+       "_resetAllMessages",
+       "_resetAttachedMenuPositions",
+       "_resetCachedValidationState",
+       "_resetCursorRects",
+       "_resetDisableCounts",
+       "_resetDragMargins",
+       "_resetFreeSpace",
+       "_resetIncrementalSearchBuffer",
+       "_resetIncrementalSearchOnFailure",
+       "_resetLastLoadedDate",
+       "_resetMainBrowser:",
+       "_resetMeasuredCell",
+       "_resetOpacity:",
+       "_resetPostingCounts",
+       "_resetScreens",
+       "_resetTitleFont",
+       "_resetTitleWidths",
+       "_resetToDefaultState",
+       "_resetToolTipIfNecessary",
+       "_resignCurrentEditor",
+       "_resize:",
+       "_resizeAccordingToTextView:",
+       "_resizeAllCaches",
+       "_resizeColumn:withEvent:",
+       "_resizeDeltaFromPoint:toEvent:",
+       "_resizeEditedCellWithOldSize:",
+       "_resizeFromEdge",
+       "_resizeHeight:",
+       "_resizeImage",
+       "_resizeOutlineColumn",
+       "_resizeSelectedTabViewItem",
+       "_resizeSubviewsFromIndex:",
+       "_resizeTextViewForTextContainer:",
+       "_resizeView",
+       "_resizeWindowWithMaxHeight:",
+       "_resizeWithDelta:fromFrame:beginOperation:endOperation:",
+       "_resizedImage:",
+       "_resolveHelpKeyForObject:",
+       "_resolveTypeAlias:",
+       "_resortMailboxPathsBecauseSpecialMailboxPathsChanged",
+       "_resortMailboxPathsInMapTable:",
+       "_responderInitWithCoder:",
+       "_responseValueFromResponse:key:",
+       "_responsibleDelegateForSelector:",
+       "_restoreCursor",
+       "_restoreDefaults",
+       "_restoreGUIView",
+       "_restoreHTMLString:",
+       "_restoreHTMLTree:",
+       "_restoreInitialMenuPosition",
+       "_restoreModalWindowLevel",
+       "_restoreMode",
+       "_restorePreviewView",
+       "_restoreRawView",
+       "_restoreSplitPos",
+       "_restoreTornOffMenus",
+       "_resultCodeFromResponse:",
+       "_retainCountForObjectWithGlobalID:",
+       "_retainedAbsoluteURL",
+       "_retainedBitmapRepresentation",
+       "_retainedFragment",
+       "_retainedHost",
+       "_retainedNetLocation",
+       "_retainedParameterString",
+       "_retainedPassword",
+       "_retainedQuery",
+       "_retainedRelativeURLPath",
+       "_retainedScheme",
+       "_retainedUser",
+       "_retrieveNewMessages",
+       "_retrieveNewMessagesInUIDRange:intoArray:statusFormat:",
+       "_returnToSenderSheetDidEnd:returnCode:contextInfo:",
+       "_returnValue",
+       "_reverseCompare:",
+       "_revert:",
+       "_revertPanel:didConfirm:contextInfo:",
+       "_revertToOldRowSelection:fromRow:toRow:",
+       "_rightEdgeOfSelection:hasGlyphRange:",
+       "_rightFrameRect",
+       "_rightGroupRect",
+       "_rightMouseUpOrDown:",
+       "_rightmostResizableColumn",
+       "_rootLevelEvents",
+       "_rotationForGlyphAtIndex:effectiveRange:",
+       "_routeMessagesIndividually",
+       "_rowEntryForChild:ofParent:",
+       "_rowEntryForItem:",
+       "_rowEntryForRow:",
+       "_ruleAreaRect",
+       "_rulerAccView",
+       "_rulerAccViewAlignmentAction:",
+       "_rulerAccViewFixedLineHeightAction:",
+       "_rulerAccViewIncrementLineHeightAction:",
+       "_rulerAccessoryViewAreaRect",
+       "_rulerOrigin",
+       "_rulerline::last:",
+       "_runAccountDetailPanelForAccount:",
+       "_runAlertPanelInMainThreadWithInfo:",
+       "_runArrayHoldingAttributes",
+       "_runInitBook:",
+       "_runModal:forDirectory:file:relativeToWindow:",
+       "_runModalForDirectory:file:relativeToWindow:",
+       "_runModalForDirectory:file:relativeToWindow:modalDelegate:didEndSelector:contextInfo:",
+       "_runPanels:withUI:faxFlag:preloaded:",
+       "_runPasswordPanelInMainThreadWithInfo:",
+       "_runSignatureDetailPanelForSignature:",
+       "_runningDocModal",
+       "_saveAllEnumeration:",
+       "_saveAsIntoFile:",
+       "_saveDefaults",
+       "_saveDefaultsToDictionary:",
+       "_saveFrameUsingName:domain:",
+       "_saveInitialMenuPosition",
+       "_saveList:",
+       "_saveMode",
+       "_savePanelDidEnd:returnCode:contextInfo:",
+       "_savePanelSheetDidEnd:returnCode:contextInfo:",
+       "_saveSplitPos",
+       "_saveTornOffMenus",
+       "_saveUserFavorites",
+       "_saveVisibleFrame",
+       "_savedMode",
+       "_savedVisibleFrame",
+       "_scanBodyResponseFromScanner:",
+       "_scanDecimal:into:",
+       "_scanForDuplicateInodes",
+       "_scanImages",
+       "_scanIntFromScanner:",
+       "_scanMessageFlagsFromScanner:",
+       "_scanToEnrichedString:scanner:",
+       "_scheduleAutoExpandTimerForItem:",
+       "_screenChanged:",
+       "_screenRectContainingPoint:",
+       "_scriptsMenuItemAction:",
+       "_scrollArrowHeight",
+       "_scrollColumnToLastVisible:",
+       "_scrollColumnToVisible:private:",
+       "_scrollColumnsRightBy:",
+       "_scrollDown:",
+       "_scrollInProgress",
+       "_scrollPageInDirection:",
+       "_scrollPoint:fromView:",
+       "_scrollRangeToVisible:forceCenter:",
+       "_scrollRectToVisible:fromView:",
+       "_scrollRowToCenter:",
+       "_scrollTo:",
+       "_scrollToEnd:",
+       "_scrollToMatchContentView",
+       "_scrollUp:",
+       "_scrollWheelMultiplier",
+       "_scrollingDirectionAndDeltas:",
+       "_scrollingMenusAreEnabled",
+       "_searchForImageNamed:",
+       "_searchForSoundNamed:",
+       "_searchForSystemImageNamed:",
+       "_searchMenu:forItemMatchingPath:",
+       "_secondsFromGMTForAbsoluteTime:",
+       "_seemsToBeVertical",
+       "_segmentIndexForElementIndex:",
+       "_selectCell:dirOk:",
+       "_selectCell:inColumn:",
+       "_selectCellIfNeeded",
+       "_selectCellIfRequired",
+       "_selectColorNamed:startingAtListNumber:andIndex:searchingBackward:usingLocalName:ignoreCase:substring:",
+       "_selectColumnRange:byExtendingSelection:",
+       "_selectEntryAt:",
+       "_selectFaxByName:",
+       "_selectFirstEnabledCell",
+       "_selectFirstKeyView",
+       "_selectFromFavoritesList:",
+       "_selectItemBestMatching:",
+       "_selectKeyCellAtRow:column:",
+       "_selectMessages:scrollIfNeeded:",
+       "_selectNextCellKeyStartingAtRow:column:",
+       "_selectNextItem",
+       "_selectOrEdit:inView:target:editor:event:start:end:",
+       "_selectPreviousItem",
+       "_selectRange::::",
+       "_selectRectRange::",
+       "_selectRowRange::",
+       "_selectRowRange:byExtendingSelection:",
+       "_selectSizeIfNecessary:",
+       "_selectTabWithDraggingInfo:",
+       "_selectTextOfCell:",
+       "_selected",
+       "_selectedItems",
+       "_selectedPrintFilter",
+       "_selectionContainsMessagesWithDeletedStatusEqualTo:",
+       "_selectionContainsMessagesWithReadStatusEqualTo:",
+       "_selfBoundsChanged",
+       "_sendAction:to:row:column:",
+       "_sendActionAndNotification",
+       "_sendActionFrom:",
+       "_sendChangeWithUserInfo:",
+       "_sendClientMessage:arg1:arg2:",
+       "_sendCommand:length:argument:trailer:",
+       "_sendCommand:withArgument:",
+       "_sendCommand:withArguments:",
+       "_sendData",
+       "_sendDataSourceWriteDragRows:toPasteboard:",
+       "_sendDelegateDidClickColumn:",
+       "_sendDelegateDidDragColumn:",
+       "_sendDelegateDidMouseDownInHeader:",
+       "_sendDoubleActionToCellAt:",
+       "_sendFileExtensionData:length:",
+       "_sendFinishLaunchingNotification",
+       "_sendInvalidateCursorRectsMessageToWindow:",
+       "_sendMailboxCommand:withArguments:errorMessage:",
+       "_sendOrEnqueueNotification:selector:",
+       "_sendPortMessageWithComponent:msgID:timeout:",
+       "_sendRedisplayMessageToWindow:",
+       "_sendRequestServerData:length:",
+       "_sendString:",
+       "_senderIsInvalid:",
+       "_sendingSocketForPort:",
+       "_serverConnectionDied:",
+       "_serverDied:",
+       "_servicesMenuIsVisible",
+       "_set:",
+       "_setAEDesc:",
+       "_setAcceptsFirstMouse:",
+       "_setAcceptsFirstResponder:",
+       "_setActivationState:",
+       "_setAggregateTag:",
+       "_setAllowsTearOffs:",
+       "_setAltContents:",
+       "_setApplicationIconImage:setDockImage:",
+       "_setArgFrame:",
+       "_setArgumentName:forAppleEventCode:",
+       "_setAsSystemColor",
+       "_setAttributedDictionaryClass:",
+       "_setAttributes:newValues:range:",
+       "_setAutoPositionMask:",
+       "_setAutoResizeDocView:",
+       "_setAutoscrollDate:",
+       "_setAvoidsActivation:",
+       "_setBackgroundColor:",
+       "_setBackgroundTransparent:",
+       "_setBlockCapacity:",
+       "_setBulletCharacter:",
+       "_setBundle:forClassPresentInAppKit:",
+       "_setBundleForHelpSearch:",
+       "_setButtonBordered:",
+       "_setButtonImageSource:",
+       "_setButtonImages",
+       "_setButtonType:adjustingImage:",
+       "_setCacheDockItemRef:forWindow:",
+       "_setCacheWindowNum:forWindow:",
+       "_setCapitalizedKey:forKey:",
+       "_setCaseConversionFlags",
+       "_setCellFrame:",
+       "_setClassDescription",
+       "_setClassDescription:",
+       "_setClassDescription:forAppleEventCode:",
+       "_setClassName:forSynonymAppleEventCode:inSuite:",
+       "_setCloseEnabled:",
+       "_setCommandDescription:forAppleEventClass:andEventCode:",
+       "_setConcreteFontClass:",
+       "_setConsistencyCheckingEnabled:superCheckEnabled:",
+       "_setContainer:",
+       "_setContainerObservesTextViewFrameChanges:",
+       "_setContentRect:",
+       "_setContents:",
+       "_setContextMenuEvent:",
+       "_setContextMenuTarget:",
+       "_setControlTextDelegateFromOld:toNew:",
+       "_setControlView:",
+       "_setControlsEnabled:",
+       "_setConvertedData:forType:pboard:generation:inItem:",
+       "_setConvertedData:pboard:generation:inItem:",
+       "_setCopy:",
+       "_setCopyrightSymbolText:",
+       "_setCopyrightText:",
+       "_setCounterpart:",
+       "_setCtrlAltForHelpDesired:",
+       "_setCurrImageName:",
+       "_setCurrListName:",
+       "_setCurrentActivation:",
+       "_setCurrentAttachmentRect:index:",
+       "_setCurrentClient:",
+       "_setCurrentEvent:",
+       "_setCurrentlyEditing:",
+       "_setCursor:forChildrenOfInode:",
+       "_setCursor:forChildrenOfPath:",
+       "_setCursor:forPath:",
+       "_setCursorForPath:keyBuf:",
+       "_setData:encoding:",
+       "_setDataSource:",
+       "_setDecimalSeparatorNoConsistencyCheck:",
+       "_setDefaultBool:forKey:",
+       "_setDefaultButtonCycleTime:",
+       "_setDefaultButtonIndicatorNeedsDisplay",
+       "_setDefaultFloat:forKey:",
+       "_setDefaultInt:forKey:",
+       "_setDefaultKeyViewLoop",
+       "_setDefaultObject:forKey:",
+       "_setDefaultPrinter:isFax:",
+       "_setDefaultRedColor:",
+       "_setDelegate:",
+       "_setDeselectsWhenMouseLeavesDuringDrag:",
+       "_setDeviceButtons:",
+       "_setDirectory:",
+       "_setDisplayableSampleText:forFamily:",
+       "_setDistanceForVerticalArrowKeyMovement:",
+       "_setDocViewFromRead:",
+       "_setDocument:",
+       "_setDocumentDictionaryName:",
+       "_setDocumentEdited:",
+       "_setDragRef:",
+       "_setDraggingMarker:",
+       "_setDrawerTransform:",
+       "_setDrawerVelocity:",
+       "_setDrawingToHeartBeatWindow:",
+       "_setDrawsBackground:",
+       "_setEditingTextView:",
+       "_setEnabled:",
+       "_setEventDelegate:",
+       "_setEventRef:",
+       "_setExportSpecialFonts:",
+       "_setExtraRefCount:",
+       "_setFallBackInitialFirstResponder:",
+       "_setFilterTypes:",
+       "_setFinalSlideLocation:",
+       "_setFirstColumnTitle:",
+       "_setFloatingPointFormat:left:right:",
+       "_setFocusForView:withFrame:withInset:",
+       "_setFocusNeedsDisplay",
+       "_setFont:forCell:",
+       "_setFontPanel:",
+       "_setForceActiveControls:",
+       "_setForceFixAttributes:",
+       "_setForm:select:ok:",
+       "_setFrame:",
+       "_setFrameCommon:display:stashSize:",
+       "_setFrameFromString:",
+       "_setFrameNeedsDisplay:",
+       "_setFrameSavedUsingTitle:",
+       "_setFrameUsingName:domain:",
+       "_setFreesObjectRecords:",
+       "_setGlyphGenerator:",
+       "_setGroupIdentifier:",
+       "_setHasEditingIvars:",
+       "_setHasShadow:",
+       "_setHelpCursor:",
+       "_setHelpKey:forObject:",
+       "_setHidden:",
+       "_setHidesOnDeactivateInCache:forWindow:",
+       "_setHorizontallyCentered:",
+       "_setIconRef:",
+       "_setImage:",
+       "_setIndicatorImage:",
+       "_setInsertionPointDisabled:",
+       "_setIsDefaultFace:",
+       "_setIsGrabber:",
+       "_setIsInUse:",
+       "_setJavaClassesLoaded",
+       "_setKey:forAppleEventCode:",
+       "_setKeyBindingMonitor:",
+       "_setKeyCellAtRow:column:",
+       "_setKeyCellFromBottom",
+       "_setKeyCellFromTop",
+       "_setKeyCellNeedsDisplay",
+       "_setKeyWindow:",
+       "_setKeyboardFocusRingNeedsDisplay",
+       "_setKnobThickness:usingInsetRect:",
+       "_setLang:",
+       "_setLastDragDestinationOperation:",
+       "_setLastGuess:",
+       "_setLayoutListFromPagesPerSheet:",
+       "_setLeaksContextUponChange:",
+       "_setLength:ofStatusItemWindow:",
+       "_setMailAccounts:",
+       "_setMainMenu:",
+       "_setMainWindow:",
+       "_setMarkedText:selectedRange:forInputManager:",
+       "_setMarker:",
+       "_setMenuClassName:",
+       "_setMenuName:",
+       "_setMinSize:",
+       "_setMiniImageInDock",
+       "_setModalInCache:forWindow:",
+       "_setModifiers:",
+       "_setMouseActivationInProgress:",
+       "_setMouseDownFlags:",
+       "_setMouseEnteredGroup:entered:",
+       "_setMouseMovedEventsEnabled:",
+       "_setMouseTrackingForCell:",
+       "_setMouseTrackingInRect:ofView:",
+       "_setName:",
+       "_setNeedsDisplay:",
+       "_setNeedsDisplayForColumn:draggedDelta:",
+       "_setNeedsDisplayForDropCandidateItem:childIndex:mask:",
+       "_setNeedsDisplayForDropCandidateRow:operation:mask:",
+       "_setNeedsDisplayForTabViewItem:",
+       "_setNeedsDisplayInColumn:",
+       "_setNeedsDisplayInColumn:row:",
+       "_setNeedsDisplayInRow:column:",
+       "_setNeedsToExpand:",
+       "_setNeedsToUpdateIndex",
+       "_setNeedsToUseHeartBeatWindow:",
+       "_setNeedsZoom:",
+       "_setNetPathsDisabled:",
+       "_setNextEvent:",
+       "_setNextKeyBindingManager:",
+       "_setNoVerticalAutosizing:",
+       "_setNumVisibleColumns:",
+       "_setObject:",
+       "_setObject:forBothSidesOfRelationshipWithKey:",
+       "_setOneShotIsDelayed:",
+       "_setOnlineStateOfAllAccountsTo:",
+       "_setOpenRecentMenu:",
+       "_setOptionValues",
+       "_setOrderDependency:",
+       "_setOwnedByPopUp:",
+       "_setOwnsRealWindow:",
+       "_setPPDInfoInPrinter",
+       "_setPageGenerationOrder:",
+       "_setPageNumber:inControl:",
+       "_setParent:",
+       "_setParentWindow:",
+       "_setPath:forFramework:usingDictionary:",
+       "_setPatternFromRect:",
+       "_setPmPageFormat:",
+       "_setPmPrintSettings:",
+       "_setPostsFocusChangedNotifications:",
+       "_setPressedTabViewItem:",
+       "_setPullsDown:",
+       "_setRTFDFileWrapper:",
+       "_setRawSelection:view:",
+       "_setReceiveHandlerRef:",
+       "_setRecentDocumentsLimit:",
+       "_setRect:forAttachment:",
+       "_setRecyclable:",
+       "_setRepresentationListCache:",
+       "_setRepresentedFilename:",
+       "_setRootNode:",
+       "_setRotatedFromBase:",
+       "_setRotatedOrScaledFromBase:",
+       "_setRotation:forGlyphAtIndex:",
+       "_setRotationLeft:andRight:",
+       "_setScroller:",
+       "_setSelected:isOriginalValue:",
+       "_setSelectedAddressInfo:",
+       "_setSelectedCell:",
+       "_setSelectedCell:atRow:column:",
+       "_setSelection:inspection:",
+       "_setSelectionFromPasteboard:",
+       "_setSelectionRange::",
+       "_setSelectionString:",
+       "_setSenderOrReceiverIfSenderIsMe",
+       "_setSharedDocumentController:",
+       "_setSheet:",
+       "_setShowAlpha:andForce:",
+       "_setShowingModalFrame:",
+       "_setShowsAllDrawing:",
+       "_setSingleWindowMode:",
+       "_setSizeType:",
+       "_setSound:",
+       "_setSoundFile:",
+       "_setStore:",
+       "_setStringInKeyNode:key:value:",
+       "_setStringListInKeyNode:key:list:len:",
+       "_setSubmenu:",
+       "_setSuiteName:forAppleEventCode:",
+       "_setSuperview:",
+       "_setSuppressAutoenabling:",
+       "_setSuppressScrollToVisible:",
+       "_setSurface:",
+       "_setSwap:",
+       "_setSynonymTable:inSuite:",
+       "_setTabRect:",
+       "_setTabState:",
+       "_setTabView:",
+       "_setTarget:",
+       "_setTargetFramework:",
+       "_setTempHidden:",
+       "_setTextAttributeParaStyleNeedsRecalc",
+       "_setTextFieldStringValue:",
+       "_setTextShadow",
+       "_setTextShadow:",
+       "_setThousandSeparatorNoConsistencyCheck:",
+       "_setThreadName:",
+       "_setTitle:",
+       "_setTitle:ofColumn:",
+       "_setTitleNeedsDisplay",
+       "_setToolTip:forView:cell:rect:owner:userData:",
+       "_setTrackingHandlerRef:",
+       "_setTrackingRect:inside:owner:userData:",
+       "_setTrackingRects",
+       "_setUIConstraints:",
+       "_setUpAccessoryViewWithEditorTypes:exportableTypes:selectedType:enableExportable:",
+       "_setUpAppKitCoercions",
+       "_setUpAppKitTranslations",
+       "_setUpDefaultTopLevelObject",
+       "_setUpFoundationCoercions",
+       "_setUpFoundationTranslations",
+       "_setUpOperation:helpedBy:",
+       "_setUpTrackingRect",
+       "_setUpdated:",
+       "_setUseSimpleTrackingMode:",
+       "_setUsesATSGlyphGenerator:",
+       "_setUsesFastJavaBundleSetup:",
+       "_setUsesNoLeading:",
+       "_setUsesQuickdraw:",
+       "_setUsesToolTipsWhenTruncated:",
+       "_setUtilityWindow:",
+       "_setVerticallyCentered:",
+       "_setVisible:",
+       "_setVisibleInCache:forWindow:",
+       "_setWantsToBeOnMainScreen:",
+       "_setWin32MouseActivationInProgress:",
+       "_setWindow:",
+       "_setWindowContextForCurrentThread:",
+       "_setWindowFrameForPopUpAttachingToRect:onScreen:preferredEdge:popUpSelectedItem:",
+       "_setWindowNumber:",
+       "_setWithCopyOfDictionary:defaults:",
+       "_setWithOffset:",
+       "_setWords:inDictionary:",
+       "_setupAccountType:hostname:username:password:emailAddress:",
+       "_setupAllFamFrame",
+       "_setupAttachmentEncodingHints",
+       "_setupColumnsForTableView",
+       "_setupConnections",
+       "_setupCursor",
+       "_setupDefaultRecipients:",
+       "_setupFromDefaults",
+       "_setupInitialState",
+       "_setupOpenPanel",
+       "_setupOutlineView",
+       "_setupPreviewFrame",
+       "_setupSeparatorSizes:",
+       "_setupSortRules",
+       "_setupSplitView",
+       "_setupSurfaceAndStartSpinning",
+       "_setupTextView:",
+       "_setupToolBar",
+       "_setupUI",
+       "_shadowTabColorAtIndex:",
+       "_shapeMenuPanel",
+       "_shareTextStorage",
+       "_sharedData",
+       "_sharedLock",
+       "_sharedSecureFieldEditor",
+       "_sharedTextCell",
+       "_sheetAnimationVelocity",
+       "_shiftDown::::",
+       "_shortNameFor:",
+       "_shouldAddNodeForProject:",
+       "_shouldAllowAutoCollapseItemsDuringDragsDefault",
+       "_shouldAllowAutoExpandItemsDuringDragsDefault",
+       "_shouldAttemptDroppingAsChildOfLeafItems",
+       "_shouldAutoscrollForDraggingInfo:",
+       "_shouldCallCompactWhenClosing",
+       "_shouldChangeComponentMessageFlags",
+       "_shouldDispatch:invocation:sequence:coder:",
+       "_shouldDrawTwoBitGray",
+       "_shouldForceShiftModifierWithKeyEquivalent:",
+       "_shouldHaveBlinkTimer",
+       "_shouldHideDisclosureTriangle",
+       "_shouldLiveResizeUseCachedImage",
+       "_shouldOpenDespiteLock:",
+       "_shouldPowerOff",
+       "_shouldRepresentFilename",
+       "_shouldRequireAutoCollapseOutlineAfterDropsDefault",
+       "_shouldSetHighlightToFlag:",
+       "_shouldShowFirstResponderForCell:",
+       "_shouldTerminate",
+       "_shouldTerminateWithDelegate:shouldTerminateSelector:",
+       "_shouldUseHTMLView",
+       "_showAccountDetailForAccountBeingEdited",
+       "_showBorder",
+       "_showCompletionListWindow:",
+       "_showDragError:forFilename:",
+       "_showDrawRect:",
+       "_showDropShadow",
+       "_showGUIView:",
+       "_showKeyboardUILoop",
+       "_showMailboxesPanel",
+       "_showMessage:",
+       "_showSelectedLineInField",
+       "_showSelectedLineRespectingSortOrder:",
+       "_showSignatureDetailForAccountBeingEdited",
+       "_showStatus:",
+       "_showToolTip",
+       "_showsAllDrawing",
+       "_shutDrawer",
+       "_signatureValid",
+       "_simpleDeleteGlyphsInRange:",
+       "_simpleDescription",
+       "_simpleInsertGlyph:atGlyphIndex:characterIndex:elastic:",
+       "_simpleRepresentedItem",
+       "_singleWindowMode",
+       "_singleWindowModeButtonOrigin",
+       "_size",
+       "_sizeAllDrawers",
+       "_sizeAllDrawersToScreenWithRect:",
+       "_sizeAllDrawersWithRect:",
+       "_sizeDownIfPossible",
+       "_sizeLastColumnToFitIfNecessary",
+       "_sizeOfTitlebarFileButton",
+       "_sizePanelTo:duration:",
+       "_sizeSet",
+       "_sizeStatus",
+       "_sizeToFitIfNecessary",
+       "_sizeToFitText",
+       "_sizeToScreenWithRect:",
+       "_sizeType",
+       "_sizeWithRect:",
+       "_sizeWithSize:",
+       "_sizeWithSize:attributes:",
+       "_slideWithDelta:beginOperation:endOperation:",
+       "_smallEncodingGlyphIndexForCharacterIndex:startOfRange:okToFillHoles:",
+       "_sortChildMailboxPaths:",
+       "_sortMessageList:usingAttributes:",
+       "_sortRulesFromArray:usingFullPaths:",
+       "_sortedObjectNames:",
+       "_sound",
+       "_specialControlView",
+       "_specialServicesMenuUpdate",
+       "_spellServers",
+       "_spellingGuessesForRange:",
+       "_splitKey:intoGlobalKey:andLanguage:",
+       "_spoolFile:",
+       "_standardFrame",
+       "_standardPaperNames",
+       "_standardizedStorePath:",
+       "_startAnimationWithThread:",
+       "_startDraggingUpdates",
+       "_startDrawingThread:",
+       "_startHeartBeating",
+       "_startHitTracking:",
+       "_startLDAPSearch",
+       "_startLiveResize",
+       "_startLiveResizeForAllDrawers",
+       "_startMessageClearCheck:",
+       "_startMove",
+       "_startMovieIdleIfNeeded",
+       "_startRegion:ofLength:atAddress:",
+       "_startRunMethod",
+       "_startSheet",
+       "_startSound",
+       "_startTearingOffWithScreenPoint:",
+       "_stashOrigin:",
+       "_stashedOrigin",
+       "_statusItemWithLength:withPriority:",
+       "_statusMessageForMessage:current:total:",
+       "_stopAnimation",
+       "_stopAnimationWithWait:",
+       "_stopDraggingUpdates",
+       "_stopFadingTimer",
+       "_stopLDAPSearch",
+       "_stopMonitoringStoreForChanges",
+       "_stopTearingOff",
+       "_stringByResolvingSymlinksInPathUsingCache:",
+       "_stringByStandardizingPathAllowingSlash:",
+       "_stringByStandardizingPathUsingCache:",
+       "_stringByTranslatingAliasDescriptor:",
+       "_stringByTranslatingChar:",
+       "_stringByTranslatingFSSpecDescriptor:",
+       "_stringByTranslatingInternationalText:",
+       "_stringByTranslatingStyledText:",
+       "_stringForEditing",
+       "_stringForHTMLEncodedStringTolerant:",
+       "_stringForMessage:",
+       "_stringRepresentation",
+       "_stringSearchParametersForListingViews",
+       "_stringToWrite",
+       "_stringWithSavedFrame",
+       "_stringWithSeparator:atFrequency:",
+       "_stringWithStrings:",
+       "_stringWithUnsigned:",
+       "_stripAttachmentCharactersFromAttributedString:",
+       "_stripAttachmentCharactersFromString:",
+       "_stripExteriorBreaks",
+       "_stripInteriorBreaks",
+       "_structureHash",
+       "_subImageFocus",
+       "_subclassManagesData",
+       "_subeventsOfClass:type:array:",
+       "_subsetDescription",
+       "_substituteFontName:flag:",
+       "_subtractColor:",
+       "_subviewResized:",
+       "_subviews",
+       "_successfulControlsWithButton:",
+       "_suggestGuessesForWord:inLanguage:",
+       "_suiteNameForAppleEventCode:",
+       "_sumThinFile:offset:size:",
+       "_summationRectForFont",
+       "_superviewClipViewFrameChanged:",
+       "_superviewUsesOurURL",
+       "_surface",
+       "_surfaceBounds",
+       "_surfaceDidComeBack:",
+       "_surfaceWillGoAway:",
+       "_surrogateFontName:",
+       "_surroundValueInString:withLength:andBuffer:",
+       "_switchImage:andUpdateColor:",
+       "_switchInitialFirstResponder:lastKeyView:",
+       "_switchPanes:",
+       "_switchToHTMLView",
+       "_switchToNSTextView",
+       "_switchToPlatformInput:",
+       "_switchView:",
+       "_switchView:with:initialFirstResponder:lastKeyView:",
+       "_symbolForGetPS2ColorSpace",
+       "_synchronizeAccountWithServer:",
+       "_synchronizeGetNewMailMenuIfNeeded",
+       "_synchronizeMailboxListWithFileSystem",
+       "_synchronizeMenu:atIndex:toPath:fromAccount:",
+       "_synchronizeMenuOfAllMailboxes:startingFromPath:",
+       "_synchronizeMenusStartingFromPath:",
+       "_synchronizeSubmenu:toPath:fromAccount:",
+       "_synchronizeTextView:",
+       "_synonymTableInSuite:",
+       "_synonymTerminologyDictionaryForCode:inSuite:",
+       "_synonymsInSuite:",
+       "_systemColorChanged:",
+       "_systemColorsChanged:",
+       "_tabHeight",
+       "_tabRect",
+       "_tabViewWillRemoveFromSuperview",
+       "_tabVueResizingRect",
+       "_takeApplicationMenuIfNeeded:",
+       "_takeColorFrom:andSendAction:",
+       "_takeColorFromAndSendActionIfContinuous:",
+       "_takeColorFromDoAction:",
+       "_target",
+       "_targetFramework",
+       "_targetState",
+       "_taskNowMultiThreaded:",
+       "_tempHide:relWin:",
+       "_tempHideHODWindow",
+       "_tempUnhideHODWindow",
+       "_temporaryFilename:",
+       "_termWindowIfOwner",
+       "_terminate",
+       "_terminate:",
+       "_terminateSendShould:",
+       "_terminologyRegistry",
+       "_terminologyRegistryForSuite:",
+       "_testWithComparisonOperator:object1:object2:",
+       "_textAttributes",
+       "_textContainerDealloc",
+       "_textDimColor",
+       "_textHighlightColor",
+       "_textLength",
+       "_textMerge:",
+       "_textStorageChanged:",
+       "_textViewOwnsTextStorage",
+       "_thinForArchs:",
+       "_thinForArchs:numArchs:",
+       "_thousandChar",
+       "_threadContext",
+       "_threadName",
+       "_threadWillExit:",
+       "_tile:",
+       "_tileTitlebar",
+       "_tileViews",
+       "_titleCellHeight",
+       "_titleCellHeight:",
+       "_titleCellSize",
+       "_titleCellSizeForTitle:styleMask:",
+       "_titleIsRepresentedFilename",
+       "_titleRectForTabViewItem:",
+       "_titleSizeWithSize:",
+       "_titleWidth",
+       "_titlebarHeight",
+       "_titlebarHeight:",
+       "_titlebarTitleRect",
+       "_toggleFrameAutosaveEnabled:",
+       "_toggleLogging",
+       "_toggleRichSheetDidEnd:returnCode:contextInfo:",
+       "_topFrameRect",
+       "_topLeftFrameRect",
+       "_topLeftResizeCursor",
+       "_topMenuView",
+       "_topRightFrameRect",
+       "_topRightResizeCursor",
+       "_totalMinimumTabsWidthWithOverlap:",
+       "_totalNominalTabsWidthWithOverlap:",
+       "_totalOffsetsForItem:",
+       "_totalTabsWidth:overlap:",
+       "_trackAttachmentClick:characterIndex:glyphIndex:attachmentCell:",
+       "_trackMouse:",
+       "_trackingHandlerRef",
+       "_transferWindowOwnership",
+       "_transparency",
+       "_traverseAtProject:withData:",
+       "_traverseProject:withInfo:",
+       "_traverseToSubmenu",
+       "_traverseToSupermenu",
+       "_treeHasDragTypes",
+       "_trimDownEventTreeTo:",
+       "_trimKeepingArchs:keepingLangs:fromBom:",
+       "_trimRecord",
+       "_trimWithCharacterSet:",
+       "_trueName",
+       "_tryDrop:dropItem:dropChildIndex:",
+       "_tryDrop:dropRow:dropOperation:",
+       "_tryToBecomeServer",
+       "_tryToOpenOrPrint:isPrint:",
+       "_typeDictForType:",
+       "_typeOfPrintFilter:",
+       "_types",
+       "_typesForDocumentClass:includeEditors:includeViewers:includeExportable:",
+       "_typesetterIsBusy",
+       "_uidsForMessages:",
+       "_umask",
+       "_unarchivingPrintInfo",
+       "_under",
+       "_underlineIsOn",
+       "_undoManagerCheckpoint:",
+       "_undoRedoTextOperation:",
+       "_undoStack",
+       "_undoUpdate:",
+       "_unformattedAttributedStringValue:",
+       "_unhide",
+       "_unhideAllDrawers",
+       "_unhideHODWindow",
+       "_unhideSheet",
+       "_unhookSubviews",
+       "_unionBitVectorMaybeCompressed:",
+       "_uniqueNameForNewSubdocument:",
+       "_uniquePrinterObject:includeUnavailable:",
+       "_uniqueTypeObject:",
+       "_unitsForClientLocation:",
+       "_unitsForRulerLocation:",
+       "_unlocalizedPaperName:",
+       "_unlock",
+       "_unlockFirstResponder",
+       "_unlockFocusNoRecursion",
+       "_unlockQuickDrawPort",
+       "_unlockViewHierarchyForDrawing",
+       "_unlockViewHierarchyForModification",
+       "_unmapActiveTable",
+       "_unobstructedPortionOfRect:",
+       "_unreadCountChanged:",
+       "_unregisterDragTypes",
+       "_unregisterForApplicationNotifications",
+       "_unregisterForCompletion:",
+       "_unregisterForStoreNotifications",
+       "_unregisterMenuForKeyEquivalentUniquing:",
+       "_unregisterMenuItemForKeyEquivalentUniquing:",
+       "_unresolveTypeAlias:",
+       "_unsetFinalSlide",
+       "_update",
+       "_updateAllEntries",
+       "_updateAppleMenu:",
+       "_updateAttributes",
+       "_updateAutoscrollingStateWithTrackingViewPoint:event:",
+       "_updateButtons",
+       "_updateCell:withInset:",
+       "_updateContentsIfNecessary",
+       "_updateCurrentFolder",
+       "_updateDeviceCount:applicationCount:",
+       "_updateDragInsertionIndicatorWith:",
+       "_updateEnabled",
+       "_updateFavoritesMenu",
+       "_updateFileNamesForChildren",
+       "_updateFlag:toState:forMessage:",
+       "_updateFocusSelection",
+       "_updateForEditedMovie:",
+       "_updateFrameWidgets",
+       "_updateFromPath:checkOnly:exists:",
+       "_updateHighlightedItemWithTrackingViewPoint:event:",
+       "_updateIndex",
+       "_updateInputManagerState",
+       "_updateKnownNotVisibleAppleMenu:",
+       "_updateLengthAndSelectedRange:",
+       "_updateMouseTracking",
+       "_updateMouseTracking:",
+       "_updateOpenRecentMenu:menuNames:",
+       "_updateOpenRecentMenus",
+       "_updatePageControls",
+       "_updatePopup",
+       "_updatePreview:",
+       "_updatePrintStatus:label:",
+       "_updatePrinterStuff",
+       "_updateRendering:",
+       "_updateRulerlineForRuler:oldPosition:newPosition:vertical:",
+       "_updateSeekingSubmenuWithScreenPoint:viewPoint:event:",
+       "_updateStatusLine",
+       "_updateStatusLineAndWindowTitle",
+       "_updateSubmenuKnownStale:",
+       "_updateTearOffPositionWithScreenPoint:",
+       "_updateToMatchServerIfNeeded",
+       "_updateUI",
+       "_updateUIOfTextField:withPath:",
+       "_updateUsageForTextContainer:addingUsedRect:",
+       "_updateWidgets",
+       "_updateWindowsUsingCache",
+       "_updateWorkspace:",
+       "_upgradeAppHelpFile",
+       "_upgradeAppIcon",
+       "_upgradeAppMainNIB",
+       "_upgradeDocExtensions",
+       "_upgradeOSDependentFields",
+       "_upgradeTo2Dot6",
+       "_upgradeTo2Dot7",
+       "_upgradeTo2Dot8",
+       "_url",
+       "_urlStringForEventInImageMap:inFrame:",
+       "_useCacheGState:rect:",
+       "_useFromFile:",
+       "_useIconNamed:from:",
+       "_useSharedKitWindow:rect:",
+       "_useSimpleTrackingMode",
+       "_useUserKeyEquivalent",
+       "_userCanChangeSelection",
+       "_userCanEditTableColumn:row:",
+       "_userCanSelectAndEditTableColumn:row:",
+       "_userCanSelectColumn:",
+       "_userCanSelectRow:",
+       "_userChangeSelection:fromAnchorRow:toRow:lastExtensionRow:selecting:",
+       "_userDeleteRange:",
+       "_userDeselectColumn:",
+       "_userDeselectRow:",
+       "_userInfoCurrentOSName",
+       "_userInfoDict",
+       "_userInfoDictForCurrentOS",
+       "_userInfoDirectoryPath",
+       "_userInfoFileName",
+       "_userKeyEquivalentForTitle:",
+       "_userKeyEquivalentModifierMaskForTitle:",
+       "_userLoggedOut",
+       "_userSelectColumn:byExtendingSelection:",
+       "_userSelectColumnRange:toColumn:byExtendingSelection:",
+       "_userSelectRow:byExtendingSelection:",
+       "_userSelectRowRange:toRow:byExtendingSelection:",
+       "_userSelectTextOfNextCell",
+       "_userSelectTextOfNextCellInSameColumn",
+       "_userSelectTextOfPreviousCell",
+       "_usesATSGlyphGenerator",
+       "_usesFastJavaBundleSetup",
+       "_usesNoLeading",
+       "_usesNoRulebook",
+       "_usesProgrammingLanguageBreaks",
+       "_usesQuickdraw",
+       "_usesToolTipsWhenTruncated",
+       "_usesUserKeyEquivalent",
+       "_validFrameForResizeFrame:fromResizeEdge:",
+       "_validSize:",
+       "_validateAction:ofMenuItem:",
+       "_validateBundleSecurity",
+       "_validateButtonState",
+       "_validateEditing:",
+       "_validateEntryString:uiHandled:",
+       "_validateNames:checkBrowser:",
+       "_validateStyleMask:",
+       "_validateValuesInUI",
+       "_validatedStoredUsageForTextContainerAtIndex:",
+       "_value",
+       "_valueForIndex:inString:returningSizeType:",
+       "_valuesForKey:inContainer:isValid:",
+       "_valuesForObject:",
+       "_verifyDataIsPICT:withFrame:fromFile:",
+       "_verifyDefaultButtonCell",
+       "_verifySelectionIsOK",
+       "_verticalDistanceForLineScroll",
+       "_verticalDistanceForPageScroll",
+       "_verticalResizeCursor",
+       "_viewDetaching:",
+       "_viewForItem:",
+       "_viewFreeing:",
+       "_visibleAndCanBecomeKey",
+       "_visibleAndCanBecomeKeyLimitedOK:",
+       "_waitCursor",
+       "_waitForLock",
+       "_waitForLock:",
+       "_wakeup",
+       "_wantToBeModal",
+       "_wantsHeartBeat",
+       "_wantsLiveResizeToUseCachedImage",
+       "_wantsToDestroyRealWindow",
+       "_whenDrawn:fills:",
+       "_widthOfColumn:",
+       "_widthOfPackedGlyphs:count:",
+       "_widthsInvalid",
+       "_willPowerOff",
+       "_willUnmountDeviceAtPath:ok:",
+       "_win32ChangeKeyAndMain",
+       "_win32TitleString",
+       "_window",
+       "_windowBorderThickness",
+       "_windowBorderThickness:",
+       "_windowChangedKeyState",
+       "_windowChangedMain:",
+       "_windowChangedNumber:",
+       "_windowDeviceRound",
+       "_windowDidBecomeVisible:",
+       "_windowDidComeBack:",
+       "_windowDidLoad",
+       "_windowDying",
+       "_windowExposed:",
+       "_windowInitWithCoder:",
+       "_windowMoved:",
+       "_windowMovedToPoint:",
+       "_windowMovedToRect:",
+       "_windowNumber:changedTo:",
+       "_windowRef",
+       "_windowResizeBorderThickness",
+       "_windowResizeCornerThickness",
+       "_windowTitleString",
+       "_windowTitlebarButtonSpacingWidth",
+       "_windowTitlebarTitleMinHeight",
+       "_windowTitlebarTitleMinHeight:",
+       "_windowTitlebarXResizeBorderThickness",
+       "_windowTitlebarYResizeBorderThickness",
+       "_windowWillClose:",
+       "_windowWillGoAway:",
+       "_windowWillLoad",
+       "_windowWithDockItemRef:",
+       "_windowsForMenu:",
+       "_wordsInDictionary:",
+       "_wrapInNode:",
+       "_writableNamesAndTypesForSaveOperation:",
+       "_writeBytesFromOffset:length:",
+       "_writeCharacters:range:",
+       "_writeDataToFile:",
+       "_writeDirCommandsTo:forProject:withPrefix:",
+       "_writeDocFontsUsed",
+       "_writeEncodings",
+       "_writeFat:wroteBytes:cpuTypes:size:",
+       "_writeFontInRange:toPasteboard:",
+       "_writeMachO:wroteBytes:cpuTypes:size:",
+       "_writeMakeFiLe_OtherRelocs:",
+       "_writeMakeFiLe_Sources:",
+       "_writeMakeFile_BuildDir:",
+       "_writeMakeFile_BundleSpecial:",
+       "_writeMakeFile_CodeGenStyle:",
+       "_writeMakeFile_Compilers:",
+       "_writeMakeFile_Header:",
+       "_writeMakeFile_Inclusions:",
+       "_writeMakeFile_JavaStuff:",
+       "_writeMakeFile_Libraries:",
+       "_writeMakeFile_ProjectNameVersionTypeLanguage:",
+       "_writeMakeFile_PublicHeadersDir:",
+       "_writeMakeFile_Resources:",
+       "_writeMakeFile_SearchPaths:",
+       "_writeMessagesToIncomingMail:unsuccessfulOnes:",
+       "_writePageFontsUsed",
+       "_writePersistentExpandItems",
+       "_writePersistentTableColumns",
+       "_writeRTFDInRange:toPasteboard:",
+       "_writeRTFInRange:toPasteboard:",
+       "_writeRecentDocumentsDefault",
+       "_writeRulerInRange:toPasteboard:",
+       "_writeSizeStringForRows:",
+       "_writeStringInRange:toPasteboard:",
+       "_writeTIFF:usingCompression:factor:",
+       "_writeUpdatedIndexToDisk",
+       "_writeWithThinningForSize:wroteBytes:cpuTypes:",
+       "_wsmIconInitFor:",
+       "_wsmOwnsWindow",
+       "_zeroScreen",
+       "_zoomButtonOrigin",
+       "abbreviation",
+       "abbreviationDictionary",
+       "abbreviationForDate:",
+       "abbreviationForTimeInterval:",
+       "abort",
+       "abortBlock:",
+       "abortEditing",
+       "abortModal",
+       "abortRegion:ofLength:",
+       "abortToolTip",
+       "abortTransaction",
+       "absoluteFrameChanged",
+       "absolutePathFromPathRelativeToProject:",
+       "absoluteString",
+       "absoluteURL",
+       "acceptColor:atPoint:",
+       "acceptConnectionInBackgroundAndNotify",
+       "acceptConnectionInBackgroundAndNotifyForModes:",
+       "acceptInputForMode:beforeDate:",
+       "acceptableDragTypes",
+       "acceptsArrowKeys",
+       "acceptsBinary",
+       "acceptsFirstMouse:",
+       "acceptsFirstResponder",
+       "acceptsMouseMovedEvents",
+       "accessInstanceVariablesDirectly",
+       "accessoryView",
+       "account",
+       "accountChanged:",
+       "accountDetailsForAccountClassNamed:",
+       "accountInfo",
+       "accountInfoDidChange",
+       "accountPath",
+       "accountRelativePathForFullPath:",
+       "accountThatReceivedMessage:matchingEmailAddress:fullUserName:",
+       "accountType",
+       "accountTypeChanged:",
+       "accountTypeString",
+       "accountWithPath:",
+       "accounts",
+       "accountsChanged:",
+       "action",
+       "activate:",
+       "activateContextHelpMode:",
+       "activateIgnoringOtherApps:",
+       "activateInputManagerFromMenu:",
+       "activeConversationChanged:toNewConversation:",
+       "activeConversationWillChange:fromOldConversation:",
+       "activeLinkColor",
+       "activeSignatureWithName:",
+       "activityMonitorDidChange:",
+       "activityViewer",
+       "actualBitsPerPixel",
+       "add:",
+       "addAWorkerThread",
+       "addAccountType:className:",
+       "addAddress:",
+       "addAllowableSubprojectType:",
+       "addAnchor:",
+       "addApplet:",
+       "addAttribute:value:range:",
+       "addAttributedString:inRect:",
+       "addAttributes:range:",
+       "addAttributesWeakly:range:",
+       "addBaseFontToState:",
+       "addBccHeader:",
+       "addBefore",
+       "addBlockquote:",
+       "addBytesInRange:",
+       "addCaption",
+       "addCharactersInRange:",
+       "addCharactersInString:",
+       "addChild:",
+       "addChildren:",
+       "addChildrenConformingToProtocol:toArray:",
+       "addChildrenOfClass:toArray:",
+       "addChildrenWithName:toArray:",
+       "addClassNamed:version:",
+       "addClient:",
+       "addClip",
+       "addColumn",
+       "addColumnAfter:",
+       "addColumnAtIndex:",
+       "addColumnBefore:",
+       "addColumnWithCells:",
+       "addComment:",
+       "addCommon:docInfo:value:zone:",
+       "addConnection:toRunLoop:forMode:",
+       "addConversation:",
+       "addCooperatingObjectStore:",
+       "addCount",
+       "addCursorRect:cursor:",
+       "addCustomMarker:",
+       "addData:name:",
+       "addDatasFoundUnderNode:toArray:",
+       "addDirNamed:lazy:",
+       "addDivision:",
+       "addDocument:",
+       "addDrawerWithView:",
+       "addEMail:",
+       "addEditor:",
+       "addElement:",
+       "addEntriesFromDictionary:",
+       "addEntry:",
+       "addEntryNamed:forObject:",
+       "addEntryNamed:ofClass:",
+       "addEntryNamed:ofClass:atBlock:",
+       "addEvent:",
+       "addFace:",
+       "addFieldChanged:",
+       "addFile:",
+       "addFile:key:",
+       "addFileNamed:fileAttributes:",
+       "addFileToFront:key:",
+       "addFileWithPath:",
+       "addFileWrapper:",
+       "addFileWrappersForPaths:turnFoldersIntoLinks:",
+       "addFontTrait:",
+       "addForm:",
+       "addFormattingReturns:toRendering:withState:mergeableLength:",
+       "addH1:",
+       "addH2:",
+       "addH3:",
+       "addH4:",
+       "addH5:",
+       "addH6:",
+       "addHandle:withWeight:",
+       "addHeaders:",
+       "addHeading:",
+       "addHeartBeatView:",
+       "addHorizontalRule:",
+       "addIndex:",
+       "addIndexRange:",
+       "addInlineFrame:",
+       "addInvocationToQueue:",
+       "addItem:",
+       "addItemWithImage:andHelp:",
+       "addItemWithObjectValue:",
+       "addItemWithTitle:",
+       "addItemWithTitle:action:keyEquivalent:",
+       "addItemsConformingToProtocol:toArray:",
+       "addItemsOfClass:toArray:",
+       "addItemsWithName:toArray:",
+       "addItemsWithObjectValues:",
+       "addItemsWithTitles:",
+       "addJavaScript:",
+       "addLayoutManager:",
+       "addLeadingBlockCharactersForChild:toRendering:withState:",
+       "addLink:",
+       "addList:",
+       "addMarker:",
+       "addMenuItemToPopUp:",
+       "addMessage:",
+       "addMessage:index:ofTotal:",
+       "addMessage:withRange:",
+       "addMessageStoresInPath:toArray:",
+       "addMessageToAllMessages:",
+       "addNewColor:andShowInWell:",
+       "addNewRow:",
+       "addNewRowInTableView:",
+       "addNodeOverSelection:contentIfEmpty:",
+       "addObject:",
+       "addObject:toBothSidesOfRelationshipWithKey:",
+       "addObject:toPropertyWithKey:",
+       "addObject:withSorter:",
+       "addObjectIfAbsent:",
+       "addObjectIfAbsentAccordingToEquals:",
+       "addObjectUsingLock:",
+       "addObjectUsingLockIfAbsent:",
+       "addObjectUsingLockIfAbsentAccordingToEquals:",
+       "addObjectsFromArray:",
+       "addObjectsFromArrayUsingLock:",
+       "addObserver:",
+       "addObserver:forObject:",
+       "addObserver:selector:name:object:",
+       "addObserver:selector:name:object:flags:",
+       "addObserver:selector:name:object:suspensionBehavior:",
+       "addObserverInMainThread:selector:name:object:",
+       "addOmniscientObserver:",
+       "addOrderedList:",
+       "addPage",
+       "addParagraph:",
+       "addPath:",
+       "addPath:for:variant:as:",
+       "addPathToLibrarySearchPaths:",
+       "addPathsToArray:",
+       "addPort:forMode:",
+       "addPortsToAllRunLoops",
+       "addPortsToRunLoop:",
+       "addPreferenceNamed:owner:",
+       "addPreferencesModules",
+       "addPreformatted:",
+       "addQualifierKeysToSet:",
+       "addRecentAddresses:",
+       "addRegularFileWithContents:preferredFilename:",
+       "addReplyToHeader:",
+       "addRepresentation:",
+       "addRepresentations:",
+       "addRequestMode:",
+       "addRow",
+       "addRowAbove:",
+       "addRowAtIndex:",
+       "addRowBelow:",
+       "addRowWithCells:",
+       "addRows",
+       "addRowsCols:",
+       "addRowsFoundUnderNode:toArray:",
+       "addRunLoop:",
+       "addServiceProvider:",
+       "addSpan:",
+       "addSpecialGStateView:",
+       "addStatistics:",
+       "addStore:",
+       "addString:attributes:inRect:",
+       "addString:inRect:",
+       "addStyles:",
+       "addSubclassItemsToMenu:",
+       "addSubelementsFoundUnderNode:toArray:",
+       "addSubnode:",
+       "addSubview:",
+       "addSubview:positioned:relativeTo:",
+       "addSuccessfulControlsToArray:",
+       "addSuiteNamed:",
+       "addSymbolicLinkWithDestination:preferredFilename:",
+       "addSystemExtensions:",
+       "addTabStop:",
+       "addTabViewItem:",
+       "addTable:",
+       "addTableColumn:",
+       "addTemporaryAttributes:forCharacterRange:",
+       "addTextContainer:",
+       "addTextStyle:",
+       "addTextStyles:overChildRange:",
+       "addTimeInterval:",
+       "addTimer:forMode:",
+       "addTimerToModes",
+       "addToPageSetup",
+       "addToken:toStyleInfo:ofAttributedString:",
+       "addToolTipRect:owner:userData:",
+       "addTrackingRect:owner:userData:assumeInside:",
+       "addTrackingRectForToolTip:",
+       "addTrailingBlockCharactersForChild:toRendering:withState:contentLength:",
+       "addType:",
+       "addTypes:owner:",
+       "addUnorderedList:",
+       "addVBScript:",
+       "addVCard:",
+       "addWillDeactivate:",
+       "addWindowController:",
+       "addWindowsItem:title:filename:",
+       "addedChild:",
+       "address",
+       "addressArrayExcludingSelf",
+       "addressAtIndex:",
+       "addressBookOwning:",
+       "addressBookWithPath:andOptions:",
+       "addressBookWithURL:andOptions:",
+       "addressComment",
+       "addressList",
+       "addressListForHeader:",
+       "addressListForRange:",
+       "addressManager",
+       "addressManagerLoaded",
+       "addresses",
+       "adjustCTM:",
+       "adjustCellTextView:forFrame:preservingContinuity:",
+       "adjustControls:",
+       "adjustHalftonePhase",
+       "adjustOffsetToNextWordBoundaryInString:startingAt:",
+       "adjustPageHeightNew:top:bottom:limit:",
+       "adjustPageWidthNew:left:right:limit:",
+       "adjustScroll:",
+       "adjustSubviews",
+       "adjustToolBarToWindow:",
+       "adjustViewport",
+       "advancementForGlyph:",
+       "aeteResource:",
+       "afmDictionary",
+       "afmFileContents",
+       "aggregateEvents:bySignatureOfType:",
+       "aggregateExceptionWithExceptions:",
+       "aggregateKeys",
+       "alertUserWithMessage:forMailbox:",
+       "alertUserWithMessage:title:",
+       "alignCenter:",
+       "alignJustified:",
+       "alignLeft:",
+       "alignRight:",
+       "alignment",
+       "alignmentCouldBeEffectedByDescendant:",
+       "alignmentValueForAttribute:",
+       "allAddressBooks",
+       "allAttributeKeys",
+       "allBundles",
+       "allCenters",
+       "allConnections",
+       "allEmailAddressesIncludingFullUserName:",
+       "allEvents",
+       "allFrameworkDependencies",
+       "allFrameworks",
+       "allHeaderKeys",
+       "allKeys",
+       "allKeysForObject:",
+       "allLocalizedStringsForKey:",
+       "allMessageViewers",
+       "allMessages",
+       "allMessagesInSelectionAreDeleted",
+       "allMessagesInSelectionHaveBeenRemoved",
+       "allModes",
+       "allObjects",
+       "allProjectTypeTables",
+       "allPropertyKeys",
+       "allQualifierKeys",
+       "allQualifierOperators",
+       "allRenderingRootTextViews",
+       "allRenderingRoots",
+       "allRunLoopModes",
+       "allTheLanguageContextNamesInstalledOnTheSystem",
+       "allThreadsIdle",
+       "allToManyRelationshipKeys",
+       "allToOneRelationshipKeys",
+       "allValues",
+       "alloc",
+       "allocFromZone:",
+       "allocIndexInfo",
+       "allocWithZone:",
+       "allocateGState",
+       "allocateMoreTokens:",
+       "allowEmptySel:",
+       "allowableFileTypesForURL",
+       "allowableSubprojectTypes",
+       "allowableSuperprojectTypes",
+       "allowsAppend",
+       "allowsBranchSelection",
+       "allowsColumnReordering",
+       "allowsColumnResizing",
+       "allowsColumnSelection",
+       "allowsContinuedTracking",
+       "allowsEditingTextAttributes",
+       "allowsEmptySelection",
+       "allowsFloats",
+       "allowsIncrementalSearching",
+       "allowsIndexing",
+       "allowsKeyboardEditing",
+       "allowsMixedState",
+       "allowsMultipleSelection",
+       "allowsNaturalLanguage",
+       "allowsTickMarkValuesOnly",
+       "allowsTruncatedLabels",
+       "allowsUndo",
+       "alpha",
+       "alphaComponent",
+       "alphaControlAddedOrRemoved:",
+       "alphanumericCharacterSet",
+       "altIncrementValue",
+       "altModifySelection:",
+       "alternateAddressesForSelf",
+       "alternateImage",
+       "alternateMnemonic",
+       "alternateMnemonicLocation",
+       "alternateText",
+       "alternateTitle",
+       "alternativeAtIndex:",
+       "altersStateOfSelectedItem",
+       "alwaysKeepColumnsSizedToFitAvailableSpace",
+       "alwaysSelectsSelf",
+       "ancestor",
+       "ancestorSharedWithView:",
+       "anchorSwitchChanged:",
+       "animate:",
+       "animationDelay",
+       "annotateIndentation",
+       "annotateTagMatching",
+       "anyFontDataForUser:hasChangedSinceDate:",
+       "anyObject",
+       "apop:",
+       "appDidActivate:",
+       "appDidUpdate:",
+       "appHelpFileForOSType:",
+       "appIconFileForOSType:",
+       "appWillUpdate:",
+       "apparentSize",
+       "appendAddressList:",
+       "appendAddressList:forHeader:",
+       "appendAndQuoteString:",
+       "appendAttributeString:cachedString:",
+       "appendAttributedString:",
+       "appendBezierPath:",
+       "appendBezierPathWithArcFromPoint:toPoint:radius:",
+       "appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:",
+       "appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:clockwise:",
+       "appendBezierPathWithGlyph:inFont:",
+       "appendBezierPathWithGlyphs:count:inFont:",
+       "appendBezierPathWithOvalInRect:",
+       "appendBezierPathWithPackedGlyphs:",
+       "appendBezierPathWithPoints:count:",
+       "appendBezierPathWithRect:",
+       "appendBodyToData:",
+       "appendByte:",
+       "appendBytes:length:",
+       "appendCString:",
+       "appendCString:length:",
+       "appendCharacter:",
+       "appendCharacters:length:",
+       "appendCloseMarkerString:cachedString:",
+       "appendData:",
+       "appendData:toMailboxNamed:flags:",
+       "appendData:wrapAtColumn:escapeFrom:",
+       "appendEditingMarkOfColor:withText:andState:toRendering:",
+       "appendEditingMarkWithText:fillColor:textColor:shape:toRendering:withState:",
+       "appendEntityMarkOfLevel:withState:toRendering:",
+       "appendEpilogueMarkOfLevel:withState:toRendering:",
+       "appendFormat:",
+       "appendFromSpaceIfMissing",
+       "appendGeneratedChildren:cachedString:",
+       "appendGeneratedHTMLEquivalent:cachedString:",
+       "appendHTMLEquivalent:cachedString:",
+       "appendHeaderData:andRecipients:",
+       "appendHeadersToData:",
+       "appendHeadersToMessageHeaders:",
+       "appendLeadingCloseWhitespace:cachedString:",
+       "appendLeadingWhitespace:cachedString:",
+       "appendList:",
+       "appendMarkerString:cachedString:",
+       "appendMessageArray:",
+       "appendMessages:",
+       "appendMessages:unsuccessfulOnes:",
+       "appendPrologueMarkOfLevel:withState:toRendering:",
+       "appendRenderedChild:toRendering:withState:buildingMap:baseLocation:",
+       "appendRenderedChildrenWithState:toString:buildingMap:baseLocation:",
+       "appendRenderedHtmlEpilogueWithState:toRendering:",
+       "appendRenderedHtmlPrologueWithState:toRendering:",
+       "appendRenderedHtmlWithState:toRendering:",
+       "appendRenderedHtmlWithState:toRendering:buildingMap:",
+       "appendRenderingRootsToArray:",
+       "appendString:",
+       "appendTagMarkOfLevel:shape:text:withState:toRendering:",
+       "appendTextFindingRenderingToString:buildingMap:withBaseLocation:",
+       "appendTrailingCloseWhitespace:cachedString:",
+       "appendTrailingWhitespace:cachedString:",
+       "appendTransform:",
+       "appleDoubleDataWithFilename:length:",
+       "appleEventClassCode",
+       "appleEventCode",
+       "appleEventCodeForArgumentWithName:",
+       "appleEventCodeForKey:",
+       "appleEventCodeForReturnType",
+       "appleEventCodeForSuite:",
+       "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:",
+       "appleSingleDataWithFilename:length:",
+       "appletClassName",
+       "appletImage",
+       "application:delegateHandlesKey:",
+       "application:openFile:",
+       "application:openFileWithoutUI:",
+       "application:openTempFile:",
+       "application:printFile:",
+       "application:receivedEvent:dequeuedEvent:",
+       "applicationClass",
+       "applicationDelegateHandlesKey::",
+       "applicationDidBecomeActive:",
+       "applicationDidChangeScreenParameters:",
+       "applicationDidFinishLaunching:",
+       "applicationDidHide:",
+       "applicationDidResignActive:",
+       "applicationDidUnhide:",
+       "applicationDidUpdate:",
+       "applicationIcon",
+       "applicationIconImage",
+       "applicationLaunched:handle:",
+       "applicationName",
+       "applicationOpenUntitledFile:",
+       "applicationQuit:handle:",
+       "applicationShouldHandleReopen:hasVisibleWindows:",
+       "applicationShouldOpenUntitledFile:",
+       "applicationShouldTerminate:",
+       "applicationShouldTerminateAfterLastWindowClosed:",
+       "applicationWillBecomeActive:",
+       "applicationWillFinishLaunching:",
+       "applicationWillHide:",
+       "applicationWillResignActive:",
+       "applicationWillTerminate:",
+       "applicationWillUnhide:",
+       "applicationWillUpdate:",
+       "apply:",
+       "apply:context:",
+       "applyChangedArray:old:addSelector:removeSelector:",
+       "applyFace:",
+       "applyFontTraits:range:",
+       "applyTextStyleToSelection:",
+       "approximateBackgroundColor",
+       "approximateBytesRepresented",
+       "approximateItem",
+       "approximateObjectCount",
+       "archList",
+       "archive",
+       "archiveButtonImageSourceWithName:toDirectory:",
+       "archiveCount:andPostings:ofType:",
+       "archiveMailboxPath",
+       "archiveMailboxSelected:",
+       "archiveNameForEncoding:",
+       "archiveRootObject:toFile:",
+       "archiveStorePath",
+       "archivedDataWithRootObject:",
+       "archiver:referenceToEncodeForObject:",
+       "archiverData",
+       "areAllContextsOutputTraced",
+       "areAllContextsSynchronized",
+       "areCursorRectsEnabled",
+       "areEventsTraced",
+       "areExceptionsEnabled",
+       "areThereAnyUnreadMessagesInItem:",
+       "areTransactionsEnabled",
+       "argumentNames",
+       "arguments",
+       "argumentsRetained",
+       "arrangeInFront:",
+       "array",
+       "arrayByAddingObject:",
+       "arrayByAddingObjects:count:",
+       "arrayByAddingObjectsFromArray:",
+       "arrayByApplyingSelector:",
+       "arrayByExcludingIdenticalObjectsInArray:",
+       "arrayByExcludingObjectsInArray:",
+       "arrayByExcludingObjectsInArray:identical:",
+       "arrayByExcludingToObjectsInArray:",
+       "arrayByInsertingObject:atIndex:",
+       "arrayByIntersectingWithArray:",
+       "arrayByRemovingFirstObject",
+       "arrayByRemovingLastObject",
+       "arrayByRemovingObject:",
+       "arrayByRemovingObjectAtIndex:",
+       "arrayByReplacingObjectAtIndex:withObject:",
+       "arrayBySubtractingArray:",
+       "arrayClass",
+       "arrayExcludingObjectsInArray:",
+       "arrayFaultWithSourceGlobalID:relationshipName:editingContext:",
+       "arrayForKey:",
+       "arrayWithArray:",
+       "arrayWithArray:copyItems:",
+       "arrayWithCapacity:",
+       "arrayWithContentsOfFile:",
+       "arrayWithContentsOfURL:",
+       "arrayWithObject:",
+       "arrayWithObjects:",
+       "arrayWithObjects:count:",
+       "arrayWithObjectsNotInArray:",
+       "arrayWithValuesForKey:",
+       "arrowCursor",
+       "arrowPosition",
+       "arrowsPosition",
+       "ascender",
+       "asciiWhitespaceSet",
+       "askForReadReceipt",
+       "askToSave:",
+       "askUserAboutEditingPreferenceWithKey:",
+       "aspectRatio",
+       "assignGloballyUniqueBytes:",
+       "asyncInvokeServiceIn:msg:pb:userData:menu:remoteServices:unhide:",
+       "attachColorList:",
+       "attachPopUpWithFrame:inView:",
+       "attachSubmenuForItemAtIndex:",
+       "attachToHTMLView:",
+       "attachedMenu",
+       "attachedMenuView",
+       "attachedView",
+       "attachment",
+       "attachmentCell",
+       "attachmentCell:doubleClickEvent:inTextView:withFrame:",
+       "attachmentCell:singleClickEvent:inTextView:withFrame:",
+       "attachmentCell:willFloatToMargin:withSize:lineFragment:characterIndex:",
+       "attachmentCellForLineBreak:",
+       "attachmentCellWithHorizontalRule:",
+       "attachmentCellWithText:fillColor:textColor:shape:representedItem:",
+       "attachmentCellWithVCard:",
+       "attachmentCharacterRange",
+       "attachmentDirectory",
+       "attachmentFilename",
+       "attachmentForWindowLocation:givenOrigin:frame:",
+       "attachmentName",
+       "attachmentPathForFileWrapper:directory:",
+       "attachmentSizeForGlyphAtIndex:",
+       "attachmentViewChangedFrame:",
+       "attachments",
+       "attemptBackgroundDelivery",
+       "attemptOverwrite:",
+       "attribute:atIndex:effectiveRange:",
+       "attribute:atIndex:longestEffectiveRange:inRange:",
+       "attribute:forTagString:",
+       "attributeDescriptorForKeyword:",
+       "attributeForKey:",
+       "attributeKeys",
+       "attributePostSetIsSafe",
+       "attributeRuns",
+       "attributeStart",
+       "attributeString",
+       "attributeStringValue",
+       "attributedAlternateTitle",
+       "attributedString",
+       "attributedStringByWeaklyAddingAttributes:",
+       "attributedStringForImageNamed:selectedImageNamed:withRepresentedObject:sender:makingCell:",
+       "attributedStringForImageNamed:withRepresentedObject:sender:makingCell:",
+       "attributedStringForNil",
+       "attributedStringForNotANumber",
+       "attributedStringForObjectValue:withDefaultAttributes:",
+       "attributedStringForSelection",
+       "attributedStringForZero",
+       "attributedStringFromMimeEnrichedString:",
+       "attributedStringFromMimeRichTextString:",
+       "attributedStringIsReady:",
+       "attributedStringShowingAllHeaders:",
+       "attributedStringToEndOfGroup",
+       "attributedStringValue",
+       "attributedStringWithAttachment:",
+       "attributedStringWithContentsOfFile:showingEditingCharacters:",
+       "attributedStringWithHTML:documentAttributes:",
+       "attributedSubstringForMarkedRange",
+       "attributedSubstringFromRange:",
+       "attributedTitle",
+       "attributes",
+       "attributesAtEndOfGroup",
+       "attributesAtIndex:effectiveRange:",
+       "attributesAtIndex:longestEffectiveRange:inRange:",
+       "attributesIndex",
+       "attributesWithStat:",
+       "authenticateAsUser:password:",
+       "authenticateComponents:withData:",
+       "authenticateWithDelegate:",
+       "authenticationDataForComponents:",
+       "autoAlternative",
+       "autoFetchMail:",
+       "autoPositionMask",
+       "autoResizesOutlineColumn",
+       "autoenablesItems",
+       "autorelease",
+       "autoreleasePoolExists",
+       "autoreleasedObjectCount",
+       "autoresizesAllColumnsToFit",
+       "autoresizesOutlineColumn",
+       "autoresizesSubviews",
+       "autoresizingMask",
+       "autosaveExpandedItems",
+       "autosaveName",
+       "autosaveTableColumns",
+       "autoscroll:",
+       "autosizesCells",
+       "availableCollatorElements",
+       "availableCollators",
+       "availableColorLists",
+       "availableData",
+       "availableFontFamilies",
+       "availableFontNamesWithTraits:",
+       "availableFonts",
+       "availableLanguageContextNames",
+       "availableLanguageNames",
+       "availableMembersOfFontFamily:",
+       "availableMessagesUsingUIDL",
+       "availablePPDTypeFiles",
+       "availableResourceData",
+       "availableStringEncodings",
+       "availableTypeFromArray:",
+       "awaitReturnValues",
+       "awake",
+       "awakeAfterUsingCoder:",
+       "awakeFromFetchInEditingContext:",
+       "awakeFromInsertionInEditingContext:",
+       "awakeFromKeyValueUnarchiver:",
+       "awakeFromNib",
+       "awakeObject:fromFetchInEditingContext:",
+       "awakeObject:fromInsertionInEditingContext:",
+       "awakeObjects",
+       "awakeWithDocument:",
+       "awakeWithPropertyList:",
+       "backClicked:",
+       "backgroundChanged",
+       "backgroundCheckboxAction:",
+       "backgroundColor",
+       "backgroundColorForCell:",
+       "backgroundColorString",
+       "backgroundDidChange",
+       "backgroundFetchFailed:",
+       "backgroundGray",
+       "backgroundImage",
+       "backgroundImageUrl",
+       "backgroundImageUrlString",
+       "backgroundLayoutEnabled",
+       "backgroundLoadDidFailWithReason:",
+       "backgroundWellAction:",
+       "backingType",
+       "base",
+       "baseAffineTransform",
+       "baseFontSizeLevel",
+       "baseOfTypesetterGlyphInfo",
+       "baseSpecifier",
+       "baseURL",
+       "baselineLocation",
+       "baselineOffset",
+       "baselineOffsetInLayoutManager:glyphIndex:",
+       "bccRecipients",
+       "becomeFirstResponder",
+       "becomeKeyWindow",
+       "becomeMainWindow",
+       "becomeMultiThreaded:",
+       "becomeSingleThreaded:",
+       "becomesKeyOnlyIfNeeded",
+       "beginAttribute:withValue:",
+       "beginDeepHTMLChange",
+       "beginDocument",
+       "beginDocumentWithTitle:",
+       "beginDraggingCell:fromIndex:toMinIndex:maxIndex:",
+       "beginEditing",
+       "beginEnum",
+       "beginEventCoalescing",
+       "beginHTMLChange",
+       "beginLoadInBackground",
+       "beginModalSessionForWindow:",
+       "beginModalSessionForWindow:relativeToWindow:",
+       "beginPage:",
+       "beginPage:label:bBox:fonts:",
+       "beginPageInRect:atPlacement:",
+       "beginPageSetupRect:placement:",
+       "beginPrologueBBox:creationDate:createdBy:fonts:forWhom:pages:title:",
+       "beginRtfParam",
+       "beginSetup",
+       "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:",
+       "beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:",
+       "beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:",
+       "beginTrailer",
+       "beginTransaction",
+       "beginUndoGrouping",
+       "bestMIMEStringEncoding",
+       "bestRepresentationForDevice:",
+       "betterImageNamed:",
+       "betterScanUpToCharactersFromSet:intoString:",
+       "betterScanUpToString:intoString:",
+       "betterSizeToFit",
+       "bezelStyle",
+       "bezelStyleForState:",
+       "bezierPath",
+       "bezierPathByFlatteningPath",
+       "bezierPathByReversingPath",
+       "bezierPathWithOvalInRect:",
+       "bezierPathWithRect:",
+       "bigMessageWarningSize",
+       "bigger:",
+       "binaryCollator",
+       "bindObjectsWithFetchSpecification:toName:",
+       "bindWithUsername:password:",
+       "binding",
+       "bindingKeys",
+       "birthDate",
+       "bitmapData",
+       "bitmapDataPlanes",
+       "bitmapImage",
+       "bitmapRepresentation",
+       "bitsPerPixel",
+       "bitsPerSample",
+       "bkgdCheckboxAction:",
+       "blackColor",
+       "blackComponent",
+       "blendedColorWithFraction:ofColor:",
+       "blockExists:",
+       "blueColor",
+       "blueComponent",
+       "blueControlTintColor",
+       "bodyClassForMessageEncoding:",
+       "bodyData",
+       "bodyDataForMessage:",
+       "bodyForMessage:",
+       "bodyPartFromAttributedString:",
+       "bodyPartWithData:",
+       "bodyParts",
+       "bodyWasDecoded:forMessage:",
+       "bodyWasEncoded:forMessage:",
+       "bodyWillBeDecoded:forMessage:",
+       "bodyWillBeEncoded:forMessage:",
+       "bodyWillBeForwarded:forMessage:",
+       "boldSystemFontOfSize:",
+       "boolForKey:",
+       "boolValue",
+       "boolValueForKey:default:",
+       "booleanForKey:inTable:",
+       "booleanValueForAttribute:",
+       "border",
+       "borderAction:",
+       "borderColor",
+       "borderColorForCell:",
+       "borderRect",
+       "borderSize",
+       "borderTextfieldAction:",
+       "borderType",
+       "borderWidth",
+       "bottomMargin",
+       "boundingBox",
+       "boundingRectForFont",
+       "boundingRectForGlyph:",
+       "boundingRectForGlyphRange:inTextContainer:",
+       "bounds",
+       "boundsForButtonCell:",
+       "boundsForTextCell:",
+       "boundsRotation",
+       "boxType",
+       "branchImage",
+       "breakClear",
+       "breakLineAtIndex:",
+       "breakLock",
+       "brightColor",
+       "brightnessComponent",
+       "brightnessSlider:",
+       "bringUpGetNewMailMenu:",
+       "bringUpTransferMenu:",
+       "broadcast",
+       "brownColor",
+       "browser:createRowsForColumn:inMatrix:",
+       "browser:isColumnValid:",
+       "browser:numberOfRowsInColumn:",
+       "browser:selectCellWithString:inColumn:",
+       "browser:selectRow:inColumn:",
+       "browser:titleOfColumn:",
+       "browser:willDisplayCell:atRow:column:",
+       "browserDidScroll:",
+       "browserMayDeferScript",
+       "browserWillScroll:",
+       "btree",
+       "bufferIsEmpty",
+       "buildAlertStyle:title:message:first:second:third:args:",
+       "buildControls",
+       "buildDir",
+       "buildParamsArray",
+       "buildPathsForSubComponentForProject:",
+       "buildTargets",
+       "builderForClass:",
+       "builderForObject:",
+       "builtInPlugInsPath",
+       "bulletString",
+       "bulletStringForListItem:",
+       "bundleExtension",
+       "bundleForClass:",
+       "bundleForSuite:",
+       "bundleIdentifier",
+       "bundleLanguages",
+       "bundleObject",
+       "bundlePath",
+       "bundleWithIdentifier:",
+       "bundleWithPath:",
+       "buttonAtIndex:",
+       "buttonCount",
+       "buttonEnableNotification:",
+       "buttonImageSourceWithName:",
+       "buttonPressed:",
+       "buttonSize",
+       "buttonWidthForCount:",
+       "buttonWithName:",
+       "buttonWithTag:",
+       "byteAtScanLocation",
+       "byteIsMember:",
+       "bytes",
+       "bytesPerPlane",
+       "bytesPerRow",
+       "cString",
+       "cStringLength",
+       "cacheCell:inRect:flipped:",
+       "cacheDepthMatchesImageDepth",
+       "cacheImageInRect:",
+       "cacheImages:fromBundle:",
+       "cacheMiniwindowTitle:guess:",
+       "cachePolicy",
+       "cachePolicyChanged:",
+       "cachedCellSize",
+       "cachedData",
+       "cachedDataSize",
+       "cachedHandleForURL:",
+       "cachedHeadersAtIndex:",
+       "cachedImageForURL:client:",
+       "cachedImageForURL:loadIfAbsent:",
+       "cachedLeftTabStopForLocation:",
+       "cachesBezierPath",
+       "calcDrawInfo:",
+       "calcFrameSizes",
+       "calcSize",
+       "calendarDate",
+       "calendarFormat",
+       "canAddNewRowInTableView:",
+       "canAppendMessages",
+       "canBeCancelled",
+       "canBeCompressedUsing:",
+       "canBeConvertedToEncoding:",
+       "canBeDisabled",
+       "canBePended",
+       "canBecomeKeyWindow",
+       "canBecomeMainWindow",
+       "canChangeDimension:",
+       "canChangeWidth:",
+       "canChooseDirectories",
+       "canChooseFiles",
+       "canCloseDocument",
+       "canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:",
+       "canCompact",
+       "canConnectFrame",
+       "canConvertToBMPRepresentation",
+       "canCreateNewFile:inProject:forKey:",
+       "canCreateNewMailboxes",
+       "canDelete",
+       "canDeleteSelectedRowInTableView:",
+       "canDraw",
+       "canDrawerExtendToEdge:",
+       "canEverAddNewRowInTableView:",
+       "canEverDeleteSelectedRowInTableView:",
+       "canGoOffline",
+       "canImportData:",
+       "canInitWithData:",
+       "canInitWithPasteboard:",
+       "canInitWithURL:",
+       "canProduceExecutableForProject:",
+       "canProvideDataFrom:",
+       "canRebuild",
+       "canRedo",
+       "canSelectNextMessage",
+       "canSelectPreviousMessage",
+       "canSetTitle",
+       "canStoreColor",
+       "canUndo",
+       "canUseAppKit",
+       "canWriteToDirectoryAtPath:",
+       "canWriteToFileAtPath:",
+       "cancel",
+       "cancel:",
+       "cancelButtonClicked:",
+       "cancelClicked:",
+       "cancelEvent:",
+       "cancelInput:conversation:",
+       "cancelLoadInBackground",
+       "cancelPerformSelector:target:argument:",
+       "cancelPreviousPerformRequestsWithTarget:selector:object:",
+       "canonicalFaceArrayFromCanonicalFaceString:",
+       "canonicalFaceArrayFromFaceString:",
+       "canonicalFaceStringFromCanonicalFaceArray:",
+       "canonicalFaceStringFromFaceString:",
+       "canonicalFile",
+       "canonicalFileToProjectDictionary",
+       "canonicalHTTPURLForURL:",
+       "canonicalHomeDirectory",
+       "canonicalPath:",
+       "canonicalString",
+       "capHeight",
+       "capabilities",
+       "capacity",
+       "capacityOfTypesetterGlyphInfo",
+       "capitalizeSelfWithLocale:",
+       "capitalizeWord:",
+       "capitalizedString",
+       "capitalizedStringWithLanguage:",
+       "caption",
+       "captionCheckboxAction:",
+       "captionHeight",
+       "captionRadioAction:",
+       "captionedCheckboxAction:",
+       "cardAtIndex:",
+       "cardCountOfMostRecentTemporaryBook",
+       "cardReferenceAtIndex:",
+       "cascadeTopLeftFromPoint:",
+       "caseConversionFlags",
+       "caseInsensitiveCompare:",
+       "caseInsensitiveLike:",
+       "caseSensitive",
+       "catalogNameComponent",
+       "categoryName",
+       "ccRecipients",
+       "cell",
+       "cellAction:",
+       "cellAtIndex:",
+       "cellAtRow:column:",
+       "cellAttribute:",
+       "cellBackgroundColor",
+       "cellBaselineOffset",
+       "cellChanged",
+       "cellClass",
+       "cellEditingIvarsCreateIfAbsent",
+       "cellEditingIvarsNullIfAbsent",
+       "cellEditingIvarsRaiseIfAbsent",
+       "cellForItemAtIndex:",
+       "cellFrameAtRow:column:",
+       "cellFrameForProposedLineFragment:glyphPosition:characterIndex:",
+       "cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:",
+       "cellMaximumSize",
+       "cellMinimumSize",
+       "cellPadding",
+       "cellPreviousToCell:requiringContent:",
+       "cellPrototype",
+       "cellSelected:",
+       "cellSize",
+       "cellSizeForBounds:",
+       "cellSizeWithTextContainerWidth:",
+       "cellSizeWithTextContainerWidth:forLockState:",
+       "cellSpacing",
+       "cellSubsequentToCell:requiringContent:",
+       "cellTextAlignment",
+       "cellTextViewWithFrame:",
+       "cellWithRepresentedObject:",
+       "cellWithTag:",
+       "cells",
+       "cellsForSelection:",
+       "center",
+       "center:didAddObserver:name:object:",
+       "center:didRemoveObserver:name:object:",
+       "centerScanRect:",
+       "centerSelectionInVisibleArea:",
+       "centerTabMarkerWithRulerView:location:",
+       "chainChildContext:",
+       "changeAddressHeader:",
+       "changeAlignment:",
+       "changeBackgroundColor:",
+       "changeCase:",
+       "changeCaseOfLetter:",
+       "changeColor:",
+       "changeCount",
+       "changeCurrentDirectoryPath:",
+       "changeDimension:toType:",
+       "changeDocFont:",
+       "changeFetchRemoteURLs:",
+       "changeFileAttributes:atPath:",
+       "changeFixedFont:",
+       "changeFont:",
+       "changeFontColor:",
+       "changeFontFace:",
+       "changeFontSize:",
+       "changeFontStyle:",
+       "changeFontTrait:",
+       "changeFromHeader:",
+       "changeHeaderField:",
+       "changeHeaderSize:",
+       "changeHighlightChanges:",
+       "changeInLength",
+       "changeIndent:",
+       "changeInspectorFloats:",
+       "changeMailboxLocation:",
+       "changeMode:",
+       "changePasteMenuItem:toHaveTitle:",
+       "changePlainTextFont:",
+       "changePopup:",
+       "changePreserveWhitespaceRadio:",
+       "changePrettyPrint:",
+       "changeRawFont:",
+       "changeReplyMode:",
+       "changeRichTextFont:",
+       "changeSaveType:",
+       "changeSpelling:",
+       "changeTo:",
+       "changeToMouseTrackingWindow",
+       "changeToType:",
+       "changeUndoLevels:",
+       "changeUseSyntaxColoring:",
+       "changeWidth:ofSubelement:toType:",
+       "changeWillBeUndone:",
+       "changeWindowsItem:title:filename:",
+       "changedShowAllOtherTags:",
+       "changedShowAppletTags:",
+       "changedShowBlackOnWhite:",
+       "changedShowBreakTags:",
+       "changedShowComments:",
+       "changedShowFrameTags:",
+       "changedShowImageTags:",
+       "changedShowNonbreakingSpaces:",
+       "changedShowParagraphTags:",
+       "changedShowPlaceholders:",
+       "changedShowScript:",
+       "changedShowSpaces:",
+       "changedShowTableTags:",
+       "changedShowTopLevelTags:",
+       "changedValuesInDictionary:withKeys:",
+       "changedWhileFrozen",
+       "changesFromSnapshot:",
+       "charValue",
+       "character:hasNumericProperty:",
+       "character:hasProperty:",
+       "characterAtIndex:",
+       "characterIndexForGlyphAtIndex:",
+       "characterIndexForPoint:",
+       "characterIsMember:",
+       "characterRangeForGlyphRange:actualGlyphRange:",
+       "characterSetCoveredByFont:language:",
+       "characterSetWithBitmapRepresentation:",
+       "characterSetWithCharactersInString:",
+       "characterSetWithContentsOfFile:",
+       "characterSetWithName:",
+       "characterSetWithRange:",
+       "characters",
+       "charactersIgnoringModifiers",
+       "charactersToBeSkipped",
+       "cheapStoreAtPathIsEmpty:",
+       "checkDictionary",
+       "checkForMessageClear:",
+       "checkForRemovableMedia",
+       "checkIntegrity",
+       "checkNewMail:",
+       "checkRendering",
+       "checkSpaceForParts",
+       "checkSpelling:",
+       "checkSpellingOfString:startingAt:",
+       "checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:",
+       "checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:reconnectOnError:",
+       "checkWhitespacePreservation",
+       "checkWhitespacePreservationWithCache:",
+       "checked",
+       "childAtIndex:",
+       "childConformingToProtocol:afterItem:",
+       "childConformingToProtocol:beforeItem:",
+       "childContext",
+       "childMailboxPathsAtPath:",
+       "childOfClass:afterItem:",
+       "childOfClass:beforeItem:",
+       "childRespondingToSelector:afterItem:",
+       "childRespondingToSelector:beforeItem:",
+       "childSpecifier",
+       "childString",
+       "childWidthsInvalid",
+       "childWithName:",
+       "children",
+       "childrenForItem:",
+       "childrenOf:",
+       "chooseImage:",
+       "choosePrinter",
+       "claimRangeFrom:to:",
+       "class",
+       "classCode",
+       "classDelegate",
+       "classDescription",
+       "classDescriptionForClass:",
+       "classDescriptionForDestinationKey:",
+       "classDescriptionForEntityName:",
+       "classDescriptionForKey:",
+       "classDescriptionForKeyPath:",
+       "classDescriptionForObjects",
+       "classDescriptionWithAppleEventCode:",
+       "classDescriptionsInSuite:",
+       "classForArchiver",
+       "classForCoder",
+       "classForFault:",
+       "classForPortCoder",
+       "classInspectorClassName",
+       "className",
+       "classNameDecodedForArchiveClassName:",
+       "classNameEncodedForTrueClassName:",
+       "classNamed:",
+       "classOfObjectsInNestedHomogeneousArray:",
+       "classPropertyKeys",
+       "classTerminologyDictionary:",
+       "cleanUpAfterDragOperation",
+       "cleanUpOperation",
+       "cleanedUpPath:",
+       "clear",
+       "clear:",
+       "clearAsMainCarbonMenuBar",
+       "clearAttributesCache",
+       "clearBackingStore",
+       "clearCaches",
+       "clearColor",
+       "clearControlTintColor",
+       "clearConversationRequest",
+       "clearCurrentContext",
+       "clearDirtyFlag:",
+       "clearDisciplineLevels",
+       "clearDrawable",
+       "clearFault:",
+       "clearGLContext",
+       "clearGlyphCache",
+       "clearImageCache",
+       "clearMarkedRange",
+       "clearMessageNow",
+       "clearOriginalSnapshotForObject:",
+       "clearProperties",
+       "clearRecentDocuments:",
+       "clearSizeCache",
+       "clearTexture",
+       "clearTooltipTrackingRects",
+       "clearwhite:",
+       "click:inFrame:notifyingHTMLView:orTextView:",
+       "clickCount",
+       "clickToolbarButton:",
+       "clickedColumn",
+       "clickedOnCell:inRect:",
+       "clickedOnLink:atIndex:",
+       "clickedRow",
+       "client",
+       "clientSideImageMapName",
+       "clientView",
+       "clientWrapperWithRealClient:",
+       "clip:",
+       "clipRect:",
+       "clipViewChangedBounds:",
+       "close",
+       "close:",
+       "closeAllDocuments",
+       "closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:",
+       "closeAppleScriptConnection",
+       "closeBlock:",
+       "closeButton",
+       "closeConfirmSheetDidEnd:returnCode:forSave:",
+       "closeFile",
+       "closeIndexAndRemoveFile:",
+       "closePath",
+       "closeRegion:ofLength:",
+       "closeSocket",
+       "closeSpellDocumentWithTag:",
+       "closeTokenRange",
+       "closeWidgetInView:withButtonID:action:",
+       "closestMatchingIndexesLessThan:selectFirstOnNoMatch:",
+       "closestTickMarkValueToValue:",
+       "coalesceAffectedRange:replacementRange:selectedRange:text:",
+       "coalesceChildren",
+       "coalesceInTextView:affectedRange:replacementRange:",
+       "codeSegment",
+       "coerceArray:toColor:",
+       "coerceColor:toArray:",
+       "coerceColor:toData:",
+       "coerceColor:toString:",
+       "coerceData:toColor:",
+       "coerceData:toTextStorage:",
+       "coerceString:toColor:",
+       "coerceString:toTextStorage:",
+       "coerceTextStorage:toData:",
+       "coerceTextStorage:toString:",
+       "coerceToDescriptorType:",
+       "coerceValue:forKey:",
+       "coerceValue:toClass:",
+       "coerceValueForTextStorage:",
+       "collapseItem:",
+       "collapseItem:collapseChildren:",
+       "collapseItemEqualTo:collapseChildren:",
+       "collator:",
+       "collatorElementWithName:",
+       "collatorWithName:",
+       "collectResources",
+       "color",
+       "colorDarkenedByFactor:",
+       "colorForControlTint:",
+       "colorForHTMLAttributeValue:",
+       "colorForLevel:",
+       "colorFromPasteboard:",
+       "colorFromPoint:",
+       "colorListChanged:",
+       "colorListNamed:",
+       "colorMask",
+       "colorNameComponent",
+       "colorPanel",
+       "colorPanelColorChanged:",
+       "colorSpace",
+       "colorSpaceDataForProfileData:",
+       "colorSpaceName",
+       "colorString",
+       "colorTable",
+       "colorToString",
+       "colorUsingColorSpaceName:",
+       "colorUsingColorSpaceName:device:",
+       "colorWithAlphaComponent:",
+       "colorWithCalibratedHue:saturation:brightness:alpha:",
+       "colorWithCalibratedRed:green:blue:alpha:",
+       "colorWithCalibratedWhite:alpha:",
+       "colorWithCatalogName:colorName:",
+       "colorWithDeviceCyan:magenta:yellow:black:alpha:",
+       "colorWithDeviceHue:saturation:brightness:alpha:",
+       "colorWithDeviceRed:green:blue:alpha:",
+       "colorWithDeviceWhite:alpha:",
+       "colorWithKey:",
+       "colorWithPatternImage:",
+       "colorize",
+       "colorizeByMappingGray:toColor:blackMapping:whiteMapping:",
+       "colorizeIncomingMail",
+       "colorizeTokensInRange:ofAttributedString:withSelection:dirtyOnly:",
+       "colorizeUsingIndexEntries",
+       "colsString",
+       "colsTextfieldAction:",
+       "columnAtPoint:",
+       "columnCount",
+       "columnKeyToSortOrder:",
+       "columnOfMatrix:",
+       "columnSpan",
+       "columnWithIdentifier:",
+       "columnsInRect:",
+       "combineWithTextStyle:",
+       "combinedFamilyNames",
+       "comboBox:completedString:",
+       "comboBox:indexOfItemWithStringValue:",
+       "comboBox:objectValueForItemAtIndex:",
+       "comboBoxCell:completedString:",
+       "comboBoxCell:indexOfItemWithStringValue:",
+       "comboBoxCell:objectValueForItemAtIndex:",
+       "comboBoxCellSelectionDidChange:",
+       "comboBoxCellSelectionIsChanging:",
+       "comboBoxCellTextDidChange:",
+       "comboBoxCellWillDismiss:",
+       "comboBoxCellWillPopUp:",
+       "comboBoxTextDidEndEditing:",
+       "commandClassName",
+       "commandDescription",
+       "commandDescriptionWithAppleEventClass:andAppleEventCode:",
+       "commandDescriptionsInSuite:",
+       "commandLineArguments",
+       "commandName",
+       "commandTerminologyDictionary:",
+       "comment",
+       "commentDidChange:",
+       "commitChanges",
+       "commitDisplayedValues",
+       "commitRegion:ofLength:",
+       "commitTransaction",
+       "committedSnapshotForObject:",
+       "commonPrefixWithString:options:",
+       "compact",
+       "compactMailbox:",
+       "compactWhenClosingMailboxes",
+       "compactWhiteSpace",
+       "compactWhiteSpaceUpdatingRanges:",
+       "compactWithTimeout:",
+       "compare:",
+       "compare:options:",
+       "compare:options:range:",
+       "compare:options:range:locale:",
+       "compareAsIntegers:",
+       "compareAscending:",
+       "compareCaseInsensitiveAscending:",
+       "compareCaseInsensitiveDescending:",
+       "compareDescending:",
+       "compareGeometry:",
+       "compareSelector",
+       "comparisonFormat",
+       "compileScript",
+       "compilerForLanguage:OSType:",
+       "compilerLanguages",
+       "compilerNamed:",
+       "compilers",
+       "compilersForLanguage:andOSType:",
+       "complete:",
+       "completeInitWithRepresentedItem:",
+       "completeInitWithTextController:",
+       "completeInitializationOfObject:",
+       "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:",
+       "completeString:",
+       "completedString:",
+       "completes",
+       "completionEnabled",
+       "componentMessageFlagsChanged:",
+       "componentStoreStructureChanged:",
+       "components",
+       "componentsJoinedByData:",
+       "componentsJoinedByString:",
+       "componentsSeparatedByData:",
+       "componentsSeparatedByString:",
+       "composeAccessoryView",
+       "composeAccessoryViewNibName",
+       "composeAccessoryViewOwner",
+       "composeAccessoryViewOwnerClassName",
+       "composeAccessoryViewOwners",
+       "composeMessages",
+       "compositeToPoint:fromRect:operation:",
+       "compositeToPoint:fromRect:operation:fraction:",
+       "compositeToPoint:operation:",
+       "compositeToPoint:operation:fraction:",
+       "compressCommand",
+       "computeAvgForKey:",
+       "computeCountForKey:",
+       "computeMaxForKey:",
+       "computeMinForKey:",
+       "computeSourceTreeForProject:executableProject:",
+       "computeSumForKey:",
+       "concat",
+       "concat:",
+       "concludeDragOperation:",
+       "condition",
+       "configureAsServer",
+       "configureBrowserCell:",
+       "configureInitialText:",
+       "configurePerformanceLoggingDefaults",
+       "configurePopUpButton:usingSignatures:defaultSignature:selectionMethod:",
+       "confirmCloseSheetIsDone:returnCode:contextInfo:",
+       "conflictsDirectlyWithTextStyle:",
+       "conflictsIndirectlyWithTextStyle:",
+       "conformsTo:",
+       "conformsToProtocol:",
+       "conformsToProtocol:forFault:",
+       "connectAllAccounts",
+       "connectAllAccounts:",
+       "connectAndAuthenticate:",
+       "connectThisAccount:",
+       "connectToHost:",
+       "connectToHost:port:",
+       "connectToHost:withPort:protocol:",
+       "connectToHost:withService:orPort:protocol:",
+       "connectToHost:withService:protocol:",
+       "connectToServer",
+       "connectToServer:port:",
+       "connection",
+       "connection:didRetrieveMessageNumber:",
+       "connection:handleRequest:",
+       "connection:receivedNumberOfBytes:",
+       "connection:shouldMakeNewConnection:",
+       "connection:willRetrieveMessageNumber:header:size:",
+       "connectionForProxy",
+       "connectionInformationDidChange",
+       "connectionState",
+       "connectionToUseForAppend",
+       "connectionWasDisconnected",
+       "connectionWithHost:",
+       "connectionWithHosts:",
+       "connectionWithReceivePort:sendPort:",
+       "connectionWithRegisteredName:host:",
+       "connectionWithRegisteredName:host:usingNameServer:",
+       "connections",
+       "connectionsCount",
+       "constrainFrameRect:toScreen:",
+       "constrainResizeEdge:withDelta:elapsedTime:",
+       "constrainScrollPoint:",
+       "constructTable",
+       "containedByItem:",
+       "container",
+       "containerClassDescription",
+       "containerIsObjectBeingTested",
+       "containerIsRangeContainerObject",
+       "containerRangeForTextRange:",
+       "containerSize",
+       "containerSpecifier",
+       "containingItemOfClass:",
+       "contains:",
+       "containsArchitecture:",
+       "containsArray:",
+       "containsAttachments",
+       "containsChildOfClass:besidesItem:",
+       "containsData",
+       "containsDictionary:",
+       "containsFile:",
+       "containsIndex:",
+       "containsItem:",
+       "containsKey:",
+       "containsLocation:inFrame:",
+       "containsMailboxes",
+       "containsObject:",
+       "containsObject:inRange:",
+       "containsObjectIdenticalTo:",
+       "containsObjectsNotIdenticalTo:",
+       "containsOnlyWhiteSpaceAndNewLines",
+       "containsPath:",
+       "containsPoint:",
+       "containsPort:forMode:",
+       "containsRichText",
+       "containsTimer:forMode:",
+       "content",
+       "contentAlpha",
+       "contentColor",
+       "contentDidChange:",
+       "contentFill",
+       "contentFrameForData:givenFrame:textStorage:layoutManager:",
+       "contentRect",
+       "contentRectForFrameRect:styleMask:",
+       "contentSize",
+       "contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:",
+       "contentString",
+       "contentView",
+       "contentViewMargins",
+       "contentsAtPath:",
+       "contentsEqualAtPath:andPath:",
+       "contentsForTextSystem",
+       "contentsWrap",
+       "context",
+       "contextDelete:",
+       "contextDeleteChildren:",
+       "contextForSecondaryThread",
+       "contextHelpForKey:",
+       "contextHelpForObject:",
+       "contextID",
+       "contextInspect:",
+       "contextIsolateSelection:",
+       "contextMenuRepresentation",
+       "contextSelectAfter:",
+       "contextSelectBefore:",
+       "contextSelectChild:",
+       "contextSelectEnd:",
+       "contextSelectExterior:",
+       "contextSelectInterior:",
+       "contextSelectStart:",
+       "contextUnwrapChildren:",
+       "continueTracking:at:inView:",
+       "continueTrackingWithEvent:",
+       "control:didFailToFormatString:errorDescription:",
+       "control:didFailToValidatePartialString:errorDescription:",
+       "control:isValidObject:",
+       "control:textShouldBeginEditing:",
+       "control:textShouldEndEditing:",
+       "control:textView:doCommandBySelector:",
+       "controlBackgroundColor",
+       "controlCharacterSet",
+       "controlColor",
+       "controlContentFontOfSize:",
+       "controlDarkShadowColor",
+       "controlDidChange:",
+       "controlFillColor",
+       "controlHighlightColor",
+       "controlLightHighlightColor",
+       "controlMenu:",
+       "controlPointBounds",
+       "controlShadowColor",
+       "controlSize",
+       "controlTextChanged:",
+       "controlTextColor",
+       "controlTextDidBeginEditing:",
+       "controlTextDidChange:",
+       "controlTextDidEndEditing:",
+       "controlTint",
+       "controlView",
+       "conversation",
+       "conversationIdentifier",
+       "conversationRequest",
+       "convertArgumentArrayToString:",
+       "convertAttributedString:toEnrichedString:",
+       "convertBaseToScreen:",
+       "convertData:toData:pattern:replacement:truncateBeforeBackslash:removeExtraLeftBrace:",
+       "convertEnrichedString:intoAttributedString:",
+       "convertFont:",
+       "convertFont:toApproximateTraits:",
+       "convertFont:toFace:",
+       "convertFont:toFamily:",
+       "convertFont:toHaveTrait:",
+       "convertFont:toNotHaveTrait:",
+       "convertFont:toSize:",
+       "convertIndexFor:outgoing:",
+       "convertOldFactor:newFactor:",
+       "convertPoint:fromView:",
+       "convertPoint:toView:",
+       "convertRect:fromView:",
+       "convertRect:toView:",
+       "convertRichTextString:intoAttributedString:",
+       "convertScreenToBase:",
+       "convertSize:fromView:",
+       "convertSize:toView:",
+       "convertType:data:to:inPasteboard:usingFilter:",
+       "convertWeight:ofFont:",
+       "convertWindowToForward:",
+       "convertWindowToReply:",
+       "convertWindowToReplyAll:",
+       "cooperatingObjectStores",
+       "coordinates",
+       "copiesOnScroll",
+       "copy",
+       "copy:",
+       "copy:into:",
+       "copyAttributesFromContext:withMask:",
+       "copyBlock:atOffset:forLength:",
+       "copyData:toBlock:atOffset:forLength:",
+       "copyFont:",
+       "copyFrom:to:withData:",
+       "copyFrom:to:withData:replaceOK:",
+       "copyFrom:to:withData:replaceOK:recursive:makeLinks:supervisor:",
+       "copyFrom:to:withData:replaceOK:recursive:makeLinks:supervisor:totallySafe:",
+       "copyFromDir:toDir:",
+       "copyFromDir:toDir:filesInBom:thinUsingBom:thinUsingArchs:sendStartMsgs:sendFinishMsgs:",
+       "copyFromDir:toDir:filesInBom:thinUsingBom:thinUsingArchs:sendStartMsgs:sendFinishMsgs:updateInodeMap:",
+       "copyFromStore:",
+       "copyFromZone:",
+       "copyMessages:toMailboxNamed:",
+       "copyOfMailboxesMenuWithTarget:selector:",
+       "copyPath:toPath:handler:",
+       "copyProjectTemplatePath:toPath:",
+       "copyRegion:ofLength:toAddress:",
+       "copyRuler:",
+       "copySerializationInto:",
+       "copyUids:toMailboxNamed:",
+       "copyWithZone:",
+       "copyingFinishedFor:fileDesc:mode:size:",
+       "copyingSkippedFor:",
+       "copyingStartedFor:mode:",
+       "copyright",
+       "coreFoundationRepresentation",
+       "cornerView",
+       "correctMatrixForOSX:",
+       "correctWhiteSpaceWithSemanticEngine:",
+       "correctWhitespaceForPasteWithPrecedingSpace:followingSpace:",
+       "count",
+       "countForKey:",
+       "countForObject:",
+       "countLinksTo:",
+       "countObserversName:object:literally:",
+       "countOccurrences:",
+       "countOfCards",
+       "countWordsInString:language:",
+       "counterpartDidChange",
+       "counterpartMoved:",
+       "counterpartResized:",
+       "coveredCharacterCache",
+       "coveredCharacterCacheData",
+       "coveredCharacterSet",
+       "coversAllCharactersInString:",
+       "coversCharacter:",
+       "creatableInExistingDirectory",
+       "createAccountWithDictionary:",
+       "createAttributedStringFromRawData",
+       "createBlock:ofSize:",
+       "createClassDescription",
+       "createCommandInstance",
+       "createCommandInstanceWithZone:",
+       "createContext",
+       "createConversationForConnection:",
+       "createDictHashTable:",
+       "createDirectoryAtPath:attributes:",
+       "createEditorWithType:originalMessage:forwardedText:",
+       "createEmptyStoreForPath:",
+       "createEmptyStoreIfNeededForPath:",
+       "createFaultForDeferredFault:sourceObject:",
+       "createFileAtPath:",
+       "createFileAtPath:contents:attributes:",
+       "createFileAtPath:flags:",
+       "createFileAtPath:flags:mode:",
+       "createInstanceWithEditingContext:globalID:zone:",
+       "createKeyValueBindingForKey:typeMask:",
+       "createMailbox:errorMessage:",
+       "createMailboxWithName:",
+       "createMailboxWithPath:reasonForFailure:",
+       "createMailboxesAndConvert:",
+       "createNew:",
+       "createNewAccount:",
+       "createNewEntry:",
+       "createNewFile:inProject:forKey:",
+       "createObject",
+       "createRandomKey:",
+       "createRawDataFromAttributedString",
+       "createRealObject",
+       "createSelector",
+       "createSignature:",
+       "createSymbolicLinkAtPath:pathContent:",
+       "createUniqueFile:atPath:mode:",
+       "createUniqueKey:",
+       "createViewersFromDefaults",
+       "creationZone",
+       "creator",
+       "credits",
+       "currentCenter",
+       "currentColumn",
+       "currentContainer",
+       "currentContext",
+       "currentContextDrawingToScreen",
+       "currentConversation",
+       "currentConversionFactor",
+       "currentCursor",
+       "currentDirectory",
+       "currentDirectoryPath",
+       "currentDisplayedMessage",
+       "currentDocument",
+       "currentEditor",
+       "currentEvent",
+       "currentEventSnapshotForObject:",
+       "currentHandler",
+       "currentHost",
+       "currentImageNumber",
+       "currentIndex",
+       "currentIndexInfoForItem:",
+       "currentInputContext",
+       "currentInputManager",
+       "currentInspector",
+       "currentLayoutManager",
+       "currentMode",
+       "currentMonitor",
+       "currentOperation",
+       "currentPage",
+       "currentParagraphStyle",
+       "currentPassNumber",
+       "currentPoint",
+       "currentRow",
+       "currentRunLoop",
+       "currentSelection",
+       "currentTask",
+       "currentTaskDictionary",
+       "currentTextStorage",
+       "currentThread",
+       "currentTransferMailboxPath",
+       "currentTypeForDimension:",
+       "currentTypeForWidth:ofSubelement:",
+       "currentUserCurrentOSDictionary",
+       "currentUserCurrentOSObjectForKey:",
+       "currentUserCurrentOSPathForInfoFile",
+       "currentUserCurrentOSRemoveObjectForKey:",
+       "currentUserCurrentOSSetObject:forKey:",
+       "currentUserCurrentOSWriteInfo",
+       "currentUserDictionary",
+       "currentValueForAttribute:",
+       "currentViewingMode",
+       "currentWidth:type:height:type:",
+       "currentlyAvailableStoreForPath:",
+       "currentlyOnMainThread",
+       "cursor",
+       "curveToPoint:controlPoint1:controlPoint2:",
+       "customizeMainFileInProject:",
+       "customizeNewProject:",
+       "cut:",
+       "cyanColor",
+       "cyanComponent",
+       "cycleToNextInputKeyboardLayout:",
+       "cycleToNextInputLanguage:",
+       "cycleToNextInputScript:",
+       "cycleToNextInputServerInLanguage:",
+       "darkBorderColor",
+       "darkBorderColorForCell:",
+       "darkGrayColor",
+       "darkenedImageForImage:",
+       "data",
+       "data1",
+       "data2",
+       "dataByUnfoldingLines",
+       "dataCell",
+       "dataCellForRow:",
+       "dataContainingPoint:withFrame:",
+       "dataDecorationSize",
+       "dataForFile:",
+       "dataForKey:",
+       "dataForType:",
+       "dataForType:fromPasteboard:",
+       "dataFrom:",
+       "dataRepresentation",
+       "dataRepresentationOfType:",
+       "dataSource",
+       "dataSourceQualifiedByKey:",
+       "dataStampForTriplet:littleEndian:",
+       "dataUsingEncoding:",
+       "dataUsingEncoding:allowLossyConversion:",
+       "dataWithBytes:length:",
+       "dataWithBytesNoCopy:length:",
+       "dataWithCapacity:",
+       "dataWithContentsOfFile:",
+       "dataWithContentsOfMappedFile:",
+       "dataWithContentsOfURL:",
+       "dataWithData:",
+       "dataWithEPSInsideRect:",
+       "dataWithLength:",
+       "dataWithPDFInsideRect:",
+       "date",
+       "dateByAddingYears:months:days:hours:minutes:seconds:",
+       "dateFormat",
+       "dateInCommonFormatsWithString:",
+       "dateReceived",
+       "dateReceivedAsTimeIntervalSince1970",
+       "dateWithCalendarFormat:timeZone:",
+       "dateWithDate:",
+       "dateWithNaturalLanguageString:",
+       "dateWithNaturalLanguageString:date:locale:",
+       "dateWithNaturalLanguageString:locale:",
+       "dateWithString:",
+       "dateWithString:calendarFormat:",
+       "dateWithString:calendarFormat:locale:",
+       "dateWithTimeInterval:sinceDate:",
+       "dateWithTimeIntervalSince1970:",
+       "dateWithTimeIntervalSinceNow:",
+       "dateWithTimeIntervalSinceReferenceDate:",
+       "dateWithYear:month:day:hour:minute:second:timeZone:",
+       "dayOfCommonEra",
+       "dayOfMonth",
+       "dayOfWeek",
+       "dayOfYear",
+       "deFactoPercentWidth",
+       "deFactoPixelHeight",
+       "deFactoPixelWidth",
+       "deactivate",
+       "dealloc",
+       "debugDescription",
+       "debugIndexInfo",
+       "decimalDigitCharacterSet",
+       "decimalNumberByAdding:",
+       "decimalNumberByAdding:withBehavior:",
+       "decimalNumberByDividingBy:",
+       "decimalNumberByDividingBy:withBehavior:",
+       "decimalNumberByMultiplyingBy:",
+       "decimalNumberByMultiplyingBy:withBehavior:",
+       "decimalNumberByMultiplyingByPowerOf10:",
+       "decimalNumberByMultiplyingByPowerOf10:withBehavior:",
+       "decimalNumberByRaisingToPower:",
+       "decimalNumberByRaisingToPower:withBehavior:",
+       "decimalNumberByRoundingAccordingToBehavior:",
+       "decimalNumberBySubstracting:",
+       "decimalNumberBySubstracting:withBehavior:",
+       "decimalNumberBySubtracting:",
+       "decimalNumberBySubtracting:withBehavior:",
+       "decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:",
+       "decimalNumberWithDecimal:",
+       "decimalNumberWithMantissa:exponent:isNegative:",
+       "decimalNumberWithString:",
+       "decimalNumberWithString:locale:",
+       "decimalSeparator",
+       "decimalTabMarkerWithRulerView:location:",
+       "decimalValue",
+       "declareTypes:owner:",
+       "decodeApplicationApplefile",
+       "decodeApplicationMac_binhex40",
+       "decodeApplicationRtf",
+       "decodeArrayOfObjCType:count:at:",
+       "decodeBase64",
+       "decodeBasicExport:",
+       "decodeBodyIntoDirectory:",
+       "decodeBoolForKey:",
+       "decodeBytesWithReturnedLength:",
+       "decodeClassName:asClassName:",
+       "decodeDataObject",
+       "decodeImage",
+       "decodeIntForKey:",
+       "decodeMessageDelivery_status",
+       "decodeMessageExternal_body",
+       "decodeMessageFlags",
+       "decodeMessagePartial",
+       "decodeMessageRfc822",
+       "decodeMimeHeaderValue",
+       "decodeMimeHeaderValueWithCharsetHint:",
+       "decodeModifiedBase64",
+       "decodeMultipart",
+       "decodeMultipartAlternative",
+       "decodeMultipartAppledouble",
+       "decodeMultipartX_folder",
+       "decodeNXColor",
+       "decodeNXObject",
+       "decodeObject",
+       "decodeObjectForKey:",
+       "decodeObjectReferenceForKey:",
+       "decodePoint",
+       "decodePortObject",
+       "decodePropertyList",
+       "decodeQuotedPrintableForText:",
+       "decodeRect",
+       "decodeReleasedProxies:",
+       "decodeRetainedObject",
+       "decodeReturnValueWithCoder:",
+       "decodeSize",
+       "decodeText",
+       "decodeTextDirectory",
+       "decodeTextEnriched",
+       "decodeTextHtml",
+       "decodeTextPlain",
+       "decodeTextRichtext",
+       "decodeTextRtf",
+       "decodeTextX_vcard",
+       "decodeValueOfObjCType:at:",
+       "decodeValuesOfObjCTypes:",
+       "decodedIMAPMailboxName",
+       "decomposableCharacterSet",
+       "decrementExtraRefCountIsZero",
+       "decrementExtraRefCountWasZero",
+       "decrementSpecialRefCount",
+       "decryptComponents:",
+       "decryptWithDelegate:",
+       "deepDescription",
+       "deepDescriptionWithIndentString:",
+       "deepMutableNotifyingCopy",
+       "deepNSMutableCopy",
+       "deepWhitespaceDescription",
+       "deepWhitespaceDescriptionWithIndentString:",
+       "deepWillChange",
+       "deepestEditingTextView",
+       "deepestScreen",
+       "defaultAccountForDeliveryClass:",
+       "defaultActiveLinkColor",
+       "defaultAddressBook",
+       "defaultAddressListForHeader:",
+       "defaultAppIcon",
+       "defaultAttachmentDirectory",
+       "defaultAttributes",
+       "defaultBackgroundColor",
+       "defaultBehavior",
+       "defaultBoldStyle",
+       "defaultButtonCell",
+       "defaultCStringEncoding",
+       "defaultCenter",
+       "defaultChildForNode:",
+       "defaultClassPath",
+       "defaultCollator",
+       "defaultConnection",
+       "defaultCoordinator",
+       "defaultDecimalNumberHandler",
+       "defaultDepthLimit",
+       "defaultExtensionForProjectDir",
+       "defaultFetchTimestampLag",
+       "defaultFilteredHeaders",
+       "defaultFirstResponder",
+       "defaultFixedFontFamily",
+       "defaultFixedFontSize",
+       "defaultFixedFontStyle",
+       "defaultFlatness",
+       "defaultFont",
+       "defaultFontFamily",
+       "defaultFontSetForUser:",
+       "defaultFontSize",
+       "defaultFormatterForKey:",
+       "defaultFormatterForKeyPath:",
+       "defaultGroup",
+       "defaultItalicStyle",
+       "defaultLanguage",
+       "defaultLanguageContext",
+       "defaultLineCapStyle",
+       "defaultLineHeightForFont",
+       "defaultLineJoinStyle",
+       "defaultLineWidth",
+       "defaultLinkColor",
+       "defaultLocalizableKeys",
+       "defaultMailCenter",
+       "defaultMailDirectory",
+       "defaultManager",
+       "defaultMenu",
+       "defaultMiterLimit",
+       "defaultNameServerPortNumber",
+       "defaultObjectValue",
+       "defaultObserverQueue",
+       "defaultParagraphStyle",
+       "defaultParentForItem:",
+       "defaultParentObjectStore",
+       "defaultPathForAccountWithHostname:username:",
+       "defaultPixelFormat",
+       "defaultPortNameServer",
+       "defaultPortNumber",
+       "defaultPreferencesClass",
+       "defaultPreferredAlternative",
+       "defaultPrinter",
+       "defaultQueue",
+       "defaultSharedEditingContext",
+       "defaultSignature",
+       "defaultTextAttributes:",
+       "defaultTextColor",
+       "defaultTimeZone",
+       "defaultUnderlineStyle",
+       "defaultValue",
+       "defaultVisitedLinkColor",
+       "defaultWindingRule",
+       "defaultsChanged:",
+       "defaultsDictionary",
+       "defaultsToWindow:",
+       "deferCheckboxChanged:",
+       "deferSync",
+       "defrostFrozenCell",
+       "delay",
+       "delayWindowOrdering",
+       "dele:",
+       "delegate",
+       "delete",
+       "delete:",
+       "deleteBackward",
+       "deleteBackward:",
+       "deleteBackwardFlatteningStructures:",
+       "deleteCharactersInRange:",
+       "deleteColumn:",
+       "deleteColumnAtIndex:givingWidthToColumnAtIndex:",
+       "deleteFilesInArray:fromDirectory:",
+       "deleteForward",
+       "deleteForward:",
+       "deleteForwardFlatteningStructures:",
+       "deleteGlyphsInRange:",
+       "deleteLastCharacter",
+       "deleteMailbox:",
+       "deleteMailbox:errorMessage:",
+       "deleteMailboxAtPath:",
+       "deleteMessage:",
+       "deleteMessages:",
+       "deleteMessages:moveToTrash:",
+       "deleteMessagesFromTrashOlderThanNumberOfDays:compact:",
+       "deleteMessagesOlderThanClicked:",
+       "deleteMessagesOlderThanNumberOfDays:compact:",
+       "deleteMessagesOnServer",
+       "deleteMessagesOnServer:",
+       "deleteObject:",
+       "deleteObjectsInRange:",
+       "deletePath",
+       "deleteRemovingEmptyNodes:",
+       "deleteRow:",
+       "deleteRowAtIndex:givingHeightToRowAtIndex:",
+       "deleteRuleForRelationshipKey:",
+       "deleteSelectedRow:",
+       "deleteSelectedRowInTableView:",
+       "deleteSelector",
+       "deleteSelf",
+       "deleteStackIsEmpty",
+       "deleteToBeginningOfLine:",
+       "deleteToBeginningOfParagraph:",
+       "deleteToEndOfLine:",
+       "deleteToEndOfParagraph:",
+       "deleteToMark:",
+       "deleteWordBackward:",
+       "deleteWordForward:",
+       "deletedCount:andSize:",
+       "deletedObjects",
+       "deliverAsynchronously",
+       "deliverMessage:",
+       "deliverMessage:askForReadReceipt:",
+       "deliverMessage:headers:format:protocol:",
+       "deliverMessage:subject:to:",
+       "deliverMessageData:toRecipients:",
+       "deliverResult",
+       "deliverSynchronously",
+       "deliveryAccounts",
+       "deliveryClass",
+       "deliveryCompleted:",
+       "deliveryMethodChanged:",
+       "deliveryQueue",
+       "deliveryStatus",
+       "deltaFontSizeLevel",
+       "deltaSizeArrayForBaseSize:",
+       "deltaX",
+       "deltaY",
+       "deltaZ",
+       "deminiaturize:",
+       "dependentBoldCopy",
+       "dependentCopy",
+       "dependentFixedCopy",
+       "dependentItalicCopy",
+       "dependentUnderlineCopy",
+       "deployedPathForFrameworkNamed:",
+       "depth",
+       "depthFromRoot",
+       "depthLimit",
+       "dequeueNotificationsMatching:coalesceMask:",
+       "dequeueObserver:",
+       "deregisterViewer:",
+       "descendant:didAddChildAtIndex:immediateChild:",
+       "descendant:didRemoveChild:atIndex:immediateChild:",
+       "descendantDidChange:immediateChild:",
+       "descendantRenderingDidChange:immediateChild:",
+       "descendantWasRepaired:",
+       "descender",
+       "descendsFrom:",
+       "description",
+       "descriptionForClassMethod:",
+       "descriptionForInstanceMethod:",
+       "descriptionForMethod:",
+       "descriptionForObject:",
+       "descriptionForTokenAtIndex:",
+       "descriptionForTokensInRange:",
+       "descriptionInStringsFileFormat",
+       "descriptionString",
+       "descriptionWithCalendarFormat:",
+       "descriptionWithCalendarFormat:locale:",
+       "descriptionWithCalendarFormat:timeZone:locale:",
+       "descriptionWithIndent:",
+       "descriptionWithLocale:",
+       "descriptionWithLocale:indent:",
+       "descriptor",
+       "descriptorAtIndex:",
+       "descriptorByTranslatingObject:desiredDescriptorType:",
+       "descriptorForKeyword:",
+       "descriptorType",
+       "descriptorWithDescriptorType:data:",
+       "deselectAddressBook:",
+       "deselectAll:",
+       "deselectAllAddressBooks",
+       "deselectAllCells",
+       "deselectColumn:",
+       "deselectItemAtIndex:",
+       "deselectRow:",
+       "deselectSelectedCell",
+       "deserializeAlignedBytesLengthAtCursor:",
+       "deserializeBytes:length:atCursor:",
+       "deserializeData:",
+       "deserializeDataAt:ofObjCType:atCursor:context:",
+       "deserializeIntAtCursor:",
+       "deserializeIntAtIndex:",
+       "deserializeInts:count:atCursor:",
+       "deserializeInts:count:atIndex:",
+       "deserializeList:",
+       "deserializeListItemIn:at:length:",
+       "deserializeNewData",
+       "deserializeNewKeyString",
+       "deserializeNewList",
+       "deserializeNewObject",
+       "deserializeNewPList",
+       "deserializeNewString",
+       "deserializeObjectAt:ofObjCType:fromData:atCursor:",
+       "deserializePList:",
+       "deserializePListKeyIn:",
+       "deserializePListValueIn:key:length:",
+       "deserializePropertyListFromData:atCursor:mutableContainers:",
+       "deserializePropertyListFromData:mutableContainers:",
+       "deserializePropertyListFromXMLData:mutableContainers:",
+       "deserializePropertyListLazilyFromData:atCursor:length:mutableContainers:",
+       "deserializeString:",
+       "deserializer",
+       "deserializerStream",
+       "destination",
+       "destinationStorePathForMessage:",
+       "destroyContext",
+       "detachColorList:",
+       "detachDrawingThread:toTarget:withObject:",
+       "detachNewThreadSelector:toTarget:withObject:",
+       "detachSubmenu",
+       "detailKey",
+       "detailView",
+       "detailedDescription",
+       "detailedDescriptionForClass:",
+       "device",
+       "deviceDescription",
+       "deztar:into:",
+       "dictionary",
+       "dictionaryByMergingDictionary:",
+       "dictionaryByRemovingObjectForKey:",
+       "dictionaryBySettingObject:forKey:",
+       "dictionaryClass",
+       "dictionaryExcludingEquivalentValuesInDictionary:",
+       "dictionaryForKey:",
+       "dictionaryInfo:",
+       "dictionaryRepresentation",
+       "dictionaryWithCapacity:",
+       "dictionaryWithContentsOfFile:",
+       "dictionaryWithContentsOfURL:",
+       "dictionaryWithDictionary:",
+       "dictionaryWithNullValuesForKeys:",
+       "dictionaryWithObject:forKey:",
+       "dictionaryWithObjects:forKeys:",
+       "dictionaryWithObjects:forKeys:count:",
+       "dictionaryWithObjectsAndKeys:",
+       "didAddChildAtIndex:",
+       "didAddSubview:",
+       "didCancelDelayedPerform:",
+       "didChange",
+       "didChangeText",
+       "didEndCloseSheet:returnCode:contextInfo:",
+       "didEndEncodingSheet:returnCode:contextInfo:",
+       "didEndFormatWarningSheet:returnCode:contextInfo:",
+       "didEndRevertSheet:returnCode:contextInfo:",
+       "didEndSaveErrorAlert:returnCode:contextInfo:",
+       "didEndSaveSheet:returnCode:contextInfo:",
+       "didEndSheet:returnCode:contextInfo:",
+       "didEndToggleRichSheet:returnCode:contextInfo:",
+       "didFinishCommand:",
+       "didFireDelayedPerform:",
+       "didLoadBytes:loadComplete:",
+       "didOpen",
+       "didRemoveChild:atIndex:",
+       "didRunOSPanel",
+       "didSaveChanges",
+       "didSaveProjectAtPath:client:",
+       "dimensions",
+       "dirForFile:",
+       "directUndoBody",
+       "directUndoDirtyFlags",
+       "directUndoFrameset",
+       "directUndoHead",
+       "directUndoHtml",
+       "directUndoTitle",
+       "directionalType:",
+       "directory",
+       "directoryAttributes",
+       "directoryCanBeCreatedAtPath:",
+       "directoryConfirmationSheetDidEnd:returnCode:contextInfo:",
+       "directoryContentsAtPath:",
+       "directoryContentsAtPath:matchingExtension:options:keepExtension:",
+       "directoryForImageBySender",
+       "directoryPathsForProject:ignoringProject:",
+       "dirtyDefaults:",
+       "dirtySelection",
+       "dirtyTokensInRange:",
+       "disableCursorRects",
+       "disableDisplayPositing",
+       "disableFlush",
+       "disableFlushWindow",
+       "disableHeartBeating",
+       "disableInspectionUpdateForEvent",
+       "disableInspectionUpdates",
+       "disableKeyEquivalentForDefaultButtonCell",
+       "disablePageColorsPanel",
+       "disableTitleControls",
+       "disableUndoRegistration",
+       "disabledControlTextColor",
+       "discardCachedImage",
+       "discardCursorRects",
+       "discardDisplayedValues",
+       "discardEventsMatchingMask:beforeEvent:",
+       "discardPendingNotification",
+       "disconnect",
+       "disconnectAllAccounts",
+       "disconnectAllAccounts:",
+       "disconnectAndNotifyDelegate:",
+       "disconnectFromServer",
+       "disconnectThisAccount:",
+       "dismissPopUp",
+       "dismissPopUp:",
+       "dispatch",
+       "dispatchInvocation:",
+       "dispatchRawAppleEvent:withRawReply:handlerRefCon:",
+       "display",
+       "displayAllColumns",
+       "displayAttributedString:",
+       "displayColumn:",
+       "displayComponentName",
+       "displayIfNeeded",
+       "displayIfNeededIgnoringOpacity",
+       "displayIfNeededInRect:",
+       "displayIfNeededInRectIgnoringOpacity:",
+       "displayIgnoringOpacity",
+       "displayMessageView:",
+       "displayName",
+       "displayNameForKey:",
+       "displayNameForMailboxAtPath:",
+       "displayNameForType:",
+       "displayOnly",
+       "displayPanel",
+       "displayRect:",
+       "displayRectIgnoringOpacity:",
+       "displaySelectedMessageInSeparateWindow:",
+       "displaySeparatelyInMailboxesDrawer",
+       "displayString",
+       "displayStringForMailboxWithPath:",
+       "displayStringForTextFieldCell:",
+       "displayToolTip:",
+       "displayableSampleText",
+       "displayableSampleTextForLanguage:",
+       "displayableString",
+       "displaysMessageNumbers",
+       "displaysMessageSizes",
+       "displaysSearchRank",
+       "dissolveToPoint:fraction:",
+       "dissolveToPoint:fromRect:fraction:",
+       "distanceFromColor:",
+       "distantFuture",
+       "distantPast",
+       "dividerAtRow:",
+       "dividerThickness",
+       "doClick:",
+       "doClose:",
+       "doCommandBySelector:",
+       "doCommandBySelector:client:",
+       "doCommandBySelector:forTextView:",
+       "doCompact",
+       "doDeleteInReceiver:",
+       "doDoubleClick:",
+       "doForegroundLayoutToCharacterIndex:",
+       "doIconify:",
+       "doPrintSplitInfo",
+       "doQueuedWork",
+       "doRevert",
+       "doSaveWithName:overwriteOK:",
+       "doStat",
+       "doToggleRich",
+       "docExtensionsForOSType:",
+       "docViewFrameChanged",
+       "dockTitleIsGuess",
+       "document",
+       "documentAttributes",
+       "documentBase",
+       "documentBaseUrl",
+       "documentBody",
+       "documentClass",
+       "documentClassForType:",
+       "documentCursor",
+       "documentEdited",
+       "documentForFileName:",
+       "documentForPath:",
+       "documentForWindow:",
+       "documentFrameset",
+       "documentFromAttributedString:",
+       "documentHead",
+       "documentName",
+       "documentRect",
+       "documentRectForPageNumber:",
+       "documentSizeInPage",
+       "documentView",
+       "documentVisibleRect",
+       "documentWillSave",
+       "documentWithContentsOfFile:",
+       "documentWithContentsOfFile:encodingUsed:",
+       "documentWithContentsOfUrl:",
+       "documentWithContentsOfUrl:encodingUsed:",
+       "documentWithHtmlData:baseUrl:",
+       "documentWithHtmlData:baseUrl:encodingUsed:",
+       "documentWithHtmlString:url:",
+       "documents",
+       "doesContain:",
+       "doesMajorVersioning",
+       "doesNotRecognize:",
+       "doesNotRecognizeSelector:",
+       "doesPreserveParents",
+       "domain",
+       "doneBeingBusy",
+       "doneTokenizing",
+       "doneWithDrawingProxyCell:",
+       "doneWithDrawingProxyView:",
+       "doneWithTextStorage",
+       "doubleAction",
+       "doubleClickAddress:",
+       "doubleClickAtIndex:",
+       "doubleClickHandler",
+       "doubleClickInString:atIndex:useBook:",
+       "doubleClickedMessage:",
+       "doubleClickedOnCell:inRect:",
+       "doubleForKey:",
+       "doubleValue",
+       "downloadBigMessage:",
+       "draftsMailboxPath",
+       "draftsMailboxSelected:",
+       "dragAttachmentFromCell:withEvent:inRect:ofTextView:attachmentDirectory:",
+       "dragColor",
+       "dragColor:withEvent:fromView:",
+       "dragColor:withEvent:inView:",
+       "dragFile:fromRect:slideBack:event:",
+       "dragImage:at:offset:event:pasteboard:source:slideBack:",
+       "dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:",
+       "dragImageForRows:event:dragImageOffset:",
+       "dragOperationForDraggingInfo:type:",
+       "dragOperationForFileDraggingInfo:",
+       "dragRectForFrameRect:",
+       "dragTypesAcceptedForTableView:",
+       "draggedCell:inRect:event:",
+       "draggedColumn",
+       "draggedDistance",
+       "draggedImage",
+       "draggedImage:beganAt:",
+       "draggedImage:endedAt:deposited:",
+       "draggedImageLocation",
+       "draggingDelegate",
+       "draggingDestinationWindow",
+       "draggingEntered:",
+       "draggingExited:",
+       "draggingLocation",
+       "draggingPasteboard",
+       "draggingSequenceNumber",
+       "draggingSource",
+       "draggingSourceOperationMask",
+       "draggingSourceOperationMaskForLocal:",
+       "draggingUpdated:",
+       "draggingUpdatedAtLocation:",
+       "draw",
+       "drawArrow:highlight:",
+       "drawAtPoint:",
+       "drawAtPoint:fromRect:operation:fraction:",
+       "drawAtPoint:withAttributes:",
+       "drawBackgroundForGlyphRange:atPoint:",
+       "drawBackgroundInRect:",
+       "drawBackgroundInRect:inView:highlight:",
+       "drawBarInside:flipped:",
+       "drawBorderAndBackgroundWithFrame:inView:",
+       "drawCell:",
+       "drawCellAtIndex:",
+       "drawCellAtRow:column:",
+       "drawCellInside:",
+       "drawColor",
+       "drawColor:",
+       "drawContentFill:",
+       "drawDescriptionInRect:",
+       "drawDividerInRect:",
+       "drawFloatersInRect:",
+       "drawForEditorWithFrame:inView:",
+       "drawFrame:",
+       "drawGlyphsForGlyphRange:atPoint:",
+       "drawGridInClipRect:",
+       "drawHashMarksAndLabelsInRect:",
+       "drawImageWithFrame:inView:",
+       "drawInRect:",
+       "drawInRect:fromRect:operation:fraction:",
+       "drawInRect:onView:",
+       "drawInRect:onView:pinToTop:",
+       "drawInRect:withAttributes:",
+       "drawInsertionPointInRect:color:turnedOn:",
+       "drawInteriorWithFrame:inView:",
+       "drawKeyEquivalentWithFrame:inView:",
+       "drawKnob",
+       "drawKnob:",
+       "drawKnobSlotInRect:highlight:",
+       "drawLabel:inRect:",
+       "drawMarkersInRect:",
+       "drawPackedGlyphs:atPoint:",
+       "drawPageBorderWithSize:",
+       "drawParts",
+       "drawRect:",
+       "drawRect:inCache:",
+       "drawRepresentation:inRect:",
+       "drawRow:clipRect:",
+       "drawSelectedOutlineWithFrame:selected:",
+       "drawSelector",
+       "drawSeparatorItemWithFrame:inView:",
+       "drawSheetBorderWithSize:",
+       "drawStateImageWithFrame:inView:",
+       "drawSwatchInRect:",
+       "drawText:forItem:atPoint:withAttributes:",
+       "drawTextureInRect:clipRect:",
+       "drawThemeContentFill:inView:",
+       "drawTitleOfColumn:inRect:",
+       "drawTitleWithFrame:inView:",
+       "drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:",
+       "drawWellInside:",
+       "drawWithFrame:inView:",
+       "drawWithFrame:inView:characterIndex:",
+       "drawWithFrame:inView:characterIndex:layoutManager:",
+       "drawWithFrame:inView:characterIndex:selected:",
+       "drawWithOuterFrame:contentFrame:clipping:",
+       "drawerShouldClose:",
+       "drawerShouldOpen:",
+       "drawers",
+       "drawingProxyCellForAttachmentCell:",
+       "drawingProxyFrameForAttachmentCell:",
+       "drawingProxyViewForAttachmentCell:",
+       "drawingRectForBounds:",
+       "drawsBackground",
+       "drawsCellBackground",
+       "drawsColumnSeparators",
+       "drawsGrid",
+       "drawsOutsideLineFragmentForGlyphAtIndex:",
+       "dropRegion:ofLength:",
+       "dualImageCellWithRepresentedItem:image:selectedImage:",
+       "dump",
+       "dumpDelayedPerforms",
+       "dumpDiskSizes:",
+       "dumpFileListForKey:toStream:",
+       "dumpKeyAndSubkeys:toStream:",
+       "duration",
+       "durationWithoutSubevents",
+       "dynamicCounterpart",
+       "eMail",
+       "eMails",
+       "earlierDate:",
+       "echosBullets",
+       "edge",
+       "editAccount:",
+       "editAddressBook",
+       "editColumn:row:withEvent:select:",
+       "editSignature:",
+       "editWithFrame:inView:editor:delegate:event:",
+       "edited:range:changeInLength:",
+       "editedCell",
+       "editedColumn",
+       "editedItem",
+       "editedMask",
+       "editedRange",
+       "editedRow",
+       "editingContext",
+       "editingContext:didForgetObjectWithGlobalID:",
+       "editingContext:presentErrorMessage:",
+       "editingContext:shouldFetchObjectsDescribedByFetchSpecification:",
+       "editingContext:shouldInvalidateObject:globalID:",
+       "editingContext:shouldMergeChangesForObject:",
+       "editingContext:shouldPresentException:",
+       "editingContextDidMergeChanges:",
+       "editingContextSelector",
+       "editingContextShouldValidateChanges:",
+       "editingContextWillSaveChanges:",
+       "editingModeDefaultsChanged",
+       "editingStringForObjectValue:",
+       "editingSwitches",
+       "editingTextView",
+       "editingTextViewBacktabbed:",
+       "editingTextViewResized:",
+       "editingTextViewTabbed:",
+       "editorClassNameWithEvent:",
+       "editorClassNameWithSelection:",
+       "editorDidActivate",
+       "editorFrameForItemFrame:",
+       "editorMadeInvisible",
+       "editorViewingMessage:",
+       "editorWillDeactivate",
+       "editors",
+       "effectiveAlignment",
+       "effectiveBackgroundColor",
+       "effectiveColumnSpan",
+       "effectiveRowSpan",
+       "effectiveVerticalAlignment",
+       "effectuateParameters",
+       "effectuateState",
+       "effectuateStateAroundAttachment:",
+       "elementAt:",
+       "elementAtIndex:",
+       "elementAtIndex:associatedPoints:",
+       "elementAtIndex:effectiveRange:",
+       "elementCount",
+       "elementSize",
+       "emailAddresses",
+       "empty",
+       "emptyAttributeDictionary",
+       "emptyFragmentDocument",
+       "emptyFramesetDocument",
+       "emptyMessageWithBodyClass:",
+       "emptyPageDocument",
+       "emptySourceTree",
+       "emptyString",
+       "enable:",
+       "enableCompletion:forTextField:",
+       "enableCursorRects",
+       "enableExceptions:",
+       "enableFlushWindow",
+       "enableFreedObjectCheck:",
+       "enableInspectionUpdates",
+       "enableKeyEquivalentForDefaultButtonCell",
+       "enableLogging:",
+       "enableMultipleThreads",
+       "enableObserverNotification",
+       "enableRelease:",
+       "enableRichTextClicked:",
+       "enableSecureString:",
+       "enableUndoRegistration",
+       "enclosingScrollView",
+       "encodeArrayOfObjCType:count:at:",
+       "encodeBase64",
+       "encodeBasicExport:",
+       "encodeBool:forKey:",
+       "encodeBycopyObject:",
+       "encodeByrefObject:",
+       "encodeBytes:length:",
+       "encodeClassName:intoClassName:",
+       "encodeConditionalObject:",
+       "encodeDataObject:",
+       "encodeInt:forKey:",
+       "encodeIntoPropertyList:",
+       "encodeMessageFlags:",
+       "encodeMimeHeaderValue",
+       "encodeModifiedBase64",
+       "encodeNXObject:",
+       "encodeObject:",
+       "encodeObject:forKey:",
+       "encodeObject:isBycopy:isByref:",
+       "encodeObject:withCoder:",
+       "encodePoint:",
+       "encodePortObject:",
+       "encodePropertyList:",
+       "encodeQuotedPrintableForText:",
+       "encodeRect:",
+       "encodeReferenceToObject:forKey:",
+       "encodeReturnValueWithCoder:",
+       "encodeRootObject:",
+       "encodeSize:",
+       "encodeValueOfObjCType:at:",
+       "encodeValuesOfObjCTypes:",
+       "encodeWithCoder:",
+       "encodeWithKeyValueArchiver:",
+       "encodedHeaders",
+       "encodedHeadersForDelivery",
+       "encodedIMAPMailboxName",
+       "encoding",
+       "encodingAccessory:includeDefaultEntry:enableIgnoreRichTextButton:",
+       "encodingForArchiveName:",
+       "encodingScheme",
+       "encodingType",
+       "encryptComponents:",
+       "encryptWithDelegate:",
+       "endAttribute:",
+       "endDeepHTMLChange",
+       "endDocument",
+       "endEditing",
+       "endEditing:",
+       "endEditingFor:",
+       "endEnumeration:",
+       "endEventCoalescing",
+       "endHTMLChange",
+       "endHTMLChangeSelecting:",
+       "endHTMLChangeSelecting:andInspecting:",
+       "endHTMLChangeSelectingAfterItem:",
+       "endHTMLChangeSelectingAfterPrologueOfNode:",
+       "endHTMLChangeSelectingAtBeginningOfItem:",
+       "endHTMLChangeSelectingBeforeEpilogueOfNode:",
+       "endHTMLChangeSelectingItem:",
+       "endHeaderComments",
+       "endIndex",
+       "endInputStream",
+       "endLoadInBackground",
+       "endModalSession:",
+       "endOfFileMayCloseTag:",
+       "endPage",
+       "endPageSetup",
+       "endParsing",
+       "endPrologue",
+       "endRoot",
+       "endRtfParam",
+       "endSetup",
+       "endSheet:",
+       "endSheet:returnCode:",
+       "endSpecifier",
+       "endSubelementIdentifier",
+       "endSubelementIndex",
+       "endTokenIndex",
+       "endTrailer",
+       "endUndoGrouping",
+       "enforceIntegrity",
+       "enqueueNotification:postingStyle:",
+       "enqueueNotification:postingStyle:coalesceMask:forModes:",
+       "enqueueObserver:",
+       "enrAppendString:",
+       "enrBigger:",
+       "enrBold:",
+       "enrCenter:",
+       "enrColor:",
+       "enrColorStart:",
+       "enrComment:",
+       "enrExcerpt:",
+       "enrFixed:",
+       "enrFlushBuf",
+       "enrFlushLeft:",
+       "enrFlushRight:",
+       "enrFontFamily:",
+       "enrFontFamilyStart:",
+       "enrForceBreak",
+       "enrGt:",
+       "enrIndent:",
+       "enrItalic:",
+       "enrLt:",
+       "enrNl:",
+       "enrNoFill:",
+       "enrNp:",
+       "enrOutdent:",
+       "enrParagraph:",
+       "enrParam:",
+       "enrSetAlignment:flag:",
+       "enrSetFont:style:",
+       "enrSmaller:",
+       "enrSpace:",
+       "enrUnderline:",
+       "enrXFontSize:",
+       "enrXFontSizeStart:",
+       "enrXTabStops:",
+       "enrXTabStopsStart:",
+       "enrichedString",
+       "ensureAttributesAreFixedInRange:",
+       "ensureObjectAwake:",
+       "ensureSpoolDirectoryExistsOnDisk",
+       "enterEditingInTextView:",
+       "enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:",
+       "enterHit:endingEditing:",
+       "enterHitInTableView:endingEditing:",
+       "enterSelection:",
+       "enteringPreformattedBlock",
+       "entireTokenRange",
+       "entityName",
+       "entries",
+       "entryNames",
+       "entryState:",
+       "entryType",
+       "entryWithMessage:connection:",
+       "enumerateFromRoot:",
+       "enumerateFromRoot:traversalMode:",
+       "enumeratePaths",
+       "enumeratorAtPath:",
+       "environment",
+       "enztar:into:",
+       "eoDescription",
+       "eoMKKDInitializer",
+       "eoShallowDescription",
+       "epilogueLengthWithMap:",
+       "error:",
+       "errorAction",
+       "errorColor",
+       "errorMessage",
+       "errorProc",
+       "errorStringWithMessage:mailbox:",
+       "escapedUnicodeStringForEncoding:",
+       "establishConnection",
+       "euid",
+       "evaluate",
+       "evaluateSpecifiers",
+       "evaluateTraversalAtProject:userData:",
+       "evaluateWithObject:",
+       "evaluatedArguments",
+       "evaluatedReceivers",
+       "evaluationErrorNumber",
+       "evaluationErrorSpecifier",
+       "event:atIndex:isInsideLink:ofItem:withRange:givenOrigin:",
+       "eventClass",
+       "eventID",
+       "eventMask",
+       "eventNumber",
+       "eventTypeDescriptions",
+       "eventTypeDescriptions:",
+       "events",
+       "eventsOfClass:type:",
+       "examineMailbox:errorMessage:",
+       "exceptionAddingEntriesToUserInfo:",
+       "exceptionDuringOperation:error:leftOperand:rightOperand:",
+       "exceptionRememberingObject:key:",
+       "exceptionWithName:reason:userInfo:",
+       "exchange::",
+       "exchangeObjectAtIndex:withObjectAtIndex:",
+       "executable",
+       "executableExtension",
+       "executablePath",
+       "executableResultPatterns",
+       "executablesForProject:atBuildPath:",
+       "executablesForProject:atBuildPath:resultNode:",
+       "executablesInRootProject:",
+       "executablesInSubProjectsForProject:atBuildPath:resultNode:",
+       "executeCommand",
+       "executeScript",
+       "existingImageDirectories",
+       "existingUniqueInstance:",
+       "existingViewerForStore:",
+       "exit",
+       "exitWithCode:",
+       "exitingPreformattedBlock",
+       "expandItem:",
+       "expandItem:expandChildren:",
+       "expandItemEqualTo:expandChildren:",
+       "expandPrivateAlias:",
+       "expandPrivateAliases:",
+       "expandProjectString:",
+       "expandProjectString:havingExpanded:",
+       "expandProjectStringAndMakePathAbsoluteWithProjectRoot:",
+       "expandSetWithOffset:",
+       "expandUserAlias:",
+       "expandVariablesInTemplateFile:outputFile:withDictionary:",
+       "expect:",
+       "expectEndOfInput",
+       "expectSelector",
+       "expectSeparatorEqualTo:",
+       "expectTokenEqualTo:mask:",
+       "exportMailbox:",
+       "expressionString",
+       "expunge",
+       "extendBy:",
+       "extendPowerOffBy:",
+       "extensionListForKey:",
+       "extensions",
+       "extensionsFromTypeDict:",
+       "externalRepresentation",
+       "extraData",
+       "extraLineFragmentRect",
+       "extraLineFragmentTextContainer",
+       "extraLineFragmentUsedRect",
+       "extraRefCount",
+       "faceString",
+       "faceTextFired:",
+       "fadeOneNotch:",
+       "fadeToEmpty",
+       "fadeToolTip:",
+       "failureReason",
+       "familyName",
+       "familyNames",
+       "fastestEncoding",
+       "fatalError:",
+       "fatalErrorCopying:error:",
+       "faultForGlobalID:editingContext:",
+       "faultForRawRow:entityNamed:",
+       "faultForRawRow:entityNamed:editingContext:",
+       "faultWillFire:",
+       "fax:",
+       "featuresOnlyOnPanel",
+       "feedbackWithImage:forWindow:",
+       "fetchAsynchronously",
+       "fetchLimit",
+       "fetchMessageSkeletonsForUidRange:intoArray:",
+       "fetchMessages:toPath:",
+       "fetchObjects",
+       "fetchRawDataForUid:intoDestinationFilePath:keepMessageInMemory:",
+       "fetchRemoteURLs",
+       "fetchSelector",
+       "fetchSpecificationNamed:",
+       "fetchSpecificationNamed:entityNamed:",
+       "fetchSpecificationWithEntityName:qualifier:sortOrderings:",
+       "fetchSpecificationWithQualifierBindings:",
+       "fetchSynchronously",
+       "fetchTimestamp",
+       "fetchUidsAndFlagsForAllMessagesIntoArray:",
+       "fetchesRawRows",
+       "fieldEditor:forObject:",
+       "file",
+       "fileAttributes",
+       "fileAttributesAtPath:traverseLink:",
+       "fileButton",
+       "fileDescriptor",
+       "fileExistsAtPath:",
+       "fileExistsAtPath:isDirectory:",
+       "fileExtensions",
+       "fileExtensionsFromType:",
+       "fileGroupOwnerAccountName",
+       "fileGroupOwnerAccountNumber",
+       "fileHandleForReading",
+       "fileHandleForReadingAtPath:",
+       "fileHandleForUpdatingAtPath:",
+       "fileHandleForWriting",
+       "fileHandleForWritingAtPath:",
+       "fileHandleWithNullDevice",
+       "fileHandleWithStandardError",
+       "fileHandleWithStandardInput",
+       "fileHandleWithStandardOutput",
+       "fileListForKey:",
+       "fileListForKey:create:",
+       "fileManager:shouldProceedAfterError:",
+       "fileManager:willProcessPath:",
+       "fileManagerShouldProceedAfterError:",
+       "fileModificationDate",
+       "fileName",
+       "fileNameFromRunningSavePanelForSaveOperation:",
+       "fileNamesFromRunningOpenPanel",
+       "fileOperationCompleted:ok:",
+       "fileOwnerAccountName",
+       "fileOwnerAccountNumber",
+       "filePosixPermissions",
+       "fileSize",
+       "fileSystemAttributesAtPath:",
+       "fileSystemChanged",
+       "fileSystemFileNumber",
+       "fileSystemNumber",
+       "fileSystemRepresentation",
+       "fileSystemRepresentationWithPath:",
+       "fileType",
+       "fileTypeFromLastRunSavePanel",
+       "fileURLForMailAddress:",
+       "fileURLWithPath:",
+       "fileWithInode:onDevice:",
+       "fileWrapper",
+       "fileWrapperRepresentationOfType:",
+       "fileWrappers",
+       "filename",
+       "filenameToDrag:",
+       "filenames",
+       "filenamesMatchingTypes:",
+       "filesTable",
+       "fill",
+       "fillAttributesCache",
+       "fillRect:",
+       "fillTableDecorationPathWithFrame:pathIsCellsWithContent:inCache:",
+       "filterAndSortObjectNames:",
+       "filterEvents:",
+       "filterString",
+       "filteredArrayUsingQualifier:",
+       "filteredHeaders",
+       "filteredMessages",
+       "finalWritePrintInfo",
+       "finalizeTable",
+       "find:",
+       "findAddedFilesIn:",
+       "findApplications",
+       "findBundleResources:callingMethod:directory:languages:name:types:limit:",
+       "findCaptionUnderNode:",
+       "findCellAtPoint:withFrame:usingInnerBorder:",
+       "findChangesIn:showAdded:",
+       "findCharsetTag",
+       "findClass:",
+       "findCombinationForLetter:accent:",
+       "findEntryListFor:",
+       "findFontDebug:",
+       "findFontLike:forCharacter:inLanguage:",
+       "findHome:",
+       "findItemEqualTo:",
+       "findNext:",
+       "findNextAndClose:",
+       "findNextAndOrderFindPanelOut:",
+       "findOutBasicInfoFor:",
+       "findOutExtendedInfoFor:",
+       "findPPDFileName:",
+       "findPanel",
+       "findPrev:",
+       "findPrevious:",
+       "findServerWithName:",
+       "findSoundFor:",
+       "findString",
+       "findString:selectedRange:options:wrap:",
+       "findTableView",
+       "finderFlags",
+       "fingerCursor",
+       "finishAllForTree:",
+       "finishDraggingCell:fromIndex:toIndex:",
+       "finishEncoding:",
+       "finishInitWithKeyValueUnarchiver:",
+       "finishInitializationOfObjects",
+       "finishInitializationWithKeyValueUnarchiver:",
+       "finishLaunching",
+       "finishUnarchiving",
+       "finished",
+       "finished:",
+       "fire",
+       "fireDate",
+       "firedAtMidnight",
+       "firstChild",
+       "firstComponentFromRelationshipPath",
+       "firstEmailAddress",
+       "firstGlyphIndexOfCurrentLineFragment",
+       "firstHeaderForKey:",
+       "firstIndentMarkerWithRulerView:location:",
+       "firstIndex",
+       "firstInspectableSelectionAtOrAboveSelection:",
+       "firstLineHeadIndent",
+       "firstName",
+       "firstObject",
+       "firstObjectCommonWithArray:",
+       "firstRectForCharacterRange:",
+       "firstResponder",
+       "firstResult",
+       "firstRowHeadersAction:",
+       "firstTextView",
+       "firstTextViewForTextStorage:",
+       "firstUnlaidCharacterIndex",
+       "firstUnlaidGlyphIndex",
+       "firstUnreadMessage",
+       "firstVCardMatchingString:",
+       "firstVisibleColumn",
+       "firstmostSelectedRow",
+       "fixAttachmentAttributeInRange:",
+       "fixAttributesInRange:",
+       "fixFontAttributeInRange:",
+       "fixHTMLAttributesInRange:",
+       "fixInvalidatedFocusForFocusView",
+       "fixParagraphStyleAttributeInRange:",
+       "fixUIForcingNewPopUpButton:",
+       "fixUpScrollViewBackgroundColor:",
+       "fixUpTabsInRange:",
+       "fixed73872",
+       "fixedCapacityLimit",
+       "fixedFamilyNames",
+       "fixesAttributesLazily",
+       "fixupDirInfo:",
+       "flagsChanged:",
+       "flagsForMessage:",
+       "flatness",
+       "flattenChild:",
+       "flattenChildAtIndex:",
+       "flippedView",
+       "floatForKey:",
+       "floatForKey:inTable:",
+       "floatValue",
+       "flush",
+       "flush:",
+       "flushAllCachedData",
+       "flushAllKeyBindings",
+       "flushAndTruncate:",
+       "flushAttributedString",
+       "flushBuffer",
+       "flushBufferedKeyEvents",
+       "flushCache",
+       "flushCachedData",
+       "flushChangesWhileFrozen",
+       "flushClassKeyBindings",
+       "flushDataForTriplet:littleEndian:",
+       "flushGraphics",
+       "flushHostCache",
+       "flushKeyBindings",
+       "flushLocalCopiesOfSharedRulebooks",
+       "flushRawData",
+       "flushTextForClient:",
+       "flushToDisk",
+       "flushToFile",
+       "flushWindow",
+       "flushWindowIfNeeded",
+       "focus:",
+       "focusRingImageForState:",
+       "focusRingImageSize",
+       "focusStack",
+       "focusView",
+       "focusView:inWindow:",
+       "focusedMessages",
+       "focusedView",
+       "followLinks",
+       "followedBySpaceCharacter",
+       "followedByWhitespace",
+       "followsItalicAngle",
+       "font",
+       "fontAttributesInRange:",
+       "fontBigger",
+       "fontConversion:",
+       "fontFamilyFromFaceString:",
+       "fontManager:willIncludeFont:",
+       "fontMenu:",
+       "fontName",
+       "fontNameWithFamily:traits:weight:",
+       "fontNamed:hasTraits:",
+       "fontPanel:",
+       "fontSetNamesForUser:",
+       "fontSetWithName:forUser:",
+       "fontSize",
+       "fontSmaller",
+       "fontStyleWithColor:",
+       "fontStyleWithSize:",
+       "fontWithColor:",
+       "fontWithFaceString:",
+       "fontWithFamily:traits:weight:size:",
+       "fontWithName:matrix:",
+       "fontWithName:size:",
+       "fontWithSize:",
+       "fontWithSizeDecrease:",
+       "fontWithSizeIncrease:",
+       "foobar:",
+       "forID",
+       "forItem",
+       "forceListToPopup",
+       "forceRendering",
+       "forceSet",
+       "foregroundColor",
+       "forgetAll",
+       "forgetAllWithTarget:",
+       "forgetFloater:",
+       "forgetObject:",
+       "forgetRememberedPassword",
+       "forgetWord:",
+       "forgetWord:language:",
+       "form",
+       "formIntersectionWithCharacterSet:",
+       "formIntersectionWithPostingsIn:",
+       "formUnionWithCharacterSet:",
+       "formUnionWithPostingsIn:",
+       "formalName",
+       "format",
+       "format:",
+       "formatSource:",
+       "formatSource:translatingRange:",
+       "formattedAddress",
+       "formattedEmail",
+       "formattedStringForRange:wrappingAtColumn:translatingRange:",
+       "formatter",
+       "formatterWithString:",
+       "forward::",
+       "forwardClicked:",
+       "forwardInvocation:",
+       "forwardMessage:",
+       "forwardUpdateForObject:changes:",
+       "fractionOfDistanceThroughGlyphForPoint:inTextContainer:",
+       "fragment",
+       "frame",
+       "frame:resizedFromEdge:withDelta:",
+       "frameAutosaveName",
+       "frameBorder",
+       "frameColor",
+       "frameForCell:withDecorations:",
+       "frameForPathItem:",
+       "frameHighlightColor",
+       "frameLength",
+       "frameNeedsDisplay",
+       "frameOfCellAtColumn:row:",
+       "frameOfColumn:",
+       "frameOfInsideOfColumn:",
+       "frameRectForContentRect:styleMask:",
+       "frameRotation",
+       "frameShadowColor",
+       "frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:",
+       "frameViewClass",
+       "frameViewClassForStyleMask:",
+       "frameset",
+       "framesetController",
+       "framesetElementClicked:",
+       "framesetView",
+       "framesetViewClass",
+       "framesetViewContainingElement:",
+       "frameworkVersion",
+       "free",
+       "freeBitsAndReleaseDataIfNecessary",
+       "freeBlock:",
+       "freeEntryAtCursor",
+       "freeEntryNamed:",
+       "freeFromBlock:inStore:",
+       "freeFromName:inFile:",
+       "freeFromStore",
+       "freeObjects",
+       "freeOnWrite",
+       "freePBSData",
+       "freeRegion:ofLength:",
+       "freeSerialized:length:",
+       "freeSpace",
+       "freeSpaceAtOffset:",
+       "freeStringList:",
+       "freeze:",
+       "frontWindow",
+       "frozenCell",
+       "fullDescription",
+       "fullJustifyLineAtGlyphIndex:",
+       "fullName",
+       "fullPathForAccountRelativePath:",
+       "fullPathForApplication:",
+       "fullUserName",
+       "gState",
+       "garbageCollectTags",
+       "gdbDebuggerName",
+       "generalPasteboard",
+       "generateGlyphsForLayoutManager:range:desiredNumberOfCharacters:startingAtGlyphIndex:completedRange:nextGlyphIndex:",
+       "get:",
+       "getAddressInfo:forReference:",
+       "getAddressLabelWithAttributes:",
+       "getArchitectures:",
+       "getArgument:atIndex:",
+       "getArgumentTypeAtIndex:",
+       "getAttribute:intoSize:percentage:",
+       "getAttributedStringAsynchronously",
+       "getAttributedStringSynchronously",
+       "getAttributesForCharacterIndex:",
+       "getBitmapDataPlanes:",
+       "getBlock:andStore:",
+       "getBlock:ofEntryNamed:",
+       "getByte",
+       "getBytes:",
+       "getBytes:length:",
+       "getBytes:maxLength:filledLength:encoding:allowLossyConversion:range:remainingRange:",
+       "getBytes:range:",
+       "getBytesForString:lossByte:",
+       "getCFRunLoop",
+       "getCString:",
+       "getCString:maxLength:",
+       "getCString:maxLength:range:remainingRange:",
+       "getCharacters:",
+       "getCharacters:range:",
+       "getClass:ofEntryNamed:",
+       "getClasses",
+       "getClassesFromResourceLocator:",
+       "getComparator:andContext:",
+       "getComponent:inValueWithName:andAttributes:",
+       "getComponent:inValueWithNameAndAttributes:",
+       "getCompression:factor:",
+       "getConfigurationFromResponder:",
+       "getContents:andLength:",
+       "getCount:andPostings:",
+       "getCyan:magenta:yellow:black:alpha:",
+       "getDefaultExtensionForType:",
+       "getDefaultMailClient",
+       "getDefaultStringForKey:fromDictionary:intoTextfield:withDefault:",
+       "getDirInfo:",
+       "getDocument:docInfo:",
+       "getDocumentNameAndSave:",
+       "getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:",
+       "getFileSystemRepresentation:maxLength:",
+       "getFileSystemRepresentation:maxLength:withPath:",
+       "getFirstUnlaidCharacterIndex:glyphIndex:",
+       "getFullAFMInfo:attributes:parameterStrings:",
+       "getGlobalWindowNum:frame:",
+       "getGlyphs:range:",
+       "getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:",
+       "getHandle:andWeight:",
+       "getHeight:percentage:",
+       "getHue:saturation:brightness:alpha:",
+       "getHyphenLocations:inString:",
+       "getHyphenLocations:inString:wordAtIndex:",
+       "getImage:rect:",
+       "getInfoForFile:application:type:",
+       "getKey:andLength:",
+       "getKey:andLength:withHint:",
+       "getKeyForType:",
+       "getKeys:",
+       "getKeysFor:",
+       "getLELong",
+       "getLEWord",
+       "getLineDash:count:phase:",
+       "getLineStart:end:contentsEnd:forRange:",
+       "getLocal:",
+       "getMailboxesOnDisk",
+       "getMarkedText:selectedRange:",
+       "getMoreInput",
+       "getName:andFile:",
+       "getNumberOfRows:columns:",
+       "getObject:atIndex:",
+       "getObjectValue:forString:errorDescription:",
+       "getObjects:",
+       "getObjects:andKeys:",
+       "getObjects:range:",
+       "getOtherKeysFor:",
+       "getPath",
+       "getPathsListFor:variant:as:",
+       "getPeriodicDelay:interval:",
+       "getPersistentExpandedItemsAsArray",
+       "getPersistentTableColumnsAsArray",
+       "getPreferredValueWithName:",
+       "getPreferredValueWithName:andAttributes:",
+       "getPrinterDataForRow:andKey:",
+       "getProperties",
+       "getProperty::",
+       "getPublicKeysFor:",
+       "getRed:green:blue:alpha:",
+       "getRef:forObjectName:",
+       "getReleasedProxies:length:",
+       "getRemote:",
+       "getReplyWithSequence:",
+       "getResourceKeysFor:",
+       "getResourceLocator",
+       "getReturnValue:",
+       "getRotationAngle",
+       "getRow:column:forPoint:",
+       "getRow:column:ofCell:",
+       "getRowSpan:columnSpan:",
+       "getRulebookData:makeSharable:littleEndian:",
+       "getSelectionString",
+       "getSourceKeysFor:",
+       "getSplitPercentage",
+       "getSplitPercentageAsString",
+       "getState:",
+       "getSubprojKeysFor:",
+       "getTIFFCompressionTypes:count:",
+       "getTopOfMessageNumber:intoMutableString:",
+       "getTypes:",
+       "getTypesWithName:",
+       "getTypesWithName:attributes:",
+       "getTypesWithNameAndAttributes:",
+       "getUrlFromUser",
+       "getUserInfoFromDefaults",
+       "getValue:",
+       "getValueFromObject:",
+       "getValueWithName:",
+       "getValueWithName:andAttributes:",
+       "getValueWithNameAndAttributes:",
+       "getValues:forAttribute:forVirtualScreen:",
+       "getValues:forParameter:",
+       "getVariantsFor:as:",
+       "getWhite:alpha:",
+       "getWidth:percentage:",
+       "gid",
+       "givenRootFindValidMailboxes:",
+       "globalIDForObject:",
+       "globalIDWithEntityName:keys:keyCount:zone:",
+       "globalIDWithEntityName:subEntityName:bestEntityName:keys:keyCount:zone:",
+       "globalRenderingBasisChanged:",
+       "globalRenderingBasisDidChange",
+       "globallyUniqueString",
+       "glyphAtIndex:",
+       "glyphAtIndex:isValidIndex:",
+       "glyphGeneratorForEncoding:language:font:",
+       "glyphGeneratorForEncoding:language:font:makeSharable:",
+       "glyphGeneratorForTriplet:makeSharable:",
+       "glyphIndexForPoint:inTextContainer:",
+       "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:",
+       "glyphIndexToBreakLineByClippingAtIndex:",
+       "glyphIndexToBreakLineByHyphenatingWordAtIndex:",
+       "glyphIndexToBreakLineByWordWrappingAtIndex:",
+       "glyphIsEncoded:",
+       "glyphPacking",
+       "glyphRangeForBoundingRect:inTextContainer:",
+       "glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:",
+       "glyphRangeForCharacterRange:actualCharacterRange:",
+       "glyphRangeForTextContainer:",
+       "glyphWithName:",
+       "goodFileCharacterSet",
+       "gotString",
+       "gotoBeginning:",
+       "gotoEnd:",
+       "gotoPosterFrame:",
+       "gradientType",
+       "graphicsContextWithAttributes:",
+       "graphicsContextWithWindow:",
+       "graphicsPort",
+       "graphiteControlTintColor",
+       "grayColor",
+       "greenColor",
+       "greenComponent",
+       "gridColor",
+       "groupEvents:bySignatureOfType:",
+       "groupIdentifier",
+       "groupName",
+       "groupingLevel",
+       "groupsByEvent",
+       "growBuffer:current:end:factor:",
+       "growGlyphCaches:fillGlyphInfo:",
+       "guaranteeMinimumWidth:",
+       "guessDockTitle:filename:",
+       "guessesForWord:",
+       "halt",
+       "handleAppleEvent:withReplyEvent:",
+       "handleChangeWithIgnore:",
+       "handleClickOnLink:",
+       "handleCloseScriptCommand:",
+       "handleCommentWithCode:",
+       "handleDividerDragWithEvent:",
+       "handleError:",
+       "handleErrors:",
+       "handleFailureInFunction:file:lineNumber:description:",
+       "handleFailureInMethod:object:file:lineNumber:description:",
+       "handleFontName",
+       "handleGURLAppleEvent:",
+       "handleGetAeteEvent:withReplyEvent:",
+       "handleHeaderOp",
+       "handleMachMessage:",
+       "handleMailToURL:",
+       "handleMouseEvent:",
+       "handleOpenAppleEvent:",
+       "handlePicVersion",
+       "handlePortCoder:",
+       "handlePortMessage:",
+       "handlePrintScriptCommand:",
+       "handleQueryWithUnboundKey:",
+       "handleQuickTimeWithCode:",
+       "handleQuitScriptCommand:",
+       "handleReleasedProxies:length:",
+       "handleRequest:sequence:",
+       "handleSaveScriptCommand:",
+       "handleSendMessageCommand:",
+       "handleTakeValue:forUnboundKey:",
+       "handleUnknownEvent:withReplyEvent:",
+       "handleUpdatingFinished",
+       "handlerForFault:",
+       "handlerForMarker:",
+       "handlesFetchSpecification:",
+       "hasAlpha",
+       "hasAttachments",
+       "hasBackingStore",
+       "hasBeenSaved",
+       "hasCachedAttributedString",
+       "hasChanges",
+       "hasChangesPending",
+       "hasCloseBox",
+       "hasComposeAccessoryViewOwner",
+       "hasConjointSelection",
+       "hasContent",
+       "hasDeliveryClassBeenConfigured",
+       "hasDynamicDepthLimit",
+       "hasEditedDocuments",
+       "hasEditingIvars",
+       "hasEntryNamed:",
+       "hasFocusView",
+       "hasFullInfo",
+       "hasHorizontalRuler",
+       "hasHorizontalScroller",
+       "hasIcons",
+       "hasImageWithAlpha",
+       "hasLeadingSpace",
+       "hasLeadingSpaceWithSemanticEngine:",
+       "hasMarkedText",
+       "hasMultiplePages",
+       "hasOfflineChangesForStoreAtPath:",
+       "hasPreferencesPanel",
+       "hasPrefix:",
+       "hasProperty:",
+       "hasRoundedCornersForButton",
+       "hasRoundedCornersForPopUp",
+       "hasRunLoop:",
+       "hasScrollerOnRight",
+       "hasSenderOrReceiver",
+       "hasShadow",
+       "hasSource",
+       "hasSubmenu",
+       "hasSuffix:",
+       "hasTextStyle:stylePossessed:styleNotPossessed:",
+       "hasThousandSeparators",
+       "hasTitleBar",
+       "hasTrailingSpace",
+       "hasTrailingSpaceWithSemanticEngine:",
+       "hasUndoManager",
+       "hasUnreadMail",
+       "hasValidCacheFileForUid:",
+       "hasValidObjectValue",
+       "hasVerticalRuler",
+       "hasVerticalScroller",
+       "hash",
+       "hashFor:",
+       "haveAccountsBeenConfigured",
+       "haveTexture",
+       "headIndent",
+       "headerCell",
+       "headerCheckboxAction:",
+       "headerColor",
+       "headerDataForMessage:",
+       "headerLevel",
+       "headerRectOfColumn:",
+       "headerTextColor",
+       "headerView",
+       "headers",
+       "headersForKey:",
+       "headersRequiredForRouting",
+       "headersToDisplayFromHeaderKeys:showAllHeaders:",
+       "heartBeat:",
+       "heartBeatCycle",
+       "height",
+       "heightAdjustLimit",
+       "heightForMaximumWidth",
+       "heightForRowAtIndex:returningHeightType:",
+       "heightPopupAction:",
+       "heightString",
+       "heightTextfieldAction:",
+       "heightTracksTextView",
+       "helpCursorShown",
+       "helpRequested:",
+       "hide",
+       "hide:",
+       "hideDeletions:",
+       "hideFavorites",
+       "hideFeedback",
+       "hideNumbers:",
+       "hideOtherApplications",
+       "hideOtherApplications:",
+       "hideSizes:",
+       "hideStatusLine:",
+       "hidesOnDeactivate",
+       "highContrastColor",
+       "highlight:",
+       "highlight:withFrame:inView:",
+       "highlightCell:atRow:column:",
+       "highlightChanges",
+       "highlightColor",
+       "highlightColor:",
+       "highlightGeneratedString:",
+       "highlightMode",
+       "highlightSelectionInClipRect:",
+       "highlightWithLevel:",
+       "highlightedBranchImage",
+       "highlightedItemIndex",
+       "highlightedMenuColor",
+       "highlightedMenuTextColor",
+       "highlightedTableColumn",
+       "highlightsBy",
+       "hintCapacity",
+       "hints",
+       "hitLineBreakWithClear:characterIndex:",
+       "hitPart",
+       "hitTest:",
+       "homeTextView",
+       "horizontalAlignPopupAction:",
+       "horizontalEdgePadding",
+       "horizontalLineScroll",
+       "horizontalPageScroll",
+       "horizontalPagination",
+       "horizontalResizeCursor",
+       "horizontalRulerView",
+       "horizontalScroller",
+       "horizontalSpace",
+       "host",
+       "hostDeviceOf:",
+       "hostName",
+       "hostWithAddress:",
+       "hostWithName:",
+       "hostname",
+       "hotSpot",
+       "hourOfDay",
+       "href",
+       "html:unableToParseDocument:",
+       "htmlAddedTextStyles",
+       "htmlAttachmentCellWithRepresentedItem:",
+       "htmlAttributeValue",
+       "htmlAttributedString",
+       "htmlDeletedTextStyles",
+       "htmlDocumentChanged:",
+       "htmlDocumentDidChange:",
+       "htmlEncodedString",
+       "htmlEquivalent",
+       "htmlFontSizeForPointSize:",
+       "htmlInspectedSelectionChanged:",
+       "htmlInspectionChanged:",
+       "htmlItemTransformed:",
+       "htmlNodeForHeaderWithTitle:value:",
+       "htmlRedo:",
+       "htmlSelection",
+       "htmlString",
+       "htmlStringFromTextString",
+       "htmlStringWithString:",
+       "htmlTextStyles",
+       "htmlTextView",
+       "htmlTree",
+       "htmlTreeClass",
+       "htmlTreeForHeaders:withTopMargin:",
+       "htmlUndo:",
+       "htmlView",
+       "htmlView:clickedOnLink:",
+       "htmlView:contentDidChange:",
+       "htmlView:didSwitchToView:",
+       "htmlView:inspectedSelectionChangedTo:",
+       "htmlView:selectionChangedTo:",
+       "htmlView:selectionWillChangeTo:",
+       "htmlView:toolbarDidChangeConfigurationFrom:to:",
+       "htmlView:willSwitchToView:",
+       "hueComponent",
+       "hyphenGlyph",
+       "hyphenGlyphForFont:language:",
+       "hyphenGlyphForLanguage:",
+       "hyphenationFactor",
+       "icon",
+       "iconForFile:",
+       "iconForFileType:",
+       "iconForFiles:",
+       "iconRef:label:",
+       "iconRef:label:forObjectName:",
+       "idealFace:conflictsWithFaceInCanonicalFaceStringArray:",
+       "idealFace:conflictsWithIdealFaceInArray:",
+       "idealFaceFromCanonicalFaceArray:",
+       "idealFaceFromCanonicalFaceString:",
+       "idealFaceFromFaceString:",
+       "idealUserDefinedFaces",
+       "identifier",
+       "identity",
+       "ignoreCase:",
+       "ignoreModifierKeysWhileDragging",
+       "ignoreNextChange",
+       "ignoreSpelling:",
+       "ignoreTextStorageDidProcessEditing",
+       "ignoreWord:inSpellDocumentWithTag:",
+       "ignoredWordsInSpellDocumentWithTag:",
+       "ignoresAlpha",
+       "ignoresMultiClick",
+       "illegalCharacterSet",
+       "image",
+       "image:focus:",
+       "imageAlignment",
+       "imageAndTitleOffset",
+       "imageAndTitleWidth",
+       "imageCellWithRepresentedItem:image:",
+       "imageDidNotDraw:inRect:",
+       "imageDimsWhenDisabled",
+       "imageFileTypes",
+       "imageForMailAddress:",
+       "imageForPreferenceNamed:",
+       "imageForState:",
+       "imageFrameStyle",
+       "imageInputAlloc",
+       "imageNamed:",
+       "imageNamed:sender:",
+       "imageOrigin",
+       "imagePasteboardTypes",
+       "imagePosition",
+       "imageRectForBounds:",
+       "imageRectForPaper:",
+       "imageRectInRuler",
+       "imageRepClassForData:",
+       "imageRepClassForFileType:",
+       "imageRepClassForPasteboardType:",
+       "imageRepWithContentsOfFile:",
+       "imageRepWithContentsOfURL:",
+       "imageRepWithData:",
+       "imageRepWithPasteboard:",
+       "imageRepsWithContentsOfFile:",
+       "imageRepsWithContentsOfURL:",
+       "imageRepsWithData:",
+       "imageRepsWithPasteboard:",
+       "imageScaling",
+       "imageSize",
+       "imageUnfilteredFileTypes",
+       "imageUnfilteredPasteboardTypes",
+       "imageWidth",
+       "imageWithoutAlpha",
+       "implementorAtIndex:",
+       "implementsSelector:",
+       "importMailboxes:",
+       "importObject:",
+       "importedObjects",
+       "importsGraphics",
+       "inRedirectionLoop",
+       "inUse",
+       "inboxMailboxSelected:",
+       "inboxMessageStorePath",
+       "includeDeleted",
+       "includeWhenGettingMail",
+       "incomingSpoolDirectory",
+       "increaseLengthBy:",
+       "increaseSizesToFit:",
+       "incrementBy:",
+       "incrementExtraRefCount",
+       "incrementLocation",
+       "incrementSpecialRefCount",
+       "incrementUndoTransactionID",
+       "indent:",
+       "indentForListItemsWithState:",
+       "indentStringForChildrenWithIndentString:",
+       "indentUsingTabs",
+       "indentationMarkerFollowsCell",
+       "indentationPerLevel",
+       "independentConversationQueueing",
+       "independentCopy",
+       "index",
+       "indexEnumerator",
+       "indexExistsForStore:",
+       "indexFollowing:",
+       "indexForKey:",
+       "indexForMailboxPath:",
+       "indexForSortingByMessageNumber",
+       "indexInfoForItem:",
+       "indexManager",
+       "indexOf:",
+       "indexOf:::",
+       "indexOf:options:",
+       "indexOfAddressReference:",
+       "indexOfAttributeBySelector:equalToObject:",
+       "indexOfCanonicalFaceString:inCanonicalFaceStringArray:",
+       "indexOfCardReference:",
+       "indexOfCellWithRepresentedObject:",
+       "indexOfCellWithTag:",
+       "indexOfChild:",
+       "indexOfItem:",
+       "indexOfItemAtPoint:",
+       "indexOfItemWithObjectValue:",
+       "indexOfItemWithRepresentedObject:",
+       "indexOfItemWithSubmenu:",
+       "indexOfItemWithTag:",
+       "indexOfItemWithTarget:andAction:",
+       "indexOfItemWithTitle:",
+       "indexOfMessage:",
+       "indexOfNextNonDeletedMessage:ignoreSelected:",
+       "indexOfObject:",
+       "indexOfObject:inRange:",
+       "indexOfObject:range:identical:",
+       "indexOfObject:usingSortFunction:context:",
+       "indexOfObjectIdenticalTo:",
+       "indexOfObjectIdenticalTo:inRange:",
+       "indexOfObjectIndenticalTo:",
+       "indexOfObjectMatchingValue:forKey:",
+       "indexOfSelectedItem",
+       "indexOfTabViewItem:",
+       "indexOfTabViewItemWithIdentifier:",
+       "indexOfTag:inString:",
+       "indexOfTickMarkAtPoint:",
+       "indexPreceding:",
+       "indexValue",
+       "indexesForObjectsIndenticalTo:",
+       "indicatorImageInTableColumn:",
+       "indicesOfObjectsByEvaluatingObjectSpecifier:",
+       "indicesOfObjectsByEvaluatingWithContainer:count:",
+       "info",
+       "infoDictionary",
+       "infoTable",
+       "infoTableFor:",
+       "init",
+       "initAndTestWithTests:",
+       "initAsTearOff",
+       "initByReferencingFile:",
+       "initCount:",
+       "initCount:andPostings:",
+       "initCount:elementSize:description:",
+       "initDir:file:docInfo:",
+       "initDirectoryWithFileWrappers:",
+       "initEPSOperationWithView:insideRect:toData:printInfo:",
+       "initFileURLWithPath:",
+       "initForDeserializerStream:",
+       "initForReadingWithData:",
+       "initForSerializerStream:",
+       "initForViewer:",
+       "initForWritingWithMutableData:",
+       "initFrameControls",
+       "initFromBlock:inStore:",
+       "initFromDefaultTreeInStore:mustExist:",
+       "initFromDocument:",
+       "initFromElement:ofDocument:",
+       "initFromFile:forWriting:",
+       "initFromFile:forWriting:createIfAbsent:",
+       "initFromImage:rect:",
+       "initFromInfo:",
+       "initFromMemoryNoCopy:length:freeWhenDone:",
+       "initFromNSFile:forWriting:",
+       "initFromName:device:inode:",
+       "initFromName:inFile:forWriting:",
+       "initFromNib",
+       "initFromPath:",
+       "initFromPath:dictionary:",
+       "initFromSerialized:",
+       "initFromSerializerStream:length:",
+       "initFromSize:andColor:",
+       "initImageCell:",
+       "initImageCell:withRepresentedItem:",
+       "initInStore:",
+       "initListDescriptor",
+       "initMainControls",
+       "initMessageViewText",
+       "initNSRoot:",
+       "initNotTestWithTest:",
+       "initObject:withCoder:",
+       "initOffscreen:withDepth:",
+       "initOrTestWithTests:",
+       "initPageControls",
+       "initPopUpWindow",
+       "initPrintInfo",
+       "initRecordDescriptor",
+       "initRegion:ofLength:atAddress:",
+       "initRegularFileWithContents:",
+       "initRemoteWithProtocolFamily:socketType:protocol:address:",
+       "initRemoteWithTCPPort:host:",
+       "initRoot:",
+       "initSymbolicLinkWithDestination:",
+       "initTableControls",
+       "initTextCell:",
+       "initTextCell:pullsDown:",
+       "initTitleButton:",
+       "initTitleCell:",
+       "initTitleCell:styleMask:",
+       "initUnixFile:",
+       "initWithAddressBookRef:",
+       "initWithAffectedRange:layoutManager:undoManager:",
+       "initWithAffectedRange:layoutManager:undoManager:replacementRange:",
+       "initWithArray:",
+       "initWithArray:addObject:",
+       "initWithArray:andToolBar:buttonOffset:",
+       "initWithArray:copyItems:",
+       "initWithArray:removeObject:",
+       "initWithArray:removeObjectAtIndex:",
+       "initWithAttributeDictionary:",
+       "initWithAttributedString:",
+       "initWithAttributes:",
+       "initWithAttributes:range:",
+       "initWithBTree:",
+       "initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:",
+       "initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:size:",
+       "initWithBitmapRepresentation:",
+       "initWithBom:archNames:delegate:",
+       "initWithBom:archNames:delegate:inodeMap:",
+       "initWithBool:",
+       "initWithButtonID:",
+       "initWithBytes:length:",
+       "initWithBytes:length:copy:freeWhenDone:bytesAreVM:",
+       "initWithBytes:length:encoding:",
+       "initWithBytes:objCType:",
+       "initWithBytesNoCopy:length:",
+       "initWithCString:",
+       "initWithCString:length:",
+       "initWithCStringNoCopy:length:",
+       "initWithCStringNoCopy:length:freeWhenDone:",
+       "initWithCapacity:",
+       "initWithCapacity:compareSelector:",
+       "initWithCatalogName:colorName:genericColor:",
+       "initWithCell:",
+       "initWithChar:",
+       "initWithCharacterRange:isSoft:",
+       "initWithCharacterSet:",
+       "initWithCharacters:length:",
+       "initWithCharactersInString:",
+       "initWithCharactersNoCopy:length:",
+       "initWithCharactersNoCopy:length:freeWhenDone:",
+       "initWithClassDescription:editingContext:",
+       "initWithClassPath:",
+       "initWithClient:",
+       "initWithCoder:",
+       "initWithColorList:",
+       "initWithCommandDescription:",
+       "initWithComment:",
+       "initWithComment:useDashes:",
+       "initWithCompareSelector:",
+       "initWithCondition:",
+       "initWithConnection:components:",
+       "initWithContainerClassDescription:containerSpecifier:key:",
+       "initWithContainerClassDescription:containerSpecifier:key:index:",
+       "initWithContainerClassDescription:containerSpecifier:key:relativePosition:baseSpecifier:",
+       "initWithContainerClassDescription:containerSpecifier:key:startSpecifier:endSpecifier:",
+       "initWithContainerClassDescription:containerSpecifier:key:test:",
+       "initWithContainerSize:",
+       "initWithContainerSpecifier:key:",
+       "initWithContentRect:",
+       "initWithContentRect:comboBoxCell:",
+       "initWithContentRect:styleMask:backing:defer:",
+       "initWithContentRect:styleMask:backing:defer:drawer:",
+       "initWithContentRect:styleMask:backing:defer:screen:",
+       "initWithContentSize:preferredEdge:",
+       "initWithContentsOfFile:",
+       "initWithContentsOfFile:andButtonSize:",
+       "initWithContentsOfFile:andButtonsWithSize:buttonOffset:",
+       "initWithContentsOfFile:byReference:",
+       "initWithContentsOfFile:ofType:",
+       "initWithContentsOfMappedFile:",
+       "initWithContentsOfURL:",
+       "initWithContentsOfURL:byReference:",
+       "initWithContentsOfURL:ofType:",
+       "initWithCyan:magenta:yellow:black:alpha:",
+       "initWithData:",
+       "initWithData:DIBFormat:",
+       "initWithData:encoding:",
+       "initWithData:isFull:",
+       "initWithData:range:",
+       "initWithDataRepresentation:",
+       "initWithDate:",
+       "initWithDateFormat:allowNaturalLanguage:",
+       "initWithDecimal:",
+       "initWithDefaultAttributes:",
+       "initWithDelegate:",
+       "initWithDelegate:name:",
+       "initWithDescriptor:andSize:forWriting:",
+       "initWithDescriptor:andSize:forWriting:isTemporary:",
+       "initWithDescriptorType:data:",
+       "initWithDictionary:",
+       "initWithDictionary:copyItems:",
+       "initWithDictionary:removeObjectForKey:",
+       "initWithDictionary:setObject:forKey:",
+       "initWithDisplayDisciplineLevelsAndString:displayOnly:",
+       "initWithDisplayName:address:type:message:",
+       "initWithDocument:",
+       "initWithDomainName:key:title:image:",
+       "initWithDouble:",
+       "initWithDrawSelector:delegate:",
+       "initWithDrawingFrame:inTextView:editedItem:editedCell:",
+       "initWithDynamicMenuItemDictionary:",
+       "initWithEditingContext:classDescription:globalID:",
+       "initWithEditor:",
+       "initWithElementName:",
+       "initWithElementSize:capacity:",
+       "initWithEntityName:qualifier:sortOrderings:usesDistinct:isDeep:hints:",
+       "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:",
+       "initWithExactName:data:",
+       "initWithExpressionString:",
+       "initWithExternalRepresentation:",
+       "initWithFile:",
+       "initWithFile:forDirectory:",
+       "initWithFile:fromBom:keepArchs:keepLangs:",
+       "initWithFile:fromDirectory:",
+       "initWithFile:fromDirectory:includeDirectoryPath:",
+       "initWithFileAttributes:",
+       "initWithFileDescriptor:",
+       "initWithFileDescriptor:closeOnDealloc:",
+       "initWithFileName:markerName:",
+       "initWithFileWrapper:",
+       "initWithFireDate:interval:target:selector:userInfo:repeats:userInfoIsArgument:",
+       "initWithFloat:",
+       "initWithFocusedViewRect:",
+       "initWithFolderType:createFolder:",
+       "initWithFormat:",
+       "initWithFormat:arguments:",
+       "initWithFormat:locale:",
+       "initWithFormat:locale:arguments:",
+       "initWithFormat:shareContext:",
+       "initWithFrame:",
+       "initWithFrame:cellCount:name:",
+       "initWithFrame:depth:",
+       "initWithFrame:framedItem:",
+       "initWithFrame:htmlView:",
+       "initWithFrame:inStatusBar:",
+       "initWithFrame:inWindow:",
+       "initWithFrame:menuView:",
+       "initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:",
+       "initWithFrame:mode:prototype:numberOfRows:numberOfColumns:",
+       "initWithFrame:pixelFormat:",
+       "initWithFrame:prototypeRulerMarker:",
+       "initWithFrame:pullsDown:",
+       "initWithFrame:rawTextController:",
+       "initWithFrame:styleMask:owner:",
+       "initWithFrame:text:alignment:",
+       "initWithFrame:textContainer:",
+       "initWithFrame:textController:",
+       "initWithFunc:forImp:selector:",
+       "initWithFunc:ivarOffset:",
+       "initWithGlyphIndex:characterRange:",
+       "initWithGrammar:",
+       "initWithGrammarRules:andGroups:",
+       "initWithHTML:baseURL:documentAttributes:",
+       "initWithHTML:documentAttributes:",
+       "initWithHTMLString:url:",
+       "initWithHeaderLevel:",
+       "initWithHeaders:",
+       "initWithHeaders:flags:size:uid:",
+       "initWithHeap:",
+       "initWithHorizontalRule:",
+       "initWithHost:port:",
+       "initWithHostName:serverName:textProc:errorProc:timeout:secure:encapsulated:",
+       "initWithHosts:port:",
+       "initWithHue:saturation:brightness:alpha:",
+       "initWithIdentifier:",
+       "initWithImage:",
+       "initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:",
+       "initWithImage:hotSpot:",
+       "initWithImage:representedItem:outliningWhenSelected:",
+       "initWithImage:representedItem:outliningWhenSelected:size:",
+       "initWithImage:selectedImage:representedItem:",
+       "initWithImage:window:",
+       "initWithInt:",
+       "initWithInvocation:conversation:sequence:importedObjects:connection:",
+       "initWithKey:",
+       "initWithKey:isStored:",
+       "initWithKey:mask:binding:",
+       "initWithKey:operatorSelector:value:",
+       "initWithKey:selector:",
+       "initWithKeyValueUnarchiver:",
+       "initWithLeftKey:operatorSelector:rightKey:",
+       "initWithLength:",
+       "initWithLocal:connection:",
+       "initWithLong:",
+       "initWithLongLong:",
+       "initWithMKKDInitializer:index:",
+       "initWithMKKDInitializer:index:key:",
+       "initWithMachMessage:",
+       "initWithMachPort:",
+       "initWithMantissa:exponent:isNegative:",
+       "initWithMapping:",
+       "initWithMarker:attributeString:",
+       "initWithMarker:attributes:",
+       "initWithMasterClassDescription:detailKey:",
+       "initWithMasterDataSource:detailKey:",
+       "initWithMessage:",
+       "initWithMessage:connection:",
+       "initWithMessage:sender:subject:dateReceived:",
+       "initWithMessage:sender:to:subject:dateReceived:",
+       "initWithMessageStore:",
+       "initWithMethodSignature:",
+       "initWithMimeBodyPart:",
+       "initWithMovie:",
+       "initWithMutableAttributedString:",
+       "initWithMutableData:forDebugging:languageEncoding:nameEncoding:textProc:errorProc:",
+       "initWithName:",
+       "initWithName:data:",
+       "initWithName:element:",
+       "initWithName:elementNames:",
+       "initWithName:fromFile:",
+       "initWithName:host:",
+       "initWithName:inFile:",
+       "initWithName:object:userInfo:",
+       "initWithName:parent:resolve:",
+       "initWithName:reason:userInfo:",
+       "initWithNotificationCenter:",
+       "initWithObjectSpecifier:comparisonOperator:testObject:",
+       "initWithObjects:",
+       "initWithObjects:count:",
+       "initWithObjects:count:target:reverse:freeWhenDone:",
+       "initWithObjects:forKeys:",
+       "initWithObjects:forKeys:count:",
+       "initWithObjectsAndKeys:",
+       "initWithOffset:",
+       "initWithParentObjectStore:",
+       "initWithPasteboard:",
+       "initWithPasteboardDataRepresentation:",
+       "initWithPath:",
+       "initWithPath:create:readOnly:account:",
+       "initWithPath:documentAttributes:",
+       "initWithPath:encoding:ignoreRTF:ignoreHTML:uniqueZone:",
+       "initWithPath:encoding:uniqueZone:",
+       "initWithPath:flags:createMode:",
+       "initWithPath:inAccount:",
+       "initWithPath:mode:uid:gid:mTime:inode:device:",
+       "initWithPath:mode:uid:gid:mTime:inode:size:",
+       "initWithPath:mode:uid:gid:mTime:inode:size:sum:",
+       "initWithPath:mode:uid:gid:mTime:inode:size:sum:target:",
+       "initWithPersistentStateDictionary:",
+       "initWithPickerMask:colorPanel:",
+       "initWithPosition:objectSpecifier:",
+       "initWithPostingsIn:",
+       "initWithPreferenceDisciplineLevelsAndString:displayOnly:",
+       "initWithPropertyList:owner:",
+       "initWithProtocolFamily:socketType:protocol:address:",
+       "initWithProtocolFamily:socketType:protocol:socket:",
+       "initWithQualifier:",
+       "initWithQualifierArray:",
+       "initWithQualifiers:",
+       "initWithQueue:threadNumber:",
+       "initWithRTF:",
+       "initWithRTF:documentAttributes:",
+       "initWithRTFD:",
+       "initWithRTFD:documentAttributes:",
+       "initWithRTFDFileWrapper:",
+       "initWithRTFDFileWrapper:documentAttributes:",
+       "initWithRange:",
+       "initWithRawCatalogInfo:name:parentRef:hidden:",
+       "initWithRealClient:",
+       "initWithRealTextStorage:",
+       "initWithReceivePort:sendPort:",
+       "initWithReceivePort:sendPort:components:",
+       "initWithRect:color:ofView:",
+       "initWithRed:green:blue:alpha:",
+       "initWithRef:",
+       "initWithRef:containerType:",
+       "initWithRef:hidden:",
+       "initWithRefCountedRunArray:",
+       "initWithRemoteName:",
+       "initWithRepresentedItem:",
+       "initWithRepresentedItem:baseImage:size:",
+       "initWithRepresentedItem:image:label:size:",
+       "initWithRepresentedItem:imageType:size:",
+       "initWithResults:connection:",
+       "initWithRoot:",
+       "initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:",
+       "initWithRulebookSet:",
+       "initWithRulerView:markerLocation:image:imageOrigin:",
+       "initWithRunStorage:",
+       "initWithScheme:host:path:",
+       "initWithScript:",
+       "initWithScriptString:",
+       "initWithScrollView:orientation:",
+       "initWithSelection:",
+       "initWithSelector:",
+       "initWithSendPort:receivePort:components:",
+       "initWithSerializedRepresentation:",
+       "initWithSet:",
+       "initWithSet:copyItems:",
+       "initWithSetFunc:forImp:selector:",
+       "initWithSetFunc:ivarOffset:",
+       "initWithSetHeader:",
+       "initWithShort:",
+       "initWithSize:",
+       "initWithSize:depth:separate:alpha:",
+       "initWithSparseArray:",
+       "initWithStatusMessage:",
+       "initWithStore:",
+       "initWithStorePaths:",
+       "initWithString:",
+       "initWithString:attributes:",
+       "initWithString:calendarFormat:",
+       "initWithString:calendarFormat:locale:",
+       "initWithString:locale:",
+       "initWithString:relativeToURL:",
+       "initWithString:type:",
+       "initWithSuiteName:bundle:",
+       "initWithSuiteName:className:dictionary:",
+       "initWithSuiteName:commandName:dictionary:",
+       "initWithSyntacticDiscipline:semanticDiscipline:string:displayOnly:",
+       "initWithTCPPort:",
+       "initWithTable:",
+       "initWithTarget:",
+       "initWithTarget:action:priority:",
+       "initWithTarget:connection:",
+       "initWithTarget:invocation:",
+       "initWithTarget:protocol:",
+       "initWithTarget:selector:object:",
+       "initWithText:fillColor:textColor:shape:representedItem:",
+       "initWithTextAttachment:",
+       "initWithTextStorage:",
+       "initWithTextStorage:range:",
+       "initWithTimeInterval:sinceDate:",
+       "initWithTimeIntervalSince1970:",
+       "initWithTimeIntervalSinceNow:",
+       "initWithTimeIntervalSinceReferenceDate:",
+       "initWithTimeout:",
+       "initWithTitle:",
+       "initWithTitle:action:keyEquivalent:",
+       "initWithTransform:",
+       "initWithTree:",
+       "initWithType:arg:",
+       "initWithType:location:",
+       "initWithType:message:",
+       "initWithURL:byReference:",
+       "initWithURL:cached:",
+       "initWithURL:documentAttributes:",
+       "initWithUTF8String:",
+       "initWithUnsignedChar:",
+       "initWithUnsignedInt:",
+       "initWithUnsignedLong:",
+       "initWithUnsignedLongLong:",
+       "initWithUnsignedShort:",
+       "initWithUser:",
+       "initWithVCard:",
+       "initWithVCardRef:",
+       "initWithView:",
+       "initWithView:className:",
+       "initWithView:height:fill:",
+       "initWithView:printInfo:",
+       "initWithView:representedItem:",
+       "initWithWhite:alpha:",
+       "initWithWindow:",
+       "initWithWindow:rect:",
+       "initWithWindowNibName:",
+       "initWithWindowNibName:owner:",
+       "initWithWindowNibPath:owner:",
+       "initWithYear:month:day:hour:minute:second:timeZone:",
+       "initialEvent",
+       "initialFirstResponder",
+       "initialPoint",
+       "initialize",
+       "initializeBackingStoreForLocation:",
+       "initializeFromDefaults",
+       "initializeItem:",
+       "initializeObject:withGlobalID:editingContext:",
+       "initializeUserAndSystemFonts",
+       "initializeUserInterface",
+       "initializerFromKeyArray:",
+       "innerBorder",
+       "innerBorderColor",
+       "innerRect",
+       "innerTitleRect",
+       "inode",
+       "inodeMap",
+       "inputClientBecomeActive:",
+       "inputClientDisabled:",
+       "inputClientEnabled:",
+       "inputClientResignActive:",
+       "inputContext",
+       "inputContextWithClient:",
+       "inputKeyBindingManager",
+       "inputSize",
+       "inputType",
+       "insert:",
+       "insert:at:",
+       "insert:replaceOK:",
+       "insert:replaceOK:andWriteData:",
+       "insert:value:",
+       "insertAddress:forHeader:atIndex:",
+       "insertAttributedString:atIndex:",
+       "insertBacktab:",
+       "insertBrowser:",
+       "insertButton:",
+       "insertCheckBox:",
+       "insertChild:atIndex:",
+       "insertChildren:atIndex:",
+       "insertColor:key:atIndex:",
+       "insertColumn:",
+       "insertColumn:withCells:",
+       "insertDescriptor:atIndex:",
+       "insertElement:at:",
+       "insertElement:atIndex:",
+       "insertElement:range:coalesceRuns:",
+       "insertElements:count:atIndex:",
+       "insertEntry:atIndex:",
+       "insertFile:",
+       "insertFile:withInode:onDevice:",
+       "insertFileInput:",
+       "insertFileUpload:",
+       "insertFiles:",
+       "insertGlyph:atGlyphIndex:characterIndex:",
+       "insertHiddenField:",
+       "insertHtmlDictionary:isPlainText:",
+       "insertImage:",
+       "insertImageButton:",
+       "insertImageFile:",
+       "insertInBccRecipients:atIndex:",
+       "insertInCcRecipients:atIndex:",
+       "insertInComposeMessages:atIndex:",
+       "insertInMessageEditors:atIndex:",
+       "insertInOrderedDocuments:atIndex:",
+       "insertInScrollViewWithMaxLines:",
+       "insertInToRecipients:atIndex:",
+       "insertInode:andPath:",
+       "insertInodeIfNotPresent:andPath:",
+       "insertInputElementOfType:followedByText:",
+       "insertItem:atIndex:",
+       "insertItem:path:dirInfo:zone:plist:",
+       "insertItemWithObjectValue:atIndex:",
+       "insertItemWithTitle:action:keyEquivalent:atIndex:",
+       "insertItemWithTitle:atIndex:",
+       "insertNewButtonImage:in:",
+       "insertNewline:",
+       "insertNewlineIgnoringFieldEditor:",
+       "insertNode:overChildren:",
+       "insertNonbreakingSpace:",
+       "insertObject:",
+       "insertObject:at:",
+       "insertObject:atIndex:",
+       "insertObject:range:",
+       "insertObject:usingSortFunction:context:",
+       "insertObject:withGlobalID:",
+       "insertObjectIfAbsent:usingSortFunction:context:",
+       "insertParagraphSeparator:",
+       "insertPasswordField:",
+       "insertPath:andProject:",
+       "insertPopUpButton:",
+       "insertPreferringDirectories:",
+       "insertProxy:",
+       "insertRadioButton:",
+       "insertRecipient:atIndex:inHeaderWithKey:",
+       "insertResetButton:",
+       "insertRow:",
+       "insertRow:withCells:",
+       "insertSelector",
+       "insertSpace:atIndex:",
+       "insertString:atIndex:",
+       "insertString:atLocation:",
+       "insertSubmitButton:",
+       "insertTab:",
+       "insertTabIgnoringFieldEditor:",
+       "insertTabViewItem:atIndex:",
+       "insertText:",
+       "insertText:client:",
+       "insertTextArea:",
+       "insertTextContainer:atIndex:",
+       "insertTextField:",
+       "insertValue:atIndex:inPropertyWithKey:",
+       "insertedObjects",
+       "insertionContainer",
+       "insertionIndex",
+       "insertionKey",
+       "insertionPointColor",
+       "inspectedBody",
+       "inspectedDocument",
+       "inspectedHTMLView",
+       "inspectedItem",
+       "inspectedSelection",
+       "inspectionChanged",
+       "inspectionChanged:",
+       "inspectorClass",
+       "inspectorClassForItem:",
+       "inspectorClassName",
+       "inspectorFor:",
+       "inspectorIsFloating",
+       "inspectorName",
+       "inspectorView",
+       "installInputManagerMenu",
+       "instanceMethodDescFor:",
+       "instanceMethodDescriptionForSelector:",
+       "instanceMethodFor:",
+       "instanceMethodForSelector:",
+       "instanceMethodSignatureForSelector:",
+       "instancesImplementSelector:",
+       "instancesRespondTo:",
+       "instancesRespondToSelector:",
+       "instancesRetainRegisteredObjects",
+       "instantiate::",
+       "instantiateObject:",
+       "instantiateProjectNamed:inDirectory:appendProjectExtension:",
+       "instantiateWithMarker:attributes:",
+       "instantiateWithObjectInstantiator:",
+       "intAttribute:forGlyphAtIndex:",
+       "intForKey:inTable:",
+       "intValue",
+       "intValueForAttribute:withDefault:",
+       "intValueForAttribute:withDefault:minimum:",
+       "integerForKey:",
+       "interRowSpacing",
+       "intercellSpacing",
+       "interfaceExtension",
+       "interfaceStyle",
+       "interiorFrame",
+       "internalSaveTo:removeBackup:errorHandler:",
+       "internalSaveTo:removeBackup:errorHandler:temp:backup:",
+       "internalWritePath:errorHandler:remapContents:",
+       "interpretEventAsCommand:forClient:",
+       "interpretEventAsText:forClient:",
+       "interpretKeyEvents:",
+       "interpretKeyEvents:forClient:",
+       "interpretKeyEvents:sender:",
+       "interpreterArguments",
+       "interpreterPath",
+       "interrupt",
+       "interruptExecution",
+       "intersectBitVector:",
+       "intersectSet:",
+       "intersectionWithBitVector:",
+       "intersectsBitVector:",
+       "intersectsItem:",
+       "intersectsSet:",
+       "interval",
+       "invTransform:",
+       "invTransformRect:",
+       "invalidate",
+       "invalidate:",
+       "invalidateAllObjects",
+       "invalidateAttributesInRange:",
+       "invalidateClassDescriptionCache",
+       "invalidateConnectionsAsNecessary:",
+       "invalidateCursorRectsForView:",
+       "invalidateDeleteStack",
+       "invalidateDisplayForCharacterRange:",
+       "invalidateDisplayForGlyphRange:",
+       "invalidateEditingContext",
+       "invalidateFocus:",
+       "invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:",
+       "invalidateHashMarks",
+       "invalidateInvisible",
+       "invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:",
+       "invalidateObjectsWithGlobalIDs:",
+       "invalidateProxy",
+       "invalidateResourceCache",
+       "invalidateTable",
+       "invalidateTargetSourceTree",
+       "invalidateTextContainerOrigin",
+       "invalidateWrapper",
+       "invalidatesObjectsWhenFreed",
+       "inverseForRelationshipKey:",
+       "invert",
+       "invertedDictionary",
+       "invertedSet",
+       "invocation",
+       "invocationWithMethodSignature:",
+       "invocationWithSelector:target:object:",
+       "invocationWithSelector:target:object:taskName:canBeCancelled:",
+       "invocationWithSelector:target:taskName:canBeCancelled:",
+       "invoke",
+       "invokeEditorForItem:selecting:",
+       "invokeEditorForItem:withEvent:",
+       "invokeServiceIn:msg:pb:userData:error:",
+       "invokeServiceIn:msg:pb:userData:menu:remoteServices:",
+       "invokeWithTarget:",
+       "isAClassOfObject:",
+       "isARepeat",
+       "isAbsolutePath",
+       "isActive",
+       "isAddressBookActive:",
+       "isAddressHeaderKey:",
+       "isAggregate",
+       "isAlias",
+       "isAlwaysVisible",
+       "isAncestorOfObject:",
+       "isAnyAccountOffline",
+       "isAppleScriptConnectionOpen",
+       "isApplication",
+       "isAtEnd",
+       "isAttached",
+       "isAttributeKeyEqual:",
+       "isAttributeStringValueEqual:",
+       "isAutodisplay",
+       "isAutoscroll",
+       "isAvailableForIndexing",
+       "isAvailableForViewing",
+       "isBacked",
+       "isBackgroundProcessingEnabled",
+       "isBaseFont",
+       "isBeginMark",
+       "isBezeled",
+       "isBidirectionalControlCharacter:",
+       "isBlockItem:",
+       "isBooleanAttribute:",
+       "isBordered",
+       "isBorderedForState:",
+       "isBound",
+       "isBycopy",
+       "isByref",
+       "isCachedSeparately",
+       "isCanonical",
+       "isCaseInsensitiveLike:",
+       "isClosedByCloseTag:",
+       "isClosedByOpenTag:",
+       "isClosedByUnadaptableOpenTag:",
+       "isCoalescing",
+       "isColor",
+       "isColumnSelected:",
+       "isCompact",
+       "isContextHelpModeActive",
+       "isContinuous",
+       "isContinuousSpellCheckingEnabled",
+       "isControllerVisible",
+       "isCopyingOperation",
+       "isCurrListEditable",
+       "isDataRetained",
+       "isDaylightSavingTime",
+       "isDaylightSavingTimeForDate:",
+       "isDaylightSavingTimeForTimeInterval:",
+       "isDeadKeyProcessingEnabled",
+       "isDeep",
+       "isDeferred",
+       "isDeletableFileAtPath:",
+       "isDescendantOf:",
+       "isDirectory",
+       "isDirty",
+       "isDisjoint",
+       "isDisplayPostingDisabled",
+       "isDisposable",
+       "isDocumentEdited",
+       "isDragging",
+       "isDrawingToScreen",
+       "isEPSOperation",
+       "isEditable",
+       "isEmpty",
+       "isEnabled",
+       "isEndMark",
+       "isEntryAcceptable:",
+       "isEqual:",
+       "isEqualTo:",
+       "isEqualToArray:",
+       "isEqualToAttributedString:",
+       "isEqualToBitVector:",
+       "isEqualToConjointSelection:",
+       "isEqualToData:",
+       "isEqualToDate:",
+       "isEqualToDictionary:",
+       "isEqualToDisjointSelection:",
+       "isEqualToDisplayOnlySelection:",
+       "isEqualToHost:",
+       "isEqualToNumber:",
+       "isEqualToSelection:",
+       "isEqualToSet:",
+       "isEqualToString:",
+       "isEqualToTimeZone:",
+       "isEqualToValue:",
+       "isError",
+       "isEventCoalescingEnabled",
+       "isExcludedFromWindowsMenu",
+       "isExecutableFileAtPath:",
+       "isExpandable:",
+       "isExpanded",
+       "isFault",
+       "isFault:",
+       "isFetching",
+       "isFieldEditor",
+       "isFileReference",
+       "isFileURL",
+       "isFinal",
+       "isFixedPitch",
+       "isFlipped",
+       "isFloatingPanel",
+       "isFlushDisabled",
+       "isFlushWindowDisabled",
+       "isFocused",
+       "isFontAvailable:",
+       "isFragment",
+       "isFrameConnected",
+       "isFrameset",
+       "isFrozen",
+       "isGreaterThan:",
+       "isGreaterThanOrEqualTo:",
+       "isGroup",
+       "isHTML",
+       "isHTMLChange",
+       "isHardLinkGroupLeader:",
+       "isHeader",
+       "isHeartBeatThread",
+       "isHidden",
+       "isHighlighted",
+       "isHitByPath:",
+       "isHitByPoint:",
+       "isHitByRect:",
+       "isHorizontal",
+       "isHorizontallyCentered",
+       "isHorizontallyResizable",
+       "isHostCacheEnabled",
+       "isIdentical:",
+       "isIdenticalTo:",
+       "isIdenticalToIgnoringMTime:",
+       "isImmutableNode:",
+       "isInInterfaceBuilder",
+       "isIndeterminate",
+       "isIndexOnly",
+       "isIndexed",
+       "isInlineSpellCheckingEnabled",
+       "isIsolatedFromChildren",
+       "isIsolatedFromText",
+       "isIsolatedInNode:",
+       "isItemAtPathExpandable:",
+       "isItemExpanded:",
+       "isKey:inTable:",
+       "isKeyEqual:",
+       "isKeyWindow",
+       "isKindOf:",
+       "isKindOfClass:",
+       "isKindOfClass:forFault:",
+       "isKindOfClassNamed:",
+       "isKindOfGivenName:",
+       "isLeaf",
+       "isLessThan:",
+       "isLessThanOrEqualTo:",
+       "isLike:",
+       "isLoaded",
+       "isLocalMount",
+       "isLocalizable:",
+       "isLocking",
+       "isMainWindow",
+       "isMatch",
+       "isMemberOf:",
+       "isMemberOfClass:",
+       "isMemberOfClass:forFault:",
+       "isMemberOfClassNamed:",
+       "isMemberOfGivenName:",
+       "isMessageAvailable:",
+       "isMiniaturizable",
+       "isMiniaturized",
+       "isModalPanel",
+       "isMovable",
+       "isMultiThreaded",
+       "isMultiple",
+       "isMutable",
+       "isMuted",
+       "isNSIDispatchProxy",
+       "isNativeType:",
+       "isNotEqualTo:",
+       "isObjectLockedWithGlobalID:editingContext:",
+       "isObjectScheduledForDeallocation:",
+       "isObscured",
+       "isOffline",
+       "isOneItem",
+       "isOneShot",
+       "isOneway",
+       "isOpaque",
+       "isOpaqueForState:",
+       "isOpen",
+       "isOptionalArgumentWithName:",
+       "isOutputStackInReverseOrder",
+       "isOutputTraced",
+       "isPackage",
+       "isPaneSplitter",
+       "isPartialStringValid:newEditingString:errorDescription:",
+       "isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:",
+       "isPathToFrameworkProject",
+       "isPercentageHeight",
+       "isPercentageWidth",
+       "isPlanar",
+       "isPlaying",
+       "isProxy",
+       "isPublic:",
+       "isQuotedString",
+       "isReadOnly",
+       "isReadOnlyKey:",
+       "isReadable",
+       "isReadableFileAtPath:",
+       "isReadableWithinTimeout:",
+       "isReadableWithinTimeout:descriptor:",
+       "isRedoing",
+       "isRegularFile",
+       "isReleasedWhenClosed",
+       "isRemovable",
+       "isRenderingRoot",
+       "isResizable",
+       "isRich",
+       "isRichText",
+       "isRotatedFromBase",
+       "isRotatedOrScaledFromBase",
+       "isRowSelected:",
+       "isRulerVisible",
+       "isRunning",
+       "isScalarProperty",
+       "isScrollable",
+       "isSelectable",
+       "isSelectionByRect",
+       "isSelectionVisible",
+       "isSeparatorItem",
+       "isServicesMenuItemEnabled:forUser:",
+       "isSetOnMouseEntered",
+       "isSetOnMouseExited",
+       "isShadowed",
+       "isShowingAllHeaders",
+       "isSimple",
+       "isSimpleAndNeedsMeasuring",
+       "isSimpleRectangularTextContainer",
+       "isSorted",
+       "isSortedAscending",
+       "isSortedDescending",
+       "isSpinning",
+       "isStrokeHitByPath:",
+       "isStrokeHitByPoint:",
+       "isStrokeHitByRect:",
+       "isSubdirectoryOfPath:",
+       "isSubsetOfSet:",
+       "isSuccessful",
+       "isSuperclassOfClass:",
+       "isSupportingCoalescing",
+       "isSymbolicLink",
+       "isSynchronized",
+       "isTag:closedByOpenTag:",
+       "isTemporary",
+       "isTextItem:",
+       "isTitled",
+       "isToMany",
+       "isToManyKey:",
+       "isTopLevel",
+       "isTornOff",
+       "isTouched",
+       "isTracking",
+       "isTransparent",
+       "isTrash",
+       "isTrue",
+       "isUndoRegistrationEnabled",
+       "isUndoable",
+       "isUndoing",
+       "isUnfinished",
+       "isUniqueItem:",
+       "isValid",
+       "isValidGlyphIndex:",
+       "isValidMailboxDirectory:",
+       "isVertical",
+       "isVerticallyCentered",
+       "isVerticallyResizable",
+       "isVisible",
+       "isVisited",
+       "isWaitCursorEnabled",
+       "isWellFormed",
+       "isWhitespaceString",
+       "isWindowInFocusStack:",
+       "isWindowLoaded",
+       "isWord:inDictionaries:caseSensitive:",
+       "isWordInUserDictionaries:caseSensitive:",
+       "isWrapper",
+       "isWritable",
+       "isWritableFileAtPath:",
+       "isZeroLength",
+       "isZoomable",
+       "isZoomed",
+       "italicAngle",
+       "item",
+       "item:acceptsAncestor:",
+       "item:acceptsParent:",
+       "item:isLegalChildOfParent:",
+       "itemAdded:",
+       "itemArray",
+       "itemAtIndex:",
+       "itemAtRow:",
+       "itemBulletString",
+       "itemChanged:",
+       "itemConformingToProtocol:",
+       "itemEditingIvarsCreateIfAbsent",
+       "itemEditingIvarsNullIfAbsent",
+       "itemEditingIvarsRaiseIfAbsent",
+       "itemForGeneratedIndex:",
+       "itemForLocation:affinity:",
+       "itemForLocation:affinity:offset:withMap:",
+       "itemForLocation:offset:withMap:",
+       "itemForMarker:attributeString:",
+       "itemForMarker:attributes:",
+       "itemForRange:",
+       "itemForRange:affinity:",
+       "itemForRange:affinity:offset:withMap:",
+       "itemForRange:offset:withMap:",
+       "itemForView:",
+       "itemFrameForEditorFrame:",
+       "itemHeight",
+       "itemMatrix",
+       "itemObjectValueAtIndex:",
+       "itemOfClass:",
+       "itemRange",
+       "itemRangeForItem:createIfNeeded:",
+       "itemRemoved:",
+       "itemTitleAtIndex:",
+       "itemTitles",
+       "itemWithID:",
+       "itemWithName:",
+       "itemWithName:ofClass:sourceDocument:",
+       "itemWithName:sourceDocument:",
+       "itemWithTag:",
+       "itemWithTitle:",
+       "javaDebuggerName",
+       "javaUsed",
+       "jobDisposition",
+       "jumpSlider:",
+       "jumpToSelection:",
+       "keepBackupFile",
+       "key",
+       "keyBindingManager",
+       "keyBindingManagerForClient:",
+       "keyBindingState",
+       "keyCell",
+       "keyClassDescription",
+       "keyCode",
+       "keyCount",
+       "keyDown:",
+       "keyEnumerator",
+       "keyEquivalent",
+       "keyEquivalentAttributedString",
+       "keyEquivalentFont",
+       "keyEquivalentModifierMask",
+       "keyEquivalentOffset",
+       "keyEquivalentRectForBounds:",
+       "keyEquivalentWidth",
+       "keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:",
+       "keyForFile:",
+       "keyForFileWrapper:",
+       "keyForMailboxPath:",
+       "keyIsSubprojOrBundle:",
+       "keyLimit",
+       "keyPathForBindingKey:",
+       "keySpecifier",
+       "keyUp:",
+       "keyValueBindingForKey:typeMask:",
+       "keyValues",
+       "keyValuesArray",
+       "keyViewSelectionDirection",
+       "keyWindow",
+       "keyWindowFrameHighlightColor",
+       "keyWindowFrameShadowColor",
+       "keyWithAppleEventCode:",
+       "keyboardFocusIndicatorColor",
+       "keys",
+       "keysSortedByValueUsingSelector:",
+       "keywordForDescriptorAtIndex:",
+       "knobColor",
+       "knobProportion",
+       "knobRectFlipped:",
+       "knobThickness",
+       "knownTimeZoneNames",
+       "knowsLastFrame",
+       "knowsLastPosition",
+       "knowsPageRange:",
+       "knowsPagesFirst:last:",
+       "label",
+       "labelFontOfSize:",
+       "labelFontSize",
+       "labelForHeader:",
+       "labelText",
+       "labelTextChanged",
+       "labelledItemChanged",
+       "language",
+       "languageCode",
+       "languageContext",
+       "languageContextWithName:",
+       "languageDir",
+       "languageLevel",
+       "languageName",
+       "languageWithName:",
+       "languagesPrefixesList",
+       "lastAndFirstName",
+       "lastCharacterIndex",
+       "lastChild",
+       "lastColumn",
+       "lastComponentFromRelationshipPath",
+       "lastComponentOfFileName",
+       "lastConversation",
+       "lastError",
+       "lastFileError",
+       "lastFrame",
+       "lastIndex",
+       "lastIndexOfObject:inRange:",
+       "lastItem",
+       "lastMessageDisplayed",
+       "lastName",
+       "lastObject",
+       "lastPathComponent",
+       "lastPosition",
+       "lastResponse",
+       "lastSemanticError",
+       "lastTextContainer",
+       "lastVisibleColumn",
+       "lastmostSelectedRow",
+       "laterDate:",
+       "launch",
+       "launchApplication:",
+       "launchApplication:showIcon:autolaunch:",
+       "launchPath",
+       "launchWithDictionary:",
+       "launchedTaskWithDictionary:",
+       "launchedTaskWithLaunchPath:arguments:",
+       "launchedTaskWithPath:arguments:",
+       "layoutControlGlyphForLineFragment:",
+       "layoutGlyphsInHorizontalLineFragment:baseline:",
+       "layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:",
+       "layoutManager",
+       "layoutManager:didCompleteLayoutForTextContainer:atEnd:",
+       "layoutManager:withOrigin:clickedOnLink:forItem:withRange:",
+       "layoutManagerDidInvalidateLayout:",
+       "layoutManagerOwnsFirstResponderInWindow:",
+       "layoutManagers",
+       "layoutTab",
+       "layoutToolbarMainControlsToConfiguration:",
+       "layoutToolbarWithResponder:toConfiguration:",
+       "lazyBrowserCell",
+       "leadingBlockCharacterLengthWithMap:",
+       "leadingOffset",
+       "learnWord:",
+       "learnWord:language:",
+       "leftIndentMarkerWithRulerView:location:",
+       "leftKey",
+       "leftMargin",
+       "leftMarginMarkerWithRulerView:location:",
+       "leftNeighbor",
+       "leftSibling",
+       "leftTabMarkerWithRulerView:location:",
+       "length",
+       "lengthWithMap:",
+       "letterCharacterSet",
+       "level",
+       "levelForItem:",
+       "levelForRow:",
+       "levelsOfUndo",
+       "lightBorderColor",
+       "lightBorderColorForCell:",
+       "lightGrayColor",
+       "likesChildren",
+       "limitDateForMode:",
+       "lineBreak",
+       "lineBreakBeforeIndex:withinRange:",
+       "lineBreakHandler",
+       "lineBreakInString:beforeIndex:withinRange:useBook:",
+       "lineBreakMode",
+       "lineCapStyle",
+       "lineColor",
+       "lineFragmentPadding",
+       "lineFragmentRectForGlyphAtIndex:effectiveRange:",
+       "lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:",
+       "lineFragmentUsedRectForGlyphAtIndex:effectiveRange:",
+       "lineJoinStyle",
+       "lineLength",
+       "lineRangeForRange:",
+       "lineScroll",
+       "lineSpacing",
+       "lineToPoint:",
+       "lineWidth",
+       "link:toExisting:",
+       "link:toExisting:replaceOK:",
+       "linkColor",
+       "linkPath:toPath:handler:",
+       "linkState",
+       "linkSwitchChanged:",
+       "linkTrackMouseDown:",
+       "linksTo:",
+       "list",
+       "list:",
+       "listDescriptor",
+       "listDictionary",
+       "listingForMailbox:includeAllChildren:",
+       "load",
+       "loadAddressBooks",
+       "loadAnyNibNamed:owner:",
+       "loadBitmapFileHeader",
+       "loadBitmapInfoHeader",
+       "loadCacheFromFile",
+       "loadCachedImages",
+       "loadCachedInfoFromBytes:",
+       "loadCell:withColor:fromColorList:andText:",
+       "loadClass:",
+       "loadColorListNamed:fromFile:",
+       "loadColumnZero",
+       "loadDataRepresentation:ofType:",
+       "loadDisplayGrammar",
+       "loadEditableAddressBooks",
+       "loadEditingGrammar",
+       "loadFamilyNames",
+       "loadFileWrapperRepresentation:ofType:",
+       "loadFindStringFromPasteboard",
+       "loadFindStringToPasteboard",
+       "loadFromPath:encoding:ignoreRTF:ignoreHTML:",
+       "loadImage:",
+       "loadImageHeader",
+       "loadImageWithName:",
+       "loadInBackground",
+       "loadInForeground",
+       "loadLibrary:",
+       "loadMessageAsynchronously:",
+       "loadMovieFromFile:",
+       "loadMovieFromURL:",
+       "loadNib",
+       "loadNibFile:externalNameTable:withZone:",
+       "loadNibNamed:owner:",
+       "loadPrinters:",
+       "loadRegistry",
+       "loadResourceDataNotifyingClient:usingCache:",
+       "loadRulebook:",
+       "loadSoundWithName:",
+       "loadStandardAddressBooks",
+       "loadStandardAddressBooksWithOptions:",
+       "loadStylesFromDefaults",
+       "loadSuiteWithDictionary:fromBundle:",
+       "loadSuitesFromBundle:",
+       "loadUI",
+       "loadUserInfoCacheStartingFromPath:",
+       "loadWindow",
+       "loadedBundles",
+       "loadedCellAtRow:column:",
+       "localAccount",
+       "localFiles",
+       "localLibraryDirectory",
+       "localObjects",
+       "localProjectDidSave:",
+       "localProxies",
+       "localTimeZone",
+       "locale",
+       "localizableKeys",
+       "localizations",
+       "localizedCaseInsensitiveCompare:",
+       "localizedCatalogNameComponent",
+       "localizedColorNameComponent",
+       "localizedCompare:",
+       "localizedHelpString:",
+       "localizedInputManagerName",
+       "localizedNameForFamily:face:",
+       "localizedNameForTIFFCompressionType:",
+       "localizedNameOfStringEncoding:",
+       "localizedScannerWithString:",
+       "localizedStringForKey:value:table:",
+       "localizedStringWithFormat:",
+       "localizesFormat",
+       "location",
+       "locationForGlyphAtIndex:",
+       "locationForSubmenu:",
+       "locationInParentWithMap:",
+       "locationInWindow",
+       "locationOfPrintRect:",
+       "locationWithMap:",
+       "lock",
+       "lockBeforeDate:",
+       "lockDate",
+       "lockFocus",
+       "lockFocusForView:inRect:needsTranslation:",
+       "lockFocusIfCanDraw",
+       "lockFocusOnRepresentation:",
+       "lockForReading",
+       "lockForReadingWithExceptionHandler:",
+       "lockForWriting",
+       "lockObject:",
+       "lockObjectWithGlobalID:editingContext:",
+       "lockWhenCondition:",
+       "lockWhenCondition:beforeDate:",
+       "lockWithPath:",
+       "lockedAttributedStringFromRTFDFile:",
+       "lockedWriteRTFDToFile:atomically:",
+       "locksObjects",
+       "locksObjectsBeforeFirstModification",
+       "logCommandBegin:string:",
+       "logCommandEnd:",
+       "logCopy",
+       "logRead",
+       "logResponse:",
+       "logWhitespaceError:",
+       "logWrite",
+       "login:password:errorString:",
+       "logout",
+       "longForKey:",
+       "longLongValue",
+       "longMonthNames",
+       "longValue",
+       "longWeekdayNames",
+       "lookup:",
+       "lookupAbsolute:",
+       "lookupAddressBookWithPath:",
+       "lookupInode:",
+       "lookupMakeVariable:",
+       "lookupPathForShortName:andProject:",
+       "lookupProjectsForAbsolutePath:",
+       "lookupProjectsForRelativePath:",
+       "lookupProjectsForShortName:",
+       "loopMode",
+       "loosenKerning:",
+       "lossyCString",
+       "lowerBaseline:",
+       "lowerThreadPriority",
+       "lowercaseLetterCharacterSet",
+       "lowercaseSelfWithLocale:",
+       "lowercaseString",
+       "lowercaseStringWithLanguage:",
+       "lowercaseWord:",
+       "mTime",
+       "machPort",
+       "magentaColor",
+       "magentaComponent",
+       "mailAccountDirectory",
+       "mailAccounts",
+       "mailAttributedString:",
+       "mailDocument:",
+       "mailDocument:userData:error:",
+       "mailFrom:",
+       "mailSelection:userData:error:",
+       "mailTo:userData:error:",
+       "mailboxListingDidChange:",
+       "mailboxListingIsShowing",
+       "mailboxName",
+       "mailboxNameFromPath:",
+       "mailboxPathExtension",
+       "mailboxSelected:",
+       "mailboxSelectionChanged:",
+       "mailboxSelectionOwner",
+       "mailboxSelectionOwnerFromSender:",
+       "mailboxes",
+       "mailboxesController",
+       "mailerPath",
+       "mainBodyPart",
+       "mainBundle",
+       "mainInfoTable",
+       "mainMenu",
+       "mainNibFileForOSType:",
+       "mainScreen",
+       "mainWindow",
+       "mainWindowFrameColor",
+       "mainWindowFrameHighlightColor",
+       "mainWindowFrameShadowColor",
+       "maintainsFile:",
+       "makeCellAtRow:column:",
+       "makeCharacterSetCompact",
+       "makeCharacterSetFast",
+       "makeCompletePath:mode:",
+       "makeConsistentWithTree:",
+       "makeCurrentContext",
+       "makeCurrentEditorInvisible",
+       "makeDirectoryWithMode:",
+       "makeDocumentWithContentsOfFile:ofType:",
+       "makeDocumentWithContentsOfURL:ofType:",
+       "makeEnvironment",
+       "makeFile:localizable:",
+       "makeFile:public:",
+       "makeFirstResponder:",
+       "makeIdentity",
+       "makeImmutable",
+       "makeKeyAndOrderFront:",
+       "makeKeyWindow",
+       "makeMainWindow",
+       "makeMatrixIndirect:",
+       "makeMimeBoundary",
+       "makeNewConnection:sender:",
+       "makeObject:performOnewaySelectorInMainThread:withObject:",
+       "makeObject:performSelectorInMainThread:withObject:",
+       "makeObject:performSelectorInMainThread:withObject:withObject:",
+       "makeObjectIntoFault:withHandler:",
+       "makeObjectsPerform:",
+       "makeObjectsPerform:with:",
+       "makeObjectsPerform:withObject:",
+       "makeObjectsPerformSelector:",
+       "makeObjectsPerformSelector:withObject:",
+       "makeObjectsPerformSelector:withObject:withObject:",
+       "makePlainText:",
+       "makeReceiver:takeValue:",
+       "makeToolbarControllerInBox:",
+       "makeUniqueAttachmentNamed:inDirectory:",
+       "makeUniqueAttachmentNamed:withExtension:inDirectory:",
+       "makeUniqueFilePath",
+       "makeUniqueTemporaryAttachmentInDirectory:",
+       "makeUntitledDocumentOfType:",
+       "makeVarForKey:",
+       "makeWindowControllers",
+       "makeWindowsPerform:inOrder:",
+       "makefileDir",
+       "makefileDirectory",
+       "manager",
+       "mapConversationToThread:",
+       "mapForClass:",
+       "mappedLength",
+       "mapping",
+       "mappingSize",
+       "marginColor",
+       "marginFloat",
+       "marginHeight",
+       "marginWidth",
+       "marginsChanged",
+       "markAsRead:",
+       "markAsUnread:",
+       "markAtomicEvent:info:",
+       "markAtomicWithInfo:",
+       "markBegin",
+       "markEnd",
+       "markEndOfEvent:",
+       "markStartOfEvent:info:",
+       "markStartWithInfo:",
+       "markedItemEditingIvarsCreateIfAbsent",
+       "markedItemEditingIvarsNullIfAbsent",
+       "markedItemEditingIvarsRaiseIfAbsent",
+       "markedRange",
+       "markedTextAbandoned:",
+       "markedTextAttributes",
+       "markedTextSelectionChanged:client:",
+       "marker",
+       "markerCasingPolicy",
+       "markerLocation",
+       "markerName",
+       "markers",
+       "maskUsingBom:",
+       "maskUsingPatternList:",
+       "masterClassDescription",
+       "masterDataSource",
+       "masterObject",
+       "match:pattern:",
+       "matchedRangeForCString:range:subexpressionRanges:count:",
+       "matchedRangeForString:range:subexpressionRanges:count:",
+       "matchesAppleEventCode:",
+       "matchesOnMultipleResolution",
+       "matchesPattern:",
+       "matchesPattern:caseInsensitive:",
+       "matchesTextStyle:",
+       "matchingAddressReferenceAtIndex:",
+       "matrix",
+       "matrix:didDragCell:fromIndex:toIndex:",
+       "matrix:shouldDragCell:fromIndex:toMinIndex:maxIndex:",
+       "matrixClass",
+       "matrixInColumn:",
+       "max",
+       "maxContentSize",
+       "maxHeight",
+       "maxLength",
+       "maxSize",
+       "maxUserData",
+       "maxValue",
+       "maxVisibleColumns",
+       "maxWidth",
+       "maximum",
+       "maximumAdvancement",
+       "maximumDecimalNumber",
+       "maximumKilobytes",
+       "maximumLineHeight",
+       "maximumWidth",
+       "mboxIndexForStore:",
+       "mboxIndexForStore:create:",
+       "mboxRange",
+       "measureRenderedText",
+       "measurementUnits",
+       "mediaBox",
+       "member:",
+       "memberOfClass:",
+       "members:notFoundMarker:",
+       "menu",
+       "menuBarHeight",
+       "menuChanged:",
+       "menuChangedMessagesEnabled",
+       "menuClassName",
+       "menuFontOfSize:",
+       "menuForEvent:",
+       "menuForEvent:inFrame:",
+       "menuForEvent:inRect:ofView:",
+       "menuForItem:",
+       "menuForNoItem",
+       "menuItem",
+       "menuItemCellForItemAtIndex:",
+       "menuRepresentation",
+       "menuToolbarAction:",
+       "menuView",
+       "menuZone",
+       "mergeAllBomsIn:",
+       "mergeBom:",
+       "mergeCells:",
+       "mergeInto:",
+       "mergeInto:usingPatternList:",
+       "mergeMessages:intoArray:attributes:",
+       "mergeSubkeysIntoKeys",
+       "mergeTextTranslatingSelection:",
+       "mergeableCells:withCollectiveBoundsRow:column:rowSpan:columnSpan:",
+       "mergeableCellsContainingCells:",
+       "mergeableKeys",
+       "message",
+       "messageBody",
+       "messageCaching",
+       "messageContents",
+       "messageContentsForInitialText:",
+       "messageData",
+       "messageEditor",
+       "messageEditorClass",
+       "messageEditors",
+       "messageFlags",
+       "messageFlagsChanged:",
+       "messageFlagsDidChange:flags:",
+       "messageFontOfSize:",
+       "messageForMessageID:",
+       "messageHandler",
+       "messageID",
+       "messageIDForSender:subject:dateAsTimeInterval:",
+       "messageInStore:",
+       "messageSize",
+       "messageStore",
+       "messageTextView",
+       "messageType",
+       "messageViewText",
+       "messageWasDisplayedInTextView:",
+       "messageWasSelected:",
+       "messageWidthForMessage:",
+       "messageWillBeDelivered:",
+       "messageWillBeDisplayedInView:",
+       "messageWillBeSaved:",
+       "messageWillNoLongerBeDisplayedInView:",
+       "messageWithData:",
+       "messageWithHeaders:flags:size:uid:",
+       "messages",
+       "messagesAvailable",
+       "messagesFilteredUsingAttributes:",
+       "messagesInStore:containingString:ranks:booleanSearch:errorString:",
+       "messagesWereExpunged:",
+       "method",
+       "methodArgSize:",
+       "methodDescFor:",
+       "methodDescriptionForSelector:",
+       "methodFor:",
+       "methodForSelector:",
+       "methodReturnLength",
+       "methodReturnType",
+       "methodSignature",
+       "methodSignatureForSelector:",
+       "methodSignatureForSelector:forFault:",
+       "metrics",
+       "microsecondOfSecond",
+       "mimeBodyPart",
+       "mimeBodyPartForAttachment",
+       "mimeCharsetTagFromStringEncoding:",
+       "mimeHeaderForKey:",
+       "mimeParameterForKey:",
+       "mimeSubtype",
+       "mimeType",
+       "minColumnWidth",
+       "minContentSize",
+       "minContentSizeForMinFrameSize:styleMask:",
+       "minFrameSize",
+       "minFrameSizeForMinContentSize:styleMask:",
+       "minFrameWidthWithTitle:styleMask:",
+       "minSize",
+       "minValue",
+       "minWidth",
+       "miniaturize:",
+       "miniaturizeAll:",
+       "miniaturizedSize",
+       "minimizeButton",
+       "minimum",
+       "minimumDecimalNumber",
+       "minimumHeightForWidth:",
+       "minimumLineHeight",
+       "minimumSize",
+       "minimumWidth",
+       "miniwindowImage",
+       "miniwindowTitle",
+       "minusSet:",
+       "minuteOfHour",
+       "miscChanged:",
+       "mismatchError:",
+       "missingAttachmentString",
+       "miterLimit",
+       "mixedStateImage",
+       "mnemonic",
+       "mnemonicLocation",
+       "modalWindow",
+       "mode",
+       "modeButton",
+       "modifierFlags",
+       "modifyFont:",
+       "modifyFontTrait:",
+       "modifyFontViaPanel:",
+       "modifyGrammarToAllow:asAChildOf:",
+       "moduleName",
+       "monitor",
+       "monitorTextStorageDidProcessEditing",
+       "monthOfYear",
+       "mostCompatibleStringEncoding",
+       "mountNewRemovableMedia",
+       "mountPoint",
+       "mounted:",
+       "mountedRemovableMedia",
+       "mouse:inRect:",
+       "mouseDown:",
+       "mouseDownFlags",
+       "mouseDownOnCharacterIndex:atCoordinate:withModifier:client:",
+       "mouseDragged:",
+       "mouseDraggedOnCharacterIndex:atCoordinate:withModifier:client:",
+       "mouseEntered",
+       "mouseEntered:",
+       "mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",
+       "mouseExited",
+       "mouseExited:",
+       "mouseLocation",
+       "mouseLocationOutsideOfEventStream",
+       "mouseMoved:",
+       "mouseMoved:inFrame:",
+       "mouseMoved:insideLink:atIndex:ofLayoutManager:givenOrigin:lastEnteredCell:pushedFinger:",
+       "mouseTrack:",
+       "mouseTracker:constrainPoint:withEvent:",
+       "mouseTracker:didStopTrackingWithEvent:",
+       "mouseTracker:handlePeriodicEvent:",
+       "mouseTracker:shouldContinueTrackingWithEvent:",
+       "mouseTracker:shouldStartTrackingWithEvent:",
+       "mouseUp:",
+       "mouseUpOnCharacterIndex:atCoordinate:withModifier:client:",
+       "moveBackward:",
+       "moveBackwardAndModifySelection:",
+       "moveColumn:toColumn:",
+       "moveColumnDividerAtIndex:byDelta:",
+       "moveDown:",
+       "moveDownAndModifySelection:",
+       "moveForward:",
+       "moveForwardAndModifySelection:",
+       "moveImage:",
+       "moveLeft:",
+       "moveParagraphBackwardAndModifySelection:",
+       "moveParagraphForwardAndModifySelection:",
+       "movePath:toPath:handler:",
+       "moveRight:",
+       "moveRowDividerAtIndex:byDelta:",
+       "moveRulerlineFromLocation:toLocation:",
+       "moveToBeginningOfDocument:",
+       "moveToBeginningOfDocumentAndModifySelection:",
+       "moveToBeginningOfLine:",
+       "moveToBeginningOfLineAndModifySelection:",
+       "moveToBeginningOfParagraph:",
+       "moveToBeginningOfParagraphAndModifySelection:",
+       "moveToEndOfDocument:",
+       "moveToEndOfDocumentAndModifySelection:",
+       "moveToEndOfLine:",
+       "moveToEndOfLineAndModifySelection:",
+       "moveToEndOfParagraph:",
+       "moveToEndOfParagraphAndModifySelection:",
+       "moveToPoint:",
+       "moveUp:",
+       "moveUpAndModifySelection:",
+       "moveWordBackward:",
+       "moveWordBackwardAndModifySelection:",
+       "moveWordForward:",
+       "moveWordForwardAndModifySelection:",
+       "movie",
+       "movieController",
+       "movieRect",
+       "movieUnfilteredFileTypes",
+       "movieUnfilteredPasteboardTypes",
+       "msgPrint:ok:",
+       "msgid",
+       "multiple",
+       "multipleThreadsEnabled",
+       "mutableAttributedString",
+       "mutableAttributes",
+       "mutableBytes",
+       "mutableCopy",
+       "mutableCopyOfMailAccounts",
+       "mutableCopyOfSignatures",
+       "mutableCopyOfSortRules",
+       "mutableCopyWithZone:",
+       "mutableData",
+       "mutableDictionary",
+       "mutableHeaders",
+       "mutableLocalFiles",
+       "mutableString",
+       "mutableSubstringFromRange:",
+       "myStatusOf:",
+       "mysteryIcon",
+       "name",
+       "nameForFetchSpecification:",
+       "nameFromPath:extra:",
+       "nameOfGlyph:",
+       "names",
+       "needsDisplay",
+       "needsLeadingBlockCharacters",
+       "needsPanelToBecomeKey",
+       "needsSizing",
+       "needsToBeUpdatedFromPath:",
+       "needsTrailingBlockCharacters",
+       "needsUpdate",
+       "negativeFormat",
+       "nestingLevel",
+       "new",
+       "new:firstIndirectType:",
+       "newAccountWithPath:",
+       "newAltText:",
+       "newAnchorValue:",
+       "newAttachmentCell",
+       "newAttributeDictionary",
+       "newBagByAddingObject:",
+       "newBagWithObject:object:",
+       "newBaseURL:",
+       "newBkgdColorOrTexture:",
+       "newBorder:",
+       "newCloseButton",
+       "newCodeURL:",
+       "newColSize:",
+       "newColor:",
+       "newComposeWindowWithHeaders:body:",
+       "newConversation",
+       "newConversionFactor",
+       "newCount:",
+       "newCount:elementSize:description:",
+       "newDefaultInstance",
+       "newDefaultRenderingState",
+       "newDictionaryFromDictionary:subsetMapping:zone:",
+       "newDisplayEngine",
+       "newDistantObjectWithCoder:",
+       "newDocument:",
+       "newDocumentType:",
+       "newEditingEngine",
+       "newEventOfClass:type:",
+       "newFileButton",
+       "newFlipped:",
+       "newFolder:",
+       "newFolderAtCurrentUsingFormString:",
+       "newHeight:",
+       "newImageSource:",
+       "newIndexInfoForItem:",
+       "newInputOfType:",
+       "newInstanceWithKeyCount:sourceDescription:destinationDescription:zone:",
+       "newInvocationWithCoder:",
+       "newInvocationWithMethodSignature:",
+       "newLinkValue:",
+       "newList:",
+       "newMailHasArrived:",
+       "newMailSoundDidChange:",
+       "newMailbox:",
+       "newMailboxFromParent:",
+       "newMailboxNameIsAcceptable:reasonForFailure:",
+       "newMaxLength:",
+       "newMessagesHaveArrived:total:",
+       "newMiniaturizeButton",
+       "newName:",
+       "newNumberOfRows:",
+       "newParagraphStyle:",
+       "newReferenceType:",
+       "newRootRenderingState",
+       "newRootRenderingStateWithMeasuring:",
+       "newRowSize:",
+       "newScaleFactor:",
+       "newSingleWindowModeButton",
+       "newSize:",
+       "newSizeType:",
+       "newStateForItem:",
+       "newStringForHTMLEncodedAttribute",
+       "newStringForHTMLEncodedString",
+       "newTextColor:",
+       "newTitle:",
+       "newType:",
+       "newType:data:firstIndirectType:",
+       "newUrl:",
+       "newValue:",
+       "newWidth:",
+       "newWithCoder:zone:",
+       "newWithDictionary:",
+       "newWithInitializer:",
+       "newWithInitializer:objects:zone:",
+       "newWithInitializer:zone:",
+       "newWithKey:object:",
+       "newWithKeyArray:",
+       "newWithKeyArray:zone:",
+       "newWithMessage:",
+       "newWithPath:prepend:attributes:cross:",
+       "newZoomButton",
+       "next",
+       "next:",
+       "nextArg:",
+       "nextAttribute:fromLocation:effectiveRange:",
+       "nextEventForWindow:",
+       "nextEventMatchingMask:",
+       "nextEventMatchingMask:untilDate:inMode:dequeue:",
+       "nextFieldFromItem:",
+       "nextInode:",
+       "nextKeyView",
+       "nextObject",
+       "nextPath:skipDirs:",
+       "nextResponder",
+       "nextResult",
+       "nextState",
+       "nextTableData",
+       "nextText",
+       "nextToken",
+       "nextTokenAttributes",
+       "nextTokenType",
+       "nextTokenWithPunctuation:",
+       "nextValidKeyView",
+       "nextWordFromIndex:forward:",
+       "nextWordFromSelection:forward:",
+       "nextWordInString:fromIndex:useBook:forward:",
+       "nibFileName",
+       "nibInstantiate",
+       "nibInstantiateWithOwner:",
+       "nibInstantiateWithOwner:topLevelObjects:",
+       "nilEnabledValueForKey:",
+       "noHref",
+       "noResize",
+       "noResponderFor:",
+       "node",
+       "node:_adaptChildren:barringMarker:",
+       "node:acceptsChild:withAdaptation:",
+       "node:acceptsChildren:withAdaptation:",
+       "node:adaptChild:",
+       "node:adaptChildren:",
+       "node:adaptNode:overChildren:",
+       "node:addAdaptedChild:",
+       "node:canInsertAdaptedChild:",
+       "node:canInsertAdaptedChildren:",
+       "node:flattenChildAdaptingChildren:",
+       "node:insertAdaptedChild:atIndex:",
+       "node:insertAdaptedChildren:atIndex:",
+       "nodeEditingIvarsCreateIfAbsent",
+       "nodeEditingIvarsNullIfAbsent",
+       "nodeEditingIvarsRaiseIfAbsent",
+       "nodeForMarker:attributes:",
+       "nodePathFromRoot",
+       "nodePathToRoot",
+       "nodeWithObject:",
+       "nonASCIIByteSet",
+       "nonASCIICharacterSet",
+       "nonAggregateRootProject",
+       "nonBaseCharacterSet",
+       "nonBreakingSpaceString",
+       "nonErrorColor",
+       "nonMergeableFiles",
+       "nonProjectExecutableStateDictionaryForPath:",
+       "nonProjectExecutableWithPersistentState:",
+       "nonretainedObjectValue",
+       "nonspacingMarkPriority:",
+       "noop",
+       "noop:",
+       "normalizedRect:",
+       "notANumber",
+       "notActiveWindowFrameColor",
+       "notActiveWindowFrameHighlightColor",
+       "notActiveWindowFrameShadowColor",
+       "notActiveWindowTitlebarTextColor",
+       "notImplemented:",
+       "notShownAttributeForGlyphAtIndex:",
+       "note",
+       "noteChange",
+       "noteCommand:parameter:",
+       "noteFileSystemChanged",
+       "noteFileSystemChanged:",
+       "noteFontCollectionsChanged",
+       "noteFontCollectionsChangedForUser:",
+       "noteFontFavoritesChanged",
+       "noteFontFavoritesChangedForUser:",
+       "noteNewRecentDocument:",
+       "noteNewRecentDocumentURL:",
+       "noteNumberOfItemsChanged",
+       "noteNumberOfRowsChanged",
+       "noteSelectionChanged",
+       "noteUserDefaultsChanged",
+       "notificationCenter",
+       "notificationCenterForType:",
+       "notificationWithName:object:",
+       "notificationWithName:object:userInfo:",
+       "notifyDidChange:",
+       "notifyObjectWhenFinishedExecuting:",
+       "notifyObserversObjectWillChange:",
+       "notifyObserversUpToPriority:",
+       "nowWouldBeAGoodTimeToStartBackgroundSynchronization",
+       "null",
+       "nullDescriptor",
+       "numDesiredBlockReturns",
+       "numberOfAlternatives",
+       "numberOfArguments",
+       "numberOfChildren",
+       "numberOfColumns",
+       "numberOfDaysToKeepTrash",
+       "numberOfFiles",
+       "numberOfFilteredVCards",
+       "numberOfGlyphs",
+       "numberOfImages",
+       "numberOfItems",
+       "numberOfItemsInComboBox:",
+       "numberOfItemsInComboBoxCell:",
+       "numberOfMatchingAddresses",
+       "numberOfOpenDocuments",
+       "numberOfPages",
+       "numberOfPaletteEntries",
+       "numberOfPlanes",
+       "numberOfRows",
+       "numberOfRowsInTableView:",
+       "numberOfSamplesPerPaletteEntry",
+       "numberOfSelectedColumns",
+       "numberOfSelectedRows",
+       "numberOfSetBits",
+       "numberOfSubexpressions",
+       "numberOfTabViewItems",
+       "numberOfTableDatas",
+       "numberOfTickMarks",
+       "numberOfVCards",
+       "numberOfVirtualScreens",
+       "numberOfVisibleColumns",
+       "numberOfVisibleItems",
+       "numberWithBool:",
+       "numberWithChar:",
+       "numberWithDouble:",
+       "numberWithFloat:",
+       "numberWithInt:",
+       "numberWithLong:",
+       "numberWithLongLong:",
+       "numberWithShort:",
+       "numberWithUnsignedChar:",
+       "numberWithUnsignedInt:",
+       "numberWithUnsignedLong:",
+       "numberWithUnsignedLongLong:",
+       "numberWithUnsignedShort:",
+       "objCType",
+       "object",
+       "objectAt:",
+       "objectAtIndex:",
+       "objectAtIndex:effectiveRange:",
+       "objectAtIndex:effectiveRange:runIndex:",
+       "objectAtRunIndex:length:",
+       "objectBeingTested",
+       "objectByTranslatingDescriptor:",
+       "objectDeallocated:",
+       "objectDidCopy:from:to:withData:recursive:wasLink:",
+       "objectEnumerator",
+       "objectExists:",
+       "objectForGlobalID:",
+       "objectForIndex:dictionary:",
+       "objectForKey:",
+       "objectForKey:inDomain:",
+       "objectForServicePath:",
+       "objectForServicePath:app:doLaunch:limitDate:",
+       "objectHasSubFolders:",
+       "objectIsAlias:",
+       "objectIsApplication:",
+       "objectIsContainer:",
+       "objectIsKnown:",
+       "objectIsLeaf:",
+       "objectIsVisible:",
+       "objectNames",
+       "objectSpecifier",
+       "objectSpecifierForComposeMessage:",
+       "objectSpecifierForMessage:",
+       "objectSpecifierForMessageStore:",
+       "objectSpecifierForMessageStorePath:",
+       "objectSpecifierForMessageStoreProxy:",
+       "objectStoreForEntityNamed:",
+       "objectStoreForFetchSpecification:",
+       "objectStoreForGlobalID:",
+       "objectStoreForObject:",
+       "objectValue",
+       "objectValueOfSelectedItem",
+       "objectValues",
+       "objectWillChange:",
+       "objectWillCopy:from:to:withData:replaceOK:makeLinks:recursive:",
+       "objectWithAttributeStringValue:",
+       "objectZone",
+       "objectsAtIndexes:",
+       "objectsByEntityName",
+       "objectsByEntityNameAndFetchSpecificationName",
+       "objectsByEvaluatingSpecifier",
+       "objectsByEvaluatingWithContainers:",
+       "objectsForKeys:notFoundMarker:",
+       "objectsForSourceGlobalID:relationshipName:editingContext:",
+       "objectsWithFetchSpecification:",
+       "objectsWithFetchSpecification:editingContext:",
+       "observerForObject:ofClass:",
+       "observerNotificationSuppressCount",
+       "observerQueue",
+       "observersForObject:",
+       "offStateImage",
+       "offsetBaselineBy:",
+       "offsetForPathToFit",
+       "offsetInFile",
+       "ok:",
+       "okButtonAction:",
+       "okButtonClicked:",
+       "okClicked:",
+       "oldSystemColorWithCoder:",
+       "onStateImage",
+       "one",
+       "oneTimeInit",
+       "opaqueAncestor",
+       "open",
+       "open:",
+       "openAppleMenuItem:",
+       "openAppleScriptConnection",
+       "openAsynchronously",
+       "openAttachmentFromCell:inRect:ofTextView:attachmentDirectory:",
+       "openBlock:atOffset:forLength:",
+       "openDocument:",
+       "openDocumentWithContentsOfFile:display:",
+       "openDocumentWithContentsOfURL:display:",
+       "openDocumentWithPath:encoding:",
+       "openDocumentWithPath:encoding:ignoreRTF:ignoreHTML:",
+       "openEntryNamed:",
+       "openFile:",
+       "openFile:fromImage:at:inView:",
+       "openFile:ok:",
+       "openFile:operation:",
+       "openFile:userData:error:",
+       "openFile:withApplication:",
+       "openFile:withApplication:andDeactivate:",
+       "openFirstDrawer:",
+       "openGLContext",
+       "openInBestDirection",
+       "openInclude:",
+       "openIndex",
+       "openList:",
+       "openOnEdge:",
+       "openPanel",
+       "openPanelSheetDidEnd:returnCode:contextInfo:",
+       "openRange:ofLength:atOffset:forWriting:",
+       "openRecentDocument:",
+       "openRegion:ofLength:atAddress:",
+       "openSavePanelDirectory",
+       "openSelection:userData:error:",
+       "openStore:",
+       "openStore:andMakeKey:",
+       "openStoreAtPath:",
+       "openStoreAtPath:andMakeKey:",
+       "openSynchronously",
+       "openTagIndexForTokenAtIndex:",
+       "openTempFile:",
+       "openTempFile:ok:",
+       "openTexture:",
+       "openUntitled",
+       "openUntitledDocumentOfType:display:",
+       "openUserDictionary:",
+       "openWithApplication",
+       "openWithEncodingAccessory:",
+       "operatingSystem",
+       "operatingSystemName",
+       "operationDidEnd",
+       "operationWillPerformStep:",
+       "operationWillStart:withTitle:andID:",
+       "operatorSelectorForString:",
+       "optimizeForSpace",
+       "optimizeForTime",
+       "optionGroup",
+       "optionSelected:",
+       "optionSetting:",
+       "options",
+       "orangeColor",
+       "order",
+       "orderBack",
+       "orderBack:",
+       "orderFront",
+       "orderFront:",
+       "orderFrontColorPanel:",
+       "orderFrontFindPanel:",
+       "orderFrontFontPanel:",
+       "orderFrontRegardless",
+       "orderFrontStandardAboutPanel:",
+       "orderFrontStandardAboutPanelWithOptions:",
+       "orderOut",
+       "orderOut:",
+       "orderOutCompletionWindow:",
+       "orderOutToolTip",
+       "orderOutToolTipImmediately:",
+       "orderString:range:string:range:flags:",
+       "orderString:string:",
+       "orderString:string:flags:",
+       "orderSurface:relativeTo:",
+       "orderWindow:relativeTo:",
+       "orderedDocuments",
+       "orderedIndex",
+       "orderedWindows",
+       "orderingType",
+       "orientation",
+       "originFromPoint:",
+       "originOffset",
+       "originalMessage",
+       "otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:",
+       "otherKeys",
+       "otherLinkedOFiles",
+       "otherSourceDirectories",
+       "outdent:",
+       "outdentForListItem:withState:",
+       "outgoingStorePath",
+       "outlineTableColumn",
+       "outlineView:acceptDrop:item:childIndex:",
+       "outlineView:child:ofItem:",
+       "outlineView:isItemExpandable:",
+       "outlineView:itemForPersistentObject:",
+       "outlineView:numberOfChildrenOfItem:",
+       "outlineView:objectValueForTableColumn:byItem:",
+       "outlineView:persistentObjectForItem:",
+       "outlineView:setObjectValue:forTableColumn:byItem:",
+       "outlineView:shouldCollapseAutoExpandedItemsForDeposited:",
+       "outlineView:shouldCollapseItem:",
+       "outlineView:shouldEditTableColumn:item:",
+       "outlineView:shouldExpandItem:",
+       "outlineView:shouldSelectItem:",
+       "outlineView:shouldSelectTableColumn:",
+       "outlineView:validateDrop:proposedItem:proposedChildIndex:",
+       "outlineView:willDisplayCell:forTableColumn:item:",
+       "outlineView:willDisplayOutlineCell:forTableColumn:item:",
+       "outlineView:writeItems:toPasteboard:",
+       "outlineViewColumnDidMove:",
+       "outlineViewColumnDidResize:",
+       "outlineViewDoubleClick:",
+       "outlineViewItemDidCollapse:",
+       "outlineViewItemDidExpand:",
+       "outlineViewItemWillCollapse:",
+       "outlineViewItemWillExpand:",
+       "outlineViewSelectionDidChange:",
+       "outlineViewSelectionIsChanging:",
+       "outlinesWhenSelected",
+       "outliningImageCellWithRepresentedItem:image:",
+       "overdrawSpacesInRect:",
+       "overhead",
+       "overrideEntriesWithObjectsFromDictionary:keys:",
+       "owner",
+       "ownsDestinationObjectsForRelationshipKey:",
+       "ownsGlobalID:",
+       "ownsObject:",
+       "padWithCFString:length:padIndex:",
+       "padding",
+       "paddingAction:",
+       "paddingTextfieldAction:",
+       "pageCount",
+       "pageDown",
+       "pageDown:",
+       "pageDownAndModifySelection:",
+       "pageLayout",
+       "pageOrder",
+       "pageRectForPageNumber:",
+       "pageScroll",
+       "pageSeparatorHeight",
+       "pageSizeForPaper:",
+       "pageUp",
+       "pageUp:",
+       "pageUpAndModifySelection:",
+       "palette",
+       "paletteFontOfSize:",
+       "panel",
+       "panel:compareFilename:with:caseSensitive:",
+       "panel:isValidFilename:",
+       "panel:shouldShowFilename:",
+       "panel:willExpand:",
+       "panelConvertFont:",
+       "paperName",
+       "paperSize",
+       "paragraphSpacing",
+       "paragraphStyle",
+       "paragraphs",
+       "paramDescriptorForKeyword:",
+       "parameterString",
+       "parenSet",
+       "parent",
+       "parentContext",
+       "parentEditor",
+       "parentEvent",
+       "parentFolderForMailboxAtPath:",
+       "parentForItem:",
+       "parentItemRepresentedObjectForMenu:",
+       "parentMarker:mayCloseTag:",
+       "parentObjectStore",
+       "parentOf:",
+       "parentPath",
+       "parentWindow",
+       "parenthesizedStringWithObjects:",
+       "parse:",
+       "parseArgument",
+       "parseCastedValueExpression",
+       "parseData",
+       "parseDictionaryOfKey:value:",
+       "parseError:",
+       "parseExceptionWithName:token:position:length:reason:userStopped:discipline:",
+       "parseKey:",
+       "parseLogicalExpression",
+       "parseLogicalExpression:logicalOp:",
+       "parseLogicalOp",
+       "parseMachMessage:localPort:remotePort:msgid:components:",
+       "parseMetaRuleBody",
+       "parseMetaSyntaxLeafResultShouldBeSkipped:",
+       "parseMetaSyntaxSequence",
+       "parseMyNumber",
+       "parseNegNumber",
+       "parseNil",
+       "parseNotExpression",
+       "parseNumber",
+       "parsePathArray:",
+       "parseQuotedString",
+       "parseRelOpExpression",
+       "parseSeparator",
+       "parseSeparatorEqualTo:",
+       "parseStream",
+       "parseString",
+       "parseSubproject:",
+       "parseSubprojects",
+       "parseSuite:separator:allowOmitLastSeparator:",
+       "parseSuiteOfPairsKey:separator:value:separator:allowOmitLastSeparator:",
+       "parseTokenEqualTo:mask:",
+       "parseTokenWithMask:",
+       "parseUnquotedString",
+       "parseVariable",
+       "parsedGrammarForString:",
+       "parserForData:",
+       "pass:",
+       "passState:throughChildrenOfNode:untilReachingChild:",
+       "password",
+       "password:",
+       "password:ignorePreviousSettings:",
+       "passwordFromStoredUserInfo",
+       "passwordPanelCancel:",
+       "passwordPanelOK:",
+       "passwordWithoutAskingUser",
+       "paste:",
+       "pasteAsPlainText:",
+       "pasteAsQuotation:",
+       "pasteAsRichText:",
+       "pasteFont:",
+       "pasteImageNamed:",
+       "pasteItemUpdate:",
+       "pasteItems:withPath:isPlainText:",
+       "pasteRuler:",
+       "pasteboard:provideDataForType:",
+       "pasteboardByFilteringData:ofType:",
+       "pasteboardByFilteringFile:",
+       "pasteboardByFilteringTypesInPasteboard:",
+       "pasteboardChangedOwner:",
+       "pasteboardDataRepresentation",
+       "pasteboardString:isTableRow:isTableData:isCaption:",
+       "pasteboardWithName:",
+       "pasteboardWithUniqueName",
+       "path",
+       "pathArrayFromNode:",
+       "pathAt:",
+       "pathComponents",
+       "pathContentOfSymbolicLinkAtPath:",
+       "pathExtension",
+       "pathForAuxiliaryExecutable:",
+       "pathForFile:",
+       "pathForFrameworkNamed:",
+       "pathForImageResource:",
+       "pathForIndexInStore:",
+       "pathForLibraryResource:type:directory:",
+       "pathForProjectTypeWithName:",
+       "pathForResource:ofType:",
+       "pathForResource:ofType:inDirectory:",
+       "pathForResource:ofType:inDirectory:forLanguage:",
+       "pathForResource:ofType:inDirectory:forLocalization:",
+       "pathForSoundResource:",
+       "pathHasMailboxExtension:",
+       "pathItemForPoint:",
+       "pathName",
+       "pathRelativeToProject:",
+       "pathSeparator",
+       "pathStoreWithCharacters:length:",
+       "pathToColumn:",
+       "pathToObjectWithName:",
+       "pathView",
+       "pathViewClass",
+       "pathWithComponents:",
+       "pathWithDirectory:filename:extension:",
+       "pathsCount",
+       "pathsForProjectNamed:",
+       "pathsForResourcesOfType:inDirectory:",
+       "pathsForResourcesOfType:inDirectory:forLanguage:",
+       "pathsForResourcesOfType:inDirectory:forLocalization:",
+       "pathsMatchingExtensions:",
+       "patternImage",
+       "pause",
+       "peekNextToken",
+       "peekNextTokenType",
+       "peekTokenType",
+       "peekTokenWithMask:",
+       "pendDeliverySheetDidEnd:returnCode:contextInfo:",
+       "pendingDeliveryMailboxPath",
+       "pendingDeliveryStore:",
+       "percentDone",
+       "perceptualBrightness",
+       "perform:",
+       "perform:with:",
+       "perform:with:with:",
+       "perform:withEachObjectInArray:",
+       "perform:withObject:",
+       "perform:withObject:withObject:",
+       "performActionFlashForItemAtIndex:",
+       "performActionForItemAtIndex:",
+       "performActionWithHighlightingForItemAtIndex:",
+       "performBruteForceSearchWithString:",
+       "performChanges",
+       "performClick:",
+       "performClick:withTextView:",
+       "performClickWithFrame:inView:",
+       "performClose:",
+       "performDefaultImplementation",
+       "performDoubleActionWithEvent:textView:frame:",
+       "performDragOperation:",
+       "performFileOperation:source:destination:files:tag:",
+       "performFunction:modes:activity:",
+       "performKeyEquivalent:",
+       "performMiniaturize:",
+       "performMnemonic:",
+       "performOneway:result:withTarget:selector:",
+       "performPendedOperations",
+       "performSearch:",
+       "performSearchInStore:forString:ranks:booleanSearch:errorString:",
+       "performSelector:",
+       "performSelector:object:afterDelay:",
+       "performSelector:target:argument:order:modes:",
+       "performSelector:withEachObjectInArray:",
+       "performSelector:withObject:",
+       "performSelector:withObject:afterDelay:",
+       "performSelector:withObject:afterDelay:inModes:",
+       "performSelector:withObject:withObject:",
+       "performSelectorReturningUnsigned:",
+       "performSelectorReturningUnsigned:withObject:",
+       "performSelectorReturningUnsigned:withObject:withObject:",
+       "performSingleActionWithEvent:textView:frame:",
+       "performUpdateWithResponder:",
+       "performZoom:",
+       "performv::",
+       "permissibleDraggedFileTypes",
+       "persistentDomainForName:",
+       "persistentDomainNames",
+       "personalizeRenderingState:copyIfChanging:",
+       "pickedAllPages:",
+       "pickedButton:",
+       "pickedFeature:",
+       "pickedLayoutList:",
+       "pickedList:",
+       "pickedOrientation:",
+       "pickedPaperSize:",
+       "pickedPrinter:",
+       "pickedUnits:",
+       "pickle",
+       "pickleAndReopen:",
+       "pictFrame",
+       "pipe",
+       "pixelFormat",
+       "pixelsHigh",
+       "pixelsWide",
+       "placeButtons:firstWidth:secondWidth:thirdWidth:",
+       "placeView:",
+       "placementViewFrameChanged:",
+       "plainTextValue",
+       "play",
+       "playsEveryFrame",
+       "playsSelectionOnly",
+       "pointSize",
+       "pointSizeForHTMLFontSize:",
+       "pointValue",
+       "pointerToElement:directlyAccessibleElements:",
+       "pointerValue",
+       "polarity",
+       "poolCountHighWaterMark",
+       "poolCountHighWaterResolution",
+       "pop",
+       "pop3ClientVersion",
+       "popAndInvoke",
+       "popBundleForImageSearch",
+       "popCommand:",
+       "popCommands:pushCommands:",
+       "popPassword",
+       "popSpoolDirectory",
+       "popTopView",
+       "popUndoObject",
+       "popUp:",
+       "popUpContextMenu:withEvent:forView:",
+       "popUpMenu:atLocation:width:forView:withSelectedItem:withFont:",
+       "populateMailboxListing",
+       "populateReplyEvent:withResult:errorNumber:errorDescription:",
+       "port",
+       "portCoderWithReceivePort:sendPort:components:",
+       "portForName:",
+       "portForName:host:",
+       "portForName:host:nameServerPortNumber:",
+       "portForName:onHost:",
+       "portNumber",
+       "portWithMachPort:",
+       "portalDied:",
+       "portsForMode:",
+       "poseAs:",
+       "poseAsClass:",
+       "positionForSingleWindowMode",
+       "positionOfGlyph:forCharacter:struckOverRect:",
+       "positionOfGlyph:precededByGlyph:isNominal:",
+       "positionOfGlyph:struckOverGlyph:metricsExist:",
+       "positionOfGlyph:struckOverRect:metricsExist:",
+       "positionOfGlyph:withRelation:toBaseGlyph:totalAdvancement:metricsExist:",
+       "positionPopupAction:",
+       "positionRadioAction:",
+       "positionSingleWindow:",
+       "positionsForCompositeSequence:numberOfGlyphs:pointArray:",
+       "positiveFormat",
+       "positivePassDirection",
+       "postActivityFinished",
+       "postActivityStarting",
+       "postDrawAllInRect:htmlTextView:",
+       "postDrawInRect:htmlTextView:",
+       "postEvent:atStart:",
+       "postInspectionRefresh:",
+       "postMailboxListingHasChangedAtPath:",
+       "postNotification:",
+       "postNotificationInMainThread:",
+       "postNotificationName:object:",
+       "postNotificationName:object:userInfo:",
+       "postNotificationName:object:userInfo:deliverImmediately:",
+       "postNotificationName:object:userInfo:flags:",
+       "postParseProcess",
+       "postUserInfoHasChangedForMailboxAtPath:",
+       "postsBoundsChangedNotifications",
+       "postsFrameChangedNotifications",
+       "postscriptForKey:withValue:",
+       "potentialSaveDirectory",
+       "powerOffIn:andSave:",
+       "pramValue",
+       "precededBySpaceCharacter",
+       "precededByWhitespace",
+       "preferenceChanged:",
+       "preferences",
+       "preferencesChanged:",
+       "preferencesContentSize",
+       "preferencesFromDefaults",
+       "preferencesNibName",
+       "preferencesOwnerClassName",
+       "preferencesPanelName",
+       "preferredAlternative",
+       "preferredBodyPart",
+       "preferredEdge",
+       "preferredEmailAddressToReplyWith",
+       "preferredFilename",
+       "preferredFontNames",
+       "preferredLocalizations",
+       "preferredLocalizationsFromArray:",
+       "preferredMIMEStringEncoding",
+       "preferredPasteboardTypeFromArray:restrictedToTypesFromArray:",
+       "prefersColorMatch",
+       "prefersTrackingUntilMouseUp",
+       "prefetchingRelationshipKeyPaths",
+       "prefixForLiteralStringOfSize:",
+       "prefixString:withLanguageType:",
+       "prefixString:withOSType:",
+       "prefixWithDelimiter:",
+       "preflightSelection:",
+       "prepareAttachmentForUuencoding",
+       "prepareForDragOperation:",
+       "prepareForSaveWithCoordinator:editingContext:",
+       "prepareGState",
+       "prepareSavePanel:",
+       "prepareToDeliver",
+       "prepareWithInvocationTarget:",
+       "prependTransform:",
+       "preserveSelectionToGUIView:",
+       "preserveSelectionToRawViewWithSelection:",
+       "pressure",
+       "prettyTextForMarkerText:",
+       "prettyprintChanges",
+       "prettyprintedSubstringForTokenRange:wrappingAtColumn:translatingRange:",
+       "preventWindowOrdering",
+       "previousEvent",
+       "previousFieldFromItem:",
+       "previousKeyView",
+       "previousPoint",
+       "previousText",
+       "previousToken",
+       "previousValidKeyView",
+       "primaryEmailAddress",
+       "primaryMessageStore",
+       "primaryMessageStorePath",
+       "principalClass",
+       "print",
+       "print:",
+       "printButtonChanged:",
+       "printDocument:",
+       "printDocumentUsingPrintPanel:",
+       "printFile:ok:",
+       "printForArchitecture:",
+       "printForDebugger:",
+       "printFormat:",
+       "printFormat:arguments:",
+       "printInfo",
+       "printJobTitle",
+       "printMessage:",
+       "printMessages:showAllHeaders:",
+       "printOperationWithView:",
+       "printOperationWithView:printInfo:",
+       "printPanel",
+       "printProjectHierarchy:",
+       "printShowingPrintPanel:",
+       "printWithoutDate",
+       "printWithoutDateForArchitecture:",
+       "printer",
+       "printerFont",
+       "printerNames",
+       "printerTypes",
+       "printerWithName:",
+       "printerWithName:includeUnavailable:",
+       "printerWithType:",
+       "printingAdjustmentInLayoutManager:forNominallySpacedGlyphRange:packedGlyphs:count:",
+       "priority",
+       "priorityForFlavor:",
+       "privateFrameworksPath",
+       "processBooleanSearchString:",
+       "processCommand:",
+       "processCommand:argument:",
+       "processEditing",
+       "processIdentifier",
+       "processInfo",
+       "processInputKeyBindings:",
+       "processKeyword:option:keyTran:arg:argTran:",
+       "processKeyword:option:keyTran:arg:argTran:quotedArg:",
+       "processName",
+       "processParsingError",
+       "processRecentChanges",
+       "processString:",
+       "processType:file:isDir:",
+       "progressIndicatorColor",
+       "progressPanel",
+       "project",
+       "projectDidSaveToPath:",
+       "projectDir",
+       "projectFileName",
+       "projectForCanonicalFile:",
+       "projectHasAttribute:",
+       "projectIsLoaded:",
+       "projectName",
+       "projectSaveTimeout:",
+       "projectType",
+       "projectTypeList",
+       "projectTypeName",
+       "projectTypeNamed:",
+       "projectTypeSearchArray",
+       "projectTypeTableWithName:",
+       "projectTypeTableWithPath:name:",
+       "projectTypeVersion",
+       "projectTypes",
+       "projectVersion",
+       "projectsContainingSourceFile:",
+       "prologueLengthWithMap:",
+       "prompt",
+       "promptsAfterFetchLimit",
+       "promulgateSelection:",
+       "propagateDeleteForObject:editingContext:",
+       "propagateDeleteWithEditingContext:",
+       "propagateDeletesUsingTable:",
+       "propagateFrameDirtyRects:",
+       "propagatesDeletesAtEndOfEvent",
+       "propertiesForObjectWithGlobalID:editingContext:",
+       "propertyForKey:",
+       "propertyForKeyIfAvailable:",
+       "propertyList",
+       "propertyListForType:",
+       "propertyListFromStringsFileFormat",
+       "propertyTableAtIndex:",
+       "propertyTableCount",
+       "protocol",
+       "protocolCheckerWithTarget:protocol:",
+       "protocolFamily",
+       "prototype",
+       "provideNewButtonImage",
+       "provideNewSubview:",
+       "provideNewView:",
+       "providerRespondingToSelector:",
+       "proxyDrawnWithFrame:needingRedrawOnResign:",
+       "proxyForFontInfoServer",
+       "proxyForObject:",
+       "proxyForRulebookServer",
+       "proxyWithLocal:",
+       "proxyWithLocal:connection:",
+       "proxyWithTarget:connection:",
+       "pullContentFromDocument:",
+       "pullsDown",
+       "punctuationCharacterSet",
+       "punctuationSet",
+       "purpleColor",
+       "push",
+       "push:",
+       "pushAttribute:value:range:",
+       "pushBundleForImageSearch:",
+       "pushCommand:",
+       "pushCommand:parameter:",
+       "pushContentToDocument:",
+       "pushOrPopCommand:arg:",
+       "pushOrPopCommand:parameter:",
+       "pushPathsToBackingStore",
+       "put::",
+       "putByte:",
+       "putCell:atRow:column:",
+       "putLELong:",
+       "putLEWord:",
+       "qdCreatePortForWindow:",
+       "qdPort",
+       "qsortUsingFunction:",
+       "qualifier",
+       "qualifierForLogicalOp:qualifierArray:",
+       "qualifierRepresentation",
+       "qualifierToMatchAllValues:",
+       "qualifierToMatchAnyValue:",
+       "qualifierWithBindings:requiresAllVariables:",
+       "qualifierWithQualifierFormat:",
+       "qualifierWithQualifierFormat:arguments:",
+       "qualifierWithQualifierFormat:varargList:",
+       "qualifiers",
+       "qualifyWithRelationshipKey:ofObject:",
+       "query",
+       "queryUserForBigMessageAction:userResponse:",
+       "queryUserForPasswordWithMessage:remember:",
+       "queryUserForYesNoWithMessage:title:yesTitle:noTitle:",
+       "queryUserIfNeededToCreateMailboxAtPath:orChooseNewMailboxPath:",
+       "queryUserToSelectMailbox:",
+       "queueMessageForLaterDelivery:",
+       "quit",
+       "quitBecauseErrorCopying:error:",
+       "quotedFromSpaceDataForMessage",
+       "quotedMessageString",
+       "quotedMimeString",
+       "quotedString",
+       "quotedStringIfNecessary",
+       "quotedStringRepresentation",
+       "quotedStringWithQuote:",
+       "raise",
+       "raise:format:",
+       "raise:format:arguments:",
+       "raiseBaseline:",
+       "rangeContainerObject",
+       "rangeForUserCharacterAttributeChange",
+       "rangeForUserParagraphAttributeChange",
+       "rangeForUserTextChange",
+       "rangeInParentWithMap:",
+       "rangeMap",
+       "rangeOfByteFromSet:",
+       "rangeOfByteFromSet:options:",
+       "rangeOfByteFromSet:options:range:",
+       "rangeOfBytes:length:options:range:",
+       "rangeOfCString:",
+       "rangeOfCString:options:",
+       "rangeOfCString:options:range:",
+       "rangeOfCharacterFromSet:",
+       "rangeOfCharacterFromSet:options:",
+       "rangeOfCharacterFromSet:options:range:",
+       "rangeOfComposedCharacterSequenceAtIndex:",
+       "rangeOfData:",
+       "rangeOfData:options:",
+       "rangeOfData:options:range:",
+       "rangeOfGraphicalSegmentAtIndex:",
+       "rangeOfNominallySpacedGlyphsContainingIndex:",
+       "rangeOfString:",
+       "rangeOfString:options:",
+       "rangeOfString:options:range:",
+       "rangeValue",
+       "rangeWithMap:",
+       "rank",
+       "rate",
+       "rationalSelectionForSelection:",
+       "rawController",
+       "rawData",
+       "rawFont",
+       "rawModeAttributesChanged:",
+       "rawModeDefaults",
+       "rawRowKeyPaths",
+       "rawTextController",
+       "rawTextControllerClass",
+       "rawTextView",
+       "rawTextViewClass",
+       "rcptTo:",
+       "reactToChangeInDescendant:",
+       "read:",
+       "readAccountsUsingDefaultsKey:",
+       "readAlignedDataSize",
+       "readBlock:atOffset:forLength:",
+       "readBytesIntoData:length:",
+       "readBytesIntoString:length:",
+       "readColors",
+       "readData:length:",
+       "readDataOfLength:",
+       "readDataOfLength:buffer:",
+       "readDataToEndOfFile",
+       "readDefaults",
+       "readDefaultsFromDictionary:",
+       "readDocumentFromPbtype:filename:",
+       "readFileContentsType:toFile:",
+       "readFileWrapper",
+       "readFromFile:",
+       "readFromFile:ofType:",
+       "readFromStream:",
+       "readFromURL:ofType:",
+       "readFromURL:options:documentAttributes:",
+       "readInBackgroundAndNotify",
+       "readInBackgroundAndNotifyForModes:",
+       "readInt",
+       "readLineIntoData:",
+       "readLineIntoString:",
+       "readMemory:withMode:",
+       "readNamesAndCreateEmailerBoxesFrom:respondTo:",
+       "readPrintInfo",
+       "readPrintInfo:",
+       "readRTFDFromFile:",
+       "readRange:ofLength:atOffset:",
+       "readRichText:forView:",
+       "readSelectionFromPasteboard:",
+       "readSelectionFromPasteboard:type:",
+       "readToEndOfFileInBackgroundAndNotify",
+       "readToEndOfFileInBackgroundAndNotifyForModes:",
+       "readToken",
+       "readTokenInto:attributes:",
+       "readValue:",
+       "readValuesFromDictionary:",
+       "readablePasteboardTypes",
+       "readableTypes",
+       "realAddDirNamed:",
+       "reallyDealloc",
+       "reannotate",
+       "reapplyChangesFromDictionary:",
+       "reapplySortingRules:",
+       "reason",
+       "rebuildCacheFromStore:",
+       "rebuildFilteredMessageList",
+       "rebuildMessageLists",
+       "rebuildTableOfContents:",
+       "rebuildTableOfContentsAsynchronously",
+       "recache",
+       "recacheAllColors",
+       "recacheColor",
+       "receiveMidnightNotification",
+       "receivePort",
+       "receivedIMAPMessageFlags:forMessageNumbered:",
+       "receiversSpecifier",
+       "recentDocumentURLs",
+       "recipients",
+       "recomputeToolTipsForView:remove:add:",
+       "recordChanges",
+       "recordChangesInEditingContext",
+       "recordDescriptor",
+       "recordForGID:",
+       "recordForObject:",
+       "recordMessageToSelectIfEntireSelectionRemoved",
+       "recordObject:globalID:",
+       "recordUpdateForObject:changes:",
+       "recordVisibleMessageRange",
+       "recordsEventsForClass:",
+       "rect",
+       "rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:",
+       "rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCount:",
+       "rectForKey:inTable:",
+       "rectForPage:",
+       "rectForPart:",
+       "rectOfColumn:",
+       "rectOfItemAtIndex:",
+       "rectOfRow:",
+       "rectOfTickMarkAtIndex:",
+       "rectValue",
+       "redColor",
+       "redComponent",
+       "redirectedHandleFromResponse:",
+       "redisplayItemEqualTo:",
+       "redo",
+       "redo:",
+       "redoActionName",
+       "redoMenuItemTitle",
+       "redoMenuTitleForUndoActionName:",
+       "redraw:",
+       "reenableDisplayPosting",
+       "reenableFlush",
+       "reenableHeartBeating:",
+       "reenableUndoRegistration",
+       "reevaluateFontSize",
+       "ref",
+       "refault:",
+       "refaultObject:withGlobalID:editingContext:",
+       "refaultObjects",
+       "refetch:",
+       "reflectScrolledClipView:",
+       "refresh:",
+       "refreshAtMidnight",
+       "refreshBrowser",
+       "refreshDefaults:",
+       "refreshFaceTable",
+       "refreshRect:",
+       "refreshesRefetchedObjects",
+       "refusesFirstResponder",
+       "regeneratePaths",
+       "registerAddressManagerClass:",
+       "registerAvailableStore:",
+       "registerBase:",
+       "registerBody:",
+       "registerBundle",
+       "registerClassDescription:",
+       "registerClassDescription:forClass:",
+       "registerClient:",
+       "registerCoercer:selector:toConvertFromClass:toClass:",
+       "registerCommandDescription:",
+       "registerDefaults:",
+       "registerDragTypes:forWindow:",
+       "registerEventClass:classPointer:",
+       "registerEventClass:handler:",
+       "registerForColorAcceptingDragTypes",
+       "registerForCommandDescription:",
+       "registerForDocumentWindowChanges",
+       "registerForDraggedTypes:",
+       "registerForDrags",
+       "registerForEditingContext:",
+       "registerForFilenameDragTypes",
+       "registerForInspectionObservation",
+       "registerForServices",
+       "registerFrameset:",
+       "registerGlobalHandlers",
+       "registerHTML:",
+       "registerHead:",
+       "registerImageRepClass:",
+       "registerIndexedStore:",
+       "registerLanguage:byVendor:",
+       "registerMessageClass:",
+       "registerMessageClass:forEncoding:",
+       "registerName:",
+       "registerName:withNameServer:",
+       "registerNewViewer:",
+       "registerObject:withServicePath:",
+       "registerObjectForDeallocNotification:",
+       "registerPort:forName:",
+       "registerPort:name:",
+       "registerPort:name:nameServerPortNumber:",
+       "registerServiceProvider:withName:",
+       "registerServicesMenuSendTypes:returnTypes:",
+       "registerTitle:",
+       "registerTranslator:selector:toTranslateFromClass:",
+       "registerTranslator:selector:toTranslateFromDescriptorType:",
+       "registerURLHandleClass:",
+       "registerUndoForModifiedObject:",
+       "registerUndoWithTarget:selector:arg:",
+       "registerUndoWithTarget:selector:object:",
+       "registerUnitWithName:abbreviation:unitToPointsConversionFactor:stepUpCycle:stepDownCycle:",
+       "registeredEventClasses",
+       "registeredImageRepClasses",
+       "registeredObjects",
+       "regularExpressionWithString:",
+       "regularFileContents",
+       "relationalQualifierOperators",
+       "relationshipPathByDeletingFirstComponent",
+       "relationshipPathByDeletingLastComponent",
+       "relationshipPathIsMultiHop",
+       "relativeCurveToPoint:controlPoint1:controlPoint2:",
+       "relativeLineToPoint:",
+       "relativeMoveToPoint:",
+       "relativePath",
+       "relativePosition",
+       "relativeString",
+       "release",
+       "releaseAllPools",
+       "releaseGState",
+       "releaseGlobally",
+       "releaseIndexInfo",
+       "releaseName:count:",
+       "releaseTemporaryAddressBooks",
+       "reloadAccounts",
+       "reloadColumn:",
+       "reloadCurrentMessage",
+       "reloadData",
+       "reloadDefaultFontFamilies",
+       "reloadItem:",
+       "reloadItem:reloadChildren:",
+       "reloadItemEqualTo:reloadChildren:",
+       "rememberFileAttributes",
+       "remoteObjects",
+       "remove:",
+       "removeAccount:",
+       "removeAccountSheetDidEnd:returnCode:account:",
+       "removeAddressForHeader:atIndex:",
+       "removeAllActions",
+       "removeAllActionsWithTarget:",
+       "removeAllAttachments",
+       "removeAllChildren",
+       "removeAllDrawersImmediately",
+       "removeAllFormattingExceptAttachments",
+       "removeAllIndices",
+       "removeAllItems",
+       "removeAllObjects",
+       "removeAllObjectsWithTarget:",
+       "removeAllPoints",
+       "removeAllRequestModes",
+       "removeAllToolTips",
+       "removeAllToolTipsForView:",
+       "removeAndRetainLastObjectUsingLock",
+       "removeAt:",
+       "removeAttachments",
+       "removeAttachments:",
+       "removeAttribute:",
+       "removeAttribute:range:",
+       "removeAttributeForKey:",
+       "removeBytesInRange:",
+       "removeCachedFiles:",
+       "removeCaption",
+       "removeCardWithReference:",
+       "removeCharactersInRange:",
+       "removeCharactersInString:",
+       "removeChild:",
+       "removeChildAtIndex:",
+       "removeChildrenDirectlyConflictingWithTextStyleFromArray:",
+       "removeChildrenMatchingTextStyleFromArray:",
+       "removeClient:",
+       "removeColor:",
+       "removeColorWithKey:",
+       "removeColumn:",
+       "removeColumnOfItem:",
+       "removeConnection:fromRunLoop:forMode:",
+       "removeContextHelpForObject:",
+       "removeConversation",
+       "removeCooperatingObjectStore:",
+       "removeCursorRect:cursor:",
+       "removeDecriptorAtIndex:",
+       "removeDescriptorWithKeyword:",
+       "removeDocument:",
+       "removeEditor:",
+       "removeElementAt:",
+       "removeElementAtIndex:",
+       "removeElementsInRange:",
+       "removeElementsInRange:coalesceRuns:",
+       "removeEmptyRows",
+       "removeEntry:",
+       "removeEntryAtIndex:",
+       "removeEventHandlerForEventClass:andEventID:",
+       "removeFeedback",
+       "removeFile",
+       "removeFile:",
+       "removeFile:key:",
+       "removeFileAtPath:handler:",
+       "removeFileWrapper:",
+       "removeFixedAttachmentAttributes",
+       "removeFontTrait:",
+       "removeFrameUsingName:",
+       "removeFreedView:",
+       "removeFreedWindow:",
+       "removeFromBccRecipientsAtIndex:",
+       "removeFromCcRecipientsAtIndex:",
+       "removeFromComposeMessages:",
+       "removeFromMessageEditors:",
+       "removeFromRunLoop:forMode:",
+       "removeFromSuperstructure:",
+       "removeFromSuperview",
+       "removeFromSuperviewWithoutNeedingDisplay",
+       "removeFromToRecipientsAtIndex:",
+       "removeHandle:",
+       "removeHandlerForMarker:",
+       "removeHeaderForKey:",
+       "removeHeartBeatView:",
+       "removeImmediately:",
+       "removeIndex:",
+       "removeIndexForStore:",
+       "removeIndexRange:",
+       "removeInvocationsWithTarget:selector:",
+       "removeItem",
+       "removeItem:",
+       "removeItemAndChildren:",
+       "removeItemAtIndex:",
+       "removeItemWithObjectValue:",
+       "removeItemWithTitle:",
+       "removeKeysForObject:",
+       "removeKeysNotIn:",
+       "removeLastElement",
+       "removeLastObject",
+       "removeLayoutManager:",
+       "removeLeadingSpaceWithSemanticEngine:",
+       "removeList:",
+       "removeLocal:",
+       "removeMailboxAtPath:confirmWithUser:",
+       "removeMarker:",
+       "removeMatchingEntry:",
+       "removeMatchingTypes:",
+       "removeMessage:",
+       "removeMessageAtIndexFromAllMessages:",
+       "removeMessages:fromArray:attributes:",
+       "removeName:",
+       "removeObject:",
+       "removeObject:fromBothSidesOfRelationshipWithKey:",
+       "removeObject:fromPropertyWithKey:",
+       "removeObject:inRange:",
+       "removeObject:range:identical:",
+       "removeObjectAt:",
+       "removeObjectAtIndex:",
+       "removeObjectForKey:",
+       "removeObjectForKey:inDomain:",
+       "removeObjectIdenticalTo:",
+       "removeObjectIdenticalTo:inRange:",
+       "removeObjectsForKeys:",
+       "removeObjectsFromCache:",
+       "removeObjectsFromCacheForStore:",
+       "removeObjectsFromIndices:numIndices:",
+       "removeObjectsInArray:",
+       "removeObjectsInRange:",
+       "removeObserver:",
+       "removeObserver:forObject:",
+       "removeObserver:name:object:",
+       "removeOmniscientObserver:",
+       "removePage",
+       "removeParamDescriptorWithKeyword:",
+       "removeParentsDirectlyConflictingWithTextStyleFromArray:",
+       "removeParentsMatchingTextStyleFromArray:",
+       "removePath:",
+       "removePathFromLibrarySearchPaths:",
+       "removePersistentDomainForName:",
+       "removePort:forMode:",
+       "removePortForName:",
+       "removePortsFromAllRunLoops",
+       "removePortsFromRunLoop:",
+       "removeProxy:",
+       "removeRepresentation:",
+       "removeRequestMode:",
+       "removeRow:",
+       "removeRowOfItem:",
+       "removeRunLoop:",
+       "removeSelectedEntry:",
+       "removeServiceProvider:",
+       "removeSignature:",
+       "removeSignatureSheetDidEnd:returnCode:contextInfo:",
+       "removeSpace:atIndex:",
+       "removeSpecifiedPathForFramework:",
+       "removeStatusItem:",
+       "removeStore:",
+       "removeStoreFromCache:",
+       "removeStyles:",
+       "removeSubnodeAtIndex:",
+       "removeSuiteNamed:",
+       "removeTabStop:",
+       "removeTabViewItem:",
+       "removeTableColumn:",
+       "removeTargetPersistentStateObjectForKey:",
+       "removeTemporaryAttribute:forCharacterRange:",
+       "removeTextAlignment",
+       "removeTextContainerAtIndex:",
+       "removeTextStyle:",
+       "removeTextStyleFromSelection:",
+       "removeTextStyles:overChildRange:",
+       "removeTimer:forMode:",
+       "removeToolTip:",
+       "removeToolTipForView:tag:",
+       "removeTrackingRect:",
+       "removeTrailingSpaceWithSemanticEngine:",
+       "removeVCard:",
+       "removeVCardsWithIdenticalEMail:",
+       "removeValue",
+       "removeValueAtIndex:fromPropertyWithKey:",
+       "removeVolatileDomainForName:",
+       "removeWindowController:",
+       "removeWindowsItem:",
+       "removedChild:",
+       "removedFromTree",
+       "removedFromTree:",
+       "rename:",
+       "renameColor:",
+       "renameList:",
+       "renameMailbox:",
+       "renameMailbox:toMailbox:errorMessage:",
+       "renameProject:",
+       "renderBitsWithCode:withSize:",
+       "renderLineWithCode:",
+       "renderPICTWithSize:",
+       "renderShapeWithCode:",
+       "renderTextWithCode:",
+       "renderedComment",
+       "renderedEndTagString",
+       "renderedScript",
+       "renderedTagShowsAttributes",
+       "renderedTagString",
+       "renderedTagType",
+       "renderingDidChange",
+       "renderingRoot",
+       "renderingRootTextView",
+       "renewGState",
+       "renewRows:columns:",
+       "repairOffer:",
+       "repairableParseExceptionWithName:token:position:length:reason:repairString:discipline:",
+       "repeatCount",
+       "replace:",
+       "replace:at:",
+       "replaceAll:",
+       "replaceAllMessagesWithArray:",
+       "replaceAndFind:",
+       "replaceBytesInRange:withBytes:",
+       "replaceBytesInRange:withBytes:length:",
+       "replaceCharactersForTextView:inRange:withString:",
+       "replaceCharactersInRange:withAttributedString:",
+       "replaceCharactersInRange:withCString:length:",
+       "replaceCharactersInRange:withCharacters:length:",
+       "replaceCharactersInRange:withRTF:",
+       "replaceCharactersInRange:withRTFD:",
+       "replaceCharactersInRange:withString:",
+       "replaceElementAt:with:",
+       "replaceElementAtIndex:withElement:",
+       "replaceElementsInRange:withElement:coalesceRuns:",
+       "replaceFile:data:",
+       "replaceFile:path:",
+       "replaceFormattedAddress:withAddress:forKey:",
+       "replaceGlyphAtIndex:withGlyph:",
+       "replaceLayoutManager:",
+       "replaceMailAccountsWithAccounts:",
+       "replaceObject:with:",
+       "replaceObject:withObject:",
+       "replaceObjectAt:with:",
+       "replaceObjectAtIndex:withObject:",
+       "replaceObjectsInRange:withObject:length:",
+       "replaceObjectsInRange:withObjects:count:",
+       "replaceObjectsInRange:withObjectsFromArray:",
+       "replaceObjectsInRange:withObjectsFromArray:range:",
+       "replaceSelectionWithItem:",
+       "replaceString:withString:",
+       "replaceSubview:with:",
+       "replaceSubviewWith:",
+       "replaceTextContainer:",
+       "replaceTextStorage:",
+       "replaceTokenRange:withTokensFromFormatter:offsettingBy:",
+       "replaceVCardWithReference:withVCard:",
+       "replaceValueAtIndex:inPropertyWithKey:withValue:",
+       "replaceWithInputOfType:",
+       "replaceWithItem:",
+       "replaceWithItem:addingStyles:removingStyles:",
+       "replacementObjectForArchiver:",
+       "replacementObjectForCoder:",
+       "replacementObjectForPortCoder:",
+       "replyAllMessage:",
+       "replyFromSendingEvent:withSendMode:sendPriority:timeout:",
+       "replyMessage:",
+       "replyTimeout",
+       "replyTo",
+       "replyToAddress",
+       "replyWithException:",
+       "reportException:",
+       "representationOfCoveredCharacters",
+       "representationOfImageRepsInArray:usingType:properties:",
+       "representationUsingType:properties:",
+       "representationWithImageProperties:withProperties:",
+       "representations",
+       "representedFilename",
+       "representedFrame",
+       "representedItem",
+       "representedObject",
+       "representedUrl",
+       "requestLimit",
+       "requestModes",
+       "requestStoreForGlobalID:fetchSpecification:object:",
+       "requestTimeout",
+       "requestedChangeWithTrait:",
+       "requiredFileType",
+       "requiredThickness",
+       "requiresAllQualifierBindingVariables",
+       "rerender",
+       "rerenderItem:",
+       "reservedSpaceLength",
+       "reservedThicknessForAccessoryView",
+       "reservedThicknessForMarkers",
+       "reset",
+       "resetAllPorts",
+       "resetAlpha",
+       "resetBytesInRange:",
+       "resetCommunication",
+       "resetCursorRect:inView:",
+       "resetCursorRects",
+       "resetDisplayDisableCount",
+       "resetFlushDisableCount",
+       "resetFormElements",
+       "resetHtmlTextStyles",
+       "resetLogging",
+       "resetProfiling",
+       "resetStandardUserDefaults",
+       "resetState",
+       "resetStateWithString:attributedString:",
+       "resetSystemTimeZone",
+       "resetTable",
+       "resetTimer",
+       "resetTotalAutoreleasedObjects",
+       "residentSize",
+       "resignAsSelectionOwner",
+       "resignCurrentEditor",
+       "resignFirstResponder",
+       "resignKeyWindow",
+       "resignMailboxSelectionOwnerFor:",
+       "resignMainWindow",
+       "resignSelection",
+       "resignSelectionFor:",
+       "resignUserInterface",
+       "resizeBlock:toSize:",
+       "resizeEdgeForEvent:",
+       "resizeFlags",
+       "resizeIncrements",
+       "resizeSubviewsFromPercentageString:defaultPercentage:",
+       "resizeSubviewsToPercentage:",
+       "resizeSubviewsWithOldSize:",
+       "resizeToScreenWithEvent:",
+       "resizeWithDelta:fromFrame:beginOperation:endOperation:",
+       "resizeWithEvent:",
+       "resizeWithMagnification:",
+       "resizeWithOldSuperviewSize:",
+       "resizedColumn",
+       "resolvedKeyDictionary",
+       "resortMailboxPaths",
+       "resourceBaseUrl",
+       "resourceData",
+       "resourceDataUsingCache:",
+       "resourceForkData",
+       "resourceKeys",
+       "resourceNamed:",
+       "resourcePath",
+       "resourceSpecifier",
+       "respondsTo:",
+       "respondsToSelector:",
+       "respondsToSelector:forFault:",
+       "restoreAttributesOfTextStorage:",
+       "restoreCachedImage",
+       "restoreDraft:",
+       "restoreGraphicsState",
+       "restoreHTMLText:",
+       "restoreOriginalGrammar",
+       "restoreScrollAndSelection",
+       "restoreVisible:nonDeleted:selection:forStore:viewingState:",
+       "restoreWindowOnDockDeath",
+       "resultCodeFromSendingCommand:withArguments:",
+       "resultCodeFromSendingCommand:withArguments:commandResponse:",
+       "resultCodeFromSendingCommand:withArguments:commandResponse:expectUntaggedUnderKey:untaggedResult:",
+       "resultCodeFromSendingCommand:withArguments:commandResponse:expectUntaggedUnderKey:untaggedResult:destFile:keepInMemory:fetchInto:",
+       "resultsOfPerformingSelector:",
+       "resultsOfPerformingSelector:withEachObjectInArray:",
+       "resume",
+       "resumeLogging",
+       "retain",
+       "retainArguments",
+       "retainCount",
+       "retainWireCount",
+       "retainedItemForMarker:tokenizer:",
+       "retainedMessageHeaderForMessageNumber:",
+       "retainedStringFromReplyLine",
+       "retokenize",
+       "retr:toFileHandle:",
+       "retrieveReaderLocks",
+       "returnCompletes",
+       "returnID",
+       "returnResult:exception:sequence:imports:",
+       "returnToSender:",
+       "returnType",
+       "reusesColumns",
+       "revalidate",
+       "reverseObjectEnumerator",
+       "revert",
+       "revert:",
+       "revertDocumentToSaved:",
+       "revertToDefault:",
+       "revertToSavedFromFile:ofType:",
+       "revertToSavedFromURL:ofType:",
+       "reviewChangesAndQuitEnumeration:",
+       "reviewTextViewWidth",
+       "reviewUnsavedDocumentsWithAlertTitle:cancellable:",
+       "reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo:",
+       "richTextForView:",
+       "richTextValue",
+       "rightIndentMarkerWithRulerView:location:",
+       "rightKey",
+       "rightMargin",
+       "rightMarginMarkerWithRulerView:location:",
+       "rightMouseDown:",
+       "rightMouseDragged:",
+       "rightMouseUp:",
+       "rightNeighbor",
+       "rightSibling",
+       "rightTabMarkerWithRulerView:location:",
+       "rollbackChanges",
+       "root",
+       "rootContainer",
+       "rootEvents",
+       "rootEventsByDuration",
+       "rootName",
+       "rootNode",
+       "rootObject",
+       "rootObjectStore",
+       "rootProject",
+       "rootProjectTypeNames",
+       "rootProxy",
+       "rootProxyForConnectionWithRegisteredName:host:",
+       "rootProxyForConnectionWithRegisteredName:host:usingNameServer:",
+       "rotateByAngle:",
+       "rotateByDegrees:",
+       "rotateByRadians:",
+       "rotated",
+       "roundingBehavior",
+       "roundingMode",
+       "routeMessages:",
+       "routerForStore:",
+       "row",
+       "rowAtPoint:",
+       "rowCount",
+       "rowForItem:",
+       "rowForItemEqualTo:",
+       "rowHeight",
+       "rowPreviousTo:wrapping:",
+       "rowSpan",
+       "rowSubsequentTo:wrapping:",
+       "rows",
+       "rowsColsRadioAction:",
+       "rowsInRect:",
+       "rowsString",
+       "rowsTextfieldAction:",
+       "rtfBold:",
+       "rtfCentered",
+       "rtfColor:",
+       "rtfFixed:",
+       "rtfFont:",
+       "rtfFontSize:",
+       "rtfItalic:",
+       "rtfLeftAligned",
+       "rtfReset",
+       "rtfRightAligned",
+       "rtfUnderline:",
+       "ruleThickness",
+       "ruler",
+       "rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled:",
+       "rulerAttributesInRange:",
+       "rulerMarkersForTextView:paragraphStyle:ruler:",
+       "rulerStateDescription",
+       "rulerView:didAddMarker:",
+       "rulerView:didMoveMarker:",
+       "rulerView:didRemoveMarker:",
+       "rulerView:handleMouseDown:",
+       "rulerView:shouldAddMarker:",
+       "rulerView:shouldMoveMarker:",
+       "rulerView:shouldRemoveMarker:",
+       "rulerView:willAddMarker:atLocation:",
+       "rulerView:willMoveMarker:toLocation:",
+       "rulerView:willRemoveMarker:",
+       "rulerView:willSetClientView:",
+       "rulerViewClass",
+       "rulersVisible",
+       "run",
+       "runAlertPanelWithTitle:defaultTitle:alternateTitle:otherTitle:message:",
+       "runBeforeDate:",
+       "runCommand:withArguments:andInputFrom:",
+       "runCommand:withArguments:andOutputTo:",
+       "runCommand:withArguments:withInputFrom:andOutputTo:",
+       "runImport",
+       "runInNewThread",
+       "runInOwnThread",
+       "runInitialization",
+       "runLoop",
+       "runLoopModes",
+       "runModal",
+       "runModalFax",
+       "runModalForDirectory:file:",
+       "runModalForDirectory:file:relativeToWindow:",
+       "runModalForDirectory:file:types:",
+       "runModalForDirectory:file:types:relativeToWindow:",
+       "runModalForTypes:",
+       "runModalForWindow:",
+       "runModalForWindow:relativeToWindow:",
+       "runModalForWindow:withFirstResponder:",
+       "runModalIsPrinter:",
+       "runModalOpenPanel:forTypes:",
+       "runModalPageLayoutWithPrintInfo:",
+       "runModalSavePanel:withAccessoryView:",
+       "runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:",
+       "runModalSession:",
+       "runModalWithPrintInfo:",
+       "runMode:beforeDate:",
+       "runMode:untilDate:",
+       "runOperation",
+       "runPageLayout:",
+       "runPipe:withInputFrom:",
+       "runPipe:withInputFrom:andOutputTo:",
+       "runPipe:withOutputTo:",
+       "runPreferencesPanelModallyForOwner:",
+       "runStartupPanel",
+       "runUntilDate:",
+       "runningOnMainThread",
+       "runtimeAdaptorNames",
+       "sampleTextForEncoding:language:font:",
+       "sampleTextForTriplet:",
+       "samplesPerPixel",
+       "sanitizedFileName:",
+       "sanityCheck",
+       "saturationComponent",
+       "save:",
+       "saveAccountInfoToDefaults",
+       "saveAccounts:usingDefaultsKey:",
+       "saveAddressBook",
+       "saveAll:",
+       "saveAllAddressBooks",
+       "saveAllDocuments:",
+       "saveAllEnumeration:",
+       "saveAs:",
+       "saveChanges",
+       "saveChanges:",
+       "saveChangesInEditingContext:",
+       "saveDefaults",
+       "saveDocument:",
+       "saveDocument:rememberName:shouldClose:",
+       "saveDocument:rememberName:shouldClose:whenDone:",
+       "saveDocumentAs:",
+       "saveDocumentTo:",
+       "saveDocumentWithDelegate:didSaveSelector:contextInfo:",
+       "saveFontCollection:withName:",
+       "saveFrameUsingName:",
+       "saveGraphicsState",
+       "saveImageNamed:andShowWarnings:",
+       "saveMessage",
+       "saveMessage:",
+       "saveMessageToDrafts:",
+       "saveOptions",
+       "savePanel",
+       "savePreferencesToDefaults:",
+       "saveProjectFiles",
+       "saveProjectFiles:block:",
+       "saveScrollAndSelection",
+       "saveServerList",
+       "saveState",
+       "saveStateForAllAccounts",
+       "saveTo:",
+       "saveToDocument:removeBackup:errorHandler:",
+       "saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:",
+       "saveToPath:encoding:updateFilenames:overwriteOK:",
+       "saveUserInfo",
+       "saveVisible:nonDeleted:selection:viewingState:",
+       "saveWeighting",
+       "savedHostname",
+       "scale",
+       "scaleBy:",
+       "scaleFactor",
+       "scalePopUpAction:",
+       "scaleTo::",
+       "scaleUnitSquareToSize:",
+       "scaleXBy:yBy:",
+       "scalesWhenResized",
+       "scanByte:",
+       "scanBytesFromSet:intoData:",
+       "scanCString:intoData:",
+       "scanCharacter:",
+       "scanCharactersFromSet:intoString:",
+       "scanData:intoData:",
+       "scanDecimal:",
+       "scanDouble:",
+       "scanEndIntoString:",
+       "scanFloat:",
+       "scanHexInt:",
+       "scanInt:",
+       "scanLocation",
+       "scanLongLong:",
+       "scanMimeTokenUsingSeparators:",
+       "scanString:intoString:",
+       "scanStringOfLength:intoString:",
+       "scanTokenSeparatedByString:",
+       "scanUpAndOverString:",
+       "scanUpToBytesFromSet:intoData:",
+       "scanUpToCString:intoData:",
+       "scanUpToCharactersFromSet:intoString:",
+       "scanUpToData:intoData:",
+       "scanUpToString:intoString:",
+       "scanUpToString:options:",
+       "scannerWithData:",
+       "scannerWithString:",
+       "scheduleInRunLoop:forMode:",
+       "scheduleTimerWithTimeInterval:target:selector:withObject:",
+       "scheduleTimerWithTimeInterval:target:selector:withObject:inModes:",
+       "scheduledTimerWithTimeInterval:invocation:repeats:",
+       "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:",
+       "scheme",
+       "scope",
+       "screen",
+       "screenFont",
+       "screens",
+       "script",
+       "scriptCommandForAppleEvent:",
+       "scriptDidChange:",
+       "scriptErrorNumber",
+       "scriptErrorString",
+       "scriptString",
+       "scriptStringItem",
+       "scriptedMessageSize",
+       "scriptingBeginsWith:",
+       "scriptingContains:",
+       "scriptingEndsWith:",
+       "scriptingIsEqualTo:",
+       "scriptingIsGreaterThan:",
+       "scriptingIsGreaterThanOrEqualTo:",
+       "scriptingIsLessThan:",
+       "scriptingIsLessThanOrEqualTo:",
+       "scrollBarColor",
+       "scrollCellToVisibleAtRow:column:",
+       "scrollClipView:toPoint:",
+       "scrollColumnToVisible:",
+       "scrollColumnsLeftBy:",
+       "scrollColumnsRightBy:",
+       "scrollDown",
+       "scrollItemAtIndexToTop:",
+       "scrollItemAtIndexToVisible:",
+       "scrollLineDown:",
+       "scrollLineUp:",
+       "scrollPageDown:",
+       "scrollPageUp:",
+       "scrollPoint:",
+       "scrollPoint:fromView:",
+       "scrollRangeToVisible:",
+       "scrollRect:by:",
+       "scrollRectToVisible:",
+       "scrollRectToVisible:fromView:",
+       "scrollRowToVisible:",
+       "scrollRowToVisible:position:",
+       "scrollToBeginningOfDocument:",
+       "scrollToEndOfDocument:",
+       "scrollToFragmentName:",
+       "scrollToPoint:",
+       "scrollUp",
+       "scrollViaScroller:",
+       "scrollView",
+       "scrollWheel:",
+       "scrollerWidth",
+       "scrollerWidthForControlSize:",
+       "scrolling",
+       "scrollsDynamically",
+       "search:",
+       "search:attributes:attributesOnly:",
+       "searchCount:",
+       "searchIndex:",
+       "searchList",
+       "searchNames",
+       "searchRanks",
+       "searchResults",
+       "searchResultsFromLDAPQuery:",
+       "searchResultsWithResults:connection:",
+       "searchedPathForFrameworkNamed:",
+       "secondOfMinute",
+       "secondaryInvocation",
+       "secondsFromGMT",
+       "secondsFromGMTForDate:",
+       "secondsFromGMTForTimeInterval:",
+       "seekToEndOfFile",
+       "seekToFileOffset:",
+       "select",
+       "selectAddressBook:",
+       "selectAll:",
+       "selectCell:",
+       "selectCellAtRow:",
+       "selectCellAtRow:column:",
+       "selectCellWithTag:",
+       "selectColumn:byExtendingSelection:",
+       "selectFile:inFileViewerRootedAtPath:",
+       "selectFirstTabViewItem:",
+       "selectFontFaceAtIndex:",
+       "selectImage:",
+       "selectItem:",
+       "selectItemAtIndex:",
+       "selectItemWithObjectValue:",
+       "selectItemWithTitle:",
+       "selectKeyViewFollowingView:",
+       "selectKeyViewPrecedingView:",
+       "selectLastTabViewItem:",
+       "selectLine:",
+       "selectMailProgram:",
+       "selectMailbox:errorMessage:",
+       "selectMailboxPanelCancel:",
+       "selectMailboxPanelOK:",
+       "selectMessages:",
+       "selectModule:",
+       "selectNewMailSound:",
+       "selectNextKeyView:",
+       "selectNextMessage",
+       "selectNextMessageMovingDownward",
+       "selectNextMessageMovingUpward",
+       "selectNextTabViewItem:",
+       "selectParagraph:",
+       "selectPathToMailbox:",
+       "selectPreviousKeyView:",
+       "selectPreviousMessage",
+       "selectPreviousTabViewItem:",
+       "selectResult:",
+       "selectRow:byExtendingSelection:",
+       "selectRow:inColumn:",
+       "selectTabViewItem:",
+       "selectTabViewItemAtIndex:",
+       "selectTabViewItemWithIdentifier:",
+       "selectTableViewRow:",
+       "selectText:",
+       "selectTextAtIndex:",
+       "selectTextAtRow:column:",
+       "selectToMark:",
+       "selectWithFrame:inView:editor:delegate:start:length:",
+       "selectWord:",
+       "selected",
+       "selectedAddressBooks",
+       "selectedAddresses",
+       "selectedCell",
+       "selectedCellInColumn:",
+       "selectedCells",
+       "selectedColumn",
+       "selectedColumnEnumerator",
+       "selectedControlColor",
+       "selectedControlTextColor",
+       "selectedElementResized:",
+       "selectedFont",
+       "selectedInactiveColor",
+       "selectedItem",
+       "selectedItemForUserChange",
+       "selectedItems",
+       "selectedKnobColor",
+       "selectedMailbox",
+       "selectedMailboxes",
+       "selectedMenuItemColor",
+       "selectedMenuItemTextColor",
+       "selectedOption",
+       "selectedOptions",
+       "selectedRange",
+       "selectedRangeForRoot:",
+       "selectedRow",
+       "selectedRowEnumerator",
+       "selectedRowInColumn:",
+       "selectedTabViewItem",
+       "selectedTag",
+       "selectedTargetCommandLineArguments",
+       "selectedTargetCommandLineArgumentsArrayIndex",
+       "selectedTargetCommandLineArgumentsString",
+       "selectedTextAttributes",
+       "selectedTextBackgroundColor",
+       "selectedTextColor",
+       "selection",
+       "selectionAddingItem:toSelection:",
+       "selectionAffinity",
+       "selectionAtEndOfContent",
+       "selectionAtStartOfContent",
+       "selectionByMovingBackwardCharacterFromSelection:",
+       "selectionByMovingBackwardFromSelection:",
+       "selectionByMovingDownwardFromSelection:usingOffset:",
+       "selectionByMovingForwardCharacterFromSelection:",
+       "selectionByMovingForwardFromSelection:",
+       "selectionByMovingToParagraphEndFromSelection:movingOutOfBlocks:stoppingAtBreaks:",
+       "selectionByMovingToParagraphStartFromSelection:movingOutOfBlocks:stoppingAtBreaks:",
+       "selectionByMovingUpwardFromSelection:usingOffset:",
+       "selectionByTrackingChange:",
+       "selectionChanged:",
+       "selectionChanged:fromRange:toRange:andColorize:",
+       "selectionColor",
+       "selectionCount",
+       "selectionEncompassingInteriorOfItem:",
+       "selectionEncompassingItem:",
+       "selectionEncompassingItems:",
+       "selectionEndItemWithOffset:",
+       "selectionForStartRoot:index:",
+       "selectionForUserChange",
+       "selectionFromOffset:inItem:toOffset:inItem:",
+       "selectionFromOffset:inItem:toOffset:inItem:affinity:",
+       "selectionFromRootSelection:endRoot:index:",
+       "selectionFromStartOfSelection:toEndOfSelection:",
+       "selectionGranularity",
+       "selectionIncorporatingFollowingPosition",
+       "selectionIncorporatingPrecedingPosition",
+       "selectionInspectingItem:",
+       "selectionIsChanging:",
+       "selectionIsFolder",
+       "selectionIsolatedFromChildren",
+       "selectionIsolatedFromText",
+       "selectionIsolatedInNode:",
+       "selectionMustBeWithinEditedItem",
+       "selectionOneOnly",
+       "selectionOwner",
+       "selectionRangeForProposedRange:granularity:",
+       "selectionRangeUsingRangeMap:",
+       "selectionRemovingItem:fromSelection:",
+       "selectionShouldChangeInOutlineView:",
+       "selectionShouldChangeInTableView:",
+       "selectionStartItemWithOffset:",
+       "selectionWithLocation:affinity:rangeMap:",
+       "selectionWithLocation:rangeMap:",
+       "selectionWithRange:affinity:rangeMap:",
+       "selectionWithRange:rangeMap:",
+       "selector",
+       "selectorForCommand:",
+       "self",
+       "semanticDiscipline",
+       "semanticDisciplineLevel",
+       "semanticEngine",
+       "semanticErrorOfType:withChildKey:parentKey:",
+       "semanticPolicyChanged:",
+       "send",
+       "send:",
+       "sendAction",
+       "sendAction:to:",
+       "sendAction:to:forAllCells:",
+       "sendAction:to:from:",
+       "sendActionOn:",
+       "sendBeforeDate:",
+       "sendBeforeDate:components:from:reserved:",
+       "sendBeforeDate:msgid:components:from:reserved:",
+       "sendBeforeTime:sendReplyPort:",
+       "sendBeforeTime:streamData:components:from:msgid:",
+       "sendBeforeTime:streamData:components:to:from:msgid:reserved:",
+       "sendData:",
+       "sendDoubleAction",
+       "sendEOF",
+       "sendEvent:",
+       "sendFormat",
+       "sendInv",
+       "sendInvocation:target:",
+       "sendPort",
+       "sendPort:withAllRights:",
+       "sendReleasedProxies",
+       "sendSizeLimit",
+       "sendTaggedMsg:",
+       "sendWireCountForTarget:port:",
+       "sender",
+       "senderDidBecomeActive:",
+       "senderDidResignActive:",
+       "senderOrReceiverIfSenderIsMe",
+       "sendmailMailer",
+       "sendsActionOnArrowKeys",
+       "sendsActionOnEndEditing",
+       "sendsDoubleAction",
+       "sendsSingleAction",
+       "separatesColumns",
+       "separator",
+       "separatorChar",
+       "separatorItem",
+       "serialize:length:",
+       "serializeAlignedBytes:length:",
+       "serializeAlignedBytesLength:",
+       "serializeData:",
+       "serializeDataAt:ofObjCType:context:",
+       "serializeInt:",
+       "serializeInt:atIndex:",
+       "serializeInts:count:",
+       "serializeInts:count:atIndex:",
+       "serializeList:",
+       "serializeListItemIn:at:",
+       "serializeObject:",
+       "serializeObjectAt:ofObjCType:intoData:",
+       "serializePListKeyIn:key:value:",
+       "serializePListValueIn:key:value:",
+       "serializePropertyList:",
+       "serializePropertyList:intoData:",
+       "serializeString:",
+       "serializeToData",
+       "serializeXMLPropertyList:",
+       "serializedRepresentation",
+       "serializerStream",
+       "server",
+       "serverName",
+       "serverSideImageMap",
+       "servers",
+       "serviceError:error:",
+       "serviceListener",
+       "servicesInfoIdentifier:",
+       "servicesMenu",
+       "servicesMenuData:forUser:",
+       "servicesProvider",
+       "set",
+       "setAbsoluteFontSizeLevel:",
+       "setAcceptsArrowKeys:",
+       "setAcceptsMouseMovedEvents:",
+       "setAccessoryView:",
+       "setAccount:",
+       "setAccountInfo:",
+       "setAction:",
+       "setAction:atRow:column:",
+       "setActionName:",
+       "setActivated:sender:",
+       "setActiveLinkColor:",
+       "setAddress:",
+       "setAddressList:forHeader:",
+       "setAlias:",
+       "setAlignment:",
+       "setAlignment:range:",
+       "setAlignmentValue:forAttribute:",
+       "setAllContextsOutputTraced:",
+       "setAllContextsSynchronized:",
+       "setAllowsBranchSelection:",
+       "setAllowsColumnReordering:",
+       "setAllowsColumnResizing:",
+       "setAllowsColumnSelection:",
+       "setAllowsContinuedTracking:",
+       "setAllowsEditingTextAttributes:",
+       "setAllowsEmptySelection:",
+       "setAllowsFloats:",
+       "setAllowsIncrementalSearching:",
+       "setAllowsMixedState:",
+       "setAllowsMultipleSelection:",
+       "setAllowsTickMarkValuesOnly:",
+       "setAllowsTruncatedLabels:",
+       "setAllowsUndo:",
+       "setAlpha:",
+       "setAltIncrementValue:",
+       "setAlternateImage:",
+       "setAlternateMnemonicLocation:",
+       "setAlternateText:",
+       "setAlternateTitle:",
+       "setAlternateTitleWithMnemonic:",
+       "setAltersStateOfSelectedItem:",
+       "setAlwaysKeepColumnsSizedToFitAvailableSpace:",
+       "setAlwaysSelectsSelf:",
+       "setAlwaysVisible:",
+       "setAnimationDelay:",
+       "setAppHelpFile:forOSType:",
+       "setAppIconFile:forOSType:",
+       "setAppImageForUnreadCount:",
+       "setAppleMenu:",
+       "setApplicationClass:",
+       "setApplicationIconImage:",
+       "setArchitectureCount:andArchs:",
+       "setArchiveMailboxPath:",
+       "setArchiveStorePath:",
+       "setArgArray:",
+       "setArgList:",
+       "setArgument:atIndex:",
+       "setArgumentBinding:",
+       "setArguments:",
+       "setArray:",
+       "setArrowPosition:",
+       "setArrowsPosition:",
+       "setAsMainCarbonMenuBar",
+       "setAskForReadReceipt:",
+       "setAspectRatio:",
+       "setAssociatedInputManager:",
+       "setAssociatedPoints:atIndex:",
+       "setAttachedView:",
+       "setAttachment:",
+       "setAttachmentCell:",
+       "setAttachmentDirectory:",
+       "setAttachmentSize:forGlyphRange:",
+       "setAttribute:forKey:",
+       "setAttribute:toSize:percentage:",
+       "setAttributeDescriptor:forKeyword:",
+       "setAttributeRuns:",
+       "setAttributeStart:",
+       "setAttributedAlternateTitle:",
+       "setAttributedString:",
+       "setAttributedStringForNil:",
+       "setAttributedStringForNotANumber:",
+       "setAttributedStringForZero:",
+       "setAttributedStringValue:",
+       "setAttributedTitle:",
+       "setAttributes:",
+       "setAttributes:range:",
+       "setAttributesInTextStorage:",
+       "setAutoAlternative:",
+       "setAutoPositionMask:",
+       "setAutoResizesOutlineColumn:",
+       "setAutoUpdateEnabled:",
+       "setAutodisplay:",
+       "setAutoenablesItems:",
+       "setAutomagicallyResizes:",
+       "setAutoresizesAllColumnsToFit:",
+       "setAutoresizesOutlineColumn:",
+       "setAutoresizesSubviews:",
+       "setAutoresizingMask:",
+       "setAutosaveExpandedItems:",
+       "setAutosaveName:",
+       "setAutosaveTableColumns:",
+       "setAutoscroll:",
+       "setAutosizesCells:",
+       "setAvailableCapacity:",
+       "setBackEnd:",
+       "setBackgroundColor:",
+       "setBackgroundColorString:",
+       "setBackgroundImageUrl:",
+       "setBackgroundImageUrlString:",
+       "setBackgroundLayoutEnabled:",
+       "setBackgroundProcessingEnabled:",
+       "setBackingType:",
+       "setBase:",
+       "setBaseAffineTransform:",
+       "setBaseFontSizeLevel:",
+       "setBaseSpecifier:",
+       "setBaselineOffset:",
+       "setBaselineTo:",
+       "setBaselineToCenterAttachmentOfHeight:",
+       "setBaselineToCenterImage:",
+       "setBaselineToCenterImageNamed:",
+       "setBecomesKeyOnlyIfNeeded:",
+       "setBezelStyle:",
+       "setBezeled:",
+       "setBigMessageWarningSize:",
+       "setBinding:",
+       "setBitsPerSample:",
+       "setBlink",
+       "setBlueUnderline",
+       "setBodyData:",
+       "setBodyParts:",
+       "setBold",
+       "setBool:forKey:",
+       "setBooleanValue:forAttribute:",
+       "setBorderColor:",
+       "setBorderOnTop:left:bottom:right:",
+       "setBorderSize:",
+       "setBorderType:",
+       "setBorderWidth:",
+       "setBordered:",
+       "setBottomMargin:",
+       "setBounds:",
+       "setBoundsOrigin:",
+       "setBoundsRotation:",
+       "setBoundsSize:",
+       "setBoxType:",
+       "setBrightness:",
+       "setBrowser:",
+       "setBrowserBox:",
+       "setBrowserMayDeferScript:",
+       "setBulletCharacter:",
+       "setBulletStyle:",
+       "setBundleExtension:",
+       "setButtonID:",
+       "setButtonSize:",
+       "setButtonType:",
+       "setButtons:",
+       "setByteThreshold:",
+       "setCacheDepthMatchesImageDepth:",
+       "setCachePolicy:",
+       "setCachedSeparately:",
+       "setCachesBezierPath:",
+       "setCalendarFormat:",
+       "setCanBeCancelled:",
+       "setCanBePended:",
+       "setCanChooseDirectories:",
+       "setCanChooseFiles:",
+       "setCanUseAppKit:",
+       "setCancelButton:",
+       "setCaseSensitive:",
+       "setCell:",
+       "setCellAttribute:to:",
+       "setCellBackgroundColor:",
+       "setCellClass:",
+       "setCellPrototype:",
+       "setCellSize:",
+       "setCellTextAlignment:",
+       "setCenteredInCell:",
+       "setCharacterIndex:forGlyphAtIndex:",
+       "setCharacters:",
+       "setCharactersToBeSkipped:",
+       "setChecked:",
+       "setChildSpecifier:",
+       "setChildren:",
+       "setChooser:",
+       "setClassDelegate:",
+       "setClassName:",
+       "setClientSideImageMapName:",
+       "setClientView:",
+       "setClip",
+       "setClipRgn",
+       "setCloseAction:",
+       "setCloseTarget:",
+       "setCloseTokenRange:",
+       "setColor:",
+       "setColor:forKey:",
+       "setColorMask:",
+       "setColorSpaceName:",
+       "setColorString:",
+       "setCols:",
+       "setColsString:",
+       "setColumnSpan:",
+       "setComment:",
+       "setCompactWhenClosingMailboxes:",
+       "setComparator:andContext:",
+       "setCompareSelector:",
+       "setComparisonFormat:",
+       "setCompiler:forLanguage:OSType:",
+       "setCompletes:",
+       "setCompletionEnabled:",
+       "setCompressCommand:",
+       "setCompression:factor:",
+       "setConstrainedFrameSize:",
+       "setContainerClassDescription:",
+       "setContainerIsObjectBeingTested:",
+       "setContainerIsRangeContainerObject:",
+       "setContainerSize:",
+       "setContainerSpecifier:",
+       "setContent:",
+       "setContentSize:",
+       "setContentString:",
+       "setContentTransferEncoding:",
+       "setContentView:",
+       "setContentViewMargins:",
+       "setContents:andLength:",
+       "setContentsNoCopy:length:freeWhenDone:isUnicode:",
+       "setContentsWrap:",
+       "setContextHelp:forObject:",
+       "setContextHelpModeActive:",
+       "setContextMenuRepresentation:",
+       "setContinuous:",
+       "setContinuousSpellCheckingEnabled:",
+       "setControlBox:",
+       "setControlSize:",
+       "setControlTint:",
+       "setConversationRequest:",
+       "setCoordinates:",
+       "setCopiesOnScroll:",
+       "setCornerView:",
+       "setCount:andPostings:",
+       "setCount:andPostings:byCopy:",
+       "setCreateSelector:",
+       "setCreationZone:",
+       "setCreator:",
+       "setCurrentContext:",
+       "setCurrentDirectoryPath:",
+       "setCurrentImageNumber:",
+       "setCurrentIndex:",
+       "setCurrentInputManager:",
+       "setCurrentOperation:",
+       "setCurrentPage:",
+       "setCurrentTransferMailboxPath:",
+       "setCursor:",
+       "setData:",
+       "setData:forType:",
+       "setDataCell:",
+       "setDataRetained:",
+       "setDataSource:",
+       "setDateReceived:",
+       "setDeadKeyProcessingEnabled:",
+       "setDebugTextView:",
+       "setDecimalSeparator:",
+       "setDefaultAttachmentDirectory:",
+       "setDefaultBehavior:",
+       "setDefaultButtonCell:",
+       "setDefaultCollator:",
+       "setDefaultCoordinator:",
+       "setDefaultFetchTimestampLag:",
+       "setDefaultFlatness:",
+       "setDefaultFontSize:",
+       "setDefaultHeader:",
+       "setDefaultLanguage:",
+       "setDefaultLanguageContext:",
+       "setDefaultLineCapStyle:",
+       "setDefaultLineJoinStyle:",
+       "setDefaultLineWidth:",
+       "setDefaultMailDirectory:",
+       "setDefaultMessageStorePath:",
+       "setDefaultMiterLimit:",
+       "setDefaultNameServerPortNumber:",
+       "setDefaultParentObjectStore:",
+       "setDefaultPreferencesClass:",
+       "setDefaultPreferredAlternative:",
+       "setDefaultPrinter:",
+       "setDefaultPrinterWithName:isFax:",
+       "setDefaultPriority:",
+       "setDefaultSharedEditingContext:",
+       "setDefaultSignature:",
+       "setDefaultString:forKey:inDictionary:",
+       "setDefaultTimeZone:",
+       "setDefaultValue:",
+       "setDefaultWindingRule:",
+       "setDeferSync:",
+       "setDeferred:",
+       "setDelegate:",
+       "setDelegate:withNotifyingTextView:",
+       "setDeleteMessagesOnServer:",
+       "setDeleteSelector:",
+       "setDeltaFontSizeLevel:",
+       "setDepthLimit:",
+       "setDescriptor:forKeyword:",
+       "setDestination:",
+       "setDevice:",
+       "setDictionary:",
+       "setDirectUndoBody:",
+       "setDirectUndoDirtyFlags:",
+       "setDirectUndoFrameset:",
+       "setDirectUndoHead:",
+       "setDirectUndoHtml:",
+       "setDirectUndoTitle:",
+       "setDirectory:",
+       "setDirtyFlag:",
+       "setDisplayDisciplineLevelsForDisplayOnly:",
+       "setDisplayName:",
+       "setDisplaySeparatelyInMailboxesDrawer:",
+       "setDisplaysMessageNumbers:",
+       "setDisplaysMessageSizes:",
+       "setDisplaysSearchRank:",
+       "setDisposable:",
+       "setDocument:",
+       "setDocumentAttributes:",
+       "setDocumentBaseUrl:",
+       "setDocumentClass:",
+       "setDocumentCursor:",
+       "setDocumentEdited:",
+       "setDocumentName:",
+       "setDocumentView:",
+       "setDouble:forKey:",
+       "setDoubleAction:",
+       "setDoubleValue:",
+       "setDraftsMailboxPath:",
+       "setDraggingDelegate:",
+       "setDrawsBackground:",
+       "setDrawsCellBackground:",
+       "setDrawsColumnSeparators:",
+       "setDrawsGrid:",
+       "setDrawsOutsideLineFragment:forGlyphAtIndex:",
+       "setDropItem:dropChildIndex:",
+       "setDropRow:dropOperation:",
+       "setDynamicCounterpart:",
+       "setDynamicDepthLimit:",
+       "setEMail:",
+       "setEchosBullets:",
+       "setEditAddressBook:",
+       "setEditable:",
+       "setEditedCell:",
+       "setEditedFlag:",
+       "setEditingContextSelector:",
+       "setEditingField:",
+       "setEditingSwitches:",
+       "setEffectiveColumnSpan:",
+       "setEffectiveRowSpan:",
+       "setEmailAddresses:",
+       "setEnableFloatParsing:",
+       "setEnableIntegerParsing:",
+       "setEnabled:",
+       "setEncoding:",
+       "setEncodingAccessory:",
+       "setEncodingPopupButton:",
+       "setEncodingType:",
+       "setEndSpecifier:",
+       "setEndSubelementIdentifier:",
+       "setEndSubelementIndex:",
+       "setEntityName:",
+       "setEntryType:",
+       "setEntryWidth:",
+       "setEnvironment:",
+       "setErrorAction:",
+       "setErrorProc:",
+       "setEvaluationErrorNumber:",
+       "setEventCoalescingEnabled:",
+       "setEventHandler:andSelector:forEventClass:andEventID:",
+       "setEventMask:",
+       "setEventsTraced:",
+       "setExcludedFromWindowsMenu:",
+       "setExpandButton:",
+       "setExtraLineFragmentRect:usedRect:textContainer:",
+       "setFaceString:",
+       "setFaces:",
+       "setFamilies:",
+       "setFavoritesButton:",
+       "setFavoritesPopup:",
+       "setFeature:forPopUp:",
+       "setFeed:",
+       "setFeedTitle:value:",
+       "setFetchLimit:",
+       "setFetchRemoteURLs:",
+       "setFetchSelector:",
+       "setFetchTimestamp:",
+       "setFetchesRawRows:",
+       "setFieldEditor:",
+       "setFile:",
+       "setFileAttributes:",
+       "setFileName:",
+       "setFilePermissionsRecursively:",
+       "setFileType:",
+       "setFileWrapper:",
+       "setFilename:",
+       "setFilterString:",
+       "setFindString:",
+       "setFindString:writeToPasteboard:",
+       "setFinderFlags:",
+       "setFirst",
+       "setFirstHandle",
+       "setFirstLineHeadIndent:",
+       "setFirstName:",
+       "setFixedCapacityLimit:",
+       "setFixedFont",
+       "setFlagsFromDictionary:forMessage:",
+       "setFlagsFromDictionary:forMessages:",
+       "setFlatness:",
+       "setFlipped:",
+       "setFloat:forKey:",
+       "setFloatValue:",
+       "setFloatValue:knobProportion:",
+       "setFloatingPanel:",
+       "setFloatingPointFormat:left:right:",
+       "setFocusStack:",
+       "setFocusedMessages:",
+       "setFollowLinks:",
+       "setFollowsItalicAngle:",
+       "setFont:",
+       "setFont:range:",
+       "setFontFace:",
+       "setFontManagerFactory:",
+       "setFontMenu:",
+       "setFontName:",
+       "setFontPanelFactory:",
+       "setFontSize:",
+       "setForID:",
+       "setForItem:",
+       "setForegroundColor:",
+       "setForm:",
+       "setFormat:",
+       "setFormatter:",
+       "setFragment:",
+       "setFragmentCleanup:",
+       "setFragmentCleanupAtEnd",
+       "setFrame:",
+       "setFrame:display:",
+       "setFrameAutosaveName:",
+       "setFrameBorder:",
+       "setFrameColor:",
+       "setFrameFromContentFrame:",
+       "setFrameFromString:",
+       "setFrameOrigin:",
+       "setFrameRotation:",
+       "setFrameSize:",
+       "setFrameTopLeftPoint:",
+       "setFrameUsingName:",
+       "setFrameViewClass:",
+       "setFrameset:",
+       "setFramesetController:",
+       "setFramesetView:",
+       "setFramesetViewClass:",
+       "setFrozenCell:",
+       "setFullScreen",
+       "setFullUserName:",
+       "setGradientType:",
+       "setGraphicAttributeWithCode:",
+       "setGraphicsState:",
+       "setGridColor:",
+       "setGroupIdentifier:",
+       "setGroupsByEvent:",
+       "setHTMLString:",
+       "setHTMLTree:",
+       "setHTMLTreeClass:",
+       "setHTMLView:",
+       "setHandle:",
+       "setHandler:forMarker:",
+       "setHandler:forMarkers:",
+       "setHasChanges:",
+       "setHasFocusView:",
+       "setHasHorizontalRuler:",
+       "setHasHorizontalScroller:",
+       "setHasMultiplePages:",
+       "setHasOfflineChanges:forStoreAtPath:",
+       "setHasProperty:",
+       "setHasRoundedCornersForButton:",
+       "setHasRoundedCornersForPopUp:",
+       "setHasScrollerOnRight:",
+       "setHasShadow:",
+       "setHasThousandSeparators:",
+       "setHasUndoManager:",
+       "setHasVerticalRuler:",
+       "setHasVerticalScroller:",
+       "setHeadIndent:",
+       "setHeader",
+       "setHeader:forKey:",
+       "setHeaderCell:",
+       "setHeaderLevel:",
+       "setHeaderView:",
+       "setHeaders:",
+       "setHeartBeatCycle:",
+       "setHeight:",
+       "setHeight:percentage:",
+       "setHeightAbsolute:",
+       "setHeightPercentage:",
+       "setHeightProportional:",
+       "setHeightString:",
+       "setHeightTracksTextView:",
+       "setHiddenUntilMouseMoves:",
+       "setHidesOnDeactivate:",
+       "setHighlightMode:",
+       "setHighlighted:",
+       "setHighlightedItemIndex:",
+       "setHighlightedTableColumn:",
+       "setHighlightsBy:",
+       "setHintCapacity:",
+       "setHints:",
+       "setHomeButton:",
+       "setHorizontal:",
+       "setHorizontalEdgePadding:",
+       "setHorizontalLineScroll:",
+       "setHorizontalPageScroll:",
+       "setHorizontalPagination:",
+       "setHorizontalRulerView:",
+       "setHorizontalScroller:",
+       "setHorizontalSpace:",
+       "setHorizontallyCentered:",
+       "setHorizontallyResizable:",
+       "setHostCacheEnabled:",
+       "setHostname:",
+       "setHref:",
+       "setHtmlAddedTextStyles:",
+       "setHtmlDeletedTextStyles:",
+       "setHtmlView:",
+       "setHyphenationFactor:",
+       "setIMAPMessageFlags:",
+       "setIcon:",
+       "setIconRef:label:",
+       "setIdentifier:",
+       "setIgnoreRichTextButton:",
+       "setIgnoreSelectionChanges:",
+       "setIgnoredWords:inSpellDocumentWithTag:",
+       "setIgnoresAlpha:",
+       "setIgnoresMultiClick:",
+       "setImage:",
+       "setImageAlignment:",
+       "setImageDimsWhenDisabled:",
+       "setImageFrameStyle:",
+       "setImageNamed:forView:",
+       "setImageNumber:",
+       "setImageOrigin:",
+       "setImagePosition:",
+       "setImageScaling:",
+       "setImageSize:",
+       "setImplementor:atIndex:",
+       "setImportsGraphics:",
+       "setInboxMessageStorePath:",
+       "setIncludeDeleted:",
+       "setIncomingSpoolDirectory:",
+       "setIndentationMarkerFollowsCell:",
+       "setIndentationPerLevel:",
+       "setIndependentConversationQueueing:",
+       "setIndeterminate:",
+       "setIndex:",
+       "setIndexStyle:",
+       "setIndexValue:",
+       "setIndicatorImage:inTableColumn:",
+       "setInfo:",
+       "setInitialFirstResponder:",
+       "setInitialGState:",
+       "setInitialToolTipDelay:",
+       "setInputSize:",
+       "setInsertSelector:",
+       "setInsertionPointColor:",
+       "setInset:",
+       "setInsetsForVisibleAreaFromLeft:top:right:bottom:",
+       "setInspectedSelection:",
+       "setInspectorView:withInitialFirstResponder:",
+       "setInstancesRetainRegisteredObjects:",
+       "setIntAttribute:value:forGlyphAtIndex:",
+       "setIntValue:",
+       "setIntValue:forAttribute:withDefault:",
+       "setIntValue:forAttribute:withDefault:minimum:",
+       "setInteger:forKey:",
+       "setInterRowSpacing:",
+       "setIntercellSpacing:",
+       "setInterfaceStyle:",
+       "setInterlineSpacing:",
+       "setInterpreterArguments:",
+       "setInterpreterPath:",
+       "setInvalidatesObjectsWhenFreed:",
+       "setIsActive:",
+       "setIsClosable:",
+       "setIsDeep:",
+       "setIsDirty:",
+       "setIsError:",
+       "setIsHeader:",
+       "setIsInlineSpellCheckingEnabled:",
+       "setIsMiniaturized:",
+       "setIsOffline:",
+       "setIsOpaque:",
+       "setIsPaneSplitter:",
+       "setIsResizable:",
+       "setIsSorted:",
+       "setIsSortedAscending:",
+       "setIsSortedDescending:",
+       "setIsUp:",
+       "setIsVisible:",
+       "setIsZoomed:",
+       "setItalic",
+       "setItemHeight:",
+       "setItemRange:",
+       "setJobDisposition:",
+       "setJobFeature:option:inPrintInfo:",
+       "setKey:",
+       "setKey:andLength:",
+       "setKey:andLength:withHint:",
+       "setKeyBindingManager:",
+       "setKeyCell:",
+       "setKeyEquivalent:",
+       "setKeyEquivalentFont:",
+       "setKeyEquivalentFont:size:",
+       "setKeyEquivalentModifierMask:",
+       "setKeyView:",
+       "setKnobThickness:",
+       "setLabel:",
+       "setLanguage:",
+       "setLanguageName:",
+       "setLast",
+       "setLastCharacterIndex:",
+       "setLastColumn:",
+       "setLastComponentOfFileName:",
+       "setLastName:",
+       "setLastOpenSavePanelDirectory:",
+       "setLastTextContainer:",
+       "setLaunchPath:",
+       "setLayoutManager:",
+       "setLeadingOffset:",
+       "setLeaf:",
+       "setLeftMargin:",
+       "setLength:",
+       "setLevel:",
+       "setLevelsOfUndo:",
+       "setLineBreakMode:",
+       "setLineCapStyle:",
+       "setLineColor:",
+       "setLineDash:count:phase:",
+       "setLineFragmentPadding:",
+       "setLineFragmentRect:forGlyphRange:usedRect:",
+       "setLineJoinStyle:",
+       "setLineScroll:",
+       "setLineSpacing:",
+       "setLineWidth:",
+       "setLinkColor:",
+       "setLinkState:",
+       "setListPopUp:",
+       "setLoaded:",
+       "setLocalLibraryDirectory:",
+       "setLocale:",
+       "setLocalizationFromDefaults",
+       "setLocalizesFormat:",
+       "setLocation:forStartOfGlyphRange:",
+       "setLocksObjects:",
+       "setLocksObjectsBeforeFirstModification:",
+       "setLoggingEnabled:forEventClass:",
+       "setLong:forKey:",
+       "setLoopMode:",
+       "setMailboxSelectionOwnerFrom:",
+       "setMailboxesController:",
+       "setMailerPath:",
+       "setMainBodyPart:",
+       "setMainMenu:",
+       "setMainNibFile:forOSType:",
+       "setMakeVariable:toValue:",
+       "setMarginColor:",
+       "setMarginFloat:",
+       "setMarginHeight:",
+       "setMarginWidth:",
+       "setMark:",
+       "setMarkedText:selectedRange:",
+       "setMarkedTextAttributes:",
+       "setMarker:",
+       "setMarkerLocation:",
+       "setMarkers:",
+       "setMasterClassDescription:",
+       "setMatchesOnMultipleResolution:",
+       "setMatrixClass:",
+       "setMax:",
+       "setMaxContentSize:",
+       "setMaxHeight:",
+       "setMaxLength:",
+       "setMaxSize:",
+       "setMaxValue:",
+       "setMaxVisibleColumns:",
+       "setMaxWidth:",
+       "setMaximum:",
+       "setMaximumLineHeight:",
+       "setMboxRange:",
+       "setMeasureRenderedText:",
+       "setMeasurementUnits:",
+       "setMenu:",
+       "setMenuChangedMessagesEnabled:",
+       "setMenuItem:",
+       "setMenuItemCell:forItemAtIndex:",
+       "setMenuRepresentation:",
+       "setMenuView:",
+       "setMenuZone:",
+       "setMessage:",
+       "setMessageBody:",
+       "setMessageContents:",
+       "setMessageFlags:",
+       "setMessageHandler:",
+       "setMessagePrinter:",
+       "setMessageScroll:",
+       "setMessageStore:",
+       "setMessageType:",
+       "setMethod:",
+       "setMilliseconds:",
+       "setMimeHeader:forKey:",
+       "setMimeParameter:forKey:",
+       "setMimeType:",
+       "setMimeType:mimeSubtype:",
+       "setMimeTypeFromFile:type:creator:",
+       "setMinColumnWidth:",
+       "setMinContentSize:",
+       "setMinSize:",
+       "setMinValue:",
+       "setMinWidth:",
+       "setMinimum:",
+       "setMinimumLineHeight:",
+       "setMiniwindowImage:",
+       "setMiniwindowTitle:",
+       "setMissingAttachmentString:",
+       "setMiterLimit:",
+       "setMixedStateImage:",
+       "setMnemonicLocation:",
+       "setMode:",
+       "setMode:uid:gid:mTime:inode:",
+       "setModes:",
+       "setMonitoredActivity:",
+       "setMonoCharacterSeparatorCharacters:usualPunctuation:",
+       "setMountPoint:",
+       "setMovable:",
+       "setMovie:",
+       "setMsgid:",
+       "setMultiple:",
+       "setMultipleCharacterSeparators:",
+       "setMutableAttributedString:",
+       "setMutableDictionary:",
+       "setMuted:",
+       "setName:",
+       "setNameField:",
+       "setNameForRow:",
+       "setNeedsDisplay",
+       "setNeedsDisplay:",
+       "setNeedsDisplayForItemAtIndex:",
+       "setNeedsDisplayInRect:",
+       "setNeedsDisplayInRect:avoidAdditionalLayout:",
+       "setNeedsSizing:",
+       "setNeedsToSynchronize",
+       "setNeedsToSynchronizeWithOtherClients:",
+       "setNegativeFormat:",
+       "setNewFolderButton:",
+       "setNext",
+       "setNextHandle",
+       "setNextKeyView:",
+       "setNextResponder:",
+       "setNextState",
+       "setNextText:",
+       "setNextTokenAttributeDictionaryForItem:",
+       "setNoHref:",
+       "setNoResize:",
+       "setNotShownAttribute:forGlyphAtIndex:",
+       "setNote:",
+       "setNotificationCenterSerializeRemoves:",
+       "setNumSlots:",
+       "setNumberOfColumns:",
+       "setNumberOfDaysToKeepTrash:",
+       "setNumberOfPages:",
+       "setNumberOfRows:",
+       "setNumberOfTickMarks:",
+       "setNumberOfVisibleItems:",
+       "setObject:",
+       "setObject:atIndex:",
+       "setObject:forIndex:dictionary:",
+       "setObject:forKey:",
+       "setObject:forKey:inDomain:",
+       "setObjectBeingTested:",
+       "setObjectValue:",
+       "setObjectZone:",
+       "setObscured:",
+       "setOffScreen:width:height:rowbytes:",
+       "setOffStateImage:",
+       "setOk:",
+       "setOkButton:",
+       "setOnMouseEntered:",
+       "setOnMouseExited:",
+       "setOnStateImage:",
+       "setOneShot:",
+       "setOpaque:",
+       "setOpenGLContext:",
+       "setOption:value:",
+       "setOptionsDictionary:",
+       "setOptionsPopUp:",
+       "setOrdered:",
+       "setOrderedIndex:",
+       "setOrderingType:",
+       "setOrientation:",
+       "setOriginOffset:",
+       "setOriginalMessage:",
+       "setOtherSourceDirectories:",
+       "setOutlineTableColumn:",
+       "setOutlinesWhenSelected:",
+       "setOutputTraced:",
+       "setPackage:",
+       "setPageOrder:",
+       "setPageScroll:",
+       "setPalettePopUp:",
+       "setPanelAttribsForList",
+       "setPanelFont:isMultiple:",
+       "setPaperFeedForPopUp:",
+       "setPaperName:",
+       "setPaperSize:",
+       "setParagraphSpacing:",
+       "setParagraphStyle:",
+       "setParagraphs:",
+       "setParamDescriptor:forKeyword:",
+       "setParent:",
+       "setParentDataSource:relationshipKey:",
+       "setParentEditor:",
+       "setParentWindow:",
+       "setPassword:",
+       "setPath:",
+       "setPath:forFramework:",
+       "setPath:overwriteExistingAddressBook:",
+       "setPathName:",
+       "setPathName:delegate:",
+       "setPathName:mode:uid:gid:mTime:inode:",
+       "setPathSeparator:",
+       "setPathViewClass:",
+       "setPenAttributeWithCode:",
+       "setPercentDone:",
+       "setPercentageHeight:",
+       "setPercentageWidth:",
+       "setPeriodicDelay:interval:",
+       "setPersistentDomain:forName:",
+       "setPersistentExpandedItemsFromArray:",
+       "setPersistentTableColumnsFromArray:",
+       "setPicker:",
+       "setPickerMask:",
+       "setPickerMode:",
+       "setPixelFormat:",
+       "setPixelsHigh:",
+       "setPixelsWide:",
+       "setPlainTextValue:",
+       "setPlaysEveryFrame:",
+       "setPlaysSelectionOnly:",
+       "setPoolCountHighWaterMark:",
+       "setPoolCountHighWaterResolution:",
+       "setPopPassword:",
+       "setPort:",
+       "setPortNumber:",
+       "setPosition:",
+       "setPositiveFormat:",
+       "setPostsBoundsChangedNotifications:",
+       "setPostsFrameChangedNotifications:",
+       "setPotentialSaveDirectory:",
+       "setPramValue:",
+       "setPreferredAlternative:",
+       "setPreferredDisciplineLevelsForDisplayOnly:",
+       "setPreferredEdge:",
+       "setPreferredFilename:",
+       "setPreferredFontNames:",
+       "setPrefersColorMatch:",
+       "setPrefetchingRelationshipKeyPaths:",
+       "setPreserveParents:",
+       "setPreview:",
+       "setPreviewBox:",
+       "setPrevious",
+       "setPreviousText:",
+       "setPrimaryEmailAddress:",
+       "setPrincipalClass:",
+       "setPrintInfo:",
+       "setPrintPanel:",
+       "setPrinter:",
+       "setPriority:forFlavor:",
+       "setProcessName:",
+       "setProject:",
+       "setProjectDir:",
+       "setProjectName:",
+       "setProjectType:",
+       "setProjectTypeVersion:",
+       "setProjectVersion:",
+       "setPrompt:",
+       "setPromptsAfterFetchLimit:",
+       "setPropagatesDeletesAtEndOfEvent:",
+       "setProperties:",
+       "setProperty:forKey:",
+       "setProperty:withValue:",
+       "setPropertyList:",
+       "setPropertyList:forType:",
+       "setProtocolForProxy:",
+       "setPrototype:",
+       "setPullsDown:",
+       "setQualifier:",
+       "setQuoteBinding:",
+       "setQuotingWithSingleQuote:double:",
+       "setRangeContainerObject:",
+       "setRank:",
+       "setRate:",
+       "setRawController:",
+       "setRawData:",
+       "setRawRowKeyPaths:",
+       "setRawTextControllerClass:",
+       "setRawTextView:",
+       "setRawTextViewClass:",
+       "setRead:forMessage:",
+       "setRead:forMessages:",
+       "setReceiversSpecifier:",
+       "setRecordsEvents:forClass:",
+       "setRefreshesRefetchedObjects:",
+       "setRefusesFirstResponder:",
+       "setRelativePosition:",
+       "setReleasedWhenClosed:",
+       "setRemovable:",
+       "setRemovableDeviceButton:",
+       "setRepeatCountForNextCommand:",
+       "setReplyTimeout:",
+       "setReporter:selector:",
+       "setRepresentedFilename:",
+       "setRepresentedFrame:",
+       "setRepresentedItem:",
+       "setRepresentedObject:",
+       "setRepresentedView:",
+       "setRequestTimeout:",
+       "setRequiredFileType:",
+       "setRequiresAllQualifierBindingVariables:",
+       "setReservedThicknessForAccessoryView:",
+       "setReservedThicknessForMarkers:",
+       "setResizable:",
+       "setResizeIncrements:",
+       "setResizeable:",
+       "setResourceData:",
+       "setResourceForkData:",
+       "setResourceLocator:",
+       "setResult:item:isHeader:",
+       "setResultsLimit:",
+       "setReturnCompletes:",
+       "setReturnValue:",
+       "setReusesColumns:",
+       "setRichText:",
+       "setRichTextValue:",
+       "setRightMargin:",
+       "setRootObject:",
+       "setRoundingBehavior:",
+       "setRouterClass:",
+       "setRowHeight:",
+       "setRowSpan:",
+       "setRows:",
+       "setRowsString:",
+       "setRuleThickness:",
+       "setRulerViewClass:",
+       "setRulerVisible:",
+       "setRulersVisible:",
+       "setRunLoop:",
+       "setRunLoopModes:",
+       "setRuntimeAdaptorNames:",
+       "setSaveWeighting:",
+       "setScaleFactor:",
+       "setScalesWhenResized:",
+       "setScanLocation:",
+       "setScope:",
+       "setScript:",
+       "setScriptErrorNumber:",
+       "setScriptErrorString:",
+       "setScriptString:",
+       "setScrollView:",
+       "setScrollable:",
+       "setScrollers:",
+       "setScrolling:",
+       "setScrollsDynamically:",
+       "setSearchList:",
+       "setSearchRanks:",
+       "setSelectable:",
+       "setSelected:",
+       "setSelectedAddressBooks:",
+       "setSelectedAddressBooksByType:",
+       "setSelectedFont:isMultiple:",
+       "setSelectedRange:",
+       "setSelectedRange:affinity:stillSelecting:",
+       "setSelectedTargetCommandLineArgumentsArrayIndex:",
+       "setSelectedTextAttributes:",
+       "setSelection:",
+       "setSelection:inspecting:promulgateImmediately:",
+       "setSelectionAlignment:",
+       "setSelectionByRect:",
+       "setSelectionFrom:",
+       "setSelectionFrom:to:anchor:highlight:",
+       "setSelectionGranularity:",
+       "setSelectionNeedsPromulgation:",
+       "setSelectionRootItem:",
+       "setSelectionString:",
+       "setSelectionString:andFormat:",
+       "setSelectionStringAndSelect:",
+       "setSelector:",
+       "setSemanticDisciplineLevel:",
+       "setSendDoubleAction:",
+       "setSendFormat:",
+       "setSendSingleAction:",
+       "setSendSizeLimit:",
+       "setSender:",
+       "setSendmailMailer:",
+       "setSendsActionOnArrowKeys:",
+       "setSendsActionOnEndEditing:",
+       "setSeparatesColumns:",
+       "setSeparator:",
+       "setServerSideImageMap:",
+       "setServicesMenu:",
+       "setServicesMenuItemEnabled:forUser:enabled:",
+       "setServicesProvider:",
+       "setSet:",
+       "setSetButton:",
+       "setShadowState:",
+       "setShape:",
+       "setSharedEditingContext:",
+       "setSharedPrintInfo:",
+       "setSharedScriptSuiteRegistry:",
+       "setShellCommand:",
+       "setShouldAutoFetch:",
+       "setShouldBeViewedInline:",
+       "setShouldCascadeWindows:",
+       "setShouldCloseDocument:",
+       "setShouldCreateUI:",
+       "setShouldGenerateMain:",
+       "setShouldValidateInspectedSelection:",
+       "setShowAllHeaders:",
+       "setShowPanels:",
+       "setShowsAlpha:",
+       "setShowsBorderOnlyWhileMouseInside:",
+       "setShowsComposeAccessoryView:",
+       "setShowsControlCharacters:",
+       "setShowsFirstResponder:",
+       "setShowsInvisibleCharacters:",
+       "setShowsLabel:",
+       "setShowsShade:",
+       "setShowsStateBy:",
+       "setShowsToolTip:",
+       "setSibling1:",
+       "setSibling2:",
+       "setSignatureSelectionMethod:",
+       "setSignatures:",
+       "setSize1:",
+       "setSize2:",
+       "setSize3:",
+       "setSize4:",
+       "setSize5:",
+       "setSize6:",
+       "setSize7:",
+       "setSize:",
+       "setSize:relative:",
+       "setSizeLimit:",
+       "setSizeString:",
+       "setSizeTitle:",
+       "setSizes:",
+       "setSkipWhitespace:",
+       "setSmartInsertDeleteEnabled:",
+       "setSnapToButtons:",
+       "setSocketFromHandle:",
+       "setSoftLeftEdge:",
+       "setSoftRightEdge:",
+       "setSortOrder:",
+       "setSortOrderings:",
+       "setSortRules:",
+       "setSound:",
+       "setSource:",
+       "setSourceUrl:",
+       "setSourceUrlString:",
+       "setSpanning:",
+       "setSpoolDirectory:",
+       "setStandardError:",
+       "setStandardInput:",
+       "setStandardOutput:",
+       "setStandardUserDefaults:",
+       "setStartSpecifier:",
+       "setStartSubelementIdentifier:",
+       "setStartSubelementIndex:",
+       "setStartingIndex:",
+       "setStartingValue:",
+       "setStartsNewProcessGroup:",
+       "setStartupPath:",
+       "setState:",
+       "setState:atRow:column:",
+       "setStateFromSelectionOwner",
+       "setStaticCounterpart:",
+       "setStatus:",
+       "setStatusBar:",
+       "setStatusMenu:",
+       "setStatusMessage:",
+       "setStatusMessage:percentDone:",
+       "setStatusText:",
+       "setStopsValidationAfterFirstError:",
+       "setStrikethrough",
+       "setString:",
+       "setString:forType:",
+       "setStringValue:",
+       "setStringValue:forAttribute:",
+       "setStyleMask:",
+       "setSubject:",
+       "setSubmenu:",
+       "setSubmenu:forItem:",
+       "setSubmenuRepresentedObjectsAreStale",
+       "setSubscript",
+       "setSubscript:",
+       "setSubstitutionEditingContext:",
+       "setSum:",
+       "setSupermenu:",
+       "setSuperscript",
+       "setSuperscript:",
+       "setSupressesDuplicates:",
+       "setSuspended:",
+       "setSynchronized:",
+       "setSyntacticDiscipline:semanticDiscipline:displayOnly:",
+       "setSyntacticDisciplineLevel:",
+       "setSystemCharacterProperties:",
+       "setSystemLanguage:",
+       "setSystemLanguageContext:",
+       "setSystemLanguages:",
+       "setTabKeyTraversesCells:",
+       "setTabStops:",
+       "setTabViewType:",
+       "setTable:",
+       "setTableColumn:toVisible:atPosition:",
+       "setTableView:",
+       "setTag:",
+       "setTag:atRow:column:",
+       "setTag:target:action:atRow:column:",
+       "setTailIndent:",
+       "setTakesTitleFromPreviousColumn:",
+       "setTarCommand:",
+       "setTarget:",
+       "setTarget:atRow:column:",
+       "setTargetAbstractName:",
+       "setTargetAdditionalSourceDirectories:",
+       "setTargetClass:extraData:",
+       "setTargetCommandLineArgumentsArray:",
+       "setTargetDLLPaths:",
+       "setTargetDisplayName:",
+       "setTargetEnvironment:",
+       "setTargetPath:",
+       "setTargetPersistentStateObject:forKey:",
+       "setTargetUrl:",
+       "setTargetUses:debuggerNamed:",
+       "setTaskDictionary:",
+       "setTaskName:",
+       "setTearOffMenuRepresentation:",
+       "setTemplate:",
+       "setTemporaryAttributes:forCharacterRange:",
+       "setTest:",
+       "setText:",
+       "setTextAlignment:",
+       "setTextAlignment:overChildRange:",
+       "setTextAttributeWithCode:",
+       "setTextAttributesForNegativeValues:",
+       "setTextAttributesForPositiveValues:",
+       "setTextBody:",
+       "setTextColor:",
+       "setTextColor:range:",
+       "setTextContainer:",
+       "setTextContainer:forGlyphRange:",
+       "setTextContainerInset:",
+       "setTextController:",
+       "setTextFont:",
+       "setTextProc:",
+       "setTextStorage:",
+       "setTextView:",
+       "setTextViewClass:",
+       "setTextureWithPath:",
+       "setTextureWithUrl:",
+       "setThemeFrameWidgetState:",
+       "setThickness:",
+       "setThousandSeparator:",
+       "setTickMarkPosition:",
+       "setTimeStamp:",
+       "setTimeThreshold:",
+       "setTimeZone:",
+       "setTimeout:",
+       "setTitle:",
+       "setTitle:andDefeatWrap:",
+       "setTitle:andMessage:",
+       "setTitle:forView:",
+       "setTitle:ofColumn:",
+       "setTitleAlignment:",
+       "setTitleCell:",
+       "setTitleColor:",
+       "setTitleFont:",
+       "setTitleNoCopy:",
+       "setTitlePosition:",
+       "setTitleString:",
+       "setTitleWidth:",
+       "setTitleWithMnemonic:",
+       "setTitleWithRepresentedFilename:",
+       "setTitled:",
+       "setTo:",
+       "setTokenRange:",
+       "setToolTip:",
+       "setToolTip:forCell:",
+       "setToolTip:forView:cell:",
+       "setToolTipForView:rect:owner:userData:",
+       "setToolTips",
+       "setToolbarClass:",
+       "setToolbarController:",
+       "setTopLevelObject:",
+       "setTopMargin:",
+       "setTouched:",
+       "setTraceEventQueue:",
+       "setTrackingConstraint:",
+       "setTrackingConstraintKeyMask:",
+       "setTrailingOffset:",
+       "setTransformStruct:",
+       "setTransparent:",
+       "setTrashMailboxName:",
+       "setTreatsFilePackagesAsDirectories:",
+       "setTree:",
+       "setTrimAppExtension:",
+       "setType:",
+       "setTypesetter:",
+       "setTypingAttributes:",
+       "setURL:",
+       "setUid:",
+       "setUnderline",
+       "setUndoActionName:",
+       "setUndoManager:",
+       "setUndoNotificationEnabled:",
+       "setUndoable:",
+       "setUnquotedStringCharacters:lowerCaseLetters:upperCaseLetters:digits:",
+       "setUnquotedStringStartCharacters:lowerCaseLetters:upperCaseLetters:digits:",
+       "setUnreadCount:forMailboxAtPath:",
+       "setUpAttachment:forTextView:",
+       "setUpContextMenuItem:",
+       "setUpFieldEditorAttributes:",
+       "setUpGState",
+       "setUpPrintOperationDefaultValues",
+       "setUrl:",
+       "setUserAgent:",
+       "setUserDefinedFaces:",
+       "setUserDefinedFaces:selectingCanonicalFaceString:",
+       "setUserDefinedFaces:selectingIndex:",
+       "setUserFilteredHeaders:",
+       "setUserFixedPitchFont:",
+       "setUserFont:",
+       "setUserInfo:",
+       "setUserIsTyping:",
+       "setUsername:",
+       "setUsesAddressLineBreaks:",
+       "setUsesContextRelativeEncoding:",
+       "setUsesDataSource:",
+       "setUsesDistinct:",
+       "setUsesEPSOnResolutionMismatch:",
+       "setUsesFontPanel:",
+       "setUsesItemFromMenu:",
+       "setUsesRuler:",
+       "setUsesScreenFonts:",
+       "setUsesThreadedAnimation:",
+       "setUsesUserKeyEquivalents:",
+       "setUsesVectorMovement:",
+       "setValid:",
+       "setValidForStartup:",
+       "setValidateSize:",
+       "setValue:",
+       "setValue:forAttribute:",
+       "setValue:inObject:",
+       "setValues:forParameter:",
+       "setVersion:",
+       "setVersionNb:",
+       "setVertical:",
+       "setVerticalAlignment:",
+       "setVerticalLineScroll:",
+       "setVerticalPageScroll:",
+       "setVerticalPagination:",
+       "setVerticalRulerView:",
+       "setVerticalScroller:",
+       "setVerticalSpace:",
+       "setVerticallyCentered:",
+       "setVerticallyResizable:",
+       "setView:",
+       "setViewSize:",
+       "setViewsNeedDisplay:",
+       "setVisited",
+       "setVisitedLinkColor:",
+       "setVolatileDomain:forName:",
+       "setVolume:",
+       "setWaitCursorEnabled:",
+       "setWantsToBeColor:",
+       "setWasInterpolated:",
+       "setWidth:",
+       "setWidth:percentage:",
+       "setWidthAbsolute:",
+       "setWidthPercentage:",
+       "setWidthProportional:",
+       "setWidthString:",
+       "setWidthTracksTextView:",
+       "setWillDebugWhenLaunched:",
+       "setWindingRule:",
+       "setWindow:",
+       "setWindowController:",
+       "setWindowFrameAutosaveName:",
+       "setWindowFrameForAttachingToRect:onScreen:preferredEdge:popUpSelectedItem:",
+       "setWindowsMenu:",
+       "setWindowsNeedUpdate:",
+       "setWithArray:",
+       "setWithCapacity:",
+       "setWithObject:",
+       "setWithObjects:",
+       "setWithObjects:count:",
+       "setWithSet:",
+       "setWordFieldStringValue:",
+       "setWords:",
+       "setWorksWhenModal:",
+       "setWraps:",
+       "setWriteRtfEnriched:",
+       "set_box:",
+       "set_delegate:",
+       "set_docView:",
+       "set_mailboxesDrawerBox:",
+       "set_messageViewerBox:",
+       "set_outlineView:",
+       "set_paletteMatrix:",
+       "set_progressBar:",
+       "set_progressIndicator:",
+       "set_scrollView:",
+       "set_searchField:",
+       "set_splitView:",
+       "set_statusField:",
+       "set_stopButton:",
+       "set_tableManager:",
+       "set_tableView:",
+       "set_taskNameField:",
+       "set_textViewer:",
+       "set_toolbar:",
+       "set_transferMenuItem:",
+       "set_window:",
+       "settingFrameDuringCellAdjustment:",
+       "setup:inRoot:oneShot:",
+       "setupAccountFromValuesInUI:",
+       "setupAccounts",
+       "setupAppNIBsforProject:inFolder:projectName:",
+       "setupCarbonMenuBar",
+       "setupConnectionForServerName:",
+       "setupFileWrapper:",
+       "setupFontAndTabsForTextView:withRawFont:",
+       "setupForNoMenuBar",
+       "setupGuessesBrowser",
+       "setupInitialTextViewSharedState",
+       "setupMainThreadObject",
+       "setupOutlineView:",
+       "setupUIForMessage:",
+       "setupUIFromValuesInAccount:",
+       "shadeColorWithDistance:towardsColor:",
+       "shadow",
+       "shadowColor",
+       "shadowState",
+       "shadowWithLevel:",
+       "shallowCopy",
+       "shallowMutableCopy",
+       "shape",
+       "shapeWindow",
+       "sharedAEDescriptorTranslator",
+       "sharedAppleEventManager",
+       "sharedApplication",
+       "sharedCoercionHandler",
+       "sharedColorPanel",
+       "sharedColorPanelExists",
+       "sharedContextMenu",
+       "sharedDocumentController",
+       "sharedDragManager",
+       "sharedEditingContext",
+       "sharedFocusState",
+       "sharedFontController",
+       "sharedFontManager",
+       "sharedFontPanel",
+       "sharedFontPanelExists",
+       "sharedFrameworksPath",
+       "sharedGlyphGenerator",
+       "sharedHeartBeat",
+       "sharedHelpManager",
+       "sharedInfoPanel",
+       "sharedInspector",
+       "sharedInspectorManager",
+       "sharedInspectorManagerWithoutCreating",
+       "sharedInstance",
+       "sharedKeyBindingManager",
+       "sharedMagnifier",
+       "sharedManager",
+       "sharedPanel",
+       "sharedPopupMenuOfMailboxes",
+       "sharedPreferences",
+       "sharedPrintInfo",
+       "sharedScriptExecutionContext",
+       "sharedScriptSuiteRegistry",
+       "sharedScriptingAppleEventHandler",
+       "sharedServiceMaster",
+       "sharedSpellChecker",
+       "sharedSpellCheckerExists",
+       "sharedSupportPath",
+       "sharedSystemTypesetter",
+       "sharedTableWizard",
+       "sharedToolTipManager",
+       "sharedTracer",
+       "sharedWorkspace",
+       "shellCommand",
+       "shiftModifySelection:",
+       "shortMonthNames",
+       "shortName",
+       "shortValue",
+       "shortWeekdayNames",
+       "shouldAbsorbEdgeWhiteSpace",
+       "shouldAddEmailerMailbox:",
+       "shouldAddEudoraMailbox:",
+       "shouldAddNetscapeMailbox:",
+       "shouldAddOEMailbox:",
+       "shouldAutoFetch",
+       "shouldBeViewedInline",
+       "shouldCancel",
+       "shouldCascadeWindows",
+       "shouldChangePrintInfo:",
+       "shouldChangeTextInRange:replacementString:",
+       "shouldCloseDocument",
+       "shouldCloseWindowController:",
+       "shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:",
+       "shouldCollapseAutoExpandedItemsForDeposited:",
+       "shouldCreateUI",
+       "shouldDecodeAsAttachment",
+       "shouldDecodeSoftLinebreaks",
+       "shouldDelayWindowOrderingForEvent:",
+       "shouldDeliverMessage:delivery:",
+       "shouldDrawColor",
+       "shouldDrawInsertionPoint",
+       "shouldDrawUsingImageCacheForCellFrame:controlView:",
+       "shouldEdit:inRect:ofView:",
+       "shouldGenerateMain",
+       "shouldMoveDeletedMessagesToTrash",
+       "shouldNotImplement:",
+       "shouldPerformInvocation:",
+       "shouldPropagateDeleteForObject:inEditingContext:forRelationshipKey:",
+       "shouldRemoveWhenEmpty",
+       "shouldRunSavePanelWithAccessoryView",
+       "shouldSubstituteCustomClass",
+       "shouldUnmount:",
+       "shouldWriteIconHeader",
+       "shouldWriteMakeFile",
+       "show",
+       "showActivityViewer:",
+       "showActivityViewerWindow",
+       "showAddressManagerPanel",
+       "showAddressPanel:",
+       "showAllHeaders:",
+       "showAllViewers",
+       "showAndMakeKey:",
+       "showAppletTags",
+       "showAttachmentCell:atPoint:",
+       "showAttachmentCell:inRect:characterIndex:",
+       "showBestAlternative:",
+       "showBreakTags",
+       "showCMYKView:",
+       "showColorPanel:",
+       "showComments",
+       "showComposeAccessoryView",
+       "showComposeWindow:",
+       "showContextHelp:",
+       "showContextHelpForObject:locationHint:",
+       "showController:adjustingSize:",
+       "showDeletions:",
+       "showDeminiaturizedWindow",
+       "showEditingCharacters",
+       "showError:",
+       "showFavorites",
+       "showFavorites:",
+       "showFeedbackAtPoint:",
+       "showFilteredHeaders:",
+       "showFirstAlternative:",
+       "showFontPanel:",
+       "showGUIOrPreview:",
+       "showGUIView:",
+       "showGenericBackgroundAndText",
+       "showGreyScaleView:",
+       "showGuessPanel:",
+       "showHSBView:",
+       "showHelp:",
+       "showHelpFile:context:",
+       "showIllegalFragments",
+       "showImageTags",
+       "showInfoPanel:",
+       "showInlineFrameTags",
+       "showInspector:",
+       "showKnownTags",
+       "showMailboxesPanel:",
+       "showMainThreadIsBusy:",
+       "showMainThreadIsNotBusy:",
+       "showMessage:",
+       "showMessage:arguments:",
+       "showModalPreferencesPanel",
+       "showModalPreferencesPanelForOwner:",
+       "showNextAlternative:",
+       "showNoView",
+       "showNonbreakingSpaces",
+       "showNumbers:",
+       "showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:",
+       "showPanel:",
+       "showPanel:andNotify:with:",
+       "showPanels",
+       "showParagraphTags",
+       "showPeople:",
+       "showPools",
+       "showPreferences:",
+       "showPreferencesPanel",
+       "showPreferencesPanel:",
+       "showPreferencesPanelForOwner:",
+       "showPreviewView:",
+       "showPreviousAlternative:",
+       "showPrintPanel:",
+       "showRGBView:",
+       "showRawView:",
+       "showScript",
+       "showSearchPanel:",
+       "showSelectionAndCenter:",
+       "showSizes:",
+       "showSpacesVisibly",
+       "showStatusLine:",
+       "showStatusMessage:",
+       "showTableTags",
+       "showThreadIsBusy",
+       "showTip:",
+       "showTopLevelTags",
+       "showUI",
+       "showUnknownTags",
+       "showValidation:",
+       "showViewerWindow:",
+       "showWindow:",
+       "showWindows",
+       "showsAlpha",
+       "showsBorderOnlyWhileMouseInside",
+       "showsControlCharacters",
+       "showsFirstResponder",
+       "showsInvisibleCharacters",
+       "showsLabel",
+       "showsShade",
+       "showsStateBy",
+       "showsToolTip",
+       "shutAllDrawers:",
+       "sideBorderCell",
+       "sideSpacer",
+       "signal",
+       "signature",
+       "signatureOfType:",
+       "signatureSelectionMethod",
+       "signatureWithObjCTypes:",
+       "signatures",
+       "signaturesPath",
+       "significantText",
+       "simpleChild",
+       "singlestep:",
+       "size",
+       "sizeAndInstallSubviews",
+       "sizeCreditsView",
+       "sizeDecrease1:",
+       "sizeDecrease2:",
+       "sizeDecrease3:",
+       "sizeDecrease4:",
+       "sizeDecrease5:",
+       "sizeDecrease6:",
+       "sizeForKey:inTable:",
+       "sizeForMagnification:",
+       "sizeForPaperName:",
+       "sizeIncrease1:",
+       "sizeIncrease2:",
+       "sizeIncrease3:",
+       "sizeIncrease4:",
+       "sizeIncrease5:",
+       "sizeIncrease6:",
+       "sizeLastColumnToFit",
+       "sizeLimit",
+       "sizeOfBlock:",
+       "sizeOfDictionary:",
+       "sizeOfLabel:",
+       "sizeOfMessageNumber:",
+       "sizeOfMessagesAvailable",
+       "sizeOfTitlebarButtons",
+       "sizeOfTitlebarButtons:",
+       "sizeOfTypesetterGlyphInfo",
+       "sizeSimpleCellsEnMasse",
+       "sizeString",
+       "sizeToCells",
+       "sizeToFit",
+       "sizeValue",
+       "sizeWithAttributes:",
+       "skipDescendents",
+       "skipDirectory",
+       "skipDirectory:",
+       "skipUnimplementedOpcode:",
+       "skipWhitespace",
+       "skippingWhitespace",
+       "sleepForTimeInterval:",
+       "sleepUntilDate:",
+       "slideDraggedImageTo:",
+       "slideImage:from:to:",
+       "slotForKey:",
+       "smallSystemFontSize",
+       "smaller:",
+       "smallestEncoding",
+       "smartCapitalizedString",
+       "smartDeleteRangeForProposedRange:",
+       "smartInsertAfterStringForString:replacingRange:",
+       "smartInsertBeforeStringForString:replacingRange:",
+       "smartInsertDeleteEnabled",
+       "smartInsertForString:replacingRange:beforeString:afterString:",
+       "snapshot",
+       "socket",
+       "socketType",
+       "softLeftEdge",
+       "softRightEdge",
+       "sortAscending:",
+       "sortByAuthor:",
+       "sortByDate:",
+       "sortByNumber:",
+       "sortByReadStatus:",
+       "sortBySize:",
+       "sortByTitle:",
+       "sortDescending:",
+       "sortKeyForString:range:flags:",
+       "sortOrder",
+       "sortOrderToColumnKey:",
+       "sortOrderingWithKey:selector:",
+       "sortOrderings",
+       "sortRules",
+       "sortRulesPath",
+       "sortSubviewsUsingFunction:context:",
+       "sortUsingFunction:context:",
+       "sortUsingFunction:context:range:",
+       "sortUsingKeyOrderArray:",
+       "sortUsingSelector:",
+       "sortedArrayHint",
+       "sortedArrayUsingFunction:context:",
+       "sortedArrayUsingFunction:context:hint:",
+       "sortedArrayUsingKeyOrderArray:",
+       "sortedArrayUsingSelector:",
+       "sortedArrayUsingSelector:hint:",
+       "sound",
+       "sound:didFinishPlaying:",
+       "soundNamed:",
+       "soundUnfilteredFileTypes",
+       "soundUnfilteredPasteboardTypes",
+       "source",
+       "sourceDirectories",
+       "sourceDirectoryPaths",
+       "sourceKeys",
+       "sourceTree",
+       "sourceUrl",
+       "sourceUrlString",
+       "spaceToOpen:",
+       "spacerRowWithHeight:columnSpan:backgroundColor:",
+       "spacesPerTab",
+       "spacingAction:",
+       "spacingTextfieldAction:",
+       "specialImageWithType:",
+       "specifiedPathForFrameworkNamed:",
+       "spellCheckerDocumentTag",
+       "spellServer:didForgetWord:inLanguage:",
+       "spellServer:didLearnWord:inLanguage:",
+       "spellServer:findMisspelledWordInString:language:wordCount:countOnly:",
+       "spellServer:suggestGuessesForWord:inLanguage:",
+       "spellingPanel",
+       "splitCellHorizontally:",
+       "splitCellVertically:",
+       "splitFrameHorizontally:",
+       "splitFrameVertically:",
+       "splitKeysIntoSubkeys",
+       "splitOverRange:",
+       "splitVertically:",
+       "splitView:canCollapseSubview:",
+       "splitView:constrainMaxCoordinate:ofSubviewAt:",
+       "splitView:constrainMinCoordinate:maxCoordinate:ofSubviewAt:",
+       "splitView:constrainMinCoordinate:ofSubviewAt:",
+       "splitView:constrainSplitPosition:ofSubviewAt:",
+       "splitView:resizeSubviewsWithOldSize:",
+       "splitViewDidResizeSubviews:",
+       "splitViewWillResizeSubviews:",
+       "spoolDirectory",
+       "spoolToTableData:",
+       "standardDoubleActionForEvent:inTextView:withFrame:",
+       "standardError",
+       "standardInput",
+       "standardOutput",
+       "standardRunLoopModes",
+       "standardUserDefaults",
+       "standardizedNativePath",
+       "standardizedURL",
+       "standardizedURLPath",
+       "start:",
+       "startAnimation:",
+       "startArchiving:",
+       "startDate",
+       "startEditingKey:",
+       "startEditingOption:",
+       "startIndex",
+       "startInputStream:closeOnEnd:",
+       "startLogging",
+       "startMessageClearCheck:",
+       "startObservingViewBoundsChange:",
+       "startPeriodicEventsAfterDelay:withPeriod:",
+       "startProfiling",
+       "startRegion:atAddress:",
+       "startRegion:ofLength:atAddress:",
+       "startRoot",
+       "startSelectionObservation",
+       "startSpecifier",
+       "startSubelementIdentifier",
+       "startSubelementIndex",
+       "startSynchronization",
+       "startTimer:userInfo:",
+       "startTrackingAt:inView:",
+       "startTrackingWithEvent:inView:withDelegate:",
+       "startTransaction",
+       "startWaitCursorTimer",
+       "starters",
+       "startingIndex",
+       "startupPath",
+       "stashSize",
+       "state",
+       "stateForChild:ofItem:",
+       "stateImageOffset",
+       "stateImageRectForBounds:",
+       "stateImageWidth",
+       "staticValidationDescription",
+       "statistics",
+       "status",
+       "statusBar",
+       "statusForMailbox:args:errorMessage:",
+       "statusForTable:",
+       "statusItemWithLength:",
+       "statusMenu",
+       "statusMessage",
+       "statusOf:",
+       "stepBack:",
+       "stepForward:",
+       "stepKey:elements:number:state:",
+       "stepsCountForOperation:",
+       "stop",
+       "stop:",
+       "stopAllActivity",
+       "stopAnimation:",
+       "stopCoalescing",
+       "stopEditingSession",
+       "stopLogging",
+       "stopModal",
+       "stopModalWithCode:",
+       "stopObservingViewBoundsChange:",
+       "stopPeriodicEvents",
+       "stopProfiling",
+       "stopSelectionObservation",
+       "stopTimer",
+       "stopTracking:at:inView:mouseIsUp:",
+       "stopTrackingWithEvent:",
+       "stopUpdatingIndex",
+       "stopsValidationAfterFirstError",
+       "store",
+       "storeAtPathIsWritable:",
+       "storeBeingDeleted:",
+       "storeClass",
+       "storeColorPanel:",
+       "storeDidOpen:",
+       "storeExistsForPath:",
+       "storeFlags:state:forUids:",
+       "storeForMailboxAtPath:",
+       "storeForMailboxAtPath:create:",
+       "storePath",
+       "storePathRelativeToAccount",
+       "storePathRelativeToMailboxDirectory",
+       "storeStructureChanged:",
+       "storedValueForKey:",
+       "stream",
+       "string",
+       "string:",
+       "stringArrayForKey:",
+       "stringByAbbreviatingWithTildeInPath",
+       "stringByAddingPercentEscapes",
+       "stringByAppendingFormat:",
+       "stringByAppendingPathComponent:",
+       "stringByAppendingPathExtension:",
+       "stringByAppendingString:",
+       "stringByConvertingPathToURL",
+       "stringByConvertingURLToPath",
+       "stringByDeletingLastPathComponent",
+       "stringByDeletingPathExtension",
+       "stringByDeletingSuffixWithDelimiter:",
+       "stringByExpandingEnvironmentVariablesInString:",
+       "stringByExpandingTildeInPath",
+       "stringByExpandingVariablesInString:withDictionary:objectList:",
+       "stringByInsertingText:",
+       "stringByLocalizingReOrFwdPrefix",
+       "stringByRemovingPercentEscapes",
+       "stringByRemovingPrefix:ignoreCase:",
+       "stringByRemovingReAndFwd",
+       "stringByReplacingString:withString:",
+       "stringByResolvingSymlinksInPath",
+       "stringByStandardizingPath",
+       "stringByStrippingEnclosingNewlines",
+       "stringBySummingWithStringAsIntegers:",
+       "stringDrawingTextStorage",
+       "stringEncodingFromMimeCharsetTag:",
+       "stringForDPSError:",
+       "stringForIndexing",
+       "stringForKey:",
+       "stringForKey:inTable:",
+       "stringForObjectValue:",
+       "stringForOperatorSelector:",
+       "stringForType:",
+       "stringFromGrammarKey:isPlural:",
+       "stringListForKey:inTable:",
+       "stringMarkingUpcaseTransitionsWithDelimiter2:",
+       "stringMarkingUpcaseTransitionsWithDelimiter:",
+       "stringRepeatedTimes:",
+       "stringRepresentation",
+       "stringToColor",
+       "stringToComplete:",
+       "stringToPrintWithHTMLString:",
+       "stringValue",
+       "stringValueForAttribute:",
+       "stringWithCString:",
+       "stringWithCString:length:",
+       "stringWithCapacity:",
+       "stringWithCharacters:length:",
+       "stringWithContentsOfFile:",
+       "stringWithContentsOfURL:",
+       "stringWithData:encoding:",
+       "stringWithFileSystemRepresentation:length:",
+       "stringWithFormat:",
+       "stringWithFormat:locale:",
+       "stringWithRepeatedCharacter:count:",
+       "stringWithSavedFrame",
+       "stringWithString:",
+       "stringWithString:language:",
+       "stringWithUTF8String:",
+       "stringWithoutAmpersand",
+       "stringWithoutLeadingSpace",
+       "stringWithoutNewlinesOnEnds",
+       "stringWithoutSpaceOnEnds",
+       "stringWithoutTrailingSpace",
+       "stringsByAppendingPathComponent:",
+       "stringsByAppendingPaths:",
+       "strippedHTMLStringWithData:",
+       "stroke",
+       "strokeLineFromPoint:toPoint:",
+       "strokeRect:",
+       "structuralElementsInItem:",
+       "structureDidChange",
+       "styleInfo",
+       "styleInfoForSelection:ofAttributedString:",
+       "styleMask",
+       "subProjectTypeList",
+       "subProjectTypesForProjectType:",
+       "subarrayWithRange:",
+       "subclassFrameForSuperclassFrame:selected:",
+       "subclassResponsibility:",
+       "subdataFromIndex:",
+       "subdataToIndex:",
+       "subdataWithRange:",
+       "subdivideBezierWithFlatness:startPoint:controlPoint1:controlPoint2:endPoint:",
+       "subelements",
+       "subevents",
+       "subject",
+       "subjectChanged",
+       "subkeyListForKey:",
+       "submenu",
+       "submenuAction:",
+       "submenuRepresentedObjects",
+       "submenuRepresentedObjectsAreStale",
+       "submitButton",
+       "submitValue",
+       "submitWithButton:inHTMLView:",
+       "subnodeAtIndex:",
+       "subnodes",
+       "subnodesCount",
+       "subpathsAtPath:",
+       "subprojKeys",
+       "subprojectKeyList",
+       "subprojects",
+       "subscript:",
+       "subscriptRange:",
+       "subsetMappingForSourceDictionaryInitializer:",
+       "subsetMappingForSourceDictionaryInitializer:sourceKeys:destinationKeys:",
+       "substituteFontForFont:",
+       "substitutionEditingContext",
+       "substringFromIndex:",
+       "substringToIndex:",
+       "substringWithRange:",
+       "subtractPostingsIn:",
+       "subtractTextStyle:subtractingDirectConflicts:",
+       "subtreeWidthsInvalid",
+       "subtype",
+       "subview:didDrawRect:",
+       "subviews",
+       "suffixForOSType:",
+       "suffixWithDelimiter:",
+       "suiteDescription",
+       "suiteForAppleEventCode:",
+       "suiteName",
+       "suiteNameArray",
+       "suiteNames",
+       "sum",
+       "superClass",
+       "superClassDescription",
+       "superProject",
+       "superclass",
+       "superclassDescription",
+       "superclassFrameForSubclassFrame:",
+       "supermenu",
+       "superscript:",
+       "superscriptRange:",
+       "superview",
+       "superviewChanged:",
+       "superviewFrameChanged:",
+       "supportedEncodings",
+       "supportedWindowDepths",
+       "supportsAuthentication",
+       "supportsCommand:",
+       "supportsMode:",
+       "supportsMultipleSelection",
+       "supportsReadingData",
+       "supportsWritingData",
+       "suppressCapitalizedKeyWarning",
+       "suppressFinalBlockCharacters",
+       "suppressObserverNotification",
+       "surfaceID",
+       "suspendLogging",
+       "suspendReaderLocks",
+       "suspended",
+       "suspiciousCodepage1252ByteSet",
+       "swapElement:withElement:",
+       "swapWithMark:",
+       "swatchWidth",
+       "switchEditFocusToCell:",
+       "switchImage:",
+       "switchList:",
+       "symbolicLinkDestination",
+       "syncItemsWithPopup",
+       "syncToView",
+       "syncToView:",
+       "syncToViewUnconditionally",
+       "synchronize",
+       "synchronizeFile",
+       "synchronizeMailboxesMenusIfNeeded",
+       "synchronizeTitleAndSelectedItem",
+       "synchronizeWindowTitleWithDocumentName",
+       "synchronizeWithOtherClients",
+       "synchronizeWithServer",
+       "synonymTerminologyDictionary:",
+       "syntacticDiscipline",
+       "syntacticDisciplineLevel",
+       "syntacticPolicyChanged:",
+       "systemCharacterProperties",
+       "systemColorsDidChange:",
+       "systemDefaultPortNameServer",
+       "systemDeveloperDirectory",
+       "systemExtensions",
+       "systemExtensionsList",
+       "systemFontOfSize:",
+       "systemFontSize",
+       "systemLanguage",
+       "systemLanguageContext",
+       "systemLanguages",
+       "systemLibraryDirectory",
+       "systemStatusBar",
+       "systemTimeZone",
+       "systemVersion",
+       "tabKeyTraversesCells",
+       "tabState",
+       "tabStopType",
+       "tabStops",
+       "tabView",
+       "tabView:didSelectTabViewItem:",
+       "tabView:shouldSelectTabViewItem:",
+       "tabView:willSelectTabViewItem:",
+       "tabViewAdded",
+       "tabViewDidChangeNumberOfTabViewItems:",
+       "tabViewItemAtIndex:",
+       "tabViewItemAtPoint:",
+       "tabViewItems",
+       "tabViewRemoved",
+       "tabViewType",
+       "table",
+       "tableColor",
+       "tableColumnWithIdentifier:",
+       "tableColumns",
+       "tableDatas",
+       "tableDecorationSize",
+       "tableEnumerator",
+       "tableFor:",
+       "tableMatrixBox",
+       "tableStructureChanged",
+       "tableView",
+       "tableView:acceptDrop:row:dropOperation:",
+       "tableView:didClickTableColumn:",
+       "tableView:didDragTableColumn:",
+       "tableView:doCommandBySelector:",
+       "tableView:dragImageForRows:event:dragImageOffset:",
+       "tableView:mouseDownInHeaderOfTableColumn:",
+       "tableView:objectValueForTableColumn:row:",
+       "tableView:setObjectValue:forTableColumn:row:",
+       "tableView:shouldEditTableColumn:row:",
+       "tableView:shouldSelectRow:",
+       "tableView:shouldSelectTableColumn:",
+       "tableView:validateDrop:proposedRow:proposedDropOperation:",
+       "tableView:willDisplayCell:forTableColumn:row:",
+       "tableView:willStartDragWithEvent:",
+       "tableView:writeRows:toPasteboard:",
+       "tableViewAction:",
+       "tableViewColumnDidMove:",
+       "tableViewColumnDidResize:",
+       "tableViewDidEndDragging:",
+       "tableViewDidScroll:",
+       "tableViewDragWillEnd:deposited:",
+       "tableViewSelectionDidChange:",
+       "tableViewSelectionIsChanging:",
+       "tag",
+       "tagForItem:",
+       "tagWithRange:",
+       "tailIndent",
+       "takeColorFrom:",
+       "takeDoubleValueFrom:",
+       "takeFindStringFromSelection:",
+       "takeFloatValueFrom:",
+       "takeIntValueFrom:",
+       "takeObjectValueFrom:",
+       "takeOverAsSelectionOwner",
+       "takeSelectedTabViewItemFromSender:",
+       "takeSettingsFromAccount:",
+       "takeStoredValue:forKey:",
+       "takeStoredValuesFromDictionary:",
+       "takeStringValueFrom:",
+       "takeValue:forKey:",
+       "takeValue:forKeyPath:",
+       "takeValuesFromDictionary:",
+       "takesTitleFromPreviousColumn",
+       "tarCommand",
+       "target",
+       "targetAbstractName",
+       "targetAdditionalSourceDirectories",
+       "targetAllowableDebuggerNames",
+       "targetClass",
+       "targetClassForFault:",
+       "targetCommandLineArgumentsArray",
+       "targetDLLPaths",
+       "targetDisplayName",
+       "targetEnvironment",
+       "targetForAction:",
+       "targetForAction:to:from:",
+       "targetPath",
+       "targetPersistentState",
+       "targetPersistentStateObjectForKey:",
+       "targetSourceDirectories",
+       "targetSourceTree",
+       "targetUrl",
+       "targetUsesDebuggerNamed:",
+       "targetsFor:",
+       "taskDictionary",
+       "taskExitedNormally",
+       "taskName",
+       "tearOffMenuRepresentation",
+       "tearOffTitlebarHighlightColor",
+       "tearOffTitlebarShadowColor",
+       "template",
+       "temporaryAddressBookFromLDAPSearchResults:",
+       "temporaryAddressBookWithName:",
+       "temporaryAttributesAtCharacterIndex:effectiveRange:",
+       "terminate",
+       "terminate:",
+       "terminateForClient:",
+       "terminateNoConfirm",
+       "terminateTask",
+       "terminationStatus",
+       "test",
+       "testPart:",
+       "testStructArrayAtIndex:",
+       "text",
+       "textAlignment",
+       "textAlignmentForSelection",
+       "textAttributesForNegativeValues",
+       "textAttributesForPositiveValues",
+       "textBackgroundColor",
+       "textColor",
+       "textContainer",
+       "textContainerChangedGeometry:",
+       "textContainerChangedTextView:",
+       "textContainerForGlyphAtIndex:effectiveRange:",
+       "textContainerHeight",
+       "textContainerInset",
+       "textContainerOrigin",
+       "textContainerWidth",
+       "textContainers",
+       "textController",
+       "textDidBeginEditing:",
+       "textDidChange:",
+       "textDidEndEditing:",
+       "textEncoding",
+       "textFindingStringWithRangeMap:",
+       "textMergeWithLogging:",
+       "textObjectToSearchIn",
+       "textProc",
+       "textRangeForTokenRange:",
+       "textShouldBeginEditing:",
+       "textShouldEndEditing:",
+       "textStorage",
+       "textStorage:edited:range:changeInLength:invalidatedRange:",
+       "textStorageDidProcessEditing:",
+       "textStorageWillProcessEditing:",
+       "textStorageWithSize:",
+       "textStyleForFontTrait:shouldRemove:",
+       "textStyles",
+       "textView",
+       "textView:clickedOnCell:inRect:",
+       "textView:clickedOnCell:inRect:atIndex:",
+       "textView:clickedOnLink:",
+       "textView:clickedOnLink:atIndex:",
+       "textView:doCommandBySelector:",
+       "textView:doubleClickedOnCell:inRect:",
+       "textView:doubleClickedOnCell:inRect:atIndex:",
+       "textView:draggedCell:inRect:event:",
+       "textView:draggedCell:inRect:event:atIndex:",
+       "textView:shouldChangeTextInRange:replacementString:",
+       "textView:shouldReadSelectionFromPasteboard:type:result:",
+       "textView:willChangeSelectionFromCharacterRange:toCharacterRange:",
+       "textViewChangedFrame:",
+       "textViewClass",
+       "textViewDidChangeSelection:",
+       "textViewForBeginningOfSelection",
+       "textViewWidthFitsContent",
+       "texture",
+       "textureUrl",
+       "thickness",
+       "thicknessRequiredInRuler",
+       "thousandSeparator",
+       "thousandsSeparator",
+       "threadDictionary",
+       "tickMarkPosition",
+       "tickMarkValueAtIndex:",
+       "tightenKerning:",
+       "tile",
+       "timeInterval",
+       "timeIntervalSince1970",
+       "timeIntervalSinceDate:",
+       "timeIntervalSinceNow",
+       "timeIntervalSinceReferenceDate",
+       "timeZone",
+       "timeZoneDetail",
+       "timeZoneForSecondsFromGMT:",
+       "timeZoneWithAbbreviation:",
+       "timeZoneWithName:",
+       "timeZoneWithName:data:",
+       "timeout",
+       "timeoutOnSaveToProjectPath:",
+       "timerWithFireDate:target:selector:userInfo:",
+       "timerWithTimeInterval:invocation:repeats:",
+       "timerWithTimeInterval:target:selector:userInfo:repeats:",
+       "timersForMode:",
+       "timestamp",
+       "title",
+       "titleAlignment",
+       "titleBarFontOfSize:",
+       "titleButtonOfClass:",
+       "titleCell",
+       "titleColor",
+       "titleFont",
+       "titleForView:",
+       "titleFrameOfColumn:",
+       "titleHeight",
+       "titleOfColumn:",
+       "titleOfSelectedItem",
+       "titlePosition",
+       "titleRect",
+       "titleRectForBounds:",
+       "titleString",
+       "titleWidth",
+       "titleWidth:",
+       "titlebarRect",
+       "tmpNameFromPath:",
+       "tmpNameFromPath:extension:",
+       "to",
+       "toManyRelationshipKeys",
+       "toOneRelationshipKeys",
+       "toRecipients",
+       "tocHeaderData",
+       "tocSillyDateInt",
+       "toggle:",
+       "toggleContinuousSpellChecking:",
+       "toggleEditingCharacters:",
+       "toggleFrameConnected:",
+       "toggleHyphenation:",
+       "toggleMultiple:",
+       "togglePageBreaks:",
+       "togglePlatformInputSystem:",
+       "toggleRich:",
+       "toggleRuler:",
+       "toggleSelected:",
+       "toggleTableEditingMode:",
+       "toggleWidgetInView:withButtonID:action:",
+       "tokenCount",
+       "tokenIndex",
+       "tokenInfoAtIndex:",
+       "tokenRange",
+       "tokenRangeForTextRange:",
+       "tokenize",
+       "tokenizeUsing:",
+       "toolBarAction:",
+       "toolTip",
+       "toolTipColor",
+       "toolTipForCell:",
+       "toolTipForView:cell:",
+       "toolTipTextColor",
+       "toolTipsFontOfSize:",
+       "toolbar",
+       "toolbarButton",
+       "toolbarClass",
+       "toolbarConfiguration",
+       "toolbarController",
+       "toolbarResponder",
+       "toolbarStrings",
+       "tooltipStringForItem:",
+       "tooltipStringForString:",
+       "topAutoreleasePoolCount",
+       "topLevelObject",
+       "topLevelTableWithHeaderParent:imageParent:topMargin:",
+       "topMargin",
+       "topRenderingRoot",
+       "topTextView",
+       "topUndoObject",
+       "totalAutoreleasedObjects",
+       "totalCount",
+       "totalCount:andSize:",
+       "totalDiskSpace",
+       "totalWidthOfAllColumns",
+       "touchRegion:ofLength:",
+       "touched",
+       "trace",
+       "traceWithFlavor:priority:format:",
+       "traceWithFlavor:priority:format:arguments:",
+       "trackKnob:",
+       "trackLinkInRect:ofView:",
+       "trackMagnifierForPanel:",
+       "trackMarker:withMouseEvent:",
+       "trackMouse:adding:",
+       "trackMouse:inRect:ofView:atCharacterIndex:untilMouseUp:",
+       "trackMouse:inRect:ofView:untilMouseUp:",
+       "trackPagingArea:",
+       "trackRect",
+       "trackScrollButtons:",
+       "trackWithEvent:",
+       "trackWithEvent:inView:withDelegate:",
+       "trackerForSelection:",
+       "trackingConstraint",
+       "trackingConstraintKeyMask",
+       "trackingNumber",
+       "trailingBlockCharacterLengthWithMap:",
+       "trailingOffset",
+       "traitsOfFont:",
+       "transactionID",
+       "transferAgain:",
+       "transferSelectionToMailboxAtPath:deleteOriginals:",
+       "transferToMailbox:",
+       "transform",
+       "transform:",
+       "transformBezierPath:",
+       "transformPoint:",
+       "transformRect:",
+       "transformSize:",
+       "transformStruct",
+       "transformUsingAffineTransform:",
+       "translateFromKeys:toKeys:",
+       "translateOriginToPoint:",
+       "translateTo::",
+       "translateXBy:yBy:",
+       "transparentColor",
+       "transpose:",
+       "transposeWords:",
+       "trashCheckboxClicked:",
+       "trashMailboxName",
+       "trashMessageStoreCreatingIfNeeded:",
+       "trashMessageStorePath",
+       "traverseAtProject:data:",
+       "traverseProject:targetObject:targetSelector:userData:",
+       "traverseWithTarget:selector:context:",
+       "treatsFilePackagesAsDirectories",
+       "tree",
+       "trimWhitespace",
+       "trimWithCharactersInCFString:",
+       "truncateFileAtOffset:",
+       "tryLock",
+       "tryLockForReading",
+       "tryLockForWriting",
+       "tryLockWhenCondition:",
+       "tryToPerform:with:",
+       "turnOffKerning:",
+       "turnOffLigatures:",
+       "twiddleToHTMLTextFieldTextView",
+       "twiddleToNSTextView",
+       "type",
+       "typeChanged:",
+       "typeComboBoxChanged:",
+       "typeDescription",
+       "typeEnumerator",
+       "typeForArgumentWithName:",
+       "typeForKey:",
+       "typeFromFileExtension:",
+       "typeToUnixName:",
+       "types",
+       "typesFilterableTo:",
+       "typesetter",
+       "typesetterLaidOneGlyph:",
+       "typingAttributes",
+       "uid",
+       "unableToSetNilForKey:",
+       "unarchiveObjectWithData:",
+       "unarchiveObjectWithFile:",
+       "unarchiver:objectForReference:",
+       "uncacheDarkenedImage:",
+       "unchainContext",
+       "uncommentedAddress",
+       "uncommentedAddressList",
+       "uncommentedAddressRespectingGroups",
+       "undeleteLastDeletedMessages",
+       "undeleteMessage",
+       "undeleteMessages:",
+       "undeleteSelection",
+       "underline:",
+       "underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:",
+       "underlinePosition",
+       "underlineThickness",
+       "undo",
+       "undo:",
+       "undoActionName",
+       "undoFieldToSlider",
+       "undoLevels",
+       "undoLevelsChanged:",
+       "undoManager",
+       "undoManagerDidBeginUndoGrouping:",
+       "undoManagerForTextView:",
+       "undoManagerForWindow:",
+       "undoMenuItemTitle",
+       "undoMenuTitleForUndoActionName:",
+       "undoNestedGroup",
+       "undoNotificationEnabled",
+       "undoRedo:",
+       "undoSliderToField",
+       "unescapedUnicodeString",
+       "unfocus:",
+       "unfocusView:",
+       "unfreeze:",
+       "unhide",
+       "unhide:",
+       "unhideAllApplications:",
+       "unhideApplication",
+       "unhideWithoutActivation",
+       "unionBitVector:",
+       "unionSet:",
+       "unionWithBitVector:",
+       "uniqueInstance:",
+       "uniqueKey:",
+       "uniquePath",
+       "uniquePathWithMaximumLength:",
+       "uniqueSpellDocumentTag",
+       "uniqueStateIdentifier",
+       "uniqueURL",
+       "uniquedAttributes",
+       "uniquedMarkerString",
+       "unixToTypeName:",
+       "unload",
+       "unlock",
+       "unlockFocus",
+       "unlockFocusInRect:",
+       "unlockForReading",
+       "unlockForWriting",
+       "unlockTopMostReader",
+       "unlockWithCondition:",
+       "unmarkText",
+       "unmountAndEjectDeviceAtPath:",
+       "unmounted:",
+       "unparse",
+       "unquotedAttributeStringValue",
+       "unquotedFromSpaceDataWithRange:",
+       "unquotedString",
+       "unreadCount",
+       "unreadCountChanged:",
+       "unreadCountForMailboxAtPath:",
+       "unregisterDragTypesForWindow:",
+       "unregisterDraggedTypes",
+       "unregisterImageRepClass:",
+       "unregisterIndexedStore:",
+       "unregisterMessageClass:",
+       "unregisterMessageClassForEncoding:",
+       "unregisterObjectWithServicePath:",
+       "unregisterServiceProviderNamed:",
+       "unrollTransaction",
+       "unscript:",
+       "unscriptRange:",
+       "unsignedCharValue",
+       "unsignedIntValue",
+       "unsignedLongLongValue",
+       "unsignedLongValue",
+       "unsignedShortValue",
+       "unwrapFromNode:adapting:",
+       "update",
+       "update:",
+       "updateAppendButtonState",
+       "updateAppleMenu:",
+       "updateAttachmentsFromPath:",
+       "updateBackground:",
+       "updateCell:",
+       "updateCellInside:",
+       "updateChangeCount:",
+       "updateCurGlyphOffset",
+       "updateDragTypeRegistration",
+       "updateDynamicServices:",
+       "updateEnabledState",
+       "updateEventCoalescing",
+       "updateFavoritesDestination:",
+       "updateFeedback",
+       "updateFileAttributesFromPath:",
+       "updateFileExtensions:",
+       "updateFilteredListsForMessagesAdded:reason:",
+       "updateFilteredListsForMessagesRemoved:reason:",
+       "updateFontPanel",
+       "updateFrame",
+       "updateFrameColors:",
+       "updateFromPath:",
+       "updateFromPrintInfo",
+       "updateFromSnapshot:",
+       "updateHeaderFields",
+       "updateHeartBeatState",
+       "updateInDock",
+       "updateInfo:parent:rootObject:",
+       "updateInputContexts",
+       "updateInsertionPointStateAndRestartTimer:",
+       "updateMailboxListing:",
+       "updateMap:forChangeInLength:",
+       "updateNameMap",
+       "updateNib",
+       "updateObject:",
+       "updateOptions",
+       "updateOptionsWithApplicationIcon",
+       "updateOptionsWithApplicationName",
+       "updateOptionsWithBackgroundImage",
+       "updateOptionsWithCopyright",
+       "updateOptionsWithCredits",
+       "updateOptionsWithProjectVersion",
+       "updateOptionsWithVersion",
+       "updatePageColorsPanel",
+       "updateProjects",
+       "updateRendering",
+       "updateRendering:",
+       "updateRequestServers:forUser:",
+       "updateRuler",
+       "updateScroller",
+       "updateSpellingPanelWithMisspelledWord:",
+       "updateSubmenu:",
+       "updateSwatch",
+       "updateTableHeaderToMatchCurrentSort",
+       "updateTextViewerToSelection",
+       "updateTitleControls",
+       "updateToggleWidget:",
+       "updateUI",
+       "updateUIOfTextField:withPath:",
+       "updateUserInfoToLatestValues",
+       "updateValidationButton:",
+       "updateWindowDirtyState:",
+       "updateWindows",
+       "updateWindowsItem:",
+       "updatedObjects",
+       "uppercaseLetterCharacterSet",
+       "uppercaseSelfWithLocale:",
+       "uppercaseString",
+       "uppercaseStringWithLanguage:",
+       "uppercaseWord:",
+       "uppercasedRetainedStringWithCharacters:length:",
+       "url",
+       "urlEncodedString",
+       "urlPathByAppendingComponent:",
+       "urlPathByDeletingLastComponent",
+       "urlPathRelativeToPath:",
+       "urlStringForLocation:inFrame:",
+       "urlVisited:",
+       "usableParts",
+       "useAllLigatures:",
+       "useDeferredFaultCreation",
+       "useDisabledEffectForState:",
+       "useFont:",
+       "useHighlightEffectForState:",
+       "useOptimizedDrawing:",
+       "useStandardKerning:",
+       "useStandardLigatures:",
+       "useStoredAccessor",
+       "usedRectForTextContainer:",
+       "usedRectIncludingFloaters",
+       "user",
+       "user:",
+       "userAddressBookWithName:",
+       "userAgent",
+       "userChoseTargetFile:",
+       "userData",
+       "userDefaultsChanged",
+       "userDefinedFaces",
+       "userEmail",
+       "userFacesChanged:",
+       "userFilteredHeaders",
+       "userFixedPitchFontOfSize:",
+       "userFontOfSize:",
+       "userFullName",
+       "userHomeDirectory",
+       "userInfo",
+       "userInfoForMailboxAtPath:",
+       "userInfoForMailboxAtPath:fetchIfNotCached:",
+       "userInfoForMailboxAtPath:fetchIfNotCached:refreshIfCached:",
+       "userIsTyping",
+       "userKeyEquivalent",
+       "userKeyEquivalentModifierMask",
+       "userName",
+       "userPresentableDescription",
+       "userPresentableDescriptionForObject:",
+       "userWantsIndexForStore",
+       "username",
+       "usesAddressLineBreaks",
+       "usesButtons",
+       "usesContextRelativeEncoding",
+       "usesDataSource",
+       "usesDistinct",
+       "usesEPSOnResolutionMismatch",
+       "usesFontPanel",
+       "usesItemFromMenu",
+       "usesNewLayout",
+       "usesRuler",
+       "usesScreenFonts",
+       "usesThreadedAnimation",
+       "usesUserKeyEquivalents",
+       "usesVectorMovement",
+       "uudecodedDataIntoFile:mode:",
+       "uuencodedDataWithFile:mode:",
+       "vCard",
+       "vCardAtFilteredIndex:",
+       "vCardAtIndex:",
+       "vCardFromEmailAddress:",
+       "vCardReferenceAtIndex:",
+       "vCardResolvingReference:",
+       "vCardWithFirstName:lastName:emailAddress:",
+       "vCardWithString:",
+       "vCardsMatchingString:",
+       "validAttributesForMarkedText",
+       "validForStartup",
+       "validRequestorForSendType:returnType:",
+       "validStartCharacter:",
+       "validateChangesForSave",
+       "validateDeletesUsingTable:",
+       "validateEditing",
+       "validateForDelete",
+       "validateForInsert",
+       "validateForSave",
+       "validateForUpdate",
+       "validateInspectedSelection",
+       "validateItem:",
+       "validateKeysWithRootClassDescription:",
+       "validateMenuItem:",
+       "validateMenuMatrix:withResponder:",
+       "validateObjectForDelete:",
+       "validateObjectForSave:",
+       "validatePath:ignore:",
+       "validateRename",
+       "validateRenameColor",
+       "validateRenameList",
+       "validateSelection",
+       "validateTable:withSelector:exceptionArray:continueAfterFailure:",
+       "validateTakeValue:forKeyPath:",
+       "validateToolBar",
+       "validateToolBarButton:",
+       "validateToolCluster",
+       "validateToolbarAction:",
+       "validateUI",
+       "validateUserInterfaceItem:",
+       "validateValue:forKey:",
+       "validateValuesInUI",
+       "validateVisibleColumns",
+       "validateWithMessageArray:itemArray:",
+       "validationDescription",
+       "validationErrors",
+       "validationExceptionWithFormat:",
+       "value",
+       "value:withObjCType:",
+       "valueAtIndex:inPropertyWithKey:",
+       "valueForAttribute:",
+       "valueForDirtyFlag:",
+       "valueForKey:",
+       "valueForKeyPath:",
+       "valueForProperty:",
+       "valueOfAttribute:changedFrom:to:",
+       "valueWithBytes:objCType:",
+       "valueWithNonretainedObject:",
+       "valueWithPoint:",
+       "valueWithPointer:",
+       "valueWithRange:",
+       "valueWithRect:",
+       "valueWithSize:",
+       "valuesForKeys:",
+       "valuesForKeys:object:",
+       "variableWithKey:",
+       "verboseVersion",
+       "verifyWithDelegate:",
+       "version",
+       "versionForClassName:",
+       "versionForClassNamed:",
+       "versionInfo",
+       "versionNb",
+       "versionString",
+       "verticalAlignPopupAction:",
+       "verticalAlignment",
+       "verticalLineScroll",
+       "verticalPageScroll",
+       "verticalPagination",
+       "verticalResizeCursor",
+       "verticalRulerView",
+       "verticalScroller",
+       "verticalSpace",
+       "view",
+       "view:stringForToolTip:point:userData:",
+       "viewBoundsChanged:",
+       "viewDidMoveToSuperview",
+       "viewDidMoveToWindow",
+       "viewForItem:",
+       "viewForPreferenceNamed:",
+       "viewFrameChanged:",
+       "viewHeight",
+       "viewSize",
+       "viewSizeChanged:",
+       "viewSource:",
+       "viewWillMoveToSuperview:",
+       "viewWillMoveToWindow:",
+       "viewWithTag:",
+       "viewedMessage:",
+       "viewingAttributes",
+       "viewsNeedDisplay",
+       "visibleFrame",
+       "visibleRect",
+       "visitedLinkColor",
+       "volatileDomainForName:",
+       "volatileDomainNames",
+       "volume",
+       "wait",
+       "waitForDataInBackgroundAndNotify",
+       "waitForDataInBackgroundAndNotifyForModes:",
+       "waitUntilDate:",
+       "waitUntilExit",
+       "walkOver",
+       "wantsDoubleBuffering",
+       "wantsMargin",
+       "wantsSynchronizedDeallocation",
+       "wantsToBeColor",
+       "wantsToDelayTextChangeNotifications",
+       "wantsToHandleMouseEvents",
+       "wantsToInterpretAllKeystrokes",
+       "wantsToTrackMouse",
+       "wantsToTrackMouseForEvent:",
+       "wantsToTrackMouseForEvent:inRect:ofView:atCharacterIndex:",
+       "warnIfDeleteMessages:",
+       "wasInterpolated",
+       "wasRepaired",
+       "wbMergeCells:",
+       "wbRemoveColumn:",
+       "wbRemoveRow:",
+       "wbSplitCells:",
+       "wbSplitCellsHorizontally:",
+       "wbSplitCellsVertically:",
+       "weightOfFont:",
+       "weightOfTag:",
+       "wellForRect:flipped:",
+       "whiteColor",
+       "whiteComponent",
+       "whitespaceAndNewlineCharacterSet",
+       "whitespaceCharacterSet",
+       "whitespaceDescription",
+       "widestOptionWidthForPopUp:",
+       "widgetInView:withButtonID:action:",
+       "width",
+       "widthAdjustLimit",
+       "widthForColumnAtIndex:returningWidthType:",
+       "widthOfString:",
+       "widthPopupAction:",
+       "widthString",
+       "widthTextfieldAction:",
+       "widthTracksTextView",
+       "widthsInvalid",
+       "willBeDisplayed",
+       "willCancelDelayedPerformWith:::",
+       "willChange",
+       "willDebugWhenLaunched",
+       "willEndCloseSheet:returnCode:contextInfo:",
+       "willFireDelayedPerform:",
+       "willForwardSelector:",
+       "willFreeOnWrite",
+       "willReadRelationship:",
+       "willRemoveSubview:",
+       "willRunOSPanel",
+       "willSaveProjectAtPath:client:",
+       "willScheduleDelayedPerform:with::::",
+       "willSetLineFragmentRect:forGlyphRange:usedRect:",
+       "willingnessToDecode:",
+       "windingRule",
+       "window",
+       "windowBackgroundColor",
+       "windowController",
+       "windowControllerDidLoadNib:",
+       "windowControllerWillLoadNib:",
+       "windowControllers",
+       "windowDidBecomeKey:",
+       "windowDidBecomeMain:",
+       "windowDidChangeScreen:",
+       "windowDidDeminiaturize:",
+       "windowDidExpose:",
+       "windowDidLoad",
+       "windowDidMiniaturize:",
+       "windowDidMove:",
+       "windowDidResignKey:",
+       "windowDidResignMain:",
+       "windowDidResize:",
+       "windowDidUpdate:",
+       "windowFrameAutosaveName",
+       "windowFrameColor",
+       "windowFrameOutlineColor",
+       "windowFrameTextColor",
+       "windowID",
+       "windowNibName",
+       "windowNibPath",
+       "windowNumber",
+       "windowShouldClose:",
+       "windowShouldZoom:toFrame:",
+       "windowTitle",
+       "windowTitleForDocumentDisplayName:",
+       "windowTitlebarLinesSpacingWidth",
+       "windowTitlebarLinesSpacingWidth:",
+       "windowTitlebarTitleLinesSpacingWidth",
+       "windowTitlebarTitleLinesSpacingWidth:",
+       "windowToDefaults:",
+       "windowWillClose:",
+       "windowWillLoad",
+       "windowWillMiniaturize:",
+       "windowWillMove:",
+       "windowWillResize:toSize:",
+       "windowWillReturnFieldEditor:toObject:",
+       "windowWillReturnUndoManager:",
+       "windowWillUseStandardFrame:defaultFrame:",
+       "windowWithWindowNumber:",
+       "windows",
+       "windowsMenu",
+       "wordMovementHandler",
+       "words",
+       "workQueue",
+       "worksWhenModal",
+       "wrapInNode:",
+       "wrapperExtensions",
+       "wrapperForAppleFileDataWithFileEncodingHint:",
+       "wrapperForBinHex40DataWithFileEncodingHint:",
+       "wraps",
+       "writablePasteboardTypes",
+       "writableTypes",
+       "write:",
+       "writeAlignedDataSize:",
+       "writeAttachment:",
+       "writeBOSArray:count:ofType:",
+       "writeBOSNumString:length:ofType:scale:",
+       "writeBOSString:length:",
+       "writeBaselineOffset:",
+       "writeBinaryObjectSequence:length:",
+       "writeBody",
+       "writeBytes:length:",
+       "writeChangesToDisk",
+       "writeCharacterAttributes:previousAttributes:",
+       "writeColor:foreground:",
+       "writeColorTable",
+       "writeColors",
+       "writeCommand:begin:",
+       "writeData:",
+       "writeData:length:",
+       "writeData:to:",
+       "writeDefaultsToDictionary:",
+       "writeDelayedInt:for:",
+       "writeDocument:pbtype:filename:",
+       "writeEPSInsideRect:toPasteboard:",
+       "writeEscapedUTF8String:",
+       "writeFd:",
+       "writeFile:",
+       "writeFileContents:",
+       "writeFileWrapper:",
+       "writeFont:",
+       "writeFontTable",
+       "writeGdbFile",
+       "writeGeneratedFiles",
+       "writeHeader",
+       "writeHyphenation",
+       "writeIconHeaderFile",
+       "writeInt:",
+       "writeKern:",
+       "writeLossyString:",
+       "writeMakeFile",
+       "writeMemory:",
+       "writeNewline",
+       "writePBProject",
+       "writePDFInsideRect:toPasteboard:",
+       "writePaperSize",
+       "writeParagraphStyle:",
+       "writePath:docInfo:errorHandler:remapContents:",
+       "writePostScriptWithLanguageEncodingConversion:",
+       "writePrintInfo",
+       "writePrintInfo:",
+       "writeProfilingDataToPath:",
+       "writeProperty:forKey:",
+       "writeRTF",
+       "writeRTFDToFile:atomically:",
+       "writeRange:ofLength:atOffset:",
+       "writeRoomForInt:",
+       "writeRtf:arg:",
+       "writeRtfEnriched",
+       "writeSelectionToPasteboard:type:",
+       "writeSelectionToPasteboard:types:",
+       "writeStyleSheetTable",
+       "writeSuperscript:",
+       "writeTargetPersistentStateForExecutable:",
+       "writeTargetPersistentStateToProject",
+       "writeText:isRTF:",
+       "writeToFile:",
+       "writeToFile:atomically:",
+       "writeToFile:atomically:updateFilenames:",
+       "writeToFile:ofType:",
+       "writeToFile:ofType:originalFile:saveOperation:",
+       "writeToPasteboard:",
+       "writeToPath:safely:",
+       "writeToURL:atomically:",
+       "writeToURL:ofType:",
+       "writeUnderlineStyle:",
+       "writeUpdatedMessageDataToDisk",
+       "writeValue:andLength:",
+       "writeValuesToDictionary:",
+       "writeWithBackupToFile:ofType:saveOperation:",
+       "xHeight",
+       "yank:",
+       "yankAndSelect:",
+       "yearOfCommonEra",
+       "years:months:days:hours:minutes:seconds:sinceDate:",
+       "yellowColor",
+       "yellowComponent",
+       "zero",
+       "zeroLengthSelectionAfterItem:",
+       "zeroLengthSelectionAfterPrologueOfNode:",
+       "zeroLengthSelectionAtEndOfConjointSelection:",
+       "zeroLengthSelectionAtEndOfSelection:",
+       "zeroLengthSelectionAtOrAfterLocation:rangeMap:",
+       "zeroLengthSelectionAtOrBeforeLocation:rangeMap:",
+       "zeroLengthSelectionAtStartOfConjointSelection:",
+       "zeroLengthSelectionAtStartOfSelection:",
+       "zeroLengthSelectionBeforeEpilogueOfNode:",
+       "zeroLengthSelectionBeforeItem:",
+       "zone",
+       "zoom:",
+       "zoomButton",
+};
+
diff --git a/runtime/objc.h b/runtime/objc.h
new file mode 100644 (file)
index 0000000..92076d9
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ *     objc.h
+ *     Copyright 1988-1996, NeXT Software, Inc.
+ */
+
+#ifndef _OBJC_OBJC_H_
+#define _OBJC_OBJC_H_
+
+#import <objc/objc-api.h>              // for OBJC_EXPORT
+
+typedef struct objc_class *Class;
+
+typedef struct objc_object {
+       Class isa;
+} *id;
+
+typedef struct objc_selector   *SEL;    
+typedef id                     (*IMP)(id, SEL, ...); 
+typedef char                   BOOL;
+
+#define YES             (BOOL)1
+#define NO              (BOOL)0
+
+#ifndef Nil
+#define Nil 0          /* id of Nil class */
+#endif
+
+#ifndef nil
+#define nil 0          /* id of Nil instance */
+#endif
+
+
+#if !defined(STRICT_OPENSTEP)
+
+typedef char *STR;
+
+OBJC_EXPORT BOOL sel_isMapped(SEL sel);
+OBJC_EXPORT const char *sel_getName(SEL sel);
+OBJC_EXPORT SEL sel_getUid(const char *str);
+OBJC_EXPORT SEL sel_registerName(const char *str);
+OBJC_EXPORT const char *object_getClassName(id obj);
+OBJC_EXPORT void *object_getIndexedIvars(id obj);
+
+#define ISSELECTOR(sel) sel_isMapped(sel)
+#define SELNAME(sel)   sel_getName(sel)
+#define SELUID(str)    sel_getUid(str)
+#define NAMEOF(obj)     object_getClassName(obj)
+#define IV(obj)         object_getIndexedIvars(obj)
+
+#if defined(__osf__) && defined(__alpha__)
+    typedef long arith_t;
+    typedef unsigned long uarith_t;
+    #define ARITH_SHIFT 32
+#else
+    typedef int arith_t;
+    typedef unsigned uarith_t;
+    #define ARITH_SHIFT 16
+#endif
+
+#endif /* !STRICT_OPENSTEP */
+
+#endif /* _OBJC_OBJC_H_ */
diff --git a/runtime/objc_dllMain.c b/runtime/objc_dllMain.c
new file mode 100644 (file)
index 0000000..29394ae
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+// Copyright 1988-1996 NeXT Software, Inc.
+
+#include <winnt-pdo.h>
+#include <windows.h>
+
+extern void __do_global_ctors();
+
+BOOL APIENTRY DllMain( HANDLE hModule,
+                        DWORD ul_reason_for_call,
+                        LPVOID lpReserved )
+{
+       _NXLogError( "DllMain got called!\n" );
+
+    switch( ul_reason_for_call ) {
+    case DLL_PROCESS_ATTACH:
+               __do_global_ctors();
+               break;
+    case DLL_THREAD_ATTACH:
+               break;
+    case DLL_THREAD_DETACH:
+               break;
+    case DLL_PROCESS_DETACH:
+               break;
+    }
+    return TRUE;
+}
diff --git a/runtime/objc_hpux_register_shlib.c b/runtime/objc_hpux_register_shlib.c
new file mode 100644 (file)
index 0000000..1e698a4
--- /dev/null
@@ -0,0 +1,640 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *  
+ * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.1 (the "License").  You may not use this file
+ * except in compliance with the License.  Please obtain a copy of the
+ * License at http://www.apple.com/publicsource 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 OR NON- INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *      
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/* 
+ *      objc_hpux_register_shlib.c
+ *      Author: Laurent Ramontianu
+ */
+
+#warning "OBJC SHLIB SUPPORT WARNING:"
+#warning "Compiling objc_hpux_register_shlib.c"
+#warning "Shlibs containing objc code must be built using"
+#warning "the ld option: +I'objc_hpux_register_shlib_$(NAME)'"
+#warning "Be advised that if collect isn't fixed to ignore"
+#warning "shlibs, your app may (and will) CRASH!!!"
+
+#include <dl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/unistd.h>
+#include <sys/stat.h>
+
+static char *_loaded_shlibs_init[128] = {
+        "java",
+        "cl",
+        "isamstub",
+        "c",
+        "m",
+        "dld",
+        "gen",
+        "pthread",
+        "lwp"
+};
+
+static unsigned _loaded_shlibs_size = 128;
+static unsigned _loaded_shlibs_count = 9;
+
+static char **_loaded_shlibs = _loaded_shlibs_init;
+
+static void dump_loaded_shlibs() {
+    int i;
+    printf("****    Loaded shlibs    ****\n");
+    for ( i=0; i<_loaded_shlibs_count; i++ ) {
+        printf("\t%s\n", _loaded_shlibs[i]);
+    }
+    printf("---                      ----\n");
+}
+
+
+static char *my_basename(char *path)
+{
+    char *res = 0;
+    unsigned idx = strlen(path) - 1;
+
+    if ( path[idx] == '/' ) idx--;
+    for ( ; (idx > 0) && (path[idx] != '/') ; idx-- ) {
+        if ( path[idx] == '.' ) path[idx] = '\000';
+    }
+    if ( path[idx] == '/') idx++;
+    res = strstr(&path[idx], "lib");
+    if ( !res ) {
+        return &path[idx];
+    }
+    if ( res == &path[idx] ) {
+        return &path[idx+3];
+    }
+    return &path[idx];
+}
+
+
+extern void *malloc(unsigned);
+extern void  free(void *);
+
+// Hooks if we decide to provide alternate malloc/free functions
+static void*(*_malloc_ptr)(unsigned) = malloc;
+static void(*_free_ptr)(void*) = free;
+
+
+static char *dep_shlibs_temp[128];
+static unsigned dep_shlibs_temp_count = 0;
+
+static void dump_dependent_shlibs() {
+    int i;
+    printf("****    Dependent shlibs    ****\n");
+    for ( i=0; i<dep_shlibs_temp_count; i++ ) {
+        printf("\t%s\n", dep_shlibs_temp[i]);
+    }
+    printf("---                      ----\n");
+}
+
+
+static void init_dependent_shlibs(char *name)
+{
+    dep_shlibs_temp[0] = name;
+    dep_shlibs_temp_count = 1;
+}
+
+
+static int already_loaded(char *path);
+
+static void insert_dependent_shlib(char *path)
+{
+    if ( ! already_loaded(path) ) {
+        dep_shlibs_temp[dep_shlibs_temp_count] = path;
+        dep_shlibs_temp_count++;
+        return;
+    }
+}
+
+static char **dependent_shlibs()
+{
+    unsigned size;
+    unsigned idx;
+    char *ptr;
+    char *name;
+    unsigned ref_size;
+
+    insert_dependent_shlib("<NULL>");
+
+    size = 0;
+    for ( idx = 0; idx < dep_shlibs_temp_count; idx++ ) {
+        size += sizeof(char*) + strlen(dep_shlibs_temp[idx]) + 1;
+    }
+
+    if ( ! (ptr = _malloc_ptr(size)) ) {
+        fprintf(stderr, "dependent_shlibs: fatal - malloc() failed\n");
+        exit(-1);
+    }
+
+    ref_size = dep_shlibs_temp_count * sizeof(char*);
+    size = 0;
+    for ( idx = 0; idx < dep_shlibs_temp_count; idx++ ) {
+        name = ptr + ref_size + size;
+        *((char **)ptr + idx) = name;
+        strcpy(name, dep_shlibs_temp[idx]);
+        size += strlen(name) + 1;
+    }
+
+    dep_shlibs_temp_count = 0;
+    return (char **)ptr;
+}
+
+
+static char **__objc_get_referenced_shlibs(char *path)
+{
+    static char **dict[128];
+    static unsigned dict_size = 0;
+    static char *res_nil[] = { "<NULL>" };
+    static char file_name[48];
+
+    int fd;
+    int child_pid;
+    unsigned long size;
+    void *addr;
+
+    char *ptr;
+    char *ptr2;
+    char buf[256], *name;
+    unsigned idx;
+
+    strcpy(buf, path);
+    name = my_basename(buf);
+
+    for (idx = 0; idx < dict_size; idx++ ) {
+        if ( ! strcmp(name, *(dict[idx])) )
+            return dict[idx]+1;
+    }
+
+    child_pid = vfork();
+    if ( child_pid < 0 ) {
+        fprintf(stderr, "__objc_get_referenced_shlibs: fatal - vfork() failed\n");
+        exit(-1);
+    }
+
+    if ( child_pid > 0 ) {
+        wait(0);
+        sprintf(file_name, "/tmp/apple_shlib_reg.%d", child_pid);
+        if ( (fd = open(file_name, O_RDONLY)) < 0 ) {
+            fprintf(stderr, "__objc_get_referenced_shlibs: fatal - open() failed\n");
+            exit(-1);
+        }
+        size = lseek(fd, 0, SEEK_END);
+        addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+
+        init_dependent_shlibs(name);
+        if ( ptr = strstr(addr, "list:") ) {
+            ptr2 = strtok(ptr, " \n\t");
+            for ( ; ; ) {
+                ptr2 = strtok(0, " \n\t");
+                if ( ! ptr2 || strcmp(ptr2, "dynamic") ) break;
+                ptr2 = strtok(0, " \n\t");
+                if ( ! ptr2 ) {
+                    fprintf(stderr, "__objc_get_referenced_shlibs: fatal - %s has bad format\n", file_name);
+                    exit(-1);
+                }
+                insert_dependent_shlib(ptr2);
+            }
+        }
+
+        dict[dict_size] = dependent_shlibs();
+        munmap(addr, size);
+        close(fd);
+        unlink(file_name);
+        return dict[dict_size++];
+    }
+    else {
+        sprintf(file_name, "/tmp/apple_shlib_reg.%d", getpid());
+        close(1);
+        if ( open(file_name, O_WRONLY | O_CREAT, 0) < 0 ) { exit(-1); }
+// Uncomment next 2 lines if it's needed to redirect stderr as well
+/*
+        close(2);
+        dup(1);
+*/
+        /* aB. For some reason the file seems to be created with no read permission if done as a normal user */
+        chmod(file_name, S_IRUSR | S_IRGRP | S_IROTH);
+        execl("/usr/bin/chatr", "chatr", path, 0);
+        fprintf(stderr, "__objc_get_referenced_shlibs: failed to exec chatr\n");
+        exit(-1);
+    }
+
+    return res_nil;
+}
+
+
+static int _verbose = -1;
+static int _reg_mechanism = -1;
+
+#define OBJC_SHLIB_INIT_REGISTRATION if (_reg_mechanism == -1) {registration_init();}
+#define REG_METHOD_CHATR 0
+#define REG_METHOD_DLD 1
+
+static void registration_init() {
+    const char *str_value = getenv("OBJC_SHOW_SHLIB_REGISTRATION");
+    if ( str_value ) {
+        if      ( !strcmp(str_value, "ALL") )   _verbose = 4;
+        else if ( !strcmp(str_value, "LIBS") )  _verbose = 1;
+        else if ( !strcmp(str_value, "LIST") )  _verbose = 2;
+        else if ( !strcmp(str_value, "CTORS") ) _verbose = 3;
+        else _verbose = 0;
+    }
+    else _verbose = 0;
+
+    str_value = getenv("OBJC_SHLIB_REGISTRATION_METHOD");
+    if ( str_value ) {
+        if      ( !strcmp(str_value, "DLD") ) _reg_mechanism = REG_METHOD_DLD;
+        else if ( !strcmp(str_value, "AB") )  _reg_mechanism = REG_METHOD_DLD;
+        else if ( !strcmp(str_value, "NEW") ) _reg_mechanism = REG_METHOD_DLD;
+        else _reg_mechanism = REG_METHOD_CHATR;
+    }
+    else _reg_mechanism = REG_METHOD_DLD;
+
+    if (_verbose > 0) {
+        if (_reg_mechanism == REG_METHOD_CHATR) {
+            fprintf(stderr, "objc_hpux_register_shlib(): Using old (chatr) registration method\n");
+        } else {
+            fprintf(stderr, "objc_hpux_register_shlib(): Using new (dld) registration method\n");
+        }
+    }
+}
+
+
+static void insert_loaded_shlib(char *path);
+
+static int already_loaded(char *path)
+{
+    static int first_time_here = 1;
+    unsigned idx;
+    char buf[256], *name;
+    
+    strcpy(buf, path);
+    name = my_basename(buf);
+
+    OBJC_SHLIB_INIT_REGISTRATION;
+
+    for ( idx = 0; idx < _loaded_shlibs_count; idx++ ) {
+        if ( ! strcmp(_loaded_shlibs[idx], name) ) {
+            return 1;
+        }
+    }
+
+    if ( first_time_here ) { // the root executable is the first shlib(sic)
+        first_time_here = 0;
+        insert_loaded_shlib(path);
+        return 1;
+    }
+
+    return 0;
+}
+
+static void insert_loaded_shlib(char *path)
+{
+    char **_loaded_shlibs_temp;
+    char buf[256], *name;
+
+    strcpy(buf, path);
+    name = my_basename(buf);
+
+    if ( already_loaded(path) ) {
+        return;
+    }
+    if ( _loaded_shlibs_count >= _loaded_shlibs_size ) {
+        _loaded_shlibs_temp = _loaded_shlibs;
+        _loaded_shlibs_size += 32;
+        _loaded_shlibs = (char **)_malloc_ptr(_loaded_shlibs_size*sizeof(char *));
+        if ( ! _loaded_shlibs ) {
+            fprintf(stderr, "objc_hpux_register_shlib() - fatal: Failed to malloc _loaded_shlibs list. Exit\n");
+            exit(-1);
+        }
+        memcpy(_loaded_shlibs, _loaded_shlibs_temp, _loaded_shlibs_count);
+        if ( _loaded_shlibs_temp != _loaded_shlibs_init ) {
+            _free_ptr(_loaded_shlibs_temp);
+        }
+    }
+
+    if ( ! (_loaded_shlibs[_loaded_shlibs_count] = _malloc_ptr(strlen(name)+1)) ) {
+        fprintf(stderr, "objc_hpux_register_shlib() - fatal: Failed to malloc _loaded_shlibs entry. Exit\n");
+        exit(-1);
+    }
+    strcpy(_loaded_shlibs[_loaded_shlibs_count++], name);
+    return;
+}
+
+
+static char *_pending_shlibs_init[128] = { "nhnd<NULL>" };
+
+static unsigned _pending_shlibs_size = 128;
+static unsigned _pending_shlibs_count = 1;
+
+static char **_pending_shlibs = _pending_shlibs_init;
+
+static void dump_pending_shlibs() {
+    int i;
+    printf("****    Pending shlibs    ****\n");
+    for ( i=0; i<_pending_shlibs_count; i++ ) {
+        printf("\t%s\n", _pending_shlibs[i]+sizeof(void*));
+    }
+    printf("---                      ----\n");
+}
+
+
+static int already_pending(const char *path)
+{
+    unsigned idx;
+    for ( idx = 0; idx < _pending_shlibs_count; idx++ ) {
+        if ( ! strcmp(_pending_shlibs[idx]+sizeof(void*), path) ) {
+            if (_verbose > 1) {
+                fprintf(stderr, "already_pending(): Already pended shlib %s\n", path);
+            }
+            return 1;
+        }
+    }
+    if (_verbose > 1) {
+        fprintf(stderr, "already_pending(): Pending shlib %s\n", path);
+    }
+    return 0;
+}
+
+static void insert_pending_shlib(struct shl_descriptor *desc)
+{
+    char **_pending_shlibs_temp;
+    char *ptr;
+    int mask;
+
+    if (_verbose > 1) {
+        fprintf(stderr, "insert_pending_shlib(): Inserting shlib %s\n", desc->filename);
+    }
+
+    if ( already_pending(desc->filename) )
+        return;
+
+    if ( _pending_shlibs_count >= _pending_shlibs_size ) {
+        _pending_shlibs_temp = _pending_shlibs;
+        _pending_shlibs_size += 32;
+        _pending_shlibs = (char **)_malloc_ptr(_pending_shlibs_size*sizeof(char *));
+        if ( ! _pending_shlibs ) {
+            fprintf(stderr, "objc_hpux_register_shlib() - fatal: Failed to malloc _pending_shlibs list. Exit\n");
+            exit(-1);
+        }
+        memcpy(_pending_shlibs, _pending_shlibs_temp, _pending_shlibs_count);
+        if ( _pending_shlibs_temp != _pending_shlibs_init ) {
+            _free_ptr(_pending_shlibs_temp);
+        }
+    }
+
+    if ( ! (ptr = _malloc_ptr(strlen(desc->filename)+1+sizeof(void *)*2)) ) {
+        fprintf(stderr, "objc_hpux_register_shlib() - fatal: Failed to malloc _pending_shlibs entry. Exit\n");
+        exit(-1);
+    }
+    strcpy(ptr+sizeof(void*), desc->filename);
+    *(void **)ptr = desc->handle;
+    _pending_shlibs[_pending_shlibs_count] = ptr;
+    return;
+}
+
+static void delete_pending_shlib(const char *path)
+{
+    unsigned idx;
+    char *ptr;
+
+    if (_verbose > 1) {
+        fprintf(stderr, "delete_pending_shlib(): Deleting shlib %s\n", path);
+    }
+
+    for ( idx = 0; idx < _pending_shlibs_count; idx++ ) {
+        ptr = _pending_shlibs[idx]+sizeof(void*);
+        if ( ! strcmp(ptr, path) ) {
+            if ( strcmp(ptr, "<NULL>") ) {
+                _free_ptr(_pending_shlibs[idx]);
+                _pending_shlibs[idx] = "<NULL>";
+                if (_verbose > 1) {
+                    fprintf(stderr, "delete_pending_shlib(): Found and deleted shlib %s\n", path);
+                }
+            }
+            return;
+        }
+    }
+}
+
+static int more_pending_shlibs()
+{
+    unsigned idx;
+    char *ptr;
+
+    for ( idx = 0; idx < _pending_shlibs_count; idx++ ) {
+        ptr = _pending_shlibs[idx]+sizeof(void*);
+        if ( strcmp(ptr, "<NULL>") ) {
+            return 0;
+        }
+    }
+    if (_verbose > 1) {
+        fprintf(stderr, "more_pending_shlib(): Pending shlibs remain\n");
+    }
+    return 1;
+}
+
+
+static int dependencies_resolved(char *path)
+{
+    char **referenced_shlibs;
+
+    referenced_shlibs = __objc_get_referenced_shlibs(path);
+    referenced_shlibs++;
+    for ( ; strcmp(*referenced_shlibs, "<NULL>"); referenced_shlibs++ ) {
+        if ( !already_loaded(*referenced_shlibs) ) {
+            if (_verbose > 1) {
+                fprintf(stderr, "dependencies_resolved(): Dependencies remaining for shlib %s\n", path);
+            }
+            return 0;
+        }
+    }
+    if (_verbose > 1) {
+        fprintf(stderr, "dependencies_resolved(): Dependencies resolved for shlib %s\n", path);
+    }
+    return 1;
+}
+
+
+void objc_hpux_register_shlib_handle(void *handle);
+
+static void resolve_pending_shlibs()
+{
+    char *ptr;
+    unsigned idx;
+
+    for ( idx = 0; idx < _pending_shlibs_count; idx++ ) {
+        ptr = _pending_shlibs[idx]+sizeof(void*);
+        if ( dependencies_resolved(ptr) ) {
+            if ( _verbose >= 1 ) {
+                fprintf(stderr, "resolve_pending_shlibs(): Examining shlib %s\n", ptr);
+            }
+            objc_hpux_register_shlib_handle(*(void **)_pending_shlibs[idx]);
+            delete_pending_shlib(ptr);
+            insert_loaded_shlib(ptr);
+        }
+    }
+}
+
+
+void objc_hpux_register_shlib_handle(void *handle)
+{
+    extern void *CMH;
+    extern objc_finish_header();
+
+    int isCMHReset;
+    int sym_count, sym_idx;
+    struct shl_symbol *symbols;
+
+    // use malloc and not _malloc_ptr
+    sym_count = shl_getsymbols(handle, TYPE_PROCEDURE,
+                        EXPORT_SYMBOLS, malloc, &symbols);
+    if ( sym_count == -1 ) {
+        fprintf(stderr, "objc_hpux_register_shlib_handle() - WARNING: shl_getsymbols failed. Continue at your own risk...\n");
+        //exit(-1);
+        return;
+    }
+
+    isCMHReset = 0;
+    for ( sym_idx = 0; sym_idx < sym_count; sym_idx++ ) {
+        if ( !strncmp(symbols[sym_idx].name, "_GLOBAL_$I$", 11) ) {
+            if ( ! isCMHReset ) {
+                 CMH = (void *)0;
+                 isCMHReset = 1;
+            }
+            if ( _verbose >= 3 )
+                fprintf(stderr, "objc_hpux_register_shlib_handle():    found ctor %s...\n", symbols[sym_idx].name);
+            ((void (*)())(symbols[sym_idx].value))();
+            if ( _verbose >= 3 )
+                fprintf(stderr, "objc_hpux_register_shlib_handle():    ... and executed it\n");
+        }
+    }
+    if ( isCMHReset )
+        objc_finish_header();
+
+    // use free and not _free_ptr
+    free(symbols);
+    return;
+}
+
+void objc_hpux_register_shlib()
+{
+    int idx;
+    int registered_at_least_one_shlib;
+    struct shl_descriptor desc;
+
+    OBJC_SHLIB_INIT_REGISTRATION;
+
+    if (_reg_mechanism != REG_METHOD_CHATR) return;
+
+    if ( _verbose == 2 || _verbose == 4 )
+        fprintf(stderr, "----        ----\n");
+
+    registered_at_least_one_shlib = 0;
+    for ( idx = 0; !shl_get_r(idx, &desc); idx++ ) {
+        if ( already_loaded(desc.filename) ) {
+            if ( _verbose == 2 || _verbose == 4 )
+                fprintf(stderr, "objc_hpux_register_shlib(): Skipping shlib %s\n", desc.filename);
+            continue;
+        }
+
+        if ( !dependencies_resolved(desc.filename) ) {
+            insert_pending_shlib(&desc);
+            continue;
+        }
+
+        if ( _verbose >= 1 || _verbose == 4 )
+            fprintf(stderr, "objc_hpux_register_shlib(): Examining shlib %s\n", desc.filename);
+        objc_hpux_register_shlib_handle(desc.handle);
+        delete_pending_shlib(desc.filename);
+        insert_loaded_shlib(desc.filename);
+        registered_at_least_one_shlib = 1;
+    }
+
+    // This is the last call and the last chance to resolve them all!
+    if ( ! registered_at_least_one_shlib ) {
+        while ( more_pending_shlibs() )
+            resolve_pending_shlibs();
+    }
+
+    if ( _verbose == 2 || _verbose == 4)
+        fprintf(stderr, "----        ----\n\n");
+
+    return;
+}
+
+/*
+ * An alternative, more efficient shlib registration that relies on the initializer
+ * functions in each shlib being called in the correct order. This was initially deemed not to work. aB.
+ */
+void objc_hpux_register_named_shlib(const char *shlib_name)
+{
+    int idx;
+    struct shl_descriptor desc;
+    char buf1[256], *p1;
+    char buf2[256], *p2;
+
+    OBJC_SHLIB_INIT_REGISTRATION;
+
+    strcpy(buf1, shlib_name);
+    p1 = my_basename(buf1);
+
+    /* Do we use the new registration method or not ? */
+    if (_reg_mechanism == REG_METHOD_DLD) {
+        if ( _verbose >= 1 ) {
+            fprintf(stderr, "objc_hpux_register_named_shlib(): Registering shlib %s\n", shlib_name);
+        }
+        for ( idx = 0; !shl_get_r(idx, &desc); idx++ ) {
+            strcpy(buf2, desc.filename);
+            p2 = my_basename(buf2);
+            /* Avoid registering the main executable (initializer == NULL) */
+            if ( strcmp(p1, p2) == 0 && desc.initializer != NULL) {
+                objc_hpux_register_shlib_handle(desc.handle);
+                if ( _verbose >= 1 ) {
+                    fprintf(stderr, "objc_hpux_register_named_shlib(): Registered shlib %s desc.initializer %x\n", desc.filename, desc.initializer);
+                }
+                break;
+            }
+        }
+    } else {
+        /* Just do things the old way */
+        objc_hpux_register_shlib();
+    }
+
+}
+
+/* Hardcoded in here for now as libpdo is built in a special manner */
+void objc_hpux_register_shlib_pdo()
+{
+    objc_hpux_register_named_shlib("libpdo.sl");
+}
+
+
+unsigned __objc_msg_spew(unsigned self_obj, unsigned self_cls, unsigned addr)
+{
+    fprintf(stderr, "\n\n****    __objc_msg_spew(self:0x%08x  self->isa:0x%08x  cls:0x%08x)    ****\n\n", self_obj, *(unsigned *)self_obj, self_cls);
+    return addr;
+}