Skip to content

wasm2c: Implement EHv4#2513

Merged
sbc100 merged 4 commits into
WebAssembly:mainfrom
SoniEx2:ehv4-wasm2c
Jan 18, 2025
Merged

wasm2c: Implement EHv4#2513
sbc100 merged 4 commits into
WebAssembly:mainfrom
SoniEx2:ehv4-wasm2c

Conversation

@SoniEx2

@SoniEx2 SoniEx2 commented Nov 20, 2024

Copy link
Copy Markdown
Collaborator

Continuation of #2470 / #2512

@SoniEx2

SoniEx2 commented Nov 20, 2024

Copy link
Copy Markdown
Collaborator Author

@sbc100 (this might still have some nits? can't remember. something about updating comments?)

@SoniEx2

SoniEx2 commented Nov 30, 2024

Copy link
Copy Markdown
Collaborator Author

@sbc100 should be good now

@SoniEx2

SoniEx2 commented Jan 12, 2025

Copy link
Copy Markdown
Collaborator Author

hello @shravanrn @keithw @sbc100 can anyone take a look at this?

@sbc100 sbc100 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.

Nice!

lgtm % comments

Comment thread wasm2c/wasm-rt-impl-tableops.inc Outdated
defined(WASM_RT_TABLE_OPS_EXNREF) > \
1
#error \
"Expected only one of { WASM_RT_TABLE_OPS_FUNCREF, WASM_RT_TABLE_OPS_EXTERNREF } to be defined"

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.

This error should now include WASM_RT_TABLE_OPS_EXNREF?

/**
* The maximum size of an exception.
*/
#define WASM_EXN_MAX_SIZE 256

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.

In practice I think this will normally just be a 4-byte pointer. So maybe 32 is enough for now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

256 is what we use today, so we just used that. we would prefer not to break compatibility with existing wasm2c exception handling users (assuming we have some).

Comment thread src/c-writer.cc Outdated
}

// static
constexpr bool CWriter::HasNonNullInitializers(Type type) {

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.

Since this is always using in the negative how about inverting it? i.e. "NullOnlyInitializers"?

@sbc100 sbc100 merged commit 46648b0 into WebAssembly:main Jan 18, 2025
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.

2 participants