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

Split runtime into multiple files#150

Merged
j-f1 merged 22 commits into
mainswiftwasm/JavaScriptKit:mainfrom
jed/runtime-js-modulesswiftwasm/JavaScriptKit:jed/runtime-js-modulesCopy head branch name to clipboard
Jan 24, 2022
Merged

Split runtime into multiple files#150
j-f1 merged 22 commits into
mainswiftwasm/JavaScriptKit:mainfrom
jed/runtime-js-modulesswiftwasm/JavaScriptKit:jed/runtime-js-modulesCopy head branch name to clipboard

Conversation

@j-f1

@j-f1 j-f1 commented Jan 8, 2022

Copy link
Copy Markdown
Member

This PR:

  • splits the runtime TypeScript code up into several separate modules
  • adds Rollup to compile that back into a single JS file
  • uses Rollup to produce two bundles instead of one:
    • one that uses UMD to allow use with Node-style require, or by embedding it with a <script> tag and using window.JavaScriptKit
    • one that uses ES Modules
  • refactor the codebase to use a Memory class that provides easy access to memory and the heap
  • check for FinalizationRegistry availability in SwiftClosureDeallocator constructor rather than outside of it

@github-actions

github-actions Bot commented Jan 8, 2022

Copy link
Copy Markdown

Time Change: -307ms (3%)

Total Time: 8,905.5ms

Test name Duration Change
Object heap/Increment and decrement RC 2,731.25ms -223ms (8%)
ℹ️ View Unchanged
Test name Duration Change
Serialization/Write JavaScript number directly 196ms -6ms (3%)
Serialization/Write JavaScript string directly 200.25ms -4.5ms (2%)
Serialization/Swift Int to JavaScript 2,983.75ms +2.75ms (0%)
Serialization/Swift String to JavaScript 2,794.25ms -76.25ms (2%)

performance-action

@kateinoigakukun

Copy link
Copy Markdown
Member

Some tests are failing 👀

Error in Literal Conversion

MessageError(message: "Expect to be equal \"212205744152385\" and \"4746794007244308480\"", file: "/home/runner/work/JavaScriptKit/JavaScriptKit/IntegrationTests/TestSuites/Sources/PrimaryTests/main.swift", line: 26, column: 28)

Swift/ErrorType.swift:200: Fatal error: Error raised at top level: PrimaryTests.MessageError(message: "Expect to be equal \"212205744152385\" and \"4746794007244308480\"", file: "/home/runner/work/JavaScriptKit/JavaScriptKit/IntegrationTests/TestSuites/Sources/PrimaryTests/main.swift", line: 26, column: 28)

RuntimeError: unreachable
    at $ss17_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_SSAHSus6UInt32VtF (wasm://wasm/02991d2a:wasm-function[2633]:0xccfd3)
    at swift_errorInMain (wasm://wasm/02991d2a:wasm-function[4819]:0x14b4ac)
    at main (wasm://wasm/02991d2a:wasm-function[1532]:0x76025)
    at main (wasm://wasm/02991d2a:wasm-function[29674]:0x622f25)
    at __main_void (wasm://wasm/02991d2a:wasm-function[29675]:0x622fa1)
    at __original_main (wasm://wasm/02991d2a:wasm-function[29672]:0x622ee6)
    at _start (wasm://wasm/02991d2a:wasm-function[45]:0x10884)
    at d.start (/home/runner/work/JavaScriptKit/JavaScriptKit/IntegrationTests/node_modules/@wasmer/wasi/lib/index.cjs.js:77:280)
    at startWasiTask (/home/runner/work/JavaScriptKit/JavaScriptKit/IntegrationTests/lib.js:47:10)

@j-f1

j-f1 commented Jan 24, 2022

Copy link
Copy Markdown
Member Author

It turned out to be an endianness issue, oof. Hoping this change fixes it 🤞

@j-f1 j-f1 requested a review from a team January 24, 2022 12:49
Comment thread Runtime/src/closure-heap.ts Outdated
Comment thread Runtime/src/types.ts
@MaxDesiatov MaxDesiatov requested a review from a team January 24, 2022 13:02

@MaxDesiatov MaxDesiatov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall seems legit 👍 but I'd wait for at least one more approval from the team

@MaxDesiatov MaxDesiatov requested a review from a team January 24, 2022 13:46
@j-f1 j-f1 merged commit 20c634a into main Jan 24, 2022
@j-f1 j-f1 deleted the jed/runtime-js-modules branch January 24, 2022 14:45
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

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