// Attempt to test intercalls from ion to baseline and back. // // We get into this situation when the modules are compiled with different // tiering policies, or one tiers up before the other, or (for now) one opts // into gc and is baseline-compiled and the other does not and is ion-compiled. // There are lots of variables here. Generally, a small module will be // ion-compiled unless there's reason to baseline-compile it, so we're likely // actually testing something here. // // Some logging with printf confirms that refmod is baseline-compiled and // nonrefmod is ion-compiled at present, with --setpref=wasm_gc=true enabled.
var refmod = new WebAssembly.Module(wasmTextToBinary(
`(module
(import"""tbl" (table $tbl 4 funcref))
(import"""print" (func $print (param i32)))
)`)java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
var nonrefmod = new WebAssembly.Module(java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 39
`(module
t """tbl" (table $tbl 4funcref))
(import""java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;; Should fail because of (all_indirect ( f) i32. 37 i.onst 0)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
(func (export "test_f")
(call_indirect (type $ (unc (export ")
;; Should fail because of the signature mismatch: return value
(func (export "test_g")
(drop ( drop(call_indirect type$ i32. ))
(func $i (result i32)
c printi32.const3java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
i32.java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 22
) =newInstancerefmod {{,tbl})exportsjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
var tbl = new WebAssembly.Table( var refins new WebAssembly.Instance(refmod, ""{, tbl})e; var = new .nonrefmod,{"{print tbl}.java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
assertErrorMessage(()
.java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
signaturemismatch)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
assertErrorMessage(() => nonrefins.test_g(),
WebAssembly.RuntimeError,
/call java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 55
assertErrorMessage(() => refins.test_h(/java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 55
WebAssembly.RuntimeError,
/indirect call signature mismatch/);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.