From: | kamal <kamalpr@hp.com> |
Newsgroups: | comp.compilers,comp.arch |
Date: | Wed, 10 Dec 2008 23:39:24 -0800 (PST) |
Organization: | Compilers Central |
References: | 08-12-014 08-12-017 08-12-025 |
Keywords: | architecture, OOP |
Posted-Date: | 11 Dec 2008 04:27:29 EST |
On Dec 5, 1:39 pm, "Tony" <t...@my.net> wrote:
> "Michael Tiomkin" <t...@netvision.net.il> wrote in message
>
>
>
> > I do not see any connection between easy compilation of OO languages
> > and machine instructions - creating the actual code is one of the
> > easiest parts of a compiler. If you mean making the OO programs run
yes -compilation/code generation is not at all a bottleneck. I can
remember compilers like Cfront used to generate C code from C++ which
was then fed to the C compiler for best results (vis-a-vis C++->
assembly). The process of using an implicit pointer (this) to
reference object members is done at runtime and not at compile time.
> > faster, a different memory model can help very much.
Segmented memory can help, but the segments are very few in number and
large in size. The concept of segment has more to do with providing a
better way to position/fetch seperate parts of a program like text/
data which are few and larger in size.
> I was just pondering whether some of the OO mechanisms could move
> out of the language and into instructions, machine code or even
> processor architecture (the sky is the limit for this
> brainstorming). You said: "easy compilation". I am "at war" with
> vptrs (not to limit the discussion to just that though).
That would be encountered at runtime. Different architectures provide
dedicated registers so that we can have faster indirection. One
typical usage is TP (thread pointer) register so that one can access
TLS faster. You could use some registers to store a 'this' for an
object when its member functions are executed [assuming that is not
already implemented].
> To me, something seems "not right" with taking OO class objects and
> shoving a vptr into them. On the flip side, it "feels right" to me
> to push/pop args on/off the stack to implement functions. Maybe
> because we could be dealing with several objects in the same
> function, but only one function at a time?
regards
-kamal
Return to the
comp.compilers page.
Search the
comp.compilers archives again.