@@ -225,6 +225,8 @@ export class Options {
225225 maximumMemory : u32 = 0 ;
226226 /** If true, memory is declared as shared. */
227227 sharedMemory : bool = false ;
228+ /** If true, imported memory is zero filled. */
229+ zeroFilledMemory : bool = false ;
228230 /** If true, imports the function table provided by the embedder. */
229231 importTable : bool = false ;
230232 /** If true, exports the function table. */
@@ -425,9 +427,9 @@ export class Compiler extends DiagnosticEmitter {
425427 var featureFlags : FeatureFlags = 0 ;
426428 if ( options . hasFeature ( Feature . SIGN_EXTENSION ) ) featureFlags |= FeatureFlags . SignExt ;
427429 if ( options . hasFeature ( Feature . MUTABLE_GLOBALS ) ) featureFlags |= FeatureFlags . MutableGloabls ;
428- if ( options . hasFeature ( Feature . NONTRAPPING_F2I ) ) featureFlags |= FeatureFlags . NontrappingFPToInt ;
430+ if ( options . hasFeature ( Feature . NONTRAPPING_F2I ) ) featureFlags |= FeatureFlags . TruncSat ;
429431 if ( options . hasFeature ( Feature . BULK_MEMORY ) ) featureFlags |= FeatureFlags . BulkMemory ;
430- if ( options . hasFeature ( Feature . SIMD ) ) featureFlags |= FeatureFlags . SIMD128 ;
432+ if ( options . hasFeature ( Feature . SIMD ) ) featureFlags |= FeatureFlags . SIMD ;
431433 if ( options . hasFeature ( Feature . THREADS ) ) featureFlags |= FeatureFlags . Atomics ;
432434 if ( options . hasFeature ( Feature . EXCEPTION_HANDLING ) ) featureFlags |= FeatureFlags . ExceptionHandling ;
433435 if ( options . hasFeature ( Feature . TAIL_CALLS ) ) featureFlags |= FeatureFlags . TailCall ;
@@ -7232,7 +7234,7 @@ export class Compiler extends DiagnosticEmitter {
72327234 // We know the last operand is optional and omitted, so inject setting
72337235 // ~argumentsLength into that operand, which is always safe.
72347236 let lastOperand = operands [ maxOperands - 1 ] ;
7235- assert ( ! ( getSideEffects ( lastOperand ) & SideEffects . WritesGlobal ) ) ;
7237+ assert ( ! ( getSideEffects ( lastOperand , module . ref ) & SideEffects . WritesGlobal ) ) ;
72367238 let lastOperandType = parameterTypes [ maxArguments - 1 ] ;
72377239 operands [ maxOperands - 1 ] = module . block ( null , [
72387240 module . global_set ( this . ensureArgumentsLength ( ) , module . i32 ( numArguments ) ) ,
@@ -7339,7 +7341,7 @@ export class Compiler extends DiagnosticEmitter {
73397341 // into the index argument, which becomes executed last after any operands.
73407342 var argumentsLength = this . ensureArgumentsLength ( ) ;
73417343 var sizeTypeRef = this . options . sizeTypeRef ;
7342- if ( getSideEffects ( functionArg ) & SideEffects . WritesGlobal ) {
7344+ if ( getSideEffects ( functionArg , module . ref ) & SideEffects . WritesGlobal ) {
73437345 let flow = this . currentFlow ;
73447346 let temp = flow . getTempLocal ( this . options . usizeType , findUsedLocals ( functionArg ) ) ;
73457347 functionArg = module . block ( null , [
0 commit comments