public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: question about interpreter
  2000-04-01  0:00 ` Jeff Sturm
  2000-04-01  0:00   ` Tom Tromey
@ 2000-04-01  0:00   ` Kresten Krab Thorup
  1 sibling, 0 replies; 4+ messages in thread
From: Kresten Krab Thorup @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: tromey, Java Discuss List

Jeff Sturm <jsturm@sigma6.com> writes:

> Tom Tromey wrote:
> >     #define LOADL(I)  ({ jint __idx = (I); \
> >         (sp++)->ia[0] = locals[__idx].ia[0]; \
> >         (sp++)->ia[0] = locals[__idx+1].ia[0]; \
> >      })
> 
> Why not use inline functions instead?  C++ was supposed to eliminate the
> preprocessor for most uses.  These macros aren't used in any C code,
> after all...

I did this originally (used inline functions) but this resulted in a
huge stack frame for the interpreter main-loop function.  If this as
improved since June 99, then clearly it would be great to use inline
functions.

-- Kresten

 Kresten Krab Thorup           "I like my eggs ploded"
 Department of Computer Science, University of Aarhus
 Aabogade 34, DK-8200 Aarhus N, Denmark
 +45 8942 5665 (office), +45 2343 4626 (mobile)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about interpreter
  2000-04-01  0:00 ` Jeff Sturm
@ 2000-04-01  0:00   ` Tom Tromey
  2000-04-01  0:00   ` Kresten Krab Thorup
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: tromey, Java Discuss List, Kresten Krab Thorup

>>>>> "Jeff" == Jeff Sturm <jsturm@sigma6.com> writes:

Jeff> Why not use inline functions instead?  C++ was supposed to
Jeff> eliminate the preprocessor for most uses.

Until recently, C++ inline functions weren't as fast as macros in all
cases.  Now that g++ inlines at the tree level, I agree.  Old
habits...

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* question about interpreter
@ 2000-04-01  0:00 Tom Tromey
  2000-04-01  0:00 ` Jeff Sturm
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Java Discuss List; +Cc: Kresten Krab Thorup

In the interpreter code I see defines like this:

    #define LOADL(I)  ({ jint __idx = (I); \
	(sp++)->ia[0] = locals[__idx].ia[0]; \
	(sp++)->ia[0] = locals[__idx+1].ia[0]; \
     })

As far as I can tell all uses of this macro (and those like it) are
statements and not expressions.  Is there a reason we're using ({...})
and not simply {...}?  This causes many warnings ("value computed not
used") from gcc.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: question about interpreter
  2000-04-01  0:00 question about interpreter Tom Tromey
@ 2000-04-01  0:00 ` Jeff Sturm
  2000-04-01  0:00   ` Tom Tromey
  2000-04-01  0:00   ` Kresten Krab Thorup
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Sturm @ 2000-04-01  0:00 UTC (permalink / raw)
  To: tromey; +Cc: Java Discuss List, Kresten Krab Thorup

Tom Tromey wrote:
>     #define LOADL(I)  ({ jint __idx = (I); \
>         (sp++)->ia[0] = locals[__idx].ia[0]; \
>         (sp++)->ia[0] = locals[__idx+1].ia[0]; \
>      })

Why not use inline functions instead?  C++ was supposed to eliminate the
preprocessor for most uses.  These macros aren't used in any C code,
after all...

-- 
Jeff Sturm
jsturm@sigma6.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-01  0:00 question about interpreter Tom Tromey
2000-04-01  0:00 ` Jeff Sturm
2000-04-01  0:00   ` Tom Tromey
2000-04-01  0:00   ` Kresten Krab Thorup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).