This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
I have been thinking about Objective-C dialect. I think Obj-C is simple and good, and if its `@selector' takes two arguments, class name and message name, then the method lookup mechanism is no more necessary because it becomes just an offset to method table that resolved in link phase.
+----------------------------+ FILE1.m => | File1.o | +-----------------------+ | +------------------------+ | | RootClass | | | | | | { | | | | | | classMethod_1 | | | | | | instanceMethod_1 | => | | 0 | | | instanceMethod_2 | => | | 1 | | | } | | | | | | | | | RootClassMAX | | | | | | => 2 | | +-----------------------+ | +------------------------+ | | | | | | | FILE2.m => | File2.o | +-----------------------+ | +------------------------+ | | SubClass: RootClass | | | | | | { | | | | | | classMethod_2 | | | | | | instanceMethod_3 | => | | RootClassMAX + 0 | | | instanceMethod_4 | => | | RootClassMAX + 1 | | | } | | | | | | | | | SubClassMAX | | | | | | => RootClassMAX + 2 | | +-----------------------+ | +------------------------+ | +----------------------------+ || \/
I found this description in GCC Internals info file.
------------------------------------------------------------------------ 11.7 Constant Expression Types ==============================
...
`(const:M EXP)' Represents a constant that is the result of an assembly-time arithmetic computation. The operand, EXP, is an expression that contains only constants (`const_int', `symbol_ref' and `label_ref' expressions) combined with `plus' and `minus'. However, not all combinations are valid, since the assembler cannot do arbitrary arithmetic on relocatable symbols.
M should be `Pmode'. ------------------------------------------------------------------------
Are there any plan to implement this facility as an extension to object file format?
I don't know the fact but I suppose why linker was originally
invented was to promise user to recompile only modified .c files, and this principal was broken with object oriented programming.
I think with this facility, simple OO language will be much cleaner than the current, because the offset of member variables or method table are resolved in link phase.
Please comment.
--- Mikiya Matsuzaka
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |