Skip to content

[capi] Fix i128Nanoseconds #372

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
Jun 24, 2025
Merged

[capi] Fix i128Nanoseconds #372

merged 2 commits into from
Jun 24, 2025

Conversation

Manishearth
Copy link
Contributor

@Manishearth Manishearth commented Jun 24, 2025

We were doing the math wrong for negative numbers; since there is no -0.

I've switched the representation over to two u64s. This is technically breaking for the capi, but I plan to handle the migration smoothly.

V8 CL: https://chromium-review.googlesource.com/c/v8/v8/+/6663150

pub struct I128Nanoseconds {
pub high: i64,
pub high: u64,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this is a breaking change for capi, but I've mitigated it in v8.

@linusg
Copy link

linusg commented Jun 24, 2025

Closes #352 (thanks!)

@nekevss nekevss merged commit 89bfca1 into boa-dev:main Jun 24, 2025
8 checks passed
@Manishearth Manishearth deleted the i128-fix branch June 24, 2025 15:30
hubot pushed a commit to v8/v8 that referenced this pull request Jun 24, 2025
temporal_capi had a bad representation of i128, and is switching to a
different one. Prepare for this change.

Until this point only positive nanosecond values was working correctly.

Note: this will not fully work until
boa-dev/temporal#372 lands, but this prepares
the codebase for that update.

Bug: 427190223
Change-Id: I6a6a69641a696bab0728ea0a9aa4271bcbc49207
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6663150
Reviewed-by: Jakob Kummerow <[email protected]>
Commit-Queue: Manish Goregaokar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#101008}
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