From: | =?ISO-8859-1?Q?Christoffer_Lern=F6?= <lerno@dragonascendant.com> |
Newsgroups: | comp.compilers |
Date: | Wed, 27 Aug 2008 11:12:12 -0700 (PDT) |
Organization: | Compilers Central |
References: | 08-08-050 08-08-060 08-08-065 |
Keywords: | optimize, OOP |
Posted-Date: | 28 Aug 2008 10:09:18 EDT |
On 25 Aug, 17:20, Paul Khuong <pkhu...@gmail.com> wrote:
> 1. Unless you have hardware tagged arithmetic support (e.g. SPARC),
> tagging fixnums with 0 saves a couple shifts during arithmetic. The
> downside is that you have to do one more addition for pointer
> operations that don't already add a constant offset. That's not bad at
> all, especially if the architecture you're targeting offers load/store-
> with-(constant-)offset instructions.
Speaking of raw pointers, is that the way to go?
I originally envisioned some sort of (compact) object table where what
I passed around was simply the index into that table rather than the
pointer itself.
Obviously this would mean another point of indirection whenever
accessing data, but I was thinking it would simplify things like
tracking all objects and maybe enable optimizations later on. It's
just an idea and I don't know if it has any real advantages.
I note that most implementations of object systems in C instead rely
on passing a pointer directly to the object struct. What are the
virtues of that approach, except for it being more C-ish?
/Christoffer
Return to the
comp.compilers page.
Search the
comp.compilers archives again.