diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-04-06 13:24:25 -0400 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-07 04:02:17 +0200 |
commit | ff901dc5267903b165c53139ddcff5f31bbf6964 (patch) | |
tree | ab177a9db308073fc699417b857841f4ca6eebba /js/src/builtin/Array.js | |
parent | 12e3ee76966664ca0330738a07c7afb9fd754857 (diff) | |
download | UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar.gz UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar.lz UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar.xz UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.zip |
Change inlining of intrinsics.
Diffstat (limited to 'js/src/builtin/Array.js')
-rw-r--r-- | js/src/builtin/Array.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/src/builtin/Array.js b/js/src/builtin/Array.js index 360dd2af1..30e6fb35f 100644 --- a/js/src/builtin/Array.js +++ b/js/src/builtin/Array.js @@ -711,13 +711,14 @@ function CreateArrayIterator(obj, kind) { // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%.next function ArrayIteratorNext() { // Step 1-3. - if (!IsObject(this) || !IsArrayIterator(this)) { + var obj; + if (!IsObject(this) || (obj = GuardToArrayIterator(this)) === null) { return callFunction(CallArrayIteratorMethodIfWrapped, this, "ArrayIteratorNext"); } // Step 4. - var a = UnsafeGetReservedSlot(this, ITERATOR_SLOT_TARGET); + var a = UnsafeGetReservedSlot(obj, ITERATOR_SLOT_TARGET); var result = { value: undefined, done: false }; // Step 5. @@ -728,10 +729,10 @@ function ArrayIteratorNext() { // Step 6. // The index might not be an integer, so we have to do a generic get here. - var index = UnsafeGetReservedSlot(this, ITERATOR_SLOT_NEXT_INDEX); + var index = UnsafeGetReservedSlot(obj, ITERATOR_SLOT_NEXT_INDEX); // Step 7. - var itemKind = UnsafeGetInt32FromReservedSlot(this, ITERATOR_SLOT_ITEM_KIND); + var itemKind = UnsafeGetInt32FromReservedSlot(obj, ITERATOR_SLOT_ITEM_KIND); // Step 8-9. var len = IsPossiblyWrappedTypedArray(a) @@ -740,13 +741,13 @@ function ArrayIteratorNext() { // Step 10. if (index >= len) { - UnsafeSetReservedSlot(this, ITERATOR_SLOT_TARGET, null); + UnsafeSetReservedSlot(obj, ITERATOR_SLOT_TARGET, null); result.done = true; return result; } // Step 11. - UnsafeSetReservedSlot(this, ITERATOR_SLOT_NEXT_INDEX, index + 1); + UnsafeSetReservedSlot(obj, ITERATOR_SLOT_NEXT_INDEX, index + 1); // Step 16. if (itemKind === ITEM_KIND_VALUE) { |