aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir/inliner.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-02-19 20:29:16 +0100
committerlemon <lsof@mailbox.org>2026-02-19 20:29:16 +0100
commitad8067a1ab1871cf57936828fb1b40c15cd3349d (patch)
treead86757ae0f84f1fd7dd58373cdb4f50d7f036d6 /ir/inliner.c
parent1430f62ebed808458baccbdf0e41b806334ff704 (diff)
IR: just use an array for extended constants
The extra work of using a hashtable to intern them is probably unnecessary.
Diffstat (limited to 'ir/inliner.c')
-rw-r--r--ir/inliner.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ir/inliner.c b/ir/inliner.c
index 0853d26..2ce817b 100644
--- a/ir/inliner.c
+++ b/ir/inliner.c
@@ -4,7 +4,7 @@ struct savedfunc {
int mark;
uint ninstr;
struct instr *instrtab;
- struct xcon *conht;
+ struct xcon *contab;
struct call *calltab;
union ref **phitab;
struct block *entry;
@@ -82,7 +82,7 @@ maybeinlinee(struct function *fn)
} while ((b = b->lnext));
sv->instrtab = alloccopy(&savearena, instrtab, sizeof *instrtab * (sv->ninstr = ninstr), 0);
- sv->conht = alloccopy(&savearena, conht, sizeof *conht * (1<<12), 0); // HACK
+ sv->contab = alloccopy(&savearena, contab.p, sizeof *contab.p * contab.n, 0);
if (calltab.n) {
sv->calltab = alloccopy(&savearena, calltab.p, sizeof *calltab.p * calltab.n, 0);
for (int i = 0; i < calltab.n; ++i) {
@@ -104,9 +104,8 @@ maybeinlinee(struct function *fn)
static union ref
mapref(short *instrmap, struct savedfunc *sv, union ref r)
{
- int newcon(const struct xcon *con);
if (r.t == RTMP) return r.i = instrmap[r.i], r;
- if (r.t == RXCON) return r.i = newcon(&sv->conht[r.i]), r;
+ if (r.t == RXCON) return newxcon(&sv->contab[r.i]);
assert(r.t != RADDR);
assert(r.t != RSTACK);
return r;