Skip to content

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`.
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.

Thank you!

@filiptibell filiptibell merged commit 6cd0234 into lune-org:main Mar 24, 2025
6 checks passed
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