@@ -2148,9 +2148,11 @@ function detectType(node, asmInfo, inVarDef) {
21482148 case 'call' : {
21492149 if ( node [ 1 ] [ 0 ] === 'name' ) {
21502150 switch ( node [ 1 ] [ 1 ] ) {
2151- case 'Math_fround' : return ASM_FLOAT ;
2152- case 'SIMD_float32x4' : return ASM_FLOAT32X4 ;
2153- case 'SIMD_int32x4' : return ASM_INT32X4 ;
2151+ case 'Math_fround' : return ASM_FLOAT ;
2152+ case 'SIMD_float32x4' :
2153+ case 'SIMD_float32x4_check' : return ASM_FLOAT32X4 ;
2154+ case 'SIMD_int32x4' :
2155+ case 'SIMD_int32x4_check' : return ASM_INT32X4 ;
21542156 default : break ;
21552157 }
21562158 }
@@ -2208,8 +2210,8 @@ function makeAsmCoercion(node, type) {
22082210 case ASM_INT : return [ 'binary' , '|' , node , [ 'num' , 0 ] ] ;
22092211 case ASM_DOUBLE : return [ 'unary-prefix' , '+' , node ] ;
22102212 case ASM_FLOAT : return [ 'call' , [ 'name' , 'Math_fround' ] , [ node ] ] ;
2211- case ASM_FLOAT32X4 : return [ 'call' , [ 'name' , 'SIMD_float32x4 ' ] , [ node ] ] ;
2212- case ASM_INT32X4 : return [ 'call' , [ 'name' , 'SIMD_int32x4 ' ] , [ node ] ] ;
2213+ case ASM_FLOAT32X4 : return [ 'call' , [ 'name' , 'SIMD_float32x4_check ' ] , [ node ] ] ;
2214+ case ASM_INT32X4 : return [ 'call' , [ 'name' , 'SIMD_int32x4_check ' ] , [ node ] ] ;
22132215 case ASM_NONE :
22142216 default : return node ; // non-validating code, emit nothing XXX this is dangerous, we should only allow this when we know we are not validating
22152217 }
@@ -2238,7 +2240,7 @@ function makeAsmVarDef(v, type) {
22382240 case ASM_INT32X4 : {
22392241 return [ v , [ 'call' , [ 'name' , 'SIMD_int32x4' ] , [ [ 'num' , 0 ] , [ 'num' , 0 ] , [ 'num' , 0 ] , [ 'num' , 0 ] ] ] ] ;
22402242 }
2241- default : throw 'wha? ' + JSON . stringify ( [ node , type ] ) + new Error ( ) . stack ;
2243+ default : throw 'wha? ' + JSON . stringify ( [ v , type ] ) + new Error ( ) . stack ;
22422244 }
22432245}
22442246
0 commit comments