[kaffe] PATCH: consistently separate jitter and backend
register ID
Casey Marshall
rsdio@metastatic.org
Mon Mar 15 10:22:02 2004
--=-=-=
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>>>>> "Timothy" == Timothy Stack <stack@cs.utah.edu> writes:
>> > Working on the MIPS JIT3 I have made some small changes to the >
>> architechture-independent register code for JIT3 that at least
>> allow > the MIPS JIT to pass all the tests in test/internal. To
>> summarize, > slotRegister now returns the `jitter ID' of the
>> assigned register (the > index into the reginfo array), instead of
>> the `backend ID'. All code > that depends on the former is
>> unchanged, and all code that depends on > the latter now uses a new
>> macro, `slotRegisterRegister', that is > equivalent to
>> slotRegister, but returns the backend ID.
>>
>> Okie, I'll take a look at this and check it in tonight/tomorrow
>> morning.
Timothy> I looked at the patch, but I'm not totally convinced its the
Timothy> right thing to do...
Me neither. I instead changed `slotAlias' to use regno, and not the
return value of `slotRegister'.
However, I tried something similar to this on x86 and it didn't
work. I haven't tried this approach (attached) on x86 yet.
Timothy> I'd really prefer something that had stronger typing so that
Timothy> these mistakes don't continue to happen. For example, the
Timothy> x86 backend mixes up uses of the jitter ID for a register and
Timothy> the backend ID. Its a little trivial, but still...
I'm in favor of Kevin's idea of renaming one of the two `regno'
members in the two structs (`kregs' and `SlotData').
Cheers,
- --
Casey Marshall || rsdio@metastatic.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>
iD8DBQFAVfHigAuWMgRGsWsRAsv9AJwL06bDJnTSYxJUfSkYGO4es9EFuwCfVKBI
LUqHxizwTTg9Kas4Q3p333Y=
=bx2x
-----END PGP SIGNATURE-----
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=slotAlias.patch
Index: kaffe/kaffevm/jit3/machine.c
===================================================================
RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/jit3/machine.c,v
retrieving revision 1.48
diff -u -r1.48 machine.c
--- kaffe/kaffevm/jit3/machine.c 8 Mar 2004 21:21:13 -0000 1.48
+++ kaffe/kaffevm/jit3/machine.c 15 Mar 2004 18:04:03 -0000
@@ -1115,6 +1115,9 @@
type = s->u[1].value.i;
from = s->u[2].slot;
+ if (from->regno == NOREG) {
+ slotRegister(from, type, rread, NOREG);
+ }
if (reginfo[from->regno].flags & Rreadonce) {
/*
* XXX Aggressively spill the floating point register on x86.
@@ -1138,7 +1141,7 @@
/* Get the register we're aliasing and attach the 'to' slot
* to it.
*/
- reg = slotRegister(from, type, rread, NOREG);
+ reg = from->regno;
reginfo[reg].refs++;
to->regno = reg;
to->modified = rwrite;
--=-=-=--