Sorry if there was any confusion earlier, but throw-on-OOB semantics is
easier from an AOT/asm.js-compilation POV.  Ideally, typed arrays would
throw on all OOB, but I realize that isn't web compatible at this point.

On Wed, Feb 25, 2015 at 6:40 PM, Jeff Walden <jwalden...@mit.edu> wrote:

> Currently, the behavior of IntegerIndexedElementSet is to return false if
> the index being set is outside the array bounds.  This return-false
> directly feeds into the result of [[Set]] on a typed array.  The result is
> that in strict mode code, setting an out-of-bounds array element throws a
> TypeError.
>
> I've heard claims from other SpiderMonkey implementers that this
> requirement makes it difficult to implement high-performance JIT
> optimizations for code that assigns into typed arrays, except in the case
> that the array length is observable in context, the typed array never
> escapes anywhere, its backing ArrayBuffer never escapes anywhere, etc.
> Restrictions that generally aren't very easy to determine with local
> information observable by a JIT.  And while quite often such
> high-performance code isn't strict mode code, it's doubtful that will be
> true far into the future.
>
> From that point of view, it would be better if IntegerIndexedElementSet
> just returned true in this case -- indicate success without doing
> anything.  What are the compelling reasons to not do this?
>
> Jeff
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to