Bug 1437842: [Part 3] Convert IsMapIterator to GuardToMapIterator r=jandem

--HG--
extra : rebase_source : 246083417a512ea34b97c1693cc7a172ec4540fb
This commit is contained in:
Matthew Gaudet 2018-04-12 13:23:45 -04:00
Родитель 188153d2d5
Коммит 9baf0fb242
3 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -75,8 +75,8 @@ function MapIteratorNext() {
var O = this;
// Steps 2-3.
if (!IsObject(O) || !IsMapIterator(O))
return callFunction(CallMapIteratorMethodIfWrapped, O, "MapIteratorNext");
if (!IsObject(O) || (O = GuardToMapIterator(O)) === null)
return callFunction(CallMapIteratorMethodIfWrapped, this, "MapIteratorNext");
// Steps 4-5 (implemented in _GetNextMapEntryForIterator).
// Steps 8-9 (omitted).
@ -95,7 +95,7 @@ function MapIteratorNext() {
// Steps 10.b-c (omitted).
// Step 6.
var itemKind = UnsafeGetInt32FromReservedSlot(this, ITERATOR_SLOT_ITEM_KIND);
var itemKind = UnsafeGetInt32FromReservedSlot(O, ITERATOR_SLOT_ITEM_KIND);
var result;
if (itemKind === ITEM_KIND_KEY) {

Просмотреть файл

@ -321,8 +321,8 @@ IonBuilder::inlineNativeCall(CallInfo& callInfo, JSFunction* target)
return inlineSubstringKernel(callInfo);
case InlinableNative::IntrinsicGuardToArrayIterator:
return inlineGuardToClass(callInfo, &ArrayIteratorObject::class_);
case InlinableNative::IntrinsicIsMapIterator:
return inlineHasClass(callInfo, &MapIteratorObject::class_);
case InlinableNative::IntrinsicGuardToMapIterator:
return inlineGuardToClass(callInfo, &MapIteratorObject::class_);
case InlinableNative::IntrinsicIsSetIterator:
return inlineHasClass(callInfo, &SetIteratorObject::class_);
case InlinableNative::IntrinsicGuardToStringIterator:

Просмотреть файл

@ -2377,9 +2377,9 @@ static const JSFunctionSpec intrinsic_functions[] = {
JS_INLINABLE_FN("GuardToArrayIterator",
intrinsic_GuardToBuiltin<ArrayIteratorObject>, 1,0,
IntrinsicGuardToArrayIterator),
JS_INLINABLE_FN("IsMapIterator",
intrinsic_IsInstanceOfBuiltin<MapIteratorObject>, 1,0,
IntrinsicIsMapIterator),
JS_INLINABLE_FN("GuardToMapIterator",
intrinsic_GuardToBuiltin<MapIteratorObject>, 1,0,
IntrinsicGuardToMapIterator),
JS_INLINABLE_FN("IsSetIterator",
intrinsic_IsInstanceOfBuiltin<SetIteratorObject>, 1,0,
IntrinsicIsSetIterator),