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

Allow toggling Luau's JIT in the CLI #265

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

CompeyDev
Copy link
Contributor

Closes #257.

* Lune now accepts the `LUNE_LUAU_JIT` to toggle JIT compilation of Luau
  code.
* The `Runtime` struct exposes the `with_jit_enabled` method to library
  consumers.
Copy link
Collaborator

@filiptibell filiptibell left a comment

Choose a reason for hiding this comment

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

Looks good but will need some additional work to make sure that JIT does not get re-enabled after using the luau library, right now it is re-enabled unconditionally:

// Enable JIT if codegen is enabled and the environment hasn't
// changed, otherwise disable JIT since it'll fall back anyways
lua.enable_jit(options.codegen_enabled && !env_changed);
let function = chunk.into_function()?;
lua.enable_jit(true);

* Creates a new struct called `JitStatus` in lune_utils, which is placed
  in `AppData` during initialization.
* The luau built-in now respects the JIT preference by using
  `JitStatus`.
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.

Add a way to disable native codegen
2 participants