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
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to