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

type function in lua #2201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

type function in lua #2201

wants to merge 2 commits into from

Conversation

Srlion
Copy link
Contributor

@Srlion Srlion commented Feb 3, 2025

This PR solves two issues:

  1. Small/Simple functions that make use of type don't get jitted because type is reintroduced as a normal C function so luajit just blacklists them from getting jitted.
  2. Beta Gmod bad jit performance garrysmod-issues#4100

I understand that it may be annoying to be implemented, but from looking at luajit source code, luajit already uses assembly for type function that is pushed to lua, so there won't be any need to modify lua_type and lua_typename C functions (modified by gmod) for this change to work.
All that needs to be done is just pushing the assembly version of type just like how luajit does it.

This type does it just like how lua_shared.dll does it:
image

image

@artemking4
Copy link

im sorry but why the actual fuck does type return "UserData" instead of "userdata"???

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