A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Allow arbitrary directives in asm.js module/nested function Directive Prologues

luke
2014-10-22

It would be useful to allow arbitrary directives (expression-statements containing string literals) in the Directive Prologue of asm.js modules and nested functions, as long as they don’t have semantic effect (so, currently, everything but “use strict”).

This extension would be useful in that it would allow us to later experiment with AOT-compilation hints. For example, one thing we’re considering (but not yet proposing) is having processing directives that tell the AOT-compiler whether an individual nested function is hot or cold. More experimentation is required, but it’d be nice if all this experimentation could happen independently of the validation predicate.

luke
2014-10-23

Actually, while strict-mode doesn’t cause any fundamental conflicts, it is strictly more work to support per-function strictness, so I’d prefer to allow any “non-semantically-defined processing directives” (which, currently, and for the forseeable future, is just “use strict”).

abchatra
2014-11-05

Module level & nested function level directives are going to be first expression statement in the Module\function body right? (Similar to “use strict”). If yes this looks good to me.

ben
2014-11-05

Current implementation in Firefox agrees with this, so I think this is what was meant in the first post, which could be updated to that matter :slight_smile:

luke
2014-11-05

Agreed. I just realized that “processing directive” isn’t the official terminology, Directive Prologue is. I’ll fix in OP.