Skip to content

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.

2 participants