Changeset 293314 in webkit
- Timestamp:
- Apr 24, 2022, 11:36:11 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
wasm/generateWasmOpsHeader.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r293313 r293314 1 2022-04-24 Dmitry Bezhetskov <dbezhetskov@igalia.com> 2 3 [Wasm] Remove confusing isFuncref and isExternref 4 https://bugs.webkit.org/show_bug.cgi?id=239699 5 6 Reviewed by Yusuke Suzuki. 7 8 There are two functions with the same name Wasm::Type::isFuncref and 9 Wasm::isFuncref but with different behaviour, and so, 10 this brings confusion into the codebase. 11 The first function checks that .kind == funcref and the second one checks 12 for the same but with respect to typed function references proposal. 13 The second one should be used when we want to check that type is funcref, 14 so the first one is not needed and actually not used, so this patch removes it. 15 16 The same situation is for isExternref. 17 18 * wasm/generateWasmOpsHeader.py: 19 (typeMacroizer): 20 (typeMacroizerFiltered): 21 1 22 2022-04-24 Zan Dobersek <zdobersek@igalia.com> 2 23 -
trunk/Source/JavaScriptCore/wasm/generateWasmOpsHeader.py
r292773 r293314 57 57 inc += 1 58 58 59 60 def typeMacroizerFiltered(filter): 61 for t in typeMacroizer(): 62 if not filter(t): 63 yield t 64 59 65 type_definitions = ["#define FOR_EACH_WASM_TYPE(macro)"] 60 66 type_definitions.extend([t for t in typeMacroizer()]) 61 67 type_definitions = "".join(type_definitions) 68 69 type_definitions_except_funcref_externref = ["#define FOR_EACH_WASM_TYPE_EXCEPT_FUNCREF_AND_EXTERNREF(macro)"] 70 type_definitions_except_funcref_externref.extend([t for t in typeMacroizerFiltered(lambda x: x == "funcref" or x == "externref")]) 71 type_definitions_except_funcref_externref = "".join(type_definitions_except_funcref_externref) 62 72 63 73 … … 207 217 static constexpr unsigned numTypes = """ + str(len(types)) + """; 208 218 209 """ + type_definitions + """ 219 """ + type_definitions + "\n" + """ 220 """ + type_definitions_except_funcref_externref + """ 210 221 #define CREATE_ENUM_VALUE(name, id, ...) name = id, 211 222 enum class TypeKind : int8_t { … … 241 252 } 242 253 254 // Use Wasm::isFuncref and Wasm::isExternref instead because they check againts all kind of representations of function referenes and external references. 255 243 256 #define CREATE_PREDICATE(name, ...) bool is ## name() const { return kind == TypeKind::name; } 244 FOR_EACH_WASM_TYPE (CREATE_PREDICATE)257 FOR_EACH_WASM_TYPE_EXCEPT_FUNCREF_AND_EXTERNREF(CREATE_PREDICATE) 245 258 #undef CREATE_PREDICATE 246 259 };
Note:
See TracChangeset
for help on using the changeset viewer.