Skip to content
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

Added specialized bytecodes with common constants #25

Merged
merged 11 commits into from
Jul 23, 2021

Conversation

smarr
Copy link
Member

@smarr smarr commented Jul 23, 2021

The PR adds:

  • push_frame/pop_frame to access indexes 0, 1, and 2
  • push_inner/pop_inner to access indexes 0, 1, and 2
  • push_field/pop_field to access indexes 0 and 1
  • push_constant/pop_constant to access indexes 0, 1, and 2
  • push_0, push_1, push_nil which push the corresponding constants

Performance impact is minimal. This might reduce run time on the SomSom benchmarks by 2%.

https://rebench.stefan-marr.de/compare/RPySOM/1439149b558ac2b722eea02f2843e69f11ded684/6f840bdb10f46872c2df340a482d767e9eca0116

smarr added 11 commits July 22, 2021 22:01
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
…nually

Signed-off-by: Stefan Marr <git@stefan-marr.de>
These bytecodes are very common and may benefit from specialization in the interpreter.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
These are common bytecodes, which we specialize to increase interpreter performance.

Note that I don't change the bytecode length for these, even so we only need 1 byte.
Though, because these are quickened into place, it's easier to keep them at 3 bytes.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Removing this is mostly about performance, which is a little unfortunate.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
The bytecode profile indicates only 0 and 1 as common literals.
There are a few others, but those are really benchmark specific.
I added `nil` even though it's not super common, but it may be useful.

Give the varity of constants that are pushed, having push_constant_0..2 seems useful as a short cut and shorter version of the standard bytecode.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr smarr merged commit d8b507d into SOM-st:master Jul 23, 2021
@smarr smarr deleted the bytecodes-with-common-params branch July 23, 2021 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant