larsbrinkhoff / lbForth

Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
GNU General Public License v3.0
418 stars 112 forks source link

IE11 doesn't have imul #40

Closed larsbrinkhoff closed 7 years ago

larsbrinkhoff commented 7 years ago

The asm.js target doesn't work in IE11 due to a missing Math.imul.

Here's a replacement: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math/imul

larsbrinkhoff commented 7 years ago

@pipcet, does this look like the right fix?

pipcet commented 7 years ago

I think that would make the code invalid asm.js, and result in much slower execution on those engines that special-case asm.js.

So I think it makes more sense to either override it in run() or to redefine Math.imul globally.

larsbrinkhoff commented 7 years ago

It does seem slow. Maybe one second from "lbForth" to first "ok".