-
-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS backend: Using BigInt-literals for long-emulation #995
Comments
I'm not sure. For me there's one use case: I also run TeaVM-generated JS in Rhino. I'm not sure that Rhino supports BigInt literals.
Can you should your benchmarks with your changes? |
You can find the actual benchmark code as a teavm sample here. This is work-in-progress and might take a while to run. The most up to date changes to the long-emulation runtime are in the long-emulation branch. These have been rebased multiple times already and still include some changes that turned out to be worse than before. IIRC, Regarding Rhino: mozilla/rhino#837 appears to have implemented |
Managed to merge at least the result graphs into a single PDF: tests.pdf |
Since the legacy long-emulation layer has been removed (9f12917), TeaVM assumes
BigInt
to be available for the JS backend.Under this assumption, the JS environment should be able to parse source code that includes BigInt-literals (e.g.
1n
in addition toBigInt(1)
) without errors. I could not find any documentation of (common) JS runtimes that supportBigInt
s while not accepting literal notation.Some preliminary tests showed that using the literal syntax when translating Java's
long
literals can significantly improve the performance. Is there interest in a PR incorporating these changes?The text was updated successfully, but these errors were encountered: