4 Mar
2011
4 Mar
'11
1:37 p.m.
Hi, I found something interesting in the v8 source code. They store the true and false as integers: 1 and 0. Actually it was a surprise to me, but "true + 1" is "2" in JavaScript, so this kind of object handling seems ok. Advantage of their approach: they don't need to care about boolean values for all arithmetic and conditional operations in JIT. This could reduce the source code (maintainability), and probably faster, since you don't need to check boolean values. Disadvantage: type resolving is a bit more difficult, but since that is a rare operation, I think the gain could be bigger. What is your opinion about it? Would it be possible to implement something like this for JSValue32_64? Would it worth it? Regards, Zoltan