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

refactor: calculate address first before cond operation #57

Merged

Conversation

xxuejie
Copy link
Collaborator

@xxuejie xxuejie commented May 18, 2019

Previously, we were doing the cond operation first on the PC offsets,
then add the base PC address to form the final AST node. The problem
with this, is that the base PC addresses and offsets are both
immediate values in most instructions. So we can just calculate the
final PC addresses first, then apply the cond operation. In a normal
interpreter this won't matter, but for JIT or AOT implementation, this
makes sure we can have simpler AST node to apply optimizations

Previously, we were doing the cond operation first on the PC offsets,
then add the base PC address to form the final AST node. The problem
with this, is that the base PC addresses and offsets are both
immediate values in most instructions. So we can just calculate the
final PC addresses first, then apply the cond operation. In a normal
interpreter this won't matter, but for JIT or AOT implementation, this
makes sure we can have simpler AST node to apply optimizations
@xxuejie xxuejie requested a review from a team May 18, 2019 10:28
@xxuejie xxuejie merged commit 985f8a7 into nervosnetwork:develop May 18, 2019
@xxuejie xxuejie deleted the calculate-branch-address-first branch May 18, 2019 15:38
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