-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Experimental idea - create facility to enable internal commands within JS #6440
base: master
Are you sure you want to change the base?
Conversation
1c4ede3
to
e58e250
Compare
I've done some significant reworking on this:
Testing with ARES-6 in the benchmarks folder this seems to show some significant improvement ~8% gain - though could likely do with some more extensive testing to see how consistent that is. I'm not 100% if I've done the Jit parts right - I think I have but could do with someone who understands the Jit a little better giving it a look over. Open Questions
|
50d5555
to
7ac45e4
Compare
Note I've added a largely unrelated change: This test was always on the boundary of being too slow - though I would like to look at further optimisations to array.sort for long arrays. |
Giving this a bit more thought - one thing it needs which it currently doesn't have is specific tests for these internal commands including putting them through: |
Whilst working on tests I've reviewed a few scenarios - my jit handling needs more work, particularly for the GetLength op. |
While I intend to revisit this it is not planned for our first community release, so not planning to merge it this month - leaving open as draft. |
This PR introduces the concept of an internal command, something that could be used in self-hosted JS and in testing environments to pass a command to the engine within a JS file that is not normal JS.
This is illustrated with an example that allows the use of the bytecode operation for object coercion within the JsBuiltins instead of calling the object constructor to accomplish the same.
Broader use of this feature would require implementing specific commands for it to make use of which could include both facilities for JsBuiltins we don't wish to use runtime methods for AND potentially testing features.
Opened as a draft PR at the moment for comment consideration - aware it would need some tidy up pre-merge; also should probably not be merged without a bigger use case than object coercion.
Currently this does the folowing:
@@
within a script, currently it can recognise @@Conv_Obj and @@Conv_Num - though the later is useless (it's resultant bytecode is identical to a unary plus) .