Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix empty TypedArray creation#278

Merged
kateinoigakukun merged 1 commit into
mainswiftwasm/JavaScriptKit:mainfrom
katei/fix-empty-typed-arrayswiftwasm/JavaScriptKit:katei/fix-empty-typed-arrayCopy head branch name to clipboard
Dec 8, 2024
Merged

Fix empty TypedArray creation#278
kateinoigakukun merged 1 commit into
mainswiftwasm/JavaScriptKit:mainfrom
katei/fix-empty-typed-arrayswiftwasm/JavaScriptKit:katei/fix-empty-typed-arrayCopy head branch name to clipboard

Conversation

@kateinoigakukun

Copy link
Copy Markdown
Member

Close swiftwasm/swift#5599

Empty array instances share the same storage for all element types, so their baseAddress can be unaligned. (It seems the empty array storage had been placed at 8-aligned position fortunately but it's no longer the case since Swift 6.0, I guess)

https://github.com/swiftlang/swift/blob/2914d0e46eda33cadfd81c3381e8737855ce397c/stdlib/public/stubs/GlobalObjects.cpp#L42

@github-actions

github-actions Bot commented Dec 8, 2024

Copy link
Copy Markdown

Time Change: +260ms (2%)

Total Time: 9,837ms

Test name Duration Change
Serialization/JavaScript function call from Swift 116ms +9ms (7%) 🔍
Serialization/Swift Int to JavaScript with assignment 354ms +32ms (9%) 🔍
Serialization/JavaScript Number to Swift Int 317ms +17ms (5%) 🔍
Serialization/Swift String to JavaScript with assignment 393ms +20ms (5%) 🔍
View Unchanged
Test name Duration Change
Serialization/JavaScript function call through Wasm import 20ms -1ms
Serialization/JavaScript function call through Wasm import with int 14ms -0ms
Serialization/Swift Int to JavaScript with call 1,071ms +51ms (4%)
Serialization/Swift String to JavaScript with call 1,118ms +39ms (3%)
Serialization/JavaScript String to Swift String 3,775ms +109ms (2%)
Object heap/Increment and decrement RC 2,647ms -16ms (0%)
View Baselines
Test name Duration
Serialization/Call JavaScript function directly 3ms
Serialization/Assign JavaScript number directly 3ms
Serialization/Call with JavaScript number directly 3ms
Serialization/Write JavaScript string directly 2ms
Serialization/Call with JavaScript string directly 2ms

@ephemer

ephemer commented Dec 9, 2024

Copy link
Copy Markdown

Thank you for this change!

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.

Base address of every empty array seems to be the same: issues where type alignment > word size

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.