RFA: Changes to interpreter to avoid non-debugging slowdown

Kyle Galloway kgallowa@redhat.com
Thu Aug 3 13:45:00 GMT 2006


Tom Tromey wrote:
>>>>>> "Kyle" == Kyle Galloway <kgallowa@redhat.com> writes:
>>>>>>             
>
> Kyle> I noticed a small error in my last patch.  I accidentally whacked out an
> Kyle> include in stacktrace.cc which will cause some problems.  The new patch
> Kyle> is included in this file.
>
> We're very close :-)
>
> Kyle> +#define STOREA(I) 		\
> Kyle> +DEBUG_LOCALS_INSN(I, 'o')	\
> Kyle> +locals[I].o = (--sp)->o
>
> It is more normal C style to make these kinds of macros "statement
> like", so that users can use them without recalling exactly how they
> expand.  So you'd write something like:
>
> #define STOREA(I)              \
>   do {                         \
>     DEBUG_LOCALS_INSN(I, 'o'); \
>     locals[I].o = (--sp)->o;   \
>   } while (0)
>
> This approach lets STOREA be used in an 'if' without remembering
> whether it needs braces.
>   
Ok, I've changed that now.
> Kyle> +#define DEBUG
> Kyle> +#undef DEBUG_LOCALS_INSN
> Kyle> +#define DEBUG_LOCALS_INSN(s, t) {}
>  
> Likewise here, DEBUG_LOCALS_INSN could be 'do {} while (0)'.
>
> I notice neither definition of DEBUG_LOCALS_INSN does anything... I
> presume that will follow?
>   
I decided to isolate the split from any extra stuff that needs to be 
added by doing it in 2 seperate patches.  Once this one goes in, I will 
submit another to fill in DEBUG_LOCALS_INSN for the debugging case.

Kyle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 120685 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060803/70251d71/attachment.bin>


More information about the Java-patches mailing list