Changeset 269790 in webkit


Ignore:
Timestamp:
Nov 13, 2020 1:39:02 PM (3 years ago)
Author:
commit-queue@webkit.org
Message:

WebAssembly: opcodes for table.grow and table.size are mixed up
https://bugs.webkit.org/show_bug.cgi?id=218644

Patch by Sergey Rubanov <Sergey Rubanov> on 2020-11-13
Reviewed by Yusuke Suzuki.

JSTests:

  • wasm/stress/table-grow-table-size.js: Added.

(async test):

  • wasm/wasm.json:

Source/JavaScriptCore:

  • wasm/wasm.json:

LayoutTests:

  • workers/wasm-references/test.js:
Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r269766 r269790  
     12020-11-13  Sergey Rubanov  <chi187@gmail.com>
     2
     3        WebAssembly: opcodes for table.grow and table.size are mixed up
     4        https://bugs.webkit.org/show_bug.cgi?id=218644
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * wasm/stress/table-grow-table-size.js: Added.
     9        (async test):
     10        * wasm/wasm.json:
     11
    1122020-11-13  Sergey Rubanov  <chi187@gmail.com>
    213
  • trunk/JSTests/wasm/wasm.json

    r269729 r269790  
    7070        "table.get":           { "category": "special",    "value":  37, "return": ["externref"],                    "parameter": ["i32"],                        "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "get a table value" },
    7171        "table.set":           { "category": "special",    "value":  38, "return": [],                               "parameter": ["i32", "externref"],           "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "set a table value" },
    72         "table.size":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": [],                             "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "get the size of a table", "extendedOp": 15 },
    73         "table.grow":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["externref", "i32"],           "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 16 },
    74         "table.fill":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["i32", "externref", "i32"],    "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "fill entries [i,i+n) with the given value", "extendedOp": 17 },
     72        "table.grow":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["externref", "i32"],           "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 15 },
     73        "table.size":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": [],                             "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "get the size of a table", "extendedOp": 16 },
     74        "table.fill":           { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["i32", "externref", "i32"],    "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "fill entries [i,i+n) with the given value", "extendedOp": 17 },
    7575        "call":                { "category": "call",       "value":  16, "return": ["call"],                         "parameter": ["call"],                       "immediate": [{"name": "function_index", "type": "varuint32"}],                                             "description": "call a function by its index" },
    7676        "call_indirect":       { "category": "call",       "value":  17, "return": ["call"],                         "parameter": ["call"],                       "immediate": [{"name": "type_index",     "type": "varuint32"}, {"name": "table_index","type": "varuint32"}],"description": "call a function indirect with an expected signature" },
  • trunk/LayoutTests/ChangeLog

    r269785 r269790  
     12020-11-13  Sergey Rubanov  <chi187@gmail.com>
     2
     3        WebAssembly: opcodes for table.grow and table.size are mixed up
     4        https://bugs.webkit.org/show_bug.cgi?id=218644
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * workers/wasm-references/test.js:
     9
    1102020-11-12  Darin Adler  <darin@apple.com>
    211
  • trunk/LayoutTests/workers/wasm-references/test.js

    r269552 r269790  
    240240        "table.get":           { "category": "special",    "value":  37, "return": ["externref"],   "parameter": ["i32"],                  "immediate": [{"name": "table_index",    "type": "varuint32"}],                                            "description": "get a table value" },
    241241        "table.set":           { "category": "special",    "value":  38, "return": [],           "parameter": ["i32", "externref"],        "immediate": [{"name": "table_index",    "type": "varuint32"}],                                            "description": "set a table value" },
    242         "table.size":          { "category": "exttable",   "value":  252, "return": ["i32"],     "parameter": [],                       "immediate": [{"name": "global_index",   "type": "varuint32"}],                                            "description": "get the size of a table", "extendedOp": 15 },
    243         "table.grow":          { "category": "exttable",   "value":  252, "return": ["i32"],     "parameter": ["externref", "i32"],        "immediate": [{"name": "global_index",   "type": "varuint32"}],                                            "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 16 },
     242        "table.grow":          { "category": "exttable",   "value":  252, "return": ["i32"],     "parameter": ["externref", "i32"],        "immediate": [{"name": "global_index",   "type": "varuint32"}],                                            "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 15 },
     243        "table.size":          { "category": "exttable",   "value":  252, "return": ["i32"],     "parameter": [],                       "immediate": [{"name": "global_index",   "type": "varuint32"}],                                            "description": "get the size of a table", "extendedOp": 16 },
    244244        "table.fill":          { "category": "exttable",   "value":  252, "return": ["i32"],     "parameter": ["i32", "externref", "i32"], "immediate": [{"name": "global_index",   "type": "varuint32"}],                                            "description": "fill entries [i,i+n) with the given value", "extendedOp": 17 },
    245245        "call":                { "category": "call",       "value":  16, "return": ["call"],     "parameter": ["call"],                 "immediate": [{"name": "function_index", "type": "varuint32"}],                                            "description": "call a function by its index" },
  • trunk/Source/JavaScriptCore/ChangeLog

    r269757 r269790  
     12020-11-13  Sergey Rubanov  <chi187@gmail.com>
     2
     3        WebAssembly: opcodes for table.grow and table.size are mixed up
     4        https://bugs.webkit.org/show_bug.cgi?id=218644
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * wasm/wasm.json:
     9
    1102020-11-12  Devin Rousso  <drousso@apple.com>
    211
  • trunk/Source/JavaScriptCore/wasm/wasm.json

    r269729 r269790  
    7070        "table.get":           { "category": "special",    "value":  37, "return": ["externref"],                    "parameter": ["i32"],                        "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "get a table value" },
    7171        "table.set":           { "category": "special",    "value":  38, "return": [],                               "parameter": ["i32", "externref"],           "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "set a table value" },
    72         "table.size":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": [],                             "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "get the size of a table", "extendedOp": 15 },
    73         "table.grow":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["externref", "i32"],           "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 16 },
    74         "table.fill":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["i32", "externref", "i32"],    "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "fill entries [i,i+n) with the given value", "extendedOp": 17 },
     72        "table.grow":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["externref", "i32"],           "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 15 },
     73        "table.size":          { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": [],                             "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "get the size of a table", "extendedOp": 16 },
     74        "table.fill":           { "category": "exttable",   "value":  252, "return": ["i32"],                         "parameter": ["i32", "externref", "i32"],    "immediate": [{"name": "table_index",    "type": "varuint32"}],                                             "description": "fill entries [i,i+n) with the given value", "extendedOp": 17 },
    7575        "call":                { "category": "call",       "value":  16, "return": ["call"],                         "parameter": ["call"],                       "immediate": [{"name": "function_index", "type": "varuint32"}],                                             "description": "call a function by its index" },
    7676        "call_indirect":       { "category": "call",       "value":  17, "return": ["call"],                         "parameter": ["call"],                       "immediate": [{"name": "type_index",     "type": "varuint32"}, {"name": "table_index","type": "varuint32"}],"description": "call a function indirect with an expected signature" },
Note: See TracChangeset for help on using the changeset viewer.