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)
Core
JavaScript Engine: JIT
Tracking
()
NEW
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.
Comment 1•11 years ago
|
||
C++11 added nicer initialization for all sorts of stuff... but afaict not unions. :(
Updated•9 years ago
|
Priority: -- → P5
Updated•3 years ago
|
Severity: normal → S3
Updated•1 year ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•