[webkit-reviews] review granted: [Bug 220323] [WASM-References] Add optional default value parameter for Table.grow : [Attachment 417077] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 6 12:36:58 PST 2021


Yusuke Suzuki <ysuzuki at apple.com> has granted Dmitry <dbezhetskov at igalia.com>'s
request for review:
Bug 220323: [WASM-References] Add optional default value parameter for
Table.grow
https://bugs.webkit.org/show_bug.cgi?id=220323

Attachment 417077: Patch

https://bugs.webkit.org/attachment.cgi?id=417077&action=review




--- Comment #5 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 417077
  --> https://bugs.webkit.org/attachment.cgi?id=417077
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417077&action=review

r=me with EWS fix. LayoutTest contain reference-types tests for Tables. expect
files need to be rebaselined.

> Source/JavaScriptCore/ChangeLog:3
> +	   [WASM-References] Add optional default value parameter for
Table.grow

Let's change the title since this patch includes constructor and Table#set
support too.

> Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp:124
> +    JSValue jsWebAssemblyTableValue =
JSWebAssemblyTable::tryCreate(globalObject, vm, webAssemblyTableStructure,
wasmTable.releaseNonNull());

Let's just receive it as `JSWebAssemblyTable* jsWebAssemblyTableValue = ...`.

> Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp:129
> +	   JSWebAssemblyTable* table = jsDynamicCast<JSWebAssemblyTable*>(vm,
jsWebAssemblyTableValue);

Remove this line.

> Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp:98
> +	   return JSValue::encode(throwException(globalObject, throwScope,
createTypeError(globalObject, "WebAssembly.Table.prototype.grow expects the
second argument to be null or an instance of WebAssembly.Function"_s)));

Use `throwVMTypeError` instead.

> Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp:101
> +    if (!table->grow(delta, defaultValue))

Let's change the old code with throwVMTypeError.

> JSTests/ChangeLog:3
> +	   [WASM-References] Add optional default value parameter for
Table.grow

Ditto.


More information about the webkit-reviews mailing list