Commit 65e1be69 by Kresten Krab Thorup

Uninstalled argframe macros

From-SVN: r4270
parent 0b80ea44
...@@ -60,12 +60,9 @@ libobjc.a: $(OBJC_O) ...@@ -60,12 +60,9 @@ libobjc.a: $(OBJC_O)
$(AR) rc libobjc.a $(OBJC_O) $(AR) rc libobjc.a $(OBJC_O)
# ranlib is run in the parent directory's makefile. # ranlib is run in the parent directory's makefile.
ARGFRAME_H = argframe.h af-sparc.h
OBJC_H = hash.h list.h sarray.h objc.h \ OBJC_H = hash.h list.h sarray.h objc.h \
objc-api.h cache.h \ objc-api.h cache.h \
Object.h Protocol.h mutex.h \ Object.h Protocol.h mutex.h
$(ARGFRAME_H)
# copy objc headers to installation include directory # copy objc headers to installation include directory
copy-headers: $(OBJC_H) copy-headers: $(OBJC_H)
...@@ -77,6 +74,19 @@ copy-headers: $(OBJC_H) ...@@ -77,6 +74,19 @@ copy-headers: $(OBJC_H)
chmod a+r $(incinstalldir)/objc; \ chmod a+r $(incinstalldir)/objc; \
done done
sendmsg.o: sendmsg.c fflags
$(GCC_FOR_TARGET) `cat fflags` -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $(srcdir)/objc/sendmsg.c
## Next to are for heuristics on forwarding mechanism...
_forward: _forward.c
-$(GCC_FOR_TARGET) -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $(srcdir)/objc/_forward.c
-$(GCC_FOR_TARGET) ./_forward.o -o _forward
if [ ! -f ./_forward ]; then touch ./_forward; fi
fflags: _forward
-rm -f fflags
-if [ -s ./_forward ]; then ./_forward > fflags; else touch fflags; fi
mostlyclean: mostlyclean:
-rm -f *.o libobjc.a _forward fflags -rm -f *.o libobjc.a _forward fflags
clean: mostlyclean clean: mostlyclean
......
...@@ -52,14 +52,10 @@ typedef char *STR; /* String alias */ ...@@ -52,14 +52,10 @@ typedef char *STR; /* String alias */
@class Protocol; @class Protocol;
typedef struct objc_typed_stream TypedStream; typedef struct objc_typed_stream TypedStream;
typedef void* arglist_t;
#endif /* not __objc_INCLUDE_GNU */ #endif /* not __objc_INCLUDE_GNU */
#ifndef __AF_FRAME
typedef struct __gnuc_af_frame *af_frame;
#define __AF_FRAME
#endif
/* /*
* All classes are derived from Object. As such, * All classes are derived from Object. As such,
* this is the overhead tacked onto those objects. * this is the overhead tacked onto those objects.
...@@ -123,8 +119,8 @@ typedef struct __gnuc_af_frame *af_frame; ...@@ -123,8 +119,8 @@ typedef struct __gnuc_af_frame *af_frame;
- - perform:(SEL)aSel with:anObject1 with:anObject2; - - perform:(SEL)aSel with:anObject1 with:anObject2;
/* Forwarding */ /* Forwarding */
- - forward:(SEL)aSel :(af_frame)argFrame; - - forward:(SEL)aSel :(arglist_t)argFrame;
- - performv:(SEL)aSel :(af_frame)argFrame; - - performv:(SEL)aSel :(arglist_t)argFrame;
/* Posing */ /* Posing */
+ + poseAs:(Class*)aClassObject; + + poseAs:(Class*)aClassObject;
......
...@@ -245,12 +245,12 @@ extern int errno; ...@@ -245,12 +245,12 @@ extern int errno;
return (*msg)(self, aSel, anObject1, anObject2); return (*msg)(self, aSel, anObject1, anObject2);
} }
- forward:(SEL)aSel :(af_frame)argFrame - forward:(SEL)aSel :(arglist_t)argFrame
{ {
return [self doesNotRecognize: aSel]; return [self doesNotRecognize: aSel];
} }
- performv:(SEL)aSel :(af_frame)argFrame - performv:(SEL)aSel :(arglist_t)argFrame
{ {
return objc_msg_sendv(self, aSel, method_get_argsize(0), argFrame); return objc_msg_sendv(self, aSel, method_get_argsize(0), argFrame);
} }
......
...@@ -26,6 +26,8 @@ You should have received a copy of the GNU General Public License along with ...@@ -26,6 +26,8 @@ You should have received a copy of the GNU General Public License along with
#include "runtime.h" #include "runtime.h"
void objc_error(id object, const char* fmt, va_list);
void (*_objc_error)(id, const char*, va_list) = objc_error; void (*_objc_error)(id, const char*, va_list) = objc_error;
/* id (*_objc_object_alloc)(Class*) = 0; */ /* id (*_objc_object_alloc)(Class*) = 0; */
/* id (*_objc_object_dispose)(id) = 0; */ /* id (*_objc_object_dispose)(id) = 0; */
......
...@@ -440,12 +440,36 @@ IMP objc_msg_lookup_super(Super_t super, SEL sel); ...@@ -440,12 +440,36 @@ IMP objc_msg_lookup_super(Super_t super, SEL sel);
typedef void* retval_t; /* return value */ typedef void* retval_t; /* return value */
typedef void(*apply_t)(void); /* function pointer */ typedef void(*apply_t)(void); /* function pointer */
#ifndef __AF_FRAME #ifndef __object_INCLUDE_GNU
typedef struct __gnuc_af_frame *af_frame;
#define __AF_FRAME #if defined(REG_ARGS) || defined(STACK_ARGS)
typedef struct {
char* arg_pointer;
#ifdef STRUCT_RETURN
void* struct_return;
#endif
#ifdef REG_ARGS
void* regs[2];
#endif
} *arglist_t;
#ifdef REG_ARGS
#define __objc_frame_receiver(FRAME) (FRAME)->regs[0]
#define __objc_frame_selector(FRAME) ((SEL)(FRAME)->regs[1])
#else
#define __objc_frame_receiver(FRAME) ((id*)(FRAME)->arg_pointer)[0]
#define __objc_frame_selector(FRAME) ((SEL*)(FRAME)->arg_pointer)[1]
#endif
#else
typedef void* arglist_t;
#endif #endif
#endif /* not __object_INCLUDE_GNU */
retval_t objc_msg_sendv(id, SEL, size_t, af_frame); retval_t objc_msg_sendv(id, SEL, size_t, arglist_t);
#ifdef __OBJC__ #ifdef __OBJC__
......
...@@ -25,7 +25,6 @@ You should have received a copy of the GNU General Public License along with ...@@ -25,7 +25,6 @@ You should have received a copy of the GNU General Public License along with
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include "runtime.h" #include "runtime.h"
#include "argframe.h"
#ifdef OBJC_SPARSE_LOOKUP #ifdef OBJC_SPARSE_LOOKUP
const char* __objc_sparse_lookup_id = "Method lookup uses sparse arrays"; const char* __objc_sparse_lookup_id = "Method lookup uses sparse arrays";
...@@ -111,13 +110,11 @@ objc_msg_lookup_super (Super_t super, SEL sel) ...@@ -111,13 +110,11 @@ objc_msg_lookup_super (Super_t super, SEL sel)
} }
retval_t retval_t
objc_msg_sendv(id object, SEL op, size_t frame_size, af_frame arg_frame) objc_msg_sendv(id object, SEL op, size_t frame_size, arglist_t arg_frame)
{ {
#ifndef __ARGFRAME_DOES_NOT_WORK #ifdef __objc_frame_receiver
af_cum cum; __objc_frame_receiver(arg_frame) = object;
af_start (cum, arg_frame); __objc_frame_selector(arg_frame) = op;
af_put (arg_frame, cum, id, object);
af_put (arg_frame, cum, SEL, op);
return __builtin_apply((apply_t)get_imp(object->class_pointer, op), return __builtin_apply((apply_t)get_imp(object->class_pointer, op),
arg_frame, arg_frame,
frame_size); frame_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment