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

Support long jumps inside an expression #248

Closed
danysirota opened this issue Jun 26, 2022 · 2 comments
Closed

Support long jumps inside an expression #248

danysirota opened this issue Jun 26, 2022 · 2 comments
Labels

Comments

@danysirota
Copy link

We are generating really long expressions (>1MB) and using conditionals there that can cause more than 64KB jumps.
Today, the args of the opcodes are 2 bytes and long jumps are truncated to this size.
When running the expression, the VM jumps (actual_offset % 64Kb) and runs invalid opcodes.

@antonmedv
Copy link
Member

Wow! Such a big expression. Amazing) So, yes. this is a limitation of the current VM.

I see to possible solutions:

  1. Use bigger opcodes (this will require proper benchmarking to make sure be op size performance as the same level).
  2. Or panic on trying to generate too big jump.

@antonmedv antonmedv added the bug label Oct 16, 2022
@antonmedv
Copy link
Member

Fixed! I refactored vm. Now it uses int for args. So, jumps can be really long. Also it got 50% faster).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants