summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/String.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-04-06 13:24:25 -0400
committerwolfbeast <mcwerewolf@gmail.com>2018-06-07 04:02:17 +0200
commitff901dc5267903b165c53139ddcff5f31bbf6964 (patch)
treeab177a9db308073fc699417b857841f4ca6eebba /js/src/builtin/String.js
parent12e3ee76966664ca0330738a07c7afb9fd754857 (diff)
downloadUXP-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/String.js')
-rw-r--r--js/src/builtin/String.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/js/src/builtin/String.js b/js/src/builtin/String.js
index 6d1d335a0..e5b2ad552 100644
--- a/js/src/builtin/String.js
+++ b/js/src/builtin/String.js
@@ -529,16 +529,17 @@ function String_iterator() {
}
function StringIteratorNext() {
- if (!IsObject(this) || !IsStringIterator(this)) {
+ var obj;
+ if (!IsObject(this) || (obj = GuardToStringIterator(this)) === null) {
return callFunction(CallStringIteratorMethodIfWrapped, this,
"StringIteratorNext");
}
- var S = UnsafeGetStringFromReservedSlot(this, ITERATOR_SLOT_TARGET);
+ var S = UnsafeGetStringFromReservedSlot(obj, ITERATOR_SLOT_TARGET);
// We know that JSString::MAX_LENGTH <= INT32_MAX (and assert this in
// SelfHostring.cpp) so our current index can never be anything other than
// an Int32Value.
- var index = UnsafeGetInt32FromReservedSlot(this, ITERATOR_SLOT_NEXT_INDEX);
+ var index = UnsafeGetInt32FromReservedSlot(obj, ITERATOR_SLOT_NEXT_INDEX);
var size = S.length;
var result = { value: undefined, done: false };
@@ -556,7 +557,7 @@ function StringIteratorNext() {
}
}
- UnsafeSetReservedSlot(this, ITERATOR_SLOT_NEXT_INDEX, index + charCount);
+ UnsafeSetReservedSlot(obj, ITERATOR_SLOT_NEXT_INDEX, index + charCount);
result.value = callFunction(String_substring, S, index, index + charCount);
return result;