From 05489d6e05a25ff4ba18ac6549ffed5a6b42985d Mon Sep 17 00:00:00 2001 From: sergei Date: Mon, 30 Dec 2013 11:51:57 +0000 Subject: [PATCH] * SPARC: fixed g_intf_wrapper for non-virtual methods once again, my initial assumption was not correct: a wrapper does not necessarily reference methods from the class that implements the interface, it may be methods from parent classes, which can be located arbitrarily far away in address space. Now using code from g_external_wrapper, which has no distance limit and is only one instruction longer. git-svn-id: trunk@26319 - --- compiler/sparc/cgcpu.pas | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/compiler/sparc/cgcpu.pas b/compiler/sparc/cgcpu.pas index 81c2c67bca..0ad941ee6d 100644 --- a/compiler/sparc/cgcpu.pas +++ b/compiler/sparc/cgcpu.pas @@ -1308,15 +1308,7 @@ implementation list.Concat(TAiCpu.Op_none(A_NOP)); end else - begin - { Emit a branch, which is PIC-safe, but limited to 8 MByte range on SPARC. - Since interface wrappers are always located in the same unit with - their target methods, this limit applies (roughly) to code size of single - unit, not to entire program. It looks like a reasonable tradeoff. - If distance limit is ever exceeded, consider changing high-level compiler - logic to emit wrappers near target methods, not at the end of unit. } - a_jmp_name(list,procdef.mangledname); - end; + g_external_wrapper(list,procdef,procdef.mangledname); List.concat(Tai_symbol_end.Createname(labelname)); end;