diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-09-01 11:08:40 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-01 12:16:21 +0000 |
commit | 03c549e0392f92c02536d3f86d5e1d8dfa3435ac (patch) | |
tree | fe49d170a929b34ba82cd10db1a0bd8e3760fa4b /chromium/v8/src/builtins/wasm.tq | |
parent | 5d013f5804a0d91fcf6c626b2d6fb6eca5c845b0 (diff) | |
download | qtwebengine-chromium-03c549e0392f92c02536d3f86d5e1d8dfa3435ac.tar.gz |
BASELINE: Update Chromium to 91.0.4472.160
Change-Id: I0def1f08a2412aeed79a9ab95dd50eb5c3f65f31
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/builtins/wasm.tq')
-rw-r--r-- | chromium/v8/src/builtins/wasm.tq | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/chromium/v8/src/builtins/wasm.tq b/chromium/v8/src/builtins/wasm.tq index 970fbd08629..05a15162040 100644 --- a/chromium/v8/src/builtins/wasm.tq +++ b/chromium/v8/src/builtins/wasm.tq @@ -11,6 +11,10 @@ extern runtime WasmTableInit( Context, WasmInstanceObject, Object, Object, Smi, Smi, Smi): JSAny; extern runtime WasmTableCopy( Context, WasmInstanceObject, Object, Object, Smi, Smi, Smi): JSAny; +extern runtime WasmTableFill( + Context, WasmInstanceObject, Smi, Smi, Object, Smi): JSAny; +extern runtime WasmTableGrow( + Context, WasmInstanceObject, Smi, Object, Smi): Smi; extern runtime WasmFunctionTableGet( Context, WasmInstanceObject, Smi, Smi): JSAny; extern runtime WasmFunctionTableSet( @@ -39,7 +43,10 @@ extern macro Allocate(intptr, constexpr AllocationFlag): HeapObject; } namespace wasm { -const kFuncTableType: constexpr int31 generates 'wasm::HeapType::kFunc'; +const kExternTableType: constexpr int31 + generates 'wasm::kWasmExternRef.raw_bit_field()'; +const kExternNonNullTableType: constexpr int31 + generates 'wasm::kWasmExternNonNullableRef.raw_bit_field()'; extern macro WasmBuiltinsAssembler::LoadInstanceFromFrame(): WasmInstanceObject; @@ -113,6 +120,34 @@ builtin WasmTableCopy( } } +builtin WasmTableFill( + table: Smi, startRaw: uint32, countRaw: uint32, value: Object): JSAny { + try { + const instance: WasmInstanceObject = LoadInstanceFromFrame(); + const start: Smi = + Convert<PositiveSmi>(startRaw) otherwise TableOutOfBounds; + const count: Smi = + Convert<PositiveSmi>(countRaw) otherwise TableOutOfBounds; + tail runtime::WasmTableFill( + LoadContextFromInstance(instance), instance, table, start, value, + count); + } label TableOutOfBounds deferred { + tail ThrowWasmTrapTableOutOfBounds(); + } +} + +builtin WasmTableGrow(table: Smi, deltaRaw: uint32, value: Object): Smi { + try { + const instance: WasmInstanceObject = LoadInstanceFromFrame(); + const delta: Smi = + Convert<PositiveSmi>(deltaRaw) otherwise TableOutOfBounds; + tail runtime::WasmTableGrow( + LoadContextFromInstance(instance), instance, table, value, delta); + } label TableOutOfBounds deferred { + return -1; + } +} + builtin WasmTableGet(tableIndex: intptr, index: int32): Object { const instance: WasmInstanceObject = LoadInstanceFromFrame(); const entryIndex: intptr = ChangeInt32ToIntPtr(index); @@ -159,8 +194,12 @@ builtin WasmTableSet(tableIndex: intptr, index: int32, value: Object): Object { // Fall back to the runtime to set funcrefs, since we have to update // function dispatch tables. + // TODO(7748): Update this if further table types are supported. const tableType: Smi = table.raw_type; - if (tableType == SmiConstant(kFuncTableType)) goto CallRuntime; + if (tableType != SmiConstant(kExternTableType) && + tableType != SmiConstant(kExternNonNullTableType)) { + goto CallRuntime; + } const entriesCount: intptr = Convert<intptr, Smi>(table.current_length); if (entryIndex >= entriesCount) goto IndexOutOfRange; @@ -373,15 +412,13 @@ transitioning builtin WasmGetOwnProperty(implicit context: Context)( try { TryHasOwnProperty( receiver, receiver.map, receiver.instanceType, uniqueName) - otherwise Found, NotFound, Bailout; + otherwise Found, NotFound, NotFound; } label Found { tail GetPropertyWithReceiver( receiver, uniqueName, receiver, SmiConstant(kReturnUndefined)); } } label NotFound deferred { return Undefined; - } label Bailout deferred { - unreachable; } } |