Skip to content

Optimize expandType for JS target #2148

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

Merged
merged 2 commits into from
Nov 18, 2021

Conversation

MaxGraey
Copy link
Member

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@MaxGraey MaxGraey requested a review from dcodeIO November 16, 2021 12:53
@dcodeIO
Copy link
Member

dcodeIO commented Nov 16, 2021

With this becoming more common, wdyt of moving these optimizations into a helper? Perhaps something like

export function i32_load(ptr: usize): i32 {
  return ASC_TARGET
    ? binaryen.__i32_load(ptr)
    : binaryen.HEAP32[ptr >> 2];
}

and always use this one instead?

@MaxGraey
Copy link
Member Author

I'm not sure. It may have some overhead on JS side

@dcodeIO
Copy link
Member

dcodeIO commented Nov 16, 2021

Yeah, depends on how well the JIT handles it. Seems rather trivial, though, perhaps it does?

@MaxGraey MaxGraey merged commit eddf08c into AssemblyScript:main Nov 18, 2021
@MaxGraey MaxGraey deleted the improve-binaryen-interop branch November 18, 2021 16:39
@MaxGraey
Copy link
Member Author

MaxGraey commented Nov 18, 2021

Merging. We could return to more granular approach later

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.

None yet

2 participants