Java: Local function pointer aliases for method metadata
Bryce McKinlay
mckinlay@redhat.com
Thu Aug 19 17:50:00 GMT 2004
Richard Henderson wrote:
>On Tue, Aug 17, 2004 at 09:34:48PM -0400, Bryce McKinlay wrote:
>
>
>>+ const char *alias_id = "LALIAS_";
>>+ int name_len;
>>+
>>+ /* Make the alias name by prepending alias_id. */
>>+ name_len = IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (method));
>>+ ptr = buf = alloca (strlen (alias_id) + name_len + 1);
>>+ strcpy (ptr, alias_id);
>>+ ptr += strlen (alias_id);
>>+ strcpy (ptr, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (method)));
>>+ ptr += name_len;
>>+ *ptr = '\0';
>>
>>
>
>You want to use ASM_GENERATE_INTERNAL_LABEL so that the symbol
>is of a form that is interpreted by the assembler as a temporary.
>This way the symbol isn't retained in the .o file, or copied to
>the executable.
>
>This isn't actively wrong, but you can save a bit o space.
>
>
Thanks - is it ok to use the target method's full asm name for the
"prefix" argument to ASM_GENERATE_INTERNAL_LABEL, or should this really
be a short prefix? Using the full name makes reading/debugging the asm a
little easier.
Bryce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcj-local-alias-3.patch
Type: text/x-patch
Size: 3961 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040819/e7457e57/attachment.bin>
More information about the Java-patches
mailing list