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

Optimize by registering labels to the instruction that follows the label #783

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Aug 24, 2023

It brings a significant speed improvement by avoiding processing label opcodes during execution.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@pguyot pguyot force-pushed the w34/optimize-by-offsetting-labels branch from 75a9f1b to 000ce26 Compare September 2, 2023 04:30
@pguyot pguyot force-pushed the w34/optimize-by-offsetting-labels branch from 000ce26 to a5a2195 Compare October 16, 2023 20:08
@pguyot pguyot marked this pull request as ready for review October 16, 2023 20:08
Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm understanding this change, since it changes code inside #ifdef IMPL_CODE_LOADER block.

@pguyot
Copy link
Collaborator Author

pguyot commented Oct 23, 2023

That's the point indeed.

This PR consists in changing the address of labels at load time. Instead of having labels point to the label opcode, they are point to the opcode that follows.

As a result, when executing a branch to a label, the label opcode is no longer executed. During execution, label opcodes are noop but require decoding.

@bettio bettio merged commit 9aab333 into atomvm:master Oct 25, 2023
83 checks passed
@pguyot pguyot deleted the w34/optimize-by-offsetting-labels branch October 26, 2023 04:16
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.

2 participants