Open Bug 1137980 Opened 11 years ago Updated 1 year ago

enable JSJitInfo ops to be type-checked harder by the compiler

Categories

(Core :: JavaScript Engine: JIT, enhancement, P5)

enhancement

Tracking

()

People

(Reporter: froydnj, Unassigned)

References

(Blocks 1 open bug)

Details

Currently in the bindings code, we have things like: static const JSJitInfo x_getterinfo = { { (JSJitGetterOp)get_x }, ... No matter what kind of thing this is jit info for, we cast the op to JSJitGetterOp, which handily defeats any type-checking the compiler might do for us. Folks adding things to bindings can sometimes get bit very hard by this. It's been a while since I looked at this, but I think the reason was that you have to initialize unions with the type of their first member. But that was partly because we were on old MSVC, and I think C++11 was supposed to improve the situation somewhat in this department. If C++11 hasn't improved things markedly, or the solution requires static constructors for every JSJitInfo, we should invent some gnarly type-checking macros + templates and use those instead.
C++11 added nicer initialization for all sorts of stuff... but afaict not unions. :(
Priority: -- → P5
Severity: normal → S3
Blocks: sm-runtime
Severity: S3 → N/A
Type: defect → enhancement
You need to log in before you can comment on or make changes to this bug.