3 ms·
The branch always has to be taken if executing JavaScript, because otherwise how would you tell if the value was correct or not? You'd have to calculate it usin
by freeone3000 6y ago
The branch always has to be taken if executing JavaScript, because otherwise how would you tell if the value was correct or not? You'd have to calculate it using this method regardless and then compare!
- olliej 6y agoWhat are you defining as correct?
- freeone3000 6y ago"correct" in this case being consistent with the JavaScript specification.
- fred256 6y agoIf you always take a branch, it's not a branch. Or did you mean by "taken" that the branch instruction has to be executed regardless of whether the branch is taken or not?
- freeone3000 6y agoJavaScript JITs always emit this instruction when ToInt32 is required, since checking would be more expensive in user code. And the instruction always used the JS rounding method, since that's cheaper in silicon. I used branch since the parent used "branch".