-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Memory64] Core JS runtime changes for 64-bit #15219
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for splitting this off! Much appreciated.
src/library.js
Outdated
__memory_base__import: true, | ||
// the wasm backend reserves slot 0 for the NULL function pointer | ||
__table_base: 1, | ||
__table_base: "new WebAssembly.Global({'value': '{{{ SIZE_TYPE }}}', 'mutable': false}, {{{ to64(1) }}})", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these three all be POINTER_TYPE since they store addresses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(in which case do we even needs SIZE_TYPE?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.
SIZE_TYPE is used in 9 other locations in the big PR.
@@ -480,7 +490,7 @@ function checkSafeHeap() { | |||
} | |||
|
|||
function getHeapOffset(offset, type) { | |||
if (Runtime.getNativeFieldSize(type) > 4 && type == 'i64') { | |||
if (!WASM_BIGINT && Runtime.getNativeFieldSize(type) > 4 && type == 'i64') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this will be no-op for wasm32 users of WASM_BIGINT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the test, yes :)
@@ -237,6 +237,7 @@ var MEMORY_GROWTH_LINEAR_STEP = -1; | |||
// the full end-to-end wasm64 mode, and 2 is wasm64 for clang/lld but lowered to | |||
// wasm32 in Binaryen (such that it can run on wasm32 engines, while internally | |||
// using i64 pointers). | |||
// Assumes WASM_BIGINT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we automatically set this? Maybe Implies WASM_BIGINT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we do, elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
const POINTER_BITS = POINTER_SIZE * 8; | ||
const POINTER_TYPE = 'i' + POINTER_BITS; | ||
|
||
const SIZE_TYPE = POINTER_TYPE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not obvious to me what this is. Is it for size_t
? Why do we need it? (It's not used anywhere)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were 10 occurrences in the big PR, so presumably those are used in the other small PRs.
No description provided.