Changeset 270827 in webkit


Ignore:
Timestamp:
Dec 15, 2020 2:17:53 AM (19 months ago)
Author:
commit-queue@webkit.org
Message:

[WASM-References] Add support for type annotated select
https://bugs.webkit.org/show_bug.cgi?id=219595

Patch by Dmitry Bezhetskov <dbezhetskov> on 2020-12-15
Reviewed by Yusuke Suzuki.
JSTests:

Added new harness for testing ref-types proposal because it has
different API with core/spec. However, a few files are actually the
same I decided to repeat them to have an independent copy.
Added ref-types spec's tests for the new type annotated select
instruction:
https://github.com/WebAssembly/reference-types/blob/master/test/core/select.wast.

  • wasm.yaml:
  • wasm/ref-spec-harness.js: Added.

(import.string_appeared_here.then):
(test):
(promise_test):
(let.assert_unreached):
(let.console.log):

  • wasm/ref-spec-harness/async_index.js: Added.

(let.testNum):
(uniqueTest):
(assertThrows):
(externref):
(is_externref):
(is_funcref):
(eq_externref):
(eq_funcref):
(binary):
(module):
(assert_invalid):
(instance):
(exports):
(then.):
(reinitializeRegistry.get promise_test):
(reinitializeRegistry):
(catch):
(assert_exhaustion):
(get const):

  • wasm/ref-spec-harness/sync_index.js: Added.

(let.testNum):
(assertThrows):
(_assert):
(ValueResult):
(ErrorResult):
(Result.prototype.isError):
(externref):
(is_externref):
(is_funcref):
(eq_externref):
(eq_funcref):
(reinitializeRegistry.let.handler.get return):
(binary):
(module):

  • wasm/ref-spec-harness/wasm-constants.js: Added.

(hostref):
(bytes):
(bytesWithHeader):
(makeSig):
(makeSig_v_x):
(makeSig_v_xx):
(makeSig_r_v):
(makeSig_r_x):
(makeSig_r_xx):
(assertTraps):
(assertWasmThrows):

  • wasm/ref-spec-harness/wasm-module-builder.js: Added.

(Binary.prototype.emit_u8):
(Binary.prototype.emit_u16):
(Binary.prototype.emit_u32):
(Binary.prototype.emit_u32v):
(Binary.prototype.emit_bytes):
(Binary.prototype.emit_string):
(Binary.prototype.emit_header):
(Binary.prototype.emit_section):
(Binary):
(WasmFunctionBuilder):
(WasmFunctionBuilder.prototype.exportAs):
(WasmFunctionBuilder.prototype.exportFunc):
(WasmFunctionBuilder.prototype.addBody):
(WasmFunctionBuilder.prototype.addLocals):
(WasmFunctionBuilder.prototype.end):
(WasmGlobalBuilder):
(WasmGlobalBuilder.prototype.exportAs):
(WasmModuleBuilder):
(WasmModuleBuilder.prototype.addStart):
(WasmModuleBuilder.prototype.addMemory):
(WasmModuleBuilder.prototype.addExplicitSection):
(WasmModuleBuilder.prototype.stringToBytes):
(WasmModuleBuilder.prototype.addCustomSection):
(WasmModuleBuilder.prototype.addType):
(WasmModuleBuilder.prototype.addGlobal):
(WasmModuleBuilder.prototype.addFunction):
(WasmModuleBuilder.prototype.addImport):
(WasmModuleBuilder.prototype.addImportedGlobal):
(WasmModuleBuilder.prototype.addImportedMemory):
(WasmModuleBuilder.prototype.addImportedTable):
(WasmModuleBuilder.prototype.addExport):
(WasmModuleBuilder.prototype.addExportOfKind):
(WasmModuleBuilder.prototype.addDataSegment):
(WasmModuleBuilder.prototype.exportMemoryAs):
(WasmModuleBuilder.prototype.addFunctionTableInit):
(WasmModuleBuilder.prototype.appendToTable):
(WasmModuleBuilder.prototype.setFunctionTableLength):
(WasmModuleBuilder.prototype.toArray):
(WasmModuleBuilder.prototype.toBuffer):
(WasmModuleBuilder.prototype.instantiate):

  • wasm/ref-spec-harness/wast.js: Added.

(normalize):
(require.else._registry.name):
(require):
(add_hex_char):
(add_char):
(string_with):
(list_of_opt):
(break_bytes.f):
(break_bytes):
(f):
(decls):
(func_type):
(limits):
(global_type):
(testop):
(relop):
(unop):
(binop):
(cvtop):
(oper):
(mem_size):
(extension):
(memop):
(storeop):
(var):
(constop):
(instr.else.switch.case.0.f):
(instr.else.switch.case.1.f.1):
(instr.else.switch.case.2.f.2):
(instr):
(func_with_name):
(func):
(start):
(table):
(memory):
(segment):
(elems):
(data):
(typedef):
(import_kind):
(import):
(export_kind):
(export):
(var_opt):
(is_func_import):
(is_table_import):
(is_memory_import):
(is_global_import):
(f.1):
(f.2):
(f.3):
(module_with_var_opt):
(module_):
(literal):
(definition):
(access):
(action):
(script):
(_registry.string_appeared_here):
(init):
(make_matrix):
(copy):
(append):
(sub):
(fill):
(blit):
(iter):
(map):
(iteri):
(mapi):
(to_list):
(list_length):
(of_list):
(fold_left):
(fold_right):
(maxson):
(trickle):
(bubble):
(trickleup):
(sort):
(merge):
(isortto):
(sortto):
(stable_sort):
(import_type):
(export_type):
(dims.n):
(dims.d.i):
(dims):
(map_file):
(create):
(of_array):
(slice_left):
(slice_right):
(slice_left_1):
(slice_right_1):
(slice_left_2):
(slice_right_2):
(array1_of_genarray):
(array2_of_genarray):
(array3_of_genarray):
(reshape_1):
(reshape_2):
(reshape_3):
(reshape):
():
(contents):
(to_bytes):
(nth):
(length):
(clear):
(reset):
(resize):
(add_substring):
(add_subbytes):
(add_string):
(add_bytes):
(add_buffer):
(add_channel):
(output_buffer):
(closing):
(advance_to_closing):
(advance_to_non_alpha):
(find_ident):
(add_substitute):
(make):
(to_string):
(of_string):
(sub_string):
(extend):
(blit_string):
(concat):
(cat):
(is_space):
(trim):
(escaped):
(uppercase):
(lowercase):
(apply1):
(capitalize):
(uncapitalize):
(index_rec):
(index):
(index_from):
(rindex_rec):
(rindex):
(rindex_from):
(contains_from):
(contains):
(rcontains_from):
(caml_array_sub):
(len):
(caml_array_concat):
(caml_make_vect):
(caml_array_blit):
(get if):
(caml_set_oo_id):
(get_id):
(caml_int32_float_of_bits):
(caml_int32_bits_of_float):
(caml_classify_float):
(caml_modf_float):
(caml_ldexp_float):
(caml_frexp_float):
(caml_copysign_float):
(caml_expm1_float):
(caml_hypot_float):
(caml_log10_float):
(caml_failwith):
(parse_digit):
(int_of_string_base):
(parse_sign_and_base):
(caml_int_of_string.aux):
(caml_int_of_string):
(caml_int64_of_string.aux):
(caml_int64_of_string):
(int_of_base):
(parse_format):
(finish_formatting):
(caml_format_int):
(caml_int64_format):
(caml_format_float):
(float_of_string):
(div):
(mod_):
(caml_bswap16):
(caml_int32_bswap):
(imul):
(neg_signed):
(not):
(eq):
(neg):
(lsl_):
(lsr_):
(asr_):
(is_zero):
(mul):
(swap):
(xor):
(or_):
(and_):
(ge):
(lt):
(gt):
(le):
(to_float):
(of_float):
(div_mod):
(compare):
(of_int32):
(to_int32):
(to_hex.aux):
(to_hex):
(discard_sign):
(float_of_bits):
(bits_of_float.to_nat):
(bits_of_float):
(get64):
(erase_rel):
(concat_fmtty):
(concat_fmt):
(create_char_set):
(add_in_char_set):
(rev_char_set):
(is_in_char_set):
(prec_of_prec_opt):
(param_format_of_ignored_format):
(buffer_check_size):
(buffer_add_char):
(buffer_add_string):
(buffer_contents):
(char_of_iconv):
(char_of_fconv):
(char_of_counter):
(print_char):
(set while.set var):
(set while.set else):
(set var):
(set else):
(set print_char):
(set if):
(bprint_padty):
(bprint_ignored_flag):
(bprint_pad_opt):
(bprint_padding):
(bprint_precision):
(bprint_iconv_flag):
(bprint_int_fmt):
(bprint_altint_fmt):
(bprint_fconv_flag):
(bprint_float_fmt):
(string_of_formatting_lit):
(string_of_formatting_gen):
(bprint_char_literal):
(bprint_string_literal):
(bprint_fmtty):
(int_of_custom_arity):
(bprint_fmt):
(string_of_fmt):
(symm):
(fmtty_rel_det):
(trans):
(fmtty_of_formatting_gen):
(fmtty_of_fmt):
(fmtty_of_custom):
(fmtty_of_padding_fmtty):
(fmtty_of_precision_fmtty):
(type_padding):
(type_padprec):
(type_ignored_param_one):
(type_format_gen):
(type_ignored_format_substitution):
(type_format):
(recast):
(fix_padding):
(fix_int_precision):
(string_to_caml_string):
(format_of_iconv):
(format_of_aconv):
(format_of_fconv):
(convert_int):
(convert_int32):
(convert_nativeint):
(convert_int64):
(else.is_valid):
(convert_float):
(format_caml_char):
(string_of_fmtty):
(else.switch.):
(else.switch.k.prime):
(else.switch.else.):
(else.switch.else.k.prime.1):
(make_printf):
(make_from_fmtty):
(make_invalid_arg):
(make_string_padding):
(make_int_padding_precision):
(make_custom):
(output_acc):
(bufput_acc):
(strput_acc):
(failwith_message.k):
(failwith_message):
(open_box_of_string.else.invalid_box):
(open_box_of_string.else.parse_spaces):
(open_box_of_string.else.parse_lword):
(open_box_of_string.else.parse_int):
(open_box_of_string):
(make_padding_fmt_ebb):
(make_precision_fmt_ebb):
(make_padprec_fmt_ebb):
(invalid_format_message):
(invalid_format_without):
(expected_character):
(compute_int_conv):
(incompatible_flag):
(parse_positive):
(parse_conv):
(parse_after_precision):
(else.parse_literal):
(parse_after_padding):
(parse_literal):
(parse_after_at):
(add_literal):
(parse_spaces):
(parse_integer):
(compute_float_conv):
(search_subformat_end):
(check_no_0):
(opt_of_pad):
(get_prec_opt):
(else.switch.case.99.char_format):
(else.switch.scan_format):
(parse_conversion):
(set_flag):
(parse_flags):
(is_int_base):
(counter_of_char):
(add_range):
(fail_single_percent):
(parse_char_set_after_char):
(parse_char_set_content):
(parse_char_set_start):
(parse_char_set):
(check_open_box):
(parse_tag):
(fmt_ebb_of_string):
(format_of_string_fmtty):
(format_of_string_format):
(caret):
(caml_ml_open_descriptor_in):
(caml_ml_open_descriptor_out):
(caml_ml_flush):
(node_std_output):
(caml_ml_output_char):
(caml_ml_input):
(caml_ml_input_char):
(caml_ml_out_channels_list):
(fail):
(caml_lex_array):
(caml_lex_engine):
(caml_lex_run_mem):
(caml_lex_run_tag):
(caml_new_lex_engine):
(caml_obj_dup):
(caml_obj_truncate):
(caml_lazy_make_forward):
(caml_update_dummy):
(caml_int_compare):
(caml_compare):
(caml_equal):
(caml_notequal):
(caml_greaterequal):
(caml_lessequal):
(else.aux):
(caml_get_public_method):
(caml_parse_engine):
(caml_set_parser_trace):
(js_string_of_char):
(caml_string_get):
(caml_create_string):
(caml_string_compare):
(caml_fill_string):
(caml_blit_string):
(caml_blit_bytes):
(bytes_of_string):
(bytes_to_string):
(caml_string_of_char_array):
(caml_is_printable):
(caml_string_get16):
(caml_string_get32):
(repeat):
(chr):
(app):
(js):
(curry_1):
(_1):
(js1):
(
1):
(curry_2):
(_2):
(js2):
(2):
(curry_3):
(_3):
(js3):
(
3):
(curry_4):
(_4):
(js4):
(4):
(curry_5):
(_5):
(js5):
(
5):
(curry_6):
(_6):
(js6):
(6):
(curry_7):
(_7):
(js7):
(
7):
(curry_8):
(_8):
(js8):
(8):
(stream):
(eos):
(skip):
(read):
(peek):
(string_of_byte):
(position):
(region):
(error):
(guard):
(get 1):
(get expect):
(get illegal):
(at):
(u32):
(u64):
(get require):
(vuN):
(get var):
(vsN):
(vu32):
(vs32):
(vs64):
(f32):
(f64):
(len32):
(string):
(opt):
(vec):
(sized):
(value_type):
(elem_type):
(stack_type):
(table_type):
(memory_type):
(mutability.get if):
(mutability):
(instr.get if):
(instr_block):
(const):
(id):
(section):
(type_section):
(import_kind.get if):
(import_section):
(func_section):
(table_section):
(memory_section):
(global):
(global_section):
(export_kind.get if):
(export_section):
(start_section):
(local):
(code):
(code_section):
(table_segment):
(elem_section):
(memory_segment):
(data_section):
(partial_arg.1):
(custom):
(custom_section):
(iterate):
(decode):
(patch):
(encode.u8):
(encode.u16):
(encode.u32):
(encode.vu64):
(encode.vs64):
(encode.vu32):
(encode.len):
(encode.bool):
(encode.string):
(encode.vec):
(encode.gap32):
(encode.patch_gap32):
(encode.value_type):
(encode.stack_type):
(encode.func_type):
(encode.limits):
(encode.table_type):
(encode.memory_type):
(encode.global_type):
(encode.memop):
(encode):
(encode.instr):
(encode.const):
(encode.section):
(encode.type_section):
(encode.import):
(encode.import_section):
(encode.func):
(encode.func_section):
(encode.table):
(encode.table_section):
(encode.memory):
(encode.memory_section):
(encode.global):
(encode.global_section):
(encode.export_kind):
(encode.export):
(encode.export_section):
(encode.start_section):
(encode.combine):
(encode.compress):
(encode.local):
(encode.code):
(encode.code_section):
(encode.segment):
(encode.table_segment):
(encode.elem_section):
(encode.memory_segment):
(encode.module_):
(Make.warn):
(Make.error):
(Make):
(print_nan_significand_digits):
(Make.of_bits):
(Make.to_bits):
(Make.is_nan):
(Make.canonicalize_nan):
(Make.determine_binary_nan):
(Make.determine_unary_nan):
(Make.binary):
(Make.unary):
(Make.add):
(Make.sub):
(Make.mul):
(Make.div):
(Make.sqrt):
(Make.ceil):
(Make.floor):
(Make.trunc):
(Make.nearest):
(Make.min):
(Make.max):
(Make.abs):
(Make.neg):
(Make.copysign):
(Make.eq):
(Make.ne):
(Make.lt):
(Make.gt):
(Make.le):
(Make.ge):
(Make.of_signless_string):
(Make.of_string):
(Make.to_string):
(add_queue):
(peek_queue):
(take_queue):
(pp_enqueue):
(pp_clear_queue):
(pp_output_string):
(break_new_line):
(break_same_line):
(pp_force_break_line):
(switch.add_tab):
(else.switch.find):
(format_pp_token):
(advance_left):
(enqueue_advance):
(enqueue_string_as):
(set_size):
(scan_push):
(pp_open_box_gen):
(pp_close_box):
(pp_open_tag):
(pp_close_tag):
(pp_set_print_tags):
(pp_set_mark_tags):
(pp_get_print_tags):
(pp_get_mark_tags):
(pp_set_tags):
(pp_get_formatter_tag_functions):
(pp_set_formatter_tag_functions):
(pp_rinit):
(pp_flush_queue):
(pp_print_as_size):
(pp_print_string):
(pp_print_int):
(pp_print_float):
(pp_print_bool):
(pp_open_hbox):
(pp_open_vbox):
(pp_open_hvbox):
(pp_open_hovbox):
(pp_open_box):
(pp_print_newline):
(pp_print_flush):
(pp_force_newline):
(pp_print_if_newline):
(pp_print_break):
(pp_print_space):
(pp_print_cut):
(pp_open_tbox):
(pp_close_tbox):
(pp_print_tbreak):
(pp_print_tab):
(pp_set_tab):
(pp_print_list):
(flush):
(pp_print_text):
(pp_set_max_boxes):
(pp_get_max_boxes):
(pp_over_max_boxes):
(pp_get_ellipsis_text):
(pp_limit):
(pp_set_max_indent):
(pp_get_max_indent):
(pp_set_margin):
(pp_get_margin):
(pp_set_formatter_out_functions):
(pp_get_formatter_out_functions):
(pp_set_formatter_output_functions):
(pp_get_formatter_output_functions):
(pp_set_all_formatter_output_functions):
(pp_get_all_formatter_output_functions):
(display_newline):
(display_blanks):
(state.16):
(state.17):
(state.18):
(state.19):
(pp_set_formatter_out_channel):
(default_pp_mark_open_tag):
(default_pp_mark_close_tag):
(default_pp_print_open_tag):
(default_pp_print_close_tag):
(pp_make_formatter):
(ppf.18):
(ppf.19):
(make_formatter):
(formatter_of_out_channel):
(formatter_of_buffer):
(flush_str_formatter):
(flush_buf_formatter):
(open_hbox):
(open_vbox):
(open_hvbox):
(open_hovbox):
(open_box):
(close_box):
(open_tag):
(close_tag):
(print_as):
(print_string):
(print_int):
(print_float):
(print_bool):
(print_cut):
(print_space):
(force_newline):
(print_flush):
(print_newline):
(print_if_newline):
(open_tbox):
(close_tbox):
(print_tbreak):
(set_tab):
(print_tab):
(set_margin):
(get_margin):
(set_max_indent):
(get_max_indent):
(set_max_boxes):
(get_max_boxes):
(over_max_boxes):
(set_ellipsis_text):
(get_ellipsis_text):
(set_formatter_out_channel):
(set_formatter_out_functions):
(get_formatter_out_functions):
(set_formatter_output_functions):
(get_formatter_output_functions):
(set_all_formatter_output_functions):
(get_all_formatter_output_functions):
(set_formatter_tag_functions):
(get_formatter_tag_functions):
(set_print_tags):
(get_print_tags):
(set_mark_tags):
(get_mark_tags):
(set_tags):
(compute_tag):
(output_formatting_lit):
(kfprintf):
(ikfprintf):
(fprintf):
(ifprintf):
(printf):
(eprintf):
(k.prime):
(ksprintf):
(sprintf):
(asprintf.k.prime):
(asprintf):
(k):
(bprintf):
(succ):
(pred):
(abs):
(lognot):
(Make.cmp_u):
(Make.divrem_u):
(Make.div_s):
(Make.div_u):
(Make.rem_s):
(Make.rem_u):
(Make.shift):
(Make.shl):
(Make.shr_s):
(Make.shr_u):
(Make.clamp_rotate_count):
(Make.rotl):
(Make.rotr):
(Make.loop):
(Make.clz):
(Make.ctz):
(Make.popcnt):
(Make.eqz):
(Make.lt_u):
(Make.le_u):
(Make.gt_u):
(Make.ge_u):
(Make.of_int_u):
(Make.to_string_u):
(Make.require):
(Make.dec_digit):
(Make.hex_digit):
(Make.parse_int):
(Make.of_string_s):
(Make.of_string_u):
(convert_pos):
(error_nest):
(text):
(intop):
(floatop):
(numop):
(memsz):
(ext):
(token.else.switch):
(token.else.switch.):
(token):
(
ocaml_lex_comment_rec):
(engine):
(new_engine):
(from_function):
(from_channel):
(from_string):
(lexeme):
(sub_lexeme):
(sub_lexeme_opt):
(sub_lexeme_char):
(sub_lexeme_char_opt):
(lexeme_char):
(lexeme_start):
(lexeme_end):
(lexeme_start_p):
(lexeme_end_p):
(new_line):
(flush_input):
(take):
(drop):
(last):
(split_last):
(index_of):
(index_of_int32):
(dim):
(set 1):
(get 2):
(log2):
(is_power_of_two):
(loop):
(breakup):
(hd):
(tl):
(rev_append):
(rev):
(flatten):
(rev_map):
(map2):
(rev_map2):
(iter2):
(fold_left2):
(fold_right2):
(for_all):
(exists):
(for_all2):
(exists2):
(mem):
(memq):
(assoc):
(assq):
(mem_assoc):
(mem_assq):
(remove_assoc):
(remove_assq):
(find):
(find_all):
(partition):
(split):
(combine):
(chop):
(rev_sort):
(sort_uniq):
(Make.height):
(Make.create):
(Make.singleton):
(Make.bal):
(Make.is_empty):
(Make.find):
(Make.mem):
(Make.min_binding):
(Make.max_binding):
(Make.remove_min_binding):
(Make.remove):
(Make.iter):
(Make.map):
(Make.mapi):
(Make.fold):
(Make.for_all):
(Make.exists):
(Make.add_min_binding):
(Make.add_max_binding):
(Make.join):
(Make.concat):
(Make.concat_or_join):
(Make.split):
(Make.merge):
(Make.filter):
(Make.partition):
(Make.cons_enum):
(Make.compare):
(Make.equal):
(Make.cardinal):
(Make.bindings_aux):
(Make.bindings):
(double_field):
(set_double_field):
(marshal):
(unmarshal):
(extension_slot):
(extension_name):
(extension_id):
(i32_const):
(i64_const):
(f32_const):
(f64_const):
(block):
(br):
(br_if):
(br_table):
(if_):
(call):
(call_indirect):
(get_local):
(set_local):
(tee_local):
(get_global):
(set_global):
(i32_load):
(i64_load):
(f32_load):
(f64_load):
(i32_load8_s):
(i32_load8_u):
(i32_load16_s):
(i32_load16_u):
(i64_load8_s):
(i64_load8_u):
(i64_load16_s):
(i64_load16_u):
(i64_load32_s):
(i64_load32_u):
(i32_store):
(i64_store):
(f32_store):
(f64_store):
(i32_store8):
(i32_store16):
(i64_store8):
(i64_store16):
(i64_store32):
(parse):
(string_to):
(string_to_script):
(string_to_module):
(parse_error):
(position_to_pos):
(positions_to_region):
(ati):
(nat):
(nat32):
(empty_context):
(enter_func):
(type_):
(lookup):
(label):
(anon_type):
(bind):
(bind_func):
(bind_local):
(bind_global):
(bind_table):
(bind_memory):
(anon):
(anon_func):
(anon_locals):
(anon_global):
(anon_table):
(anon_memory):
(anon_label):
(explicit_sig):
(inline_type):
(yyact):
(script1):
(module1):
(grow_stacks):
(clear_parser):
(current_lookahead_fun):
(catch.else.current_lookahead_fun.0):
(yyparse):
(peek_val):
(symbol_start_pos):
(symbol_end_pos):
(rhs_start_pos):
(rhs_end_pos):
(symbol_start):
(symbol_end):
(rhs_start):
(rhs_end):
(is_current_lookahead):
(failwith):
(invalid_arg):
(min):
(max):
(lnot):
(char_of_int):
(string_of_bool):
(bool_of_string):
(string_of_int):
(valid_float_lexem):
(string_of_float):
(open_out_gen):
(open_out):
(open_out_bin):
(flush_all):
(output_bytes):
(output_string):
(output):
(output_substring):
(output_value):
(close_out):
(close_out_noerr):
(open_in_gen):
(open_in):
(open_in_bin):
(input):
(else.r):
(unsafe_really_input):
(really_input):
(really_input_string):
(input_line.build_result):
(input_line.n):
(input_line.scan):
(input_line):
(close_in_noerr):
(print_bytes):
(print_endline):
(prerr_char):
(prerr_string):
(prerr_bytes):
(prerr_int):
(prerr_float):
(prerr_endline):
(prerr_newline):
(read_line):
(read_int):
(read_float):
(string_of_format):
(at_exit.exit_function.0):
(at_exit):
(do_at_exit):
(exit):
(output_binary_int):
(seek_out):
(pos_out):
(out_channel_length):
(set_binary_mode_out):
(input_binary_int):
(input_value):
(seek_in):
(pos_in):
(in_channel_length):
(close_in):
(set_binary_mode_in):
(LargeFile_000):
(LargeFile_001):
(LargeFile_002):
(LargeFile_003):
(LargeFile_004):
(LargeFile_005):
(kbprintf):
(plus):
(pp):
(print):
(string_of_pos):
(string_of_region):
(escaped.needs_escape):
(set_signal):
(catch_break):
(size):
(string_of_value_type):
(string_of_value_types):
(string_of_elem_type):
(string_of_limits):
(string_of_table_type):
(string_of_global_type):
(string_of_stack_type):
(string_of_func_type):
(type_of):
(default_value):
(value_of_bool):
(string_of_values):
(to_value):
(of_value):
(g):
(binary):
(bytes):

  • wasm/references-spec-tests/select.wast.js: Added.
  • wasm/references/table_instructions_parse_unreachable.js:

(invalidAnnotatedSelectUnreachable):

  • wasm/wasm.json:

Source/JavaScriptCore:

Add support for typed select instruction from ref-types proposal:
select t : [t t i32] -> [t].
The annotated select instruction takes a value type immediate to deduce result type of select expression.
This version of select will help us with subtyping in the future where we want to avoid computing lubs.
For more information see:
https://github.com/WebAssembly/reference-types/issues/125,
https://webassembly.github.io/reference-types/core/binary/instructions.html#parametric-instructions.

  • wasm/WasmFunctionParser.h:

(JSC::Wasm::FunctionParser<Context>::parseAnnotatedSelectImmediates):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):

  • wasm/wasm.json:

Tools:

Add support for testing ref-types.

  • Scripts/run-jsc-stress-tests:
Location:
trunk
Files:
8 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r270695 r270827  
     12020-12-15  Dmitry Bezhetskov  <dbezhetskov@igalia.com>
     2
     3        [WASM-References] Add support for type annotated select
     4        https://bugs.webkit.org/show_bug.cgi?id=219595
     5
     6        Reviewed by Yusuke Suzuki.
     7       
     8        Added new harness for testing ref-types proposal because it has
     9        different API with core/spec. However, a few files are actually the
     10        same I decided to repeat them to have an independent copy.
     11        Added ref-types spec's tests for the new type annotated select
     12        instruction:
     13        https://github.com/WebAssembly/reference-types/blob/master/test/core/select.wast.
     14
     15        * wasm.yaml:
     16        * wasm/ref-spec-harness.js: Added.
     17        (import.string_appeared_here.then):
     18        (test):
     19        (promise_test):
     20        (let.assert_unreached):
     21        (let.console.log):
     22        * wasm/ref-spec-harness/async_index.js: Added.
     23        (let.testNum):
     24        (uniqueTest):
     25        (assertThrows):
     26        (externref):
     27        (is_externref):
     28        (is_funcref):
     29        (eq_externref):
     30        (eq_funcref):
     31        (binary):
     32        (module):
     33        (assert_invalid):
     34        (instance):
     35        (exports):
     36        (then.):
     37        (reinitializeRegistry.get promise_test):
     38        (reinitializeRegistry):
     39        (catch):
     40        (assert_exhaustion):
     41        (get const):
     42        * wasm/ref-spec-harness/sync_index.js: Added.
     43        (let.testNum):
     44        (assertThrows):
     45        (_assert):
     46        (ValueResult):
     47        (ErrorResult):
     48        (Result.prototype.isError):
     49        (externref):
     50        (is_externref):
     51        (is_funcref):
     52        (eq_externref):
     53        (eq_funcref):
     54        (reinitializeRegistry.let.handler.get return):
     55        (binary):
     56        (module):
     57        * wasm/ref-spec-harness/wasm-constants.js: Added.
     58        (hostref):
     59        (bytes):
     60        (bytesWithHeader):
     61        (makeSig):
     62        (makeSig_v_x):
     63        (makeSig_v_xx):
     64        (makeSig_r_v):
     65        (makeSig_r_x):
     66        (makeSig_r_xx):
     67        (assertTraps):
     68        (assertWasmThrows):
     69        * wasm/ref-spec-harness/wasm-module-builder.js: Added.
     70        (Binary.prototype.emit_u8):
     71        (Binary.prototype.emit_u16):
     72        (Binary.prototype.emit_u32):
     73        (Binary.prototype.emit_u32v):
     74        (Binary.prototype.emit_bytes):
     75        (Binary.prototype.emit_string):
     76        (Binary.prototype.emit_header):
     77        (Binary.prototype.emit_section):
     78        (Binary):
     79        (WasmFunctionBuilder):
     80        (WasmFunctionBuilder.prototype.exportAs):
     81        (WasmFunctionBuilder.prototype.exportFunc):
     82        (WasmFunctionBuilder.prototype.addBody):
     83        (WasmFunctionBuilder.prototype.addLocals):
     84        (WasmFunctionBuilder.prototype.end):
     85        (WasmGlobalBuilder):
     86        (WasmGlobalBuilder.prototype.exportAs):
     87        (WasmModuleBuilder):
     88        (WasmModuleBuilder.prototype.addStart):
     89        (WasmModuleBuilder.prototype.addMemory):
     90        (WasmModuleBuilder.prototype.addExplicitSection):
     91        (WasmModuleBuilder.prototype.stringToBytes):
     92        (WasmModuleBuilder.prototype.addCustomSection):
     93        (WasmModuleBuilder.prototype.addType):
     94        (WasmModuleBuilder.prototype.addGlobal):
     95        (WasmModuleBuilder.prototype.addFunction):
     96        (WasmModuleBuilder.prototype.addImport):
     97        (WasmModuleBuilder.prototype.addImportedGlobal):
     98        (WasmModuleBuilder.prototype.addImportedMemory):
     99        (WasmModuleBuilder.prototype.addImportedTable):
     100        (WasmModuleBuilder.prototype.addExport):
     101        (WasmModuleBuilder.prototype.addExportOfKind):
     102        (WasmModuleBuilder.prototype.addDataSegment):
     103        (WasmModuleBuilder.prototype.exportMemoryAs):
     104        (WasmModuleBuilder.prototype.addFunctionTableInit):
     105        (WasmModuleBuilder.prototype.appendToTable):
     106        (WasmModuleBuilder.prototype.setFunctionTableLength):
     107        (WasmModuleBuilder.prototype.toArray):
     108        (WasmModuleBuilder.prototype.toBuffer):
     109        (WasmModuleBuilder.prototype.instantiate):
     110        * wasm/ref-spec-harness/wast.js: Added.
     111        (normalize):
     112        (require.else._registry.name):
     113        (require):
     114        (add_hex_char):
     115        (add_char):
     116        (string_with):
     117        (list_of_opt):
     118        (break_bytes.f):
     119        (break_bytes):
     120        (f):
     121        (decls):
     122        (func_type):
     123        (limits):
     124        (global_type):
     125        (testop):
     126        (relop):
     127        (unop):
     128        (binop):
     129        (cvtop):
     130        (oper):
     131        (mem_size):
     132        (extension):
     133        (memop):
     134        (storeop):
     135        (var):
     136        (constop):
     137        (instr.else.switch.case.0.f):
     138        (instr.else.switch.case.1.f.1):
     139        (instr.else.switch.case.2.f.2):
     140        (instr):
     141        (func_with_name):
     142        (func):
     143        (start):
     144        (table):
     145        (memory):
     146        (segment):
     147        (elems):
     148        (data):
     149        (typedef):
     150        (import_kind):
     151        (import):
     152        (export_kind):
     153        (export):
     154        (var_opt):
     155        (is_func_import):
     156        (is_table_import):
     157        (is_memory_import):
     158        (is_global_import):
     159        (f.1):
     160        (f.2):
     161        (f.3):
     162        (module_with_var_opt):
     163        (module_):
     164        (literal):
     165        (definition):
     166        (access):
     167        (action):
     168        (script):
     169        (_registry.string_appeared_here):
     170        (init):
     171        (make_matrix):
     172        (copy):
     173        (append):
     174        (sub):
     175        (fill):
     176        (blit):
     177        (iter):
     178        (map):
     179        (iteri):
     180        (mapi):
     181        (to_list):
     182        (list_length):
     183        (of_list):
     184        (fold_left):
     185        (fold_right):
     186        (maxson):
     187        (trickle):
     188        (bubble):
     189        (trickleup):
     190        (sort):
     191        (merge):
     192        (isortto):
     193        (sortto):
     194        (stable_sort):
     195        (import_type):
     196        (export_type):
     197        (dims.n):
     198        (dims.d.i):
     199        (dims):
     200        (map_file):
     201        (create):
     202        (of_array):
     203        (slice_left):
     204        (slice_right):
     205        (slice_left_1):
     206        (slice_right_1):
     207        (slice_left_2):
     208        (slice_right_2):
     209        (array1_of_genarray):
     210        (array2_of_genarray):
     211        (array3_of_genarray):
     212        (reshape_1):
     213        (reshape_2):
     214        (reshape_3):
     215        (reshape):
     216        (__):
     217        (contents):
     218        (to_bytes):
     219        (nth):
     220        (length):
     221        (clear):
     222        (reset):
     223        (resize):
     224        (add_substring):
     225        (add_subbytes):
     226        (add_string):
     227        (add_bytes):
     228        (add_buffer):
     229        (add_channel):
     230        (output_buffer):
     231        (closing):
     232        (advance_to_closing):
     233        (advance_to_non_alpha):
     234        (find_ident):
     235        (add_substitute):
     236        (make):
     237        (to_string):
     238        (of_string):
     239        (sub_string):
     240        (extend):
     241        (blit_string):
     242        (concat):
     243        (cat):
     244        (is_space):
     245        (trim):
     246        (escaped):
     247        (uppercase):
     248        (lowercase):
     249        (apply1):
     250        (capitalize):
     251        (uncapitalize):
     252        (index_rec):
     253        (index):
     254        (index_from):
     255        (rindex_rec):
     256        (rindex):
     257        (rindex_from):
     258        (contains_from):
     259        (contains):
     260        (rcontains_from):
     261        (caml_array_sub):
     262        (len):
     263        (caml_array_concat):
     264        (caml_make_vect):
     265        (caml_array_blit):
     266        (get if):
     267        (caml_set_oo_id):
     268        (get_id):
     269        (caml_int32_float_of_bits):
     270        (caml_int32_bits_of_float):
     271        (caml_classify_float):
     272        (caml_modf_float):
     273        (caml_ldexp_float):
     274        (caml_frexp_float):
     275        (caml_copysign_float):
     276        (caml_expm1_float):
     277        (caml_hypot_float):
     278        (caml_log10_float):
     279        (caml_failwith):
     280        (parse_digit):
     281        (int_of_string_base):
     282        (parse_sign_and_base):
     283        (caml_int_of_string.aux):
     284        (caml_int_of_string):
     285        (caml_int64_of_string.aux):
     286        (caml_int64_of_string):
     287        (int_of_base):
     288        (parse_format):
     289        (finish_formatting):
     290        (caml_format_int):
     291        (caml_int64_format):
     292        (caml_format_float):
     293        (float_of_string):
     294        (div):
     295        (mod_):
     296        (caml_bswap16):
     297        (caml_int32_bswap):
     298        (imul):
     299        (neg_signed):
     300        (not):
     301        (eq):
     302        (neg):
     303        (lsl_):
     304        (lsr_):
     305        (asr_):
     306        (is_zero):
     307        (mul):
     308        (swap):
     309        (xor):
     310        (or_):
     311        (and_):
     312        (ge):
     313        (lt):
     314        (gt):
     315        (le):
     316        (to_float):
     317        (of_float):
     318        (div_mod):
     319        (compare):
     320        (of_int32):
     321        (to_int32):
     322        (to_hex.aux):
     323        (to_hex):
     324        (discard_sign):
     325        (float_of_bits):
     326        (bits_of_float.to_nat):
     327        (bits_of_float):
     328        (get64):
     329        (erase_rel):
     330        (concat_fmtty):
     331        (concat_fmt):
     332        (create_char_set):
     333        (add_in_char_set):
     334        (rev_char_set):
     335        (is_in_char_set):
     336        (prec_of_prec_opt):
     337        (param_format_of_ignored_format):
     338        (buffer_check_size):
     339        (buffer_add_char):
     340        (buffer_add_string):
     341        (buffer_contents):
     342        (char_of_iconv):
     343        (char_of_fconv):
     344        (char_of_counter):
     345        (print_char):
     346        (set while.set var):
     347        (set while.set else):
     348        (set var):
     349        (set else):
     350        (set print_char):
     351        (set if):
     352        (bprint_padty):
     353        (bprint_ignored_flag):
     354        (bprint_pad_opt):
     355        (bprint_padding):
     356        (bprint_precision):
     357        (bprint_iconv_flag):
     358        (bprint_int_fmt):
     359        (bprint_altint_fmt):
     360        (bprint_fconv_flag):
     361        (bprint_float_fmt):
     362        (string_of_formatting_lit):
     363        (string_of_formatting_gen):
     364        (bprint_char_literal):
     365        (bprint_string_literal):
     366        (bprint_fmtty):
     367        (int_of_custom_arity):
     368        (bprint_fmt):
     369        (string_of_fmt):
     370        (symm):
     371        (fmtty_rel_det):
     372        (trans):
     373        (fmtty_of_formatting_gen):
     374        (fmtty_of_fmt):
     375        (fmtty_of_custom):
     376        (fmtty_of_padding_fmtty):
     377        (fmtty_of_precision_fmtty):
     378        (type_padding):
     379        (type_padprec):
     380        (type_ignored_param_one):
     381        (type_format_gen):
     382        (type_ignored_format_substitution):
     383        (type_format):
     384        (recast):
     385        (fix_padding):
     386        (fix_int_precision):
     387        (string_to_caml_string):
     388        (format_of_iconv):
     389        (format_of_aconv):
     390        (format_of_fconv):
     391        (convert_int):
     392        (convert_int32):
     393        (convert_nativeint):
     394        (convert_int64):
     395        (else.is_valid):
     396        (convert_float):
     397        (format_caml_char):
     398        (string_of_fmtty):
     399        (else.switch.):
     400        (else.switch.k.prime):
     401        (else.switch.else.):
     402        (else.switch.else.k.prime.1):
     403        (make_printf):
     404        (make_from_fmtty):
     405        (make_invalid_arg):
     406        (make_string_padding):
     407        (make_int_padding_precision):
     408        (make_custom):
     409        (output_acc):
     410        (bufput_acc):
     411        (strput_acc):
     412        (failwith_message.k):
     413        (failwith_message):
     414        (open_box_of_string.else.invalid_box):
     415        (open_box_of_string.else.parse_spaces):
     416        (open_box_of_string.else.parse_lword):
     417        (open_box_of_string.else.parse_int):
     418        (open_box_of_string):
     419        (make_padding_fmt_ebb):
     420        (make_precision_fmt_ebb):
     421        (make_padprec_fmt_ebb):
     422        (invalid_format_message):
     423        (invalid_format_without):
     424        (expected_character):
     425        (compute_int_conv):
     426        (incompatible_flag):
     427        (parse_positive):
     428        (parse_conv):
     429        (parse_after_precision):
     430        (else.parse_literal):
     431        (parse_after_padding):
     432        (parse_literal):
     433        (parse_after_at):
     434        (add_literal):
     435        (parse_spaces):
     436        (parse_integer):
     437        (compute_float_conv):
     438        (search_subformat_end):
     439        (check_no_0):
     440        (opt_of_pad):
     441        (get_prec_opt):
     442        (else.switch.case.99.char_format):
     443        (else.switch.scan_format):
     444        (parse_conversion):
     445        (set_flag):
     446        (parse_flags):
     447        (is_int_base):
     448        (counter_of_char):
     449        (add_range):
     450        (fail_single_percent):
     451        (parse_char_set_after_char):
     452        (parse_char_set_content):
     453        (parse_char_set_start):
     454        (parse_char_set):
     455        (check_open_box):
     456        (parse_tag):
     457        (fmt_ebb_of_string):
     458        (format_of_string_fmtty):
     459        (format_of_string_format):
     460        (caret):
     461        (caml_ml_open_descriptor_in):
     462        (caml_ml_open_descriptor_out):
     463        (caml_ml_flush):
     464        (node_std_output):
     465        (caml_ml_output_char):
     466        (caml_ml_input):
     467        (caml_ml_input_char):
     468        (caml_ml_out_channels_list):
     469        (fail):
     470        (caml_lex_array):
     471        (caml_lex_engine):
     472        (caml_lex_run_mem):
     473        (caml_lex_run_tag):
     474        (caml_new_lex_engine):
     475        (caml_obj_dup):
     476        (caml_obj_truncate):
     477        (caml_lazy_make_forward):
     478        (caml_update_dummy):
     479        (caml_int_compare):
     480        (caml_compare):
     481        (caml_equal):
     482        (caml_notequal):
     483        (caml_greaterequal):
     484        (caml_lessequal):
     485        (else.aux):
     486        (caml_get_public_method):
     487        (caml_parse_engine):
     488        (caml_set_parser_trace):
     489        (js_string_of_char):
     490        (caml_string_get):
     491        (caml_create_string):
     492        (caml_string_compare):
     493        (caml_fill_string):
     494        (caml_blit_string):
     495        (caml_blit_bytes):
     496        (bytes_of_string):
     497        (bytes_to_string):
     498        (caml_string_of_char_array):
     499        (caml_is_printable):
     500        (caml_string_get16):
     501        (caml_string_get32):
     502        (repeat):
     503        (chr):
     504        (app):
     505        (js):
     506        (curry_1):
     507        (_1):
     508        (js1):
     509        (__1):
     510        (curry_2):
     511        (_2):
     512        (js2):
     513        (__2):
     514        (curry_3):
     515        (_3):
     516        (js3):
     517        (__3):
     518        (curry_4):
     519        (_4):
     520        (js4):
     521        (__4):
     522        (curry_5):
     523        (_5):
     524        (js5):
     525        (__5):
     526        (curry_6):
     527        (_6):
     528        (js6):
     529        (__6):
     530        (curry_7):
     531        (_7):
     532        (js7):
     533        (__7):
     534        (curry_8):
     535        (_8):
     536        (js8):
     537        (__8):
     538        (stream):
     539        (eos):
     540        (skip):
     541        (read):
     542        (peek):
     543        (string_of_byte):
     544        (position):
     545        (region):
     546        (error):
     547        (guard):
     548        (get 1):
     549        (get expect):
     550        (get illegal):
     551        (at):
     552        (u32):
     553        (u64):
     554        (get require):
     555        (vuN):
     556        (get var):
     557        (vsN):
     558        (vu32):
     559        (vs32):
     560        (vs64):
     561        (f32):
     562        (f64):
     563        (len32):
     564        (string):
     565        (opt):
     566        (vec):
     567        (sized):
     568        (value_type):
     569        (elem_type):
     570        (stack_type):
     571        (table_type):
     572        (memory_type):
     573        (mutability.get if):
     574        (mutability):
     575        (instr.get if):
     576        (instr_block):
     577        (const):
     578        (id):
     579        (section):
     580        (type_section):
     581        (import_kind.get if):
     582        (import_section):
     583        (func_section):
     584        (table_section):
     585        (memory_section):
     586        (global):
     587        (global_section):
     588        (export_kind.get if):
     589        (export_section):
     590        (start_section):
     591        (local):
     592        (code):
     593        (code_section):
     594        (table_segment):
     595        (elem_section):
     596        (memory_segment):
     597        (data_section):
     598        (partial_arg.1):
     599        (custom):
     600        (custom_section):
     601        (iterate):
     602        (decode):
     603        (patch):
     604        (encode.u8):
     605        (encode.u16):
     606        (encode.u32):
     607        (encode.vu64):
     608        (encode.vs64):
     609        (encode.vu32):
     610        (encode.len):
     611        (encode.bool):
     612        (encode.string):
     613        (encode.vec):
     614        (encode.gap32):
     615        (encode.patch_gap32):
     616        (encode.value_type):
     617        (encode.stack_type):
     618        (encode.func_type):
     619        (encode.limits):
     620        (encode.table_type):
     621        (encode.memory_type):
     622        (encode.global_type):
     623        (encode.memop):
     624        (encode):
     625        (encode.instr):
     626        (encode.const):
     627        (encode.section):
     628        (encode.type_section):
     629        (encode.import):
     630        (encode.import_section):
     631        (encode.func):
     632        (encode.func_section):
     633        (encode.table):
     634        (encode.table_section):
     635        (encode.memory):
     636        (encode.memory_section):
     637        (encode.global):
     638        (encode.global_section):
     639        (encode.export_kind):
     640        (encode.export):
     641        (encode.export_section):
     642        (encode.start_section):
     643        (encode.combine):
     644        (encode.compress):
     645        (encode.local):
     646        (encode.code):
     647        (encode.code_section):
     648        (encode.segment):
     649        (encode.table_segment):
     650        (encode.elem_section):
     651        (encode.memory_segment):
     652        (encode.module_):
     653        (Make.warn):
     654        (Make.error):
     655        (Make):
     656        (print_nan_significand_digits):
     657        (Make.of_bits):
     658        (Make.to_bits):
     659        (Make.is_nan):
     660        (Make.canonicalize_nan):
     661        (Make.determine_binary_nan):
     662        (Make.determine_unary_nan):
     663        (Make.binary):
     664        (Make.unary):
     665        (Make.add):
     666        (Make.sub):
     667        (Make.mul):
     668        (Make.div):
     669        (Make.sqrt):
     670        (Make.ceil):
     671        (Make.floor):
     672        (Make.trunc):
     673        (Make.nearest):
     674        (Make.min):
     675        (Make.max):
     676        (Make.abs):
     677        (Make.neg):
     678        (Make.copysign):
     679        (Make.eq):
     680        (Make.ne):
     681        (Make.lt):
     682        (Make.gt):
     683        (Make.le):
     684        (Make.ge):
     685        (Make.of_signless_string):
     686        (Make.of_string):
     687        (Make.to_string):
     688        (add_queue):
     689        (peek_queue):
     690        (take_queue):
     691        (pp_enqueue):
     692        (pp_clear_queue):
     693        (pp_output_string):
     694        (break_new_line):
     695        (break_same_line):
     696        (pp_force_break_line):
     697        (switch.add_tab):
     698        (else.switch.find):
     699        (format_pp_token):
     700        (advance_left):
     701        (enqueue_advance):
     702        (enqueue_string_as):
     703        (set_size):
     704        (scan_push):
     705        (pp_open_box_gen):
     706        (pp_close_box):
     707        (pp_open_tag):
     708        (pp_close_tag):
     709        (pp_set_print_tags):
     710        (pp_set_mark_tags):
     711        (pp_get_print_tags):
     712        (pp_get_mark_tags):
     713        (pp_set_tags):
     714        (pp_get_formatter_tag_functions):
     715        (pp_set_formatter_tag_functions):
     716        (pp_rinit):
     717        (pp_flush_queue):
     718        (pp_print_as_size):
     719        (pp_print_string):
     720        (pp_print_int):
     721        (pp_print_float):
     722        (pp_print_bool):
     723        (pp_open_hbox):
     724        (pp_open_vbox):
     725        (pp_open_hvbox):
     726        (pp_open_hovbox):
     727        (pp_open_box):
     728        (pp_print_newline):
     729        (pp_print_flush):
     730        (pp_force_newline):
     731        (pp_print_if_newline):
     732        (pp_print_break):
     733        (pp_print_space):
     734        (pp_print_cut):
     735        (pp_open_tbox):
     736        (pp_close_tbox):
     737        (pp_print_tbreak):
     738        (pp_print_tab):
     739        (pp_set_tab):
     740        (pp_print_list):
     741        (flush):
     742        (pp_print_text):
     743        (pp_set_max_boxes):
     744        (pp_get_max_boxes):
     745        (pp_over_max_boxes):
     746        (pp_get_ellipsis_text):
     747        (pp_limit):
     748        (pp_set_max_indent):
     749        (pp_get_max_indent):
     750        (pp_set_margin):
     751        (pp_get_margin):
     752        (pp_set_formatter_out_functions):
     753        (pp_get_formatter_out_functions):
     754        (pp_set_formatter_output_functions):
     755        (pp_get_formatter_output_functions):
     756        (pp_set_all_formatter_output_functions):
     757        (pp_get_all_formatter_output_functions):
     758        (display_newline):
     759        (display_blanks):
     760        (state.16):
     761        (state.17):
     762        (state.18):
     763        (state.19):
     764        (pp_set_formatter_out_channel):
     765        (default_pp_mark_open_tag):
     766        (default_pp_mark_close_tag):
     767        (default_pp_print_open_tag):
     768        (default_pp_print_close_tag):
     769        (pp_make_formatter):
     770        (ppf.18):
     771        (ppf.19):
     772        (make_formatter):
     773        (formatter_of_out_channel):
     774        (formatter_of_buffer):
     775        (flush_str_formatter):
     776        (flush_buf_formatter):
     777        (open_hbox):
     778        (open_vbox):
     779        (open_hvbox):
     780        (open_hovbox):
     781        (open_box):
     782        (close_box):
     783        (open_tag):
     784        (close_tag):
     785        (print_as):
     786        (print_string):
     787        (print_int):
     788        (print_float):
     789        (print_bool):
     790        (print_cut):
     791        (print_space):
     792        (force_newline):
     793        (print_flush):
     794        (print_newline):
     795        (print_if_newline):
     796        (open_tbox):
     797        (close_tbox):
     798        (print_tbreak):
     799        (set_tab):
     800        (print_tab):
     801        (set_margin):
     802        (get_margin):
     803        (set_max_indent):
     804        (get_max_indent):
     805        (set_max_boxes):
     806        (get_max_boxes):
     807        (over_max_boxes):
     808        (set_ellipsis_text):
     809        (get_ellipsis_text):
     810        (set_formatter_out_channel):
     811        (set_formatter_out_functions):
     812        (get_formatter_out_functions):
     813        (set_formatter_output_functions):
     814        (get_formatter_output_functions):
     815        (set_all_formatter_output_functions):
     816        (get_all_formatter_output_functions):
     817        (set_formatter_tag_functions):
     818        (get_formatter_tag_functions):
     819        (set_print_tags):
     820        (get_print_tags):
     821        (set_mark_tags):
     822        (get_mark_tags):
     823        (set_tags):
     824        (compute_tag):
     825        (output_formatting_lit):
     826        (kfprintf):
     827        (ikfprintf):
     828        (fprintf):
     829        (ifprintf):
     830        (printf):
     831        (eprintf):
     832        (k.prime):
     833        (ksprintf):
     834        (sprintf):
     835        (asprintf.k.prime):
     836        (asprintf):
     837        (k):
     838        (bprintf):
     839        (succ):
     840        (pred):
     841        (abs):
     842        (lognot):
     843        (Make.cmp_u):
     844        (Make.divrem_u):
     845        (Make.div_s):
     846        (Make.div_u):
     847        (Make.rem_s):
     848        (Make.rem_u):
     849        (Make.shift):
     850        (Make.shl):
     851        (Make.shr_s):
     852        (Make.shr_u):
     853        (Make.clamp_rotate_count):
     854        (Make.rotl):
     855        (Make.rotr):
     856        (Make.loop):
     857        (Make.clz):
     858        (Make.ctz):
     859        (Make.popcnt):
     860        (Make.eqz):
     861        (Make.lt_u):
     862        (Make.le_u):
     863        (Make.gt_u):
     864        (Make.ge_u):
     865        (Make.of_int_u):
     866        (Make.to_string_u):
     867        (Make.require):
     868        (Make.dec_digit):
     869        (Make.hex_digit):
     870        (Make.parse_int):
     871        (Make.of_string_s):
     872        (Make.of_string_u):
     873        (convert_pos):
     874        (error_nest):
     875        (text):
     876        (intop):
     877        (floatop):
     878        (numop):
     879        (memsz):
     880        (ext):
     881        (token.else.switch):
     882        (token.else.switch.):
     883        (token):
     884        (__ocaml_lex_comment_rec):
     885        (engine):
     886        (new_engine):
     887        (from_function):
     888        (from_channel):
     889        (from_string):
     890        (lexeme):
     891        (sub_lexeme):
     892        (sub_lexeme_opt):
     893        (sub_lexeme_char):
     894        (sub_lexeme_char_opt):
     895        (lexeme_char):
     896        (lexeme_start):
     897        (lexeme_end):
     898        (lexeme_start_p):
     899        (lexeme_end_p):
     900        (new_line):
     901        (flush_input):
     902        (take):
     903        (drop):
     904        (last):
     905        (split_last):
     906        (index_of):
     907        (index_of_int32):
     908        (dim):
     909        (set 1):
     910        (get 2):
     911        (log2):
     912        (is_power_of_two):
     913        (loop):
     914        (breakup):
     915        (hd):
     916        (tl):
     917        (rev_append):
     918        (rev):
     919        (flatten):
     920        (rev_map):
     921        (map2):
     922        (rev_map2):
     923        (iter2):
     924        (fold_left2):
     925        (fold_right2):
     926        (for_all):
     927        (exists):
     928        (for_all2):
     929        (exists2):
     930        (mem):
     931        (memq):
     932        (assoc):
     933        (assq):
     934        (mem_assoc):
     935        (mem_assq):
     936        (remove_assoc):
     937        (remove_assq):
     938        (find):
     939        (find_all):
     940        (partition):
     941        (split):
     942        (combine):
     943        (chop):
     944        (rev_sort):
     945        (sort_uniq):
     946        (Make.height):
     947        (Make.create):
     948        (Make.singleton):
     949        (Make.bal):
     950        (Make.is_empty):
     951        (Make.find):
     952        (Make.mem):
     953        (Make.min_binding):
     954        (Make.max_binding):
     955        (Make.remove_min_binding):
     956        (Make.remove):
     957        (Make.iter):
     958        (Make.map):
     959        (Make.mapi):
     960        (Make.fold):
     961        (Make.for_all):
     962        (Make.exists):
     963        (Make.add_min_binding):
     964        (Make.add_max_binding):
     965        (Make.join):
     966        (Make.concat):
     967        (Make.concat_or_join):
     968        (Make.split):
     969        (Make.merge):
     970        (Make.filter):
     971        (Make.partition):
     972        (Make.cons_enum):
     973        (Make.compare):
     974        (Make.equal):
     975        (Make.cardinal):
     976        (Make.bindings_aux):
     977        (Make.bindings):
     978        (double_field):
     979        (set_double_field):
     980        (marshal):
     981        (unmarshal):
     982        (extension_slot):
     983        (extension_name):
     984        (extension_id):
     985        (i32_const):
     986        (i64_const):
     987        (f32_const):
     988        (f64_const):
     989        (block):
     990        (br):
     991        (br_if):
     992        (br_table):
     993        (if_):
     994        (call):
     995        (call_indirect):
     996        (get_local):
     997        (set_local):
     998        (tee_local):
     999        (get_global):
     1000        (set_global):
     1001        (i32_load):
     1002        (i64_load):
     1003        (f32_load):
     1004        (f64_load):
     1005        (i32_load8_s):
     1006        (i32_load8_u):
     1007        (i32_load16_s):
     1008        (i32_load16_u):
     1009        (i64_load8_s):
     1010        (i64_load8_u):
     1011        (i64_load16_s):
     1012        (i64_load16_u):
     1013        (i64_load32_s):
     1014        (i64_load32_u):
     1015        (i32_store):
     1016        (i64_store):
     1017        (f32_store):
     1018        (f64_store):
     1019        (i32_store8):
     1020        (i32_store16):
     1021        (i64_store8):
     1022        (i64_store16):
     1023        (i64_store32):
     1024        (parse):
     1025        (string_to):
     1026        (string_to_script):
     1027        (string_to_module):
     1028        (parse_error):
     1029        (position_to_pos):
     1030        (positions_to_region):
     1031        (ati):
     1032        (nat):
     1033        (nat32):
     1034        (empty_context):
     1035        (enter_func):
     1036        (type_):
     1037        (lookup):
     1038        (label):
     1039        (anon_type):
     1040        (bind):
     1041        (bind_func):
     1042        (bind_local):
     1043        (bind_global):
     1044        (bind_table):
     1045        (bind_memory):
     1046        (anon):
     1047        (anon_func):
     1048        (anon_locals):
     1049        (anon_global):
     1050        (anon_table):
     1051        (anon_memory):
     1052        (anon_label):
     1053        (explicit_sig):
     1054        (inline_type):
     1055        (yyact):
     1056        (script1):
     1057        (module1):
     1058        (grow_stacks):
     1059        (clear_parser):
     1060        (current_lookahead_fun):
     1061        (catch.else.current_lookahead_fun.0):
     1062        (yyparse):
     1063        (peek_val):
     1064        (symbol_start_pos):
     1065        (symbol_end_pos):
     1066        (rhs_start_pos):
     1067        (rhs_end_pos):
     1068        (symbol_start):
     1069        (symbol_end):
     1070        (rhs_start):
     1071        (rhs_end):
     1072        (is_current_lookahead):
     1073        (failwith):
     1074        (invalid_arg):
     1075        (min):
     1076        (max):
     1077        (lnot):
     1078        (char_of_int):
     1079        (string_of_bool):
     1080        (bool_of_string):
     1081        (string_of_int):
     1082        (valid_float_lexem):
     1083        (string_of_float):
     1084        (open_out_gen):
     1085        (open_out):
     1086        (open_out_bin):
     1087        (flush_all):
     1088        (output_bytes):
     1089        (output_string):
     1090        (output):
     1091        (output_substring):
     1092        (output_value):
     1093        (close_out):
     1094        (close_out_noerr):
     1095        (open_in_gen):
     1096        (open_in):
     1097        (open_in_bin):
     1098        (input):
     1099        (else.r):
     1100        (unsafe_really_input):
     1101        (really_input):
     1102        (really_input_string):
     1103        (input_line.build_result):
     1104        (input_line.n):
     1105        (input_line.scan):
     1106        (input_line):
     1107        (close_in_noerr):
     1108        (print_bytes):
     1109        (print_endline):
     1110        (prerr_char):
     1111        (prerr_string):
     1112        (prerr_bytes):
     1113        (prerr_int):
     1114        (prerr_float):
     1115        (prerr_endline):
     1116        (prerr_newline):
     1117        (read_line):
     1118        (read_int):
     1119        (read_float):
     1120        (string_of_format):
     1121        (at_exit.exit_function.0):
     1122        (at_exit):
     1123        (do_at_exit):
     1124        (exit):
     1125        (output_binary_int):
     1126        (seek_out):
     1127        (pos_out):
     1128        (out_channel_length):
     1129        (set_binary_mode_out):
     1130        (input_binary_int):
     1131        (input_value):
     1132        (seek_in):
     1133        (pos_in):
     1134        (in_channel_length):
     1135        (close_in):
     1136        (set_binary_mode_in):
     1137        (LargeFile_000):
     1138        (LargeFile_001):
     1139        (LargeFile_002):
     1140        (LargeFile_003):
     1141        (LargeFile_004):
     1142        (LargeFile_005):
     1143        (kbprintf):
     1144        (plus):
     1145        (pp):
     1146        (print):
     1147        (string_of_pos):
     1148        (string_of_region):
     1149        (escaped.needs_escape):
     1150        (set_signal):
     1151        (catch_break):
     1152        (size):
     1153        (string_of_value_type):
     1154        (string_of_value_types):
     1155        (string_of_elem_type):
     1156        (string_of_limits):
     1157        (string_of_table_type):
     1158        (string_of_global_type):
     1159        (string_of_stack_type):
     1160        (string_of_func_type):
     1161        (type_of):
     1162        (default_value):
     1163        (value_of_bool):
     1164        (string_of_values):
     1165        (to_value):
     1166        (of_value):
     1167        (g):
     1168        (binary):
     1169        (bytes):
     1170        * wasm/references-spec-tests/select.wast.js: Added.
     1171        * wasm/references/table_instructions_parse_unreachable.js:
     1172        (invalidAnnotatedSelectUnreachable):
     1173        * wasm/wasm.json:
     1174
    111752020-12-11  Yusuke Suzuki  <ysuzuki@apple.com>
    21176
  • trunk/JSTests/wasm.yaml

    r270689 r270827  
    5555- path: wasm/references-spec-tests/table_init.wast.js
    5656  cmd: runWebAssemblyReferenceSpecTest :normal
     57- path: wasm/references-spec-tests/select.wast.js
     58  cmd: runWebAssemblyReferenceSpecTest :normal
    5759
    5860- path: wasm/multi-value-spec-tests/block.wast.js
  • trunk/JSTests/wasm/references/table_instructions_parse_unreachable.js

    r270689 r270827  
    223223}
    224224
     225function validAnnotatedSelectUnreachable() {
     226  /*
     227  (module
     228    (table $t 10 externref)
     229    (func (export "run")
     230      (return)
     231      (drop
     232        (select (result externref) (ref.null extern) (ref.null extern) (i32.const 1)))
     233    )
     234  )
     235  */
     236  let instance = new WebAssembly.Instance(module("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x03\x02\x01\x00\x04\x04\x01\x6f\x00\x0a\x07\x07\x01\x03\x72\x75\x6e\x00\x00\x0a\x0f\x01\x0d\x00\x0f\xd0\x6f\xd0\x6f\x41\x01\x1c\x01\x6f\x1a\x0b"));
     237  instance.exports.run();
     238}
     239
     240function invalidAnnotatedSelectUnreachable() {
     241  /*
     242  (module
     243    (table $t 10 externref)
     244    (func (export "run")
     245      (return)
     246      (drop
     247        (select (result (size = 2) externref) (ref.null extern) (ref.null extern) (i32.const 1)))
     248    )
     249  )
     250  */
     251  assert.throws(() => module("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x04\x01\x60\x00\x00\x03\x02\x01\x00\x04\x04\x01\x6f\x00\x0a\x07\x07\x01\x03\x72\x75\x6e\x00\x00\x0a\x0f\x01\x0d\x00\x0f\xd0\x6f\xd0\x6f\x41\x01\x1c\x02\x6f\x1a\x0b"),
     252  WebAssembly.CompileError,
     253  "WebAssembly.Module doesn't parse at byte 10: select invalid result arity for, in function at index 0 (evaluating 'new WebAssembly.Module(buffer)')");
     254}
     255
    225256validTableInitUnreachable();
    226257invalidTableInitUnreachable();
     
    240271validTableCopyUnreachable();
    241272invalidTableCopyUnreachable();
     273
     274validAnnotatedSelectUnreachable();
     275invalidAnnotatedSelectUnreachable();
  • trunk/JSTests/wasm/wasm.json

    r270689 r270827  
    4646        "else":                { "category": "control",    "value":   5, "return": ["control"],                      "parameter": [],                             "immediate": [],                                                                                            "description": "begin else expression of if" },
    4747        "select":              { "category": "control",    "value":  27, "return": ["prev"],                         "parameter": ["any", "prev", "bool"],        "immediate": [],                                                                                            "description": "select one of two values based on condition" },
     48        "annotated_select":    { "category": "control",    "value":  28, "return": ["prev"],                         "parameter": ["any", "prev", "bool"],        "immediate": [{"name": "target_types_count", "type": "varuint32",                                           "description": "number of entries in the target types vector"},
     49                                                                                                                                                                                {"name": "target_types",       "type": "value_type*",                                         "description": "target types that indicate result of select instruction"}],
     50                                                                                                                                                                                                                                                                              "description": "the same as just select but with the annotation for result types" },
    4851        "br":                  { "category": "control",    "value":  12, "return": [],                               "parameter": [],                             "immediate": [{"name": "relative_depth", "type": "varuint32"}],                                             "description": "break that targets an outer nested block" },
    4952        "br_if":               { "category": "control",    "value":  13, "return": [],                               "parameter": [],                             "immediate": [{"name": "relative_depth", "type": "varuint32"}],                                             "description": "conditional break that targets an outer nested block" },
  • trunk/Source/JavaScriptCore/ChangeLog

    r270794 r270827  
     12020-12-15  Dmitry Bezhetskov  <dbezhetskov@igalia.com>
     2
     3        [WASM-References] Add support for type annotated select
     4        https://bugs.webkit.org/show_bug.cgi?id=219595
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Add support for typed select instruction from ref-types proposal:
     9        select t : [t t i32] -> [t].
     10        The annotated select instruction takes a value type immediate to deduce result type of select expression.
     11        This version of select will help us with subtyping in the future where we want to avoid computing lubs.
     12        For more information see:
     13        https://github.com/WebAssembly/reference-types/issues/125,
     14        https://webassembly.github.io/reference-types/core/binary/instructions.html#parametric-instructions.
     15
     16        * wasm/WasmFunctionParser.h:
     17        (JSC::Wasm::FunctionParser<Context>::parseAnnotatedSelectImmediates):
     18        (JSC::Wasm::FunctionParser<Context>::parseExpression):
     19        (JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):
     20        * wasm/wasm.json:
     21
    1222020-12-14  Tadeu Zagallo  <tzagallo@apple.com>
    223
  • trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h

    r270689 r270827  
    151151    PartialResult WARN_UNUSED_RETURN parseTableCopyImmediates(TableCopyImmediates&);
    152152
     153    struct AnnotatedSelectImmediates {
     154        unsigned sizeOfAnnotationVector;
     155        Type targetType;
     156    };
     157    PartialResult WARN_UNUSED_RETURN parseAnnotatedSelectImmediates(AnnotatedSelectImmediates&);
     158
    153159#define WASM_TRY_ADD_TO_CONTEXT(add_expression) WASM_FAIL_IF_HELPER_FAILS(m_context.add_expression)
    154160
     
    548554
    549555template<typename Context>
     556auto FunctionParser<Context>::parseAnnotatedSelectImmediates(AnnotatedSelectImmediates& result) -> PartialResult
     557{
     558    uint32_t sizeOfAnnotationVector;
     559    WASM_PARSER_FAIL_IF(!parseVarUInt32(sizeOfAnnotationVector), "select can't parse the size of annotation vector");
     560    WASM_PARSER_FAIL_IF(sizeOfAnnotationVector != 1, "select invalid result arity for");
     561
     562    Type targetType;
     563    WASM_PARSER_FAIL_IF(!parseValueType(targetType), "select can't parse annotations");
     564
     565    result.sizeOfAnnotationVector = sizeOfAnnotationVector;
     566    result.targetType = targetType;
     567
     568    return { };
     569}
     570
     571template<typename Context>
    550572auto FunctionParser<Context>::checkBranchTarget(const ControlType& target) -> PartialResult
    551573{
     
    594616        WASM_TRY_POP_EXPRESSION_STACK_INTO(nonZero, "select non-zero");
    595617
     618        if (Options::useWebAssemblyReferences())
     619            WASM_PARSER_FAIL_IF(isRefType(nonZero.type()) || isRefType(nonZero.type()), "can't use ref-types with unannotated select");
     620
    596621        WASM_VALIDATOR_FAIL_IF(condition.type() != I32, "select condition must be i32, got ", condition.type());
    597622        WASM_VALIDATOR_FAIL_IF(nonZero.type() != zero.type(), "select result types must match, got ", nonZero.type(), " and ", zero.type());
     
    601626
    602627        m_expressionStack.constructAndAppend(zero.type(), result);
     628        return { };
     629    }
     630
     631    case AnnotatedSelect: {
     632        WASM_PARSER_FAIL_IF(!Options::useWebAssemblyReferences(), "references are not enabled");
     633
     634        AnnotatedSelectImmediates immediates;
     635        WASM_FAIL_IF_HELPER_FAILS(parseAnnotatedSelectImmediates(immediates));
     636
     637        TypedExpression condition;
     638        TypedExpression zero;
     639        TypedExpression nonZero;
     640
     641        WASM_TRY_POP_EXPRESSION_STACK_INTO(condition, "select condition");
     642        WASM_TRY_POP_EXPRESSION_STACK_INTO(zero, "select zero");
     643        WASM_TRY_POP_EXPRESSION_STACK_INTO(nonZero, "select non-zero");
     644
     645        WASM_VALIDATOR_FAIL_IF(condition.type() != I32, "select condition must be i32, got ", condition.type());
     646        WASM_VALIDATOR_FAIL_IF(nonZero.type() != immediates.targetType, "select result types must match, got ", nonZero.type(), " and ", immediates.targetType);
     647        WASM_VALIDATOR_FAIL_IF(zero.type() != immediates.targetType, "select result types must match, got ", zero.type(), " and ", immediates.targetType);
     648
     649        ExpressionType result;
     650        WASM_TRY_ADD_TO_CONTEXT(addSelect(condition, nonZero, zero, result));
     651
     652        m_expressionStack.constructAndAppend(immediates.targetType, result);
    603653        return { };
    604654    }
     
    13441394    }
    13451395
     1396    case AnnotatedSelect: {
     1397        WASM_PARSER_FAIL_IF(!Options::useWebAssemblyReferences(), "references are not enabled");
     1398
     1399        AnnotatedSelectImmediates immediates;
     1400        WASM_FAIL_IF_HELPER_FAILS(parseAnnotatedSelectImmediates(immediates));
     1401        return { };
     1402    }
     1403
    13461404    case TableGet:
    13471405    case TableSet: {
  • trunk/Source/JavaScriptCore/wasm/wasm.json

    r270689 r270827  
    4646        "else":                { "category": "control",    "value":   5, "return": ["control"],                      "parameter": [],                             "immediate": [],                                                                                            "description": "begin else expression of if" },
    4747        "select":              { "category": "control",    "value":  27, "return": ["prev"],                         "parameter": ["any", "prev", "bool"],        "immediate": [],                                                                                            "description": "select one of two values based on condition" },
     48        "annotated_select":    { "category": "control",    "value":  28, "return": ["prev"],                         "parameter": ["any", "prev", "bool"],        "immediate": [{"name": "target_types_count", "type": "varuint32",                                           "description": "number of entries in the target types vector"},
     49                                                                                                                                                                                {"name": "target_types",       "type": "value_type*",                                         "description": "target types that indicate result of select instruction"}],
     50                                                                                                                                                                                                                                                                              "description": "the same as just select but with the annotation for result types" },
    4851        "br":                  { "category": "control",    "value":  12, "return": [],                               "parameter": [],                             "immediate": [{"name": "relative_depth", "type": "varuint32"}],                                             "description": "break that targets an outer nested block" },
    4952        "br_if":               { "category": "control",    "value":  13, "return": [],                               "parameter": [],                             "immediate": [{"name": "relative_depth", "type": "varuint32"}],                                             "description": "conditional break that targets an outer nested block" },
  • trunk/Tools/ChangeLog

    r270812 r270827  
     12020-12-15  Dmitry Bezhetskov  <dbezhetskov@igalia.com>
     2
     3        [WASM-References] Add support for type annotated select
     4        https://bugs.webkit.org/show_bug.cgi?id=219595
     5
     6        Reviewed by Yusuke Suzuki.
     7       
     8        Add support for testing ref-types.
     9
     10        * Scripts/run-jsc-stress-tests:
     11
    1122020-12-14  Andy Estes  <aestes@apple.com>
    213
  • trunk/Tools/Scripts/run-jsc-stress-tests

    r270689 r270827  
    12491249end
    12501250
    1251 def runWebAssemblySpecTest(mode)
     1251def runWebAssemblySpecTestBase(mode, specHarnessPath, *optionalTestSpecificOptions)
    12521252    case mode
    12531253    when :skip
     
    12611261    prepareExtraRelativeFiles(modules.map { |f| "../../" + f }, $collection)
    12621262
    1263     harness = Dir[WASMTESTS_PATH + "spec-harness/" + "*.js"].map { |f| File.basename(f) }
    1264     prepareExtraRelativeFiles(harness.map { |f| "../../spec-harness/" + f }, $collection)
    1265 
    1266     runWithOutputHandler("default-wasm", noisyOutputHandler, "../spec-harness.js", *FTL_OPTIONS)
     1263    harness = Dir[WASMTESTS_PATH + (specHarnessPath + "/") + "*.js"].map { |f| File.basename(f) }
     1264    prepareExtraRelativeFiles(harness.map { |f| ("../../" + specHarnessPath + "/") + f }, $collection)
     1265
     1266    specHarnessJsPath = "../" + specHarnessPath + ".js"
     1267    runWithOutputHandler("default-wasm", noisyOutputHandler, specHarnessJsPath, *(FTL_OPTIONS + optionalTestSpecificOptions))
    12671268    if $mode != "quick"
    1268       runWithOutputHandler("wasm-no-cjit-yes-tls-context", noisyOutputHandler, "../spec-harness.js",  "--useFastTLSForWasmContext=true", *(FTL_OPTIONS + NO_CJIT_OPTIONS))
    1269       runWithOutputHandler("wasm-eager-jettison", noisyOutputHandler, "../spec-harness.js", "--forceCodeBlockToJettisonDueToOldAge=true", "--useRandomizingExecutableIslandAllocation=true", *FTL_OPTIONS)
    1270       runWithOutputHandler("wasm-no-tls-context", noisyOutputHandler, "../spec-harness.js", "--useFastTLSForWasmContext=false", *FTL_OPTIONS)
    1271       runWithOutputHandler("wasm-b3", noisyOutputHandler, "../spec-harness.js", "--useWasmLLInt=false", "--wasmBBQUsesAir=false", *FTL_OPTIONS)
    1272       runWithOutputHandler("wasm-air", noisyOutputHandler, "../spec-harness.js", "--useWasmLLInt=false", "--useRandomizingExecutableIslandAllocation=true", *FTL_OPTIONS)
    1273       runWithOutputHandler("wasm-collect-continuously", noisyOutputHandler, "../spec-harness.js", "--collectContinuously=true", *FTL_OPTIONS) if shouldCollectContinuously?
    1274     end
     1269      runWithOutputHandler("wasm-no-cjit-yes-tls-context", noisyOutputHandler, specHarnessJsPath,  "--useFastTLSForWasmContext=true", *(FTL_OPTIONS + NO_CJIT_OPTIONS + optionalTestSpecificOptions))
     1270      runWithOutputHandler("wasm-eager-jettison", noisyOutputHandler, specHarnessJsPath, "--forceCodeBlockToJettisonDueToOldAge=true", "--useRandomizingExecutableIslandAllocation=true", *(FTL_OPTIONS + optionalTestSpecificOptions))
     1271      runWithOutputHandler("wasm-no-tls-context", noisyOutputHandler, specHarnessJsPath, "--useFastTLSForWasmContext=false", *(FTL_OPTIONS + optionalTestSpecificOptions))
     1272      runWithOutputHandler("wasm-b3", noisyOutputHandler, specHarnessJsPath, "--useWasmLLInt=false", "--wasmBBQUsesAir=false", *(FTL_OPTIONS + optionalTestSpecificOptions))
     1273      runWithOutputHandler("wasm-air", noisyOutputHandler, specHarnessJsPath, "--useWasmLLInt=false", "--useRandomizingExecutableIslandAllocation=true", *(FTL_OPTIONS + optionalTestSpecificOptions))
     1274      runWithOutputHandler("wasm-collect-continuously", noisyOutputHandler, specHarnessJsPath, "--collectContinuously=true", *(FTL_OPTIONS + optionalTestSpecificOptions)) if shouldCollectContinuously?
     1275    end
     1276end
     1277
     1278def runWebAssemblySpecTest(mode)
     1279    runWebAssemblySpecTestBase(mode, "spec-harness")
    12751280end
    12761281
    12771282def runWebAssemblyReferenceSpecTest(mode)
    1278     case mode
    1279     when :skip
    1280         return
    1281     end
    1282     return if !$jitTests
    1283     return if !$isFTLPlatform
    1284     prepareExtraAbsoluteFiles(WASMTESTS_PATH, ["wasm.json"])
    1285 
    1286     modules = Dir[WASMTESTS_PATH + "*.js"].map { |f| File.basename(f) }
    1287     prepareExtraRelativeFiles(modules.map { |f| "../../" + f }, $collection)
    1288 
    1289     harness = Dir[WASMTESTS_PATH + "spec-harness/" + "*.js"].map { |f| File.basename(f) }
    1290     prepareExtraRelativeFiles(harness.map { |f| "../../spec-harness/" + f }, $collection)
    1291 
    1292     runWithOutputHandler("default-wasm", noisyOutputHandler, "../spec-harness.js", "--useWebAssemblyReferences=true", *FTL_OPTIONS)
    1293     if $mode != "quick"
    1294       runWithOutputHandler("wasm-no-cjit-yes-tls-context", noisyOutputHandler, "../spec-harness.js", "--useWebAssemblyReferences=true", "--useFastTLSForWasmContext=true", *(FTL_OPTIONS + NO_CJIT_OPTIONS))
    1295       runWithOutputHandler("wasm-eager-jettison", noisyOutputHandler, "../spec-harness.js", "--useWebAssemblyReferences=true", "--forceCodeBlockToJettisonDueToOldAge=true", "--useRandomizingExecutableIslandAllocation=true", *FTL_OPTIONS)
    1296       runWithOutputHandler("wasm-no-tls-context", noisyOutputHandler, "../spec-harness.js", "--useWebAssemblyReferences=true", "--useFastTLSForWasmContext=false", *FTL_OPTIONS)
    1297       runWithOutputHandler("wasm-b3", noisyOutputHandler, "../spec-harness.js", "--useWebAssemblyReferences=true", "--useWasmLLInt=false", "--wasmBBQUsesAir=false", *FTL_OPTIONS)
    1298       runWithOutputHandler("wasm-air", noisyOutputHandler, "../spec-harness.js", "--useWebAssemblyReferences=true", "--useWasmLLInt=false", "--useRandomizingExecutableIslandAllocation=true", *FTL_OPTIONS)
    1299       runWithOutputHandler("wasm-collect-continuously", noisyOutputHandler, "../spec-harness.js", "--useWebAssemblyReferences=true", "--collectContinuously=true", *FTL_OPTIONS) if shouldCollectContinuously?
    1300     end
     1283    runWebAssemblySpecTestBase(mode, "ref-spec-harness", "--useWebAssemblyReferences=true")
    13011284end
    13021285
Note: See TracChangeset for help on using the changeset viewer.