WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-210302-20201115023531.patch (text/plain), 13.19 KB, created by
Sergey Rubanov
on 2020-11-14 15:35:33 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sergey Rubanov
Created:
2020-11-14 15:35:33 PST
Size:
13.19 KB
patch
obsolete
>Subversion Revision: 269810 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index b1193aee0d2c36895d5828525787e4b5b33cfaf6..5d55ed643bd4ebdea92b0dea78fc0a4f27f3518d 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,21 @@ >+2020-11-14 Sergey Rubanov <chi187@gmail.com> >+ >+ Add support for the Wasm sign-extension-ops proposal >+ https://bugs.webkit.org/show_bug.cgi?id=210302 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * llint/LowLevelInterpreter.asm: >+ * llint/WebAssembly.asm: >+ * offlineasm/arm64.rb: >+ * offlineasm/cloop.rb: >+ * offlineasm/instructions.rb: >+ * offlineasm/x86.rb: >+ * wasm/WasmAirIRGenerator.cpp: >+ (JSC::Wasm::AirIRGenerator::addOp<OpType::I32Extend8S>): >+ (JSC::Wasm::AirIRGenerator::addOp<OpType::I32Extend16S>): >+ * wasm/wasm.json: >+ > 2020-11-13 Xan López <xan@igalia.com> > > [JSC] Use symbols as identifiers for class fields computed names storage >diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm >index 83e24a08210b95eb87003bcee1683a098a8f4867..20160507ee4c8138473ccaaada6b33cb906dd0db 100644 >--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm >+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm >@@ -29,9 +29,9 @@ > # comparisons are in-order, so "if (a < b)" is written as > # "bilt a, b, ...". > # >-# - "b" = byte, "h" = 16-bit word, "i" = 32-bit word, "p" = pointer. >-# For 32-bit, "i" and "p" are interchangeable except when an op supports one >-# but not the other. >+# - "b" = byte, "h" = 16-bit word, "i" = 32-bit word, "q" = 64-bit word, >+# "f" = float, "d" = double, "p" = pointer. For 32-bit, "i" and "p" are >+# interchangeable except when an op supports one but not the other. > # > # - In general, valid operands for macro invocations and instructions are > # registers (eg "t0"), addresses (eg "4[t0]"), base-index addresses >diff --git a/Source/JavaScriptCore/llint/WebAssembly.asm b/Source/JavaScriptCore/llint/WebAssembly.asm >index 8bffc8a697d2e6e4f20de96405a5f3d24f8a1ebc..83ca89652b6667dfd0a63c6125308b684b07c125 100644 >--- a/Source/JavaScriptCore/llint/WebAssembly.asm >+++ b/Source/JavaScriptCore/llint/WebAssembly.asm >@@ -2042,6 +2042,18 @@ wasmOp(i64_extend_u_i32, WasmI64ExtendUI32, macro(ctx) > returnq(ctx, t1) > end) > >+wasmOp(i32_extend8_s, WasmI32Extend8S, macro(ctx) >+ mloadi(ctx, m_operand, t0) >+ sxb2i t0, t1 >+ returnq(ctx, t1) >+end) >+ >+wasmOp(i32_extend16_s, WasmI32Extend16S, macro(ctx) >+ mloadi(ctx, m_operand, t0) >+ sxh2i t0, t1 >+ returnq(ctx, t1) >+end) >+ > wasmOp(f32_convert_s_i32, WasmF32ConvertSI32, macro(ctx) > mloadi(ctx, m_operand, t0) > ci2fs t0, ft0 >diff --git a/Source/JavaScriptCore/offlineasm/arm64.rb b/Source/JavaScriptCore/offlineasm/arm64.rb >index 10d575973a2650ad2aedc3c41e272cdd1d61056e..d61108c67e4b280a40747d2cef1532c1b371c5cd 100644 >--- a/Source/JavaScriptCore/offlineasm/arm64.rb >+++ b/Source/JavaScriptCore/offlineasm/arm64.rb >@@ -82,6 +82,10 @@ def arm64GPRName(name, kind) > raise "bad GPR name #{name}" unless name =~ /^x/ > number = name[1..-1] > case kind >+ when :byte >+ "b" + number >+ when :half >+ "h" + number > when :word > "w" + number > when :ptr >@@ -887,6 +891,10 @@ class Instruction > emitARM64("uxtw", operands, [:word, :ptr]) > when "zxi2q" > emitARM64("uxtw", operands, [:word, :quad]) >+ when "sxb2i" >+ emitARM64("sxtb", operands, [:byte, :word]) >+ when "sxh2i" >+ emitARM64("sxth", operands, [:half, :word]) > when "nop" > $asm.puts "nop" > when "bieq", "bbeq" >diff --git a/Source/JavaScriptCore/offlineasm/cloop.rb b/Source/JavaScriptCore/offlineasm/cloop.rb >index 1ac46ae5af360cd67499ba118f5da8993d4ac00c..c1d082bfb4de5b2c93f1be05292f033cadf83f5c 100644 >--- a/Source/JavaScriptCore/offlineasm/cloop.rb >+++ b/Source/JavaScriptCore/offlineasm/cloop.rb >@@ -742,6 +742,10 @@ class Instruction > $asm.putc "#{operands[1].clLValue(:int64)} = #{operands[0].clValue(:int32)};" > when "zxi2q" > $asm.putc "#{operands[1].clLValue(:uint64)} = #{operands[0].clValue(:uint32)};" >+ when "sxb2i" >+ $asm.putc "#{operands[1].clLValue(:int32)} = #{operands[0].clValue(:int32)};" >+ when "sxh2i" >+ $asm.putc "#{operands[1].clLValue(:int32)} = #{operands[0].clValue(:int32)};" > when "nop" > $asm.putc "// nop" > when "bbeq" >diff --git a/Source/JavaScriptCore/offlineasm/instructions.rb b/Source/JavaScriptCore/offlineasm/instructions.rb >index 43c7d1bf8e69f308ed32a07db7cdfb91d13aa091..34f5c97b51ffe9b4806823242608a98599187c09 100644 >--- a/Source/JavaScriptCore/offlineasm/instructions.rb >+++ b/Source/JavaScriptCore/offlineasm/instructions.rb >@@ -141,6 +141,8 @@ MACRO_INSTRUCTIONS = > "move", > "sxi2q", > "zxi2q", >+ "sxb2i", >+ "sxh2i", > "nop", > "bieq", > "bineq", >diff --git a/Source/JavaScriptCore/offlineasm/x86.rb b/Source/JavaScriptCore/offlineasm/x86.rb >index 3753151f6a5c18443e34cee6847624e7e0f7cf15..81930629a407659bc5e0b352a26d241ae621af1a 100644 >--- a/Source/JavaScriptCore/offlineasm/x86.rb >+++ b/Source/JavaScriptCore/offlineasm/x86.rb >@@ -1412,6 +1412,18 @@ class Instruction > end > when "zxi2q" > $asm.puts "mov#{x86Suffix(:int)} #{orderOperands(operands[0].x86Operand(:int), operands[1].x86Operand(:int))}" >+ when "sxb2i" >+# if !isIntelSyntax >+# $asm.puts "movslq #{operands[0].x86Operand(:byte)}, #{operands[1].x86Operand(:int)}" >+# else >+ $asm.puts "movsx #{orderOperands(operands[0].x86Operand(:byte), operands[1].x86Operand(:int))}" >+# end >+ when "sxh2i" >+# if !isIntelSyntax >+# $asm.puts "movslq #{operands[0].x86Operand(:half)}, #{operands[1].x86Operand(:int)}" >+# else >+ $asm.puts "movsx #{orderOperands(operands[0].x86Operand(:half), operands[1].x86Operand(:int))}" >+# end > when "nop" > $asm.puts "nop" > when "bieq" >diff --git a/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp b/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp >index 43d0c872ee4c63b4d56b6f0e346235333e84b793..e2cc43f2caddbbb7f0e0accb65bf330c2041571f 100644 >--- a/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp >+++ b/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp >@@ -3857,6 +3857,20 @@ template<> auto AirIRGenerator::addOp<OpType::I64ExtendSI32>(ExpressionType arg0 > return { }; > } > >+template<> auto AirIRGenerator::addOp<OpType::I32Extend8S>(ExpressionType arg0, ExpressionType& result) -> PartialResult >+{ >+ result = g32(); >+ append(SignExtend8To32, arg0, result); >+ return { }; >+} >+ >+template<> auto AirIRGenerator::addOp<OpType::I32Extend16S>(ExpressionType arg0, ExpressionType& result) -> PartialResult >+{ >+ result = g32(); >+ append(SignExtend16To32, arg0, result); >+ return { }; >+} >+ > template<> auto AirIRGenerator::addOp<OpType::I32GtS>(ExpressionType arg0, ExpressionType arg1, ExpressionType& result) -> PartialResult > { > result = g32(); >diff --git a/Source/JavaScriptCore/wasm/wasm.json b/Source/JavaScriptCore/wasm/wasm.json >index 308ecb9731d3dd0b22d22a6e84809f0c6c7ad8e2..2c228f3edf537651eada978394901ae41a12c28d 100644 >--- a/Source/JavaScriptCore/wasm/wasm.json >+++ b/Source/JavaScriptCore/wasm/wasm.json >@@ -221,6 +221,8 @@ > "f64.promote/f32": { "category": "conversion", "value": 187, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"}, > "f64.reinterpret/i64": { "category": "conversion", "value": 191, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" }, > "i32.reinterpret/f32": { "category": "conversion", "value": 188, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" }, >- "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" } >+ "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }, >+ "i32.extend8_s": { "category": "conversion", "value": 192, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "SExt8" }, >+ "i32.extend16_s": { "category": "conversion", "value": 193, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "SExt16" } > } > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 0cbfdc5ab26bec02f07cc08a45fa3e4bbda26090..2f34d60e6230df1d8c6da418a647b42e97110969 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2020-11-14 Sergey Rubanov <chi187@gmail.com> >+ >+ Add support for the Wasm sign-extension-ops proposal >+ https://bugs.webkit.org/show_bug.cgi?id=210302 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * workers/wasm-references/test.js: >+ > 2020-11-13 Sihui Liu <sihui_liu@apple.com> > > Implement basic permission check for SpeechRecognition >diff --git a/LayoutTests/workers/wasm-references/test.js b/LayoutTests/workers/wasm-references/test.js >index 214a2bdcd580f36b1666956d96dc3cc76cdfac8d..72920b8448f0151188f96d8ffdc05c28f76f70f5 100644 >--- a/LayoutTests/workers/wasm-references/test.js >+++ b/LayoutTests/workers/wasm-references/test.js >@@ -391,7 +391,9 @@ const WASM_JSON = ` > "f64.promote/f32": { "category": "conversion", "value": 187, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"}, > "f64.reinterpret/i64": { "category": "conversion", "value": 191, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" }, > "i32.reinterpret/f32": { "category": "conversion", "value": 188, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" }, >- "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" } >+ "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }, >+ "i32.extend8_s": { "category": "conversion", "value": 192, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "SExt8" }, >+ "i32.extend16_s": { "category": "conversion", "value": 193, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "SExt16" } > } > } > `; >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index bd6e000c367f9f64ae1eba42f13fbcc6ef8f61c4..9fc5c94d7824ca4fc282a7601e20b07f35c508d4 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,12 @@ >+2020-11-14 Sergey Rubanov <chi187@gmail.com> >+ >+ Add support for the Wasm sign-extension-ops proposal >+ https://bugs.webkit.org/show_bug.cgi?id=210302 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wasm/wasm.json: >+ > 2020-11-13 Xan López <xan@igalia.com> > > [JSC] Use symbols as identifiers for class fields computed names storage >diff --git a/JSTests/wasm/wasm.json b/JSTests/wasm/wasm.json >index 308ecb9731d3dd0b22d22a6e84809f0c6c7ad8e2..2c228f3edf537651eada978394901ae41a12c28d 100644 >--- a/JSTests/wasm/wasm.json >+++ b/JSTests/wasm/wasm.json >@@ -221,6 +221,8 @@ > "f64.promote/f32": { "category": "conversion", "value": 187, "return": ["f64"], "parameter": ["f32"], "immediate": [], "b3op": "FloatToDouble"}, > "f64.reinterpret/i64": { "category": "conversion", "value": 191, "return": ["f64"], "parameter": ["i64"], "immediate": [], "b3op": "BitwiseCast" }, > "i32.reinterpret/f32": { "category": "conversion", "value": 188, "return": ["i32"], "parameter": ["f32"], "immediate": [], "b3op": "BitwiseCast" }, >- "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" } >+ "i64.reinterpret/f64": { "category": "conversion", "value": 189, "return": ["i64"], "parameter": ["f64"], "immediate": [], "b3op": "BitwiseCast" }, >+ "i32.extend8_s": { "category": "conversion", "value": 192, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "SExt8" }, >+ "i32.extend16_s": { "category": "conversion", "value": 193, "return": ["i32"], "parameter": ["i32"], "immediate": [], "b3op": "SExt16" } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-feeder
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 210302
:
414143
|
414145
|
414147
|
414148
|
414150
|
414173
|
414239
|
414242
|
414245