Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 3.1.4
-
Component/s: Compiler: Optimizing
-
Labels:None
-
Number of attachments :
Description
We have a bunch of Magic.objectAsXXX methods. It would be nice to generalize these. We would like to be able to do:
RVMThread t = (RVMThread)Magic.eatCast(o);
instead of:
RVMThread t = Magic.objectAsThread(o);
since this results in fewer Magic methods. The semantics of eatCast would be as follows:
- ignored in baseline compiler (because we don't care about performance there, and this will be used in runtime code that is opt compiled anyway),
- any checkcast on the result of the eatCast() call is eliminated.
Included is a patch that appears to implement this. Please review if you have a chance. I'm using it in my branch but it would be nice to get this into the trunk to simplify work for others doing similar things as me.
If defining magic methods wasn't such an annoyance, then we wouldn't need this?
if one could just write:
and be done with it, then I'd think that we'd prefer that to eatCast.
Asking because this should be possible after the next couple steps of magic implementation re-working that I'm doing in support of the VEE'09 paper.
It's a shame that type erasure prevents us from writing