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

64 bit LEB128 constant encoding #78

Merged
merged 13 commits into from
Feb 6, 2018
Merged

64 bit LEB128 constant encoding #78

merged 13 commits into from
Feb 6, 2018

Conversation

ballercat
Copy link
Owner

@ballercat ballercat commented Feb 4, 2018

The constant encoding for 64-bit integers/floats is non-existent and is done via runtime typecasts instead. This is work to fix that.

Fixing some things while here.

  • Expressions no longer parse function calls, hackily
  • Speed up travis builds a bit

@coveralls
Copy link

coveralls commented Feb 4, 2018

Coverage Status

Coverage increased (+0.2%) to 96.075% when pulling 0f79c01 on 64-bit-leb128 into c341437 on master.

}
export function test(): i32 {
return number(): i32;
}
`).then(result => t.is(result.instance.exports.test(), 0));
`).then(result => t.is(result.instance.exports.test(), 42));
Copy link

@xtuc xtuc Feb 6, 2018

Choose a reason for hiding this comment

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

Just for my information, the test function is doing a conversion from i64 to i32? Is this your technique to test 64 bits ints in js?

I like how TypeScript explicitly does it: number() as i32 (just an idea).

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, but 64-bit nums are tested indirectly. If that encoding failed, then the data would be garbage or the program wouldn't compile at runtime.

The : is a type cast operator borrowed from flow

@ballercat ballercat changed the title WIP: 64 bit LEB128 constant encoding 64 bit LEB128 constant encoding Feb 6, 2018
@ballercat ballercat merged commit c3bf85a into master Feb 6, 2018
@ballercat ballercat deleted the 64-bit-leb128 branch February 6, 2018 16:07
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.

3 participants