🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #923

Re: Large constants in RISC

#923
From: aph
Date: Tue, 24 Nov 2026 13:46
39 lines
3153 bytes
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
> Hmm... didn't think of that.  Indeed this could lead to actual
> addresses embedded in the code.  Then again, I'd expect most such JIT
> setups to want to keep most of those addresses in data rather than in
> the code so the GC can more easily trace through them.

GCs have not the slightest difficulty tracing through embedded
addresses. We use whatever form of address constants is fastest.

> So, we now have 3 suggested circumstances, but it's not clear if these
> occur enough to explain Andrew's experience.
> 
> Andrew, do you know what causes all those large constant addresses
> you're seeing?

Very common constants are classes used in expressions, such as

  new File("filename")

or casts between types

  File x = (File)anObject;

Casts are more common than is immediately apparent, because the
compiler inserts them when it can't prove the type of an object.

The other important case is metadata. We gather a lot of information
about running code: branch frequency, type frequency, and so on. Every
metadata address is a constant in the generated code. After a while,
code is recompiled and we use all the gathered informtion to drive
inlining and other optimizations.

[ We actually have two compilers. One is optimized to generate code as
fast as possible in order to gather metadata about the program, and
the other compiler optimizes everything, producing small code that
doesn't collect metadata. ]

Andrew.
Technical Details
Message-ID: <8OWcnVnljcStCJj2nZ2dnZfqnPqdnZ2d@supernews.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-4.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
References: <11d76uq$11cdc$1@paganini.bofh.team> <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team> <2026Nov14.201017@mips.complang.tuwien.ac.at> <6af911ea.18530156@news.eternal-september.org> <SYScnWsR3rgGWWP3nZ2dnZfqn_WdnZ2d@supernews.com> <jwv1p8hhqmy.fsf-monnier+comp.arch@gnu.org> <4m2MS.132607$Lt64.106487@fx41.iad> <jwvo6bidgit.fsf-monnier+comp.arch@gnu.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-4.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 24 Nov 2026 13:46:24 +0000
Sender: Andrew Haley <aph@li-f2cf9ecc-3241-11b2-a85c-b613f11f80f0.ibm.com>
From: aph@littlepinkcloud.invalid
Subject: Re: Large constants in RISC
Newsgroups: comp.arch
References: <11d76uq$11cdc$1@paganini.bofh.team> <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team> <2026Nov14.201017@mips.complang.tuwien.ac.at> <6af911ea.18530156@news.eternal-september.org> <SYScnWsR3rgGWWP3nZ2dnZfqn_WdnZ2d@supernews.com> <jwv1p8hhqmy.fsf-monnier+comp.arch@gnu.org> <4m2MS.132607$Lt64.106487@fx41.iad> <jwvo6bidgit.fsf-monnier+comp.arch@gnu.org>
User-Agent: tin/1.9.2-20070201 ("Dalaruan") (UNIX) (Linux/7.3.3-100.fc43.x86_64 (x86_64))
Message-ID: <8OWcnVnljcStCJj2nZ2dnZfqnPqdnZ2d@supernews.com>
Date: Tue, 24 Nov 2026 13:46:24 +0000
Lines: 39
X-Trace: sv3-GV4gTtjHkD3jXjSSW+ltpymZ1UgbMwVSqT1bL1y2kTRIDRUJ4qMFD5fYIhIZvF55fcNAkR6G75vUW3y!s7/f5GmrYdsYaARuMn5+7onaIxAbFqiJDbAJo8+bUktF3z8rXmNdpvDha2GL7YQcnF9mkl4Vv0JR!lbVSw2c8NJXq
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40