Re:Architecture for a JavaScript to C compiler
by chrisseaton on Thursday February 14, 2019 @03:02AM
(#19160367)
TypeScript lets you annotate that a parameter will only ever be a number, but the JIT can find that out for itself by seeing that it’s only ever a number when it runs the program and a number is all you pass to it, using stamps and class profiling. The JIT can also see types beyond that, like that it’s only ever a number and it’s always below 0xff, using stamps and value profiling. The JIT has to guard that the type is as expected, yes, but so would the static compiler in order to do the more specific types.
[ Parent
| on HN ]
There are no comments on this comment yet.