Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use ForInCache for enumerator in Object.assign #4852

Merged
merged 4 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Backend/JITTimeFunctionBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,10 +1092,10 @@ JITTimeFunctionBody::GetFormalsPropIdArray() const
return (Js::PropertyIdArray *)m_bodyData.formalsPropIdArray;
}

Js::ForInCache *
Js::EnumeratorCache *
JITTimeFunctionBody::GetForInCache(uint profileId) const
{
return &((Js::ForInCache *)m_bodyData.forInCacheArrayAddr)[profileId];
return &((Js::EnumeratorCache *)m_bodyData.forInCacheArrayAddr)[profileId];
}

bool
Expand Down
2 changes: 1 addition & 1 deletion lib/Backend/JITTimeFunctionBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class JITTimeFunctionBody
const Js::PropertyIdArray * ReadPropertyIdArrayFromAuxData(uint offset) const;
Js::PropertyIdArray * GetFormalsPropIdArray() const;

Js::ForInCache * GetForInCache(uint profileId) const;
Js::EnumeratorCache * GetForInCache(uint profileId) const;
bool InitializeStatementMap(Js::SmallSpanSequence * statementMap, ArenaAllocator* alloc) const;
private:
Js::FunctionInfo::Attributes GetAttributes() const;
Expand Down
4 changes: 2 additions & 2 deletions lib/Backend/Lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27159,7 +27159,7 @@ Lowerer::GenerateHasObjectArrayCheck(IR::RegOpnd * objectOpnd, IR::RegOpnd * typ
}

void
Lowerer::GenerateInitForInEnumeratorFastPath(IR::Instr * instr, Js::ForInCache * forInCache)
Lowerer::GenerateInitForInEnumeratorFastPath(IR::Instr * instr, Js::EnumeratorCache * forInCache)
{
Func * func = this->m_func;

Expand Down Expand Up @@ -27292,7 +27292,7 @@ Lowerer::GenerateInitForInEnumeratorFastPath(IR::Instr * instr, Js::ForInCache *
void
Lowerer::LowerInitForInEnumerator(IR::Instr * instr)
{
Js::ForInCache * forInCache = nullptr;
Js::EnumeratorCache * forInCache = nullptr;
Func * func = instr->m_func;
if (instr->IsProfiledInstr())
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Backend/Lower.h
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ class Lowerer
IR::RegOpnd * GenerateForInEnumeratorLoad(IR::Opnd * forInEnumeratorOpnd, IR::Instr * insertBeforeInstr);
IR::Opnd * GetForInEnumeratorFieldOpnd(IR::Opnd * forInEnumeratorOpnd, uint fieldOffset, IRType type);

void GenerateInitForInEnumeratorFastPath(IR::Instr * instr, Js::ForInCache * forInCache);
void GenerateInitForInEnumeratorFastPath(IR::Instr * instr, Js::EnumeratorCache * forInCache);
void GenerateHasObjectArrayCheck(IR::RegOpnd * objectOpnd, IR::RegOpnd * typeOpnd, IR::LabelInstr * hasObjectArray, IR::Instr * insertBeforeInstr);

IR::LabelInstr* InsertLoopTopLabel(IR::Instr * insertBeforeInstr);
Expand Down
6 changes: 3 additions & 3 deletions lib/Backend/Opnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3906,15 +3906,15 @@ Opnd::GetAddrDescription(__out_ecount(count) char16 *const description, const si
break;
case AddrOpndKindForInCache:
DumpAddress(address, printToConsole, skipMaskedAddress);
WriteToBuffer(&buffer, &n, _u(" (ForInCache)"));
WriteToBuffer(&buffer, &n, _u(" (EnumeratorCache)"));
break;
case AddrOpndKindForInCacheType:
DumpAddress(address, printToConsole, skipMaskedAddress);
WriteToBuffer(&buffer, &n, _u(" (&ForInCache->type)"));
WriteToBuffer(&buffer, &n, _u(" (&EnumeratorCache->type)"));
break;
case AddrOpndKindForInCacheData:
DumpAddress(address, printToConsole, skipMaskedAddress);
WriteToBuffer(&buffer, &n, _u(" (&ForInCache->data)"));
WriteToBuffer(&buffer, &n, _u(" (&EnumeratorCache->data)"));
break;
case AddrOpndKindDynamicNativeCodeDataRef:
DumpAddress(address, printToConsole, skipMaskedAddress);
Expand Down
16 changes: 8 additions & 8 deletions lib/Runtime/Base/FunctionBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6032,18 +6032,18 @@ namespace Js
{
return;
}
this->SetAuxPtr(AuxPointerType::ForInCacheArray, AllocatorNewArrayZ(CacheAllocator, this->GetScriptContext()->ForInCacheAllocator(), ForInCache, profiledForInLoopCount));
this->SetAuxPtr(AuxPointerType::ForInCacheArray, AllocatorNewArrayZ(CacheAllocator, this->GetScriptContext()->GetEnumeratorAllocator(), EnumeratorCache, profiledForInLoopCount));
}

ForInCache * FunctionBody::GetForInCache(uint index)
EnumeratorCache * FunctionBody::GetForInCache(uint index)
{
Assert(index < this->GetProfiledForInLoopCount());
return &((ForInCache *)this->GetAuxPtr(AuxPointerType::ForInCacheArray))[index];
return &((EnumeratorCache *)this->GetAuxPtr(AuxPointerType::ForInCacheArray))[index];
}

ForInCache * FunctionBody::GetForInCacheArray()
EnumeratorCache * FunctionBody::GetForInCacheArray()
{
return ((ForInCache *)this->GetAuxPtrWithLock(AuxPointerType::ForInCacheArray));
return ((EnumeratorCache *)this->GetAuxPtrWithLock(AuxPointerType::ForInCacheArray));
}

void FunctionBody::CleanUpForInCache(bool isShutdown)
Expand All @@ -6053,16 +6053,16 @@ namespace Js
{
return;
}
ForInCache * forInCacheArray = (ForInCache *)this->GetAuxPtr(AuxPointerType::ForInCacheArray);
EnumeratorCache * forInCacheArray = (EnumeratorCache *)this->GetAuxPtr(AuxPointerType::ForInCacheArray);
if (forInCacheArray)
{
if (isShutdown)
{
memset(forInCacheArray, 0, sizeof(ForInCache) * profiledForInLoopCount);
memset(forInCacheArray, 0, sizeof(EnumeratorCache) * profiledForInLoopCount);
}
else
{
AllocatorDeleteArray(CacheAllocator, this->GetScriptContext()->ForInCacheAllocator(), profiledForInLoopCount, forInCacheArray);
AllocatorDeleteArray(CacheAllocator, this->GetScriptContext()->GetEnumeratorAllocator(), profiledForInLoopCount, forInCacheArray);
this->SetAuxPtr(AuxPointerType::ForInCacheArray, nullptr);
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Runtime/Base/FunctionBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace Js
DiagParamScopeInObject, // The scope represents symbols at formals and formal scope in activation object
};

struct ForInCache
struct EnumeratorCache
{
Type * type;
void * data;
Expand Down Expand Up @@ -3229,8 +3229,8 @@ namespace Js
uint IncLiteralRegexCount() { return IncreaseCountField(CounterFields::LiteralRegexCount); }

void AllocateForInCache();
ForInCache * GetForInCache(uint index);
ForInCache * GetForInCacheArray();
EnumeratorCache * GetForInCache(uint index);
EnumeratorCache * GetForInCacheArray();
void CleanUpForInCache(bool isShutdown);

void AllocateInlineCache();
Expand Down
9 changes: 4 additions & 5 deletions lib/Runtime/Base/ScriptContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace Js
#endif
inlineCacheAllocator(_u("SC-InlineCache"), threadContext->GetPageAllocator(), Throw::OutOfMemory),
isInstInlineCacheAllocator(_u("SC-IsInstInlineCache"), threadContext->GetPageAllocator(), Throw::OutOfMemory),
forInCacheAllocator(_u("SC-ForInCache"), threadContext->GetPageAllocator(), Throw::OutOfMemory),
enumeratorCacheAllocator(_u("SC-EnumeratorCache"), threadContext->GetPageAllocator(), Throw::OutOfMemory),
hasUsedInlineCache(false),
hasProtoOrStoreFieldInlineCache(false),
hasIsInstInlineCache(false),
Expand Down Expand Up @@ -4726,13 +4726,12 @@ void ScriptContext::ClearIsInstInlineCaches()
DebugOnly(isInstInlineCacheAllocator.CheckIsAllZero(true));
}

void ScriptContext::ClearForInCaches()
void ScriptContext::ClearEnumeratorCaches()
{
forInCacheAllocator.ZeroAll();
DebugOnly(forInCacheAllocator.CheckIsAllZero(false));
enumeratorCacheAllocator.ZeroAll();
DebugOnly(enumeratorCacheAllocator.CheckIsAllZero(false));
}


#ifdef PERSISTENT_INLINE_CACHES
void ScriptContext::ClearInlineCachesWithDeadWeakRefs()
{
Expand Down
6 changes: 3 additions & 3 deletions lib/Runtime/Base/ScriptContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ namespace Js
ArenaAllocator dynamicProfileInfoAllocator;
InlineCacheAllocator inlineCacheAllocator;
CacheAllocator isInstInlineCacheAllocator;
CacheAllocator forInCacheAllocator;
CacheAllocator enumeratorCacheAllocator;

ArenaAllocator* interpreterArena;
ArenaAllocator* guestArena;
Expand Down Expand Up @@ -1290,7 +1290,7 @@ namespace Js
#endif
InlineCacheAllocator* GetInlineCacheAllocator() { return &inlineCacheAllocator; }
CacheAllocator* GetIsInstInlineCacheAllocator() { return &isInstInlineCacheAllocator; }
CacheAllocator * ForInCacheAllocator() { return &forInCacheAllocator; }
CacheAllocator * GetEnumeratorAllocator() { return &enumeratorCacheAllocator; }
ArenaAllocator* DynamicProfileInfoAllocator() { return &dynamicProfileInfoAllocator; }

#ifdef ENABLE_SCRIPT_DEBUGGING
Expand Down Expand Up @@ -1480,7 +1480,7 @@ namespace Js
#endif
void ClearInlineCaches();
void ClearIsInstInlineCaches();
void ClearForInCaches();
void ClearEnumeratorCaches();
#ifdef PERSISTENT_INLINE_CACHES
void ClearInlineCachesWithDeadWeakRefs();
#endif
Expand Down
6 changes: 3 additions & 3 deletions lib/Runtime/Base/ThreadContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2529,7 +2529,7 @@ ThreadContext::PreSweepCallback()

ClearEquivalentTypeCaches();

ClearForInCaches();
ClearEnumeratorCaches();

this->dynamicObjectEnumeratorCacheMap.Clear();
}
Expand Down Expand Up @@ -3116,12 +3116,12 @@ ThreadContext::ClearIsInstInlineCaches()
}

void
ThreadContext::ClearForInCaches()
ThreadContext::ClearEnumeratorCaches()
{
Js::ScriptContext *scriptContext = this->scriptContextList;
while (scriptContext != nullptr)
{
scriptContext->ClearForInCaches();
scriptContext->ClearEnumeratorCaches();
scriptContext = scriptContext->next;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Base/ThreadContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ class ThreadContext sealed :
void ClearInvalidatedUniqueGuards();
void ClearInlineCaches();
void ClearIsInstInlineCaches();
void ClearForInCaches();
void ClearEnumeratorCaches();
void ClearEquivalentTypeCaches();
void ClearScriptContextCaches();

Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Language/JavascriptOperators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5199,7 +5199,7 @@ namespace Js
return aEnumerator->MoveAndGetNext(id);
}

void JavascriptOperators::OP_InitForInEnumerator(Var enumerable, ForInObjectEnumerator * enumerator, ScriptContext* scriptContext, ForInCache * forInCache)
void JavascriptOperators::OP_InitForInEnumerator(Var enumerable, ForInObjectEnumerator * enumerator, ScriptContext* scriptContext, EnumeratorCache * forInCache)
{
RecyclableObject* enumerableObject;
#if ENABLE_COPYONACCESS_ARRAY
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Language/JavascriptOperators.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ namespace Js
static void OP_InitComputedProperty(Var object, Var elementName, Var value, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None);
static void OP_InitProto(Var object, PropertyId propertyId, Var value);

static void OP_InitForInEnumerator(Var enumerable, ForInObjectEnumerator * enumerator, ScriptContext* scriptContext, ForInCache * forInCache = nullptr);
static void OP_InitForInEnumerator(Var enumerable, ForInObjectEnumerator * enumerator, ScriptContext* scriptContext, EnumeratorCache * forInCache = nullptr);
Copy link
Contributor

@sethbrenith sethbrenith Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forInCache [](start = 143, length = 10)

Nit: could rename this param for consistency with others (and in corresponding cpp) #ByDesign

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this one on purpose because it is used specifically for for in

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point


In reply to: 176263509 [](ancestors = 176263509)

static Var OP_BrOnEmpty(ForInObjectEnumerator * enumerator);
static BOOL OP_BrHasSideEffects(int se,ScriptContext* scriptContext);
static BOOL OP_BrNotHasSideEffects(int se,ScriptContext* scriptContext);
Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Language/ModuleNamespace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ namespace Js
return JavascriptConversion::BooleanToPropertyQueryFlags(GetProperty(originalInstance, propertyId, value, info, requestContext));
}

BOOL ModuleNamespace::GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, ForInCache * forInCache)
BOOL ModuleNamespace::GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, EnumeratorCache * enumeratorCache)
{
ModuleNamespaceEnumerator* moduleEnumerator = ModuleNamespaceEnumerator::New(this, flags, requestContext, forInCache);
ModuleNamespaceEnumerator* moduleEnumerator = ModuleNamespaceEnumerator::New(this, flags, requestContext, enumeratorCache);
if (moduleEnumerator == nullptr)
{
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Language/ModuleNamespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace Js
virtual DescriptorFlags GetItemSetter(uint32 index, Var* setterValue, ScriptContext* requestContext) override { *setterValue = nullptr; return DescriptorFlags::None; }
virtual BOOL SetItem(uint32 index, Var value, PropertyOperationFlags flags) override { return false; }
virtual BOOL DeleteItem(uint32 index, PropertyOperationFlags flags) override { return true; }
virtual BOOL GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, ForInCache * forInCache = nullptr);
virtual BOOL GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, EnumeratorCache * enumeratorCache = nullptr);
virtual BOOL SetAccessors(PropertyId propertyId, Var getter, Var setter, PropertyOperationFlags flags = PropertyOperation_None) override { return false; }
virtual BOOL GetAccessors(PropertyId propertyId, Var *getter, Var *setter, ScriptContext * requestContext) override { return false; }
virtual BOOL IsWritable(PropertyId propertyId) override;
Expand Down
8 changes: 4 additions & 4 deletions lib/Runtime/Language/ModuleNamespaceEnumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ namespace Js
{
}

ModuleNamespaceEnumerator* ModuleNamespaceEnumerator::New(ModuleNamespace* nsObject, EnumeratorFlags flags, ScriptContext* scriptContext, ForInCache * forInCache)
ModuleNamespaceEnumerator* ModuleNamespaceEnumerator::New(ModuleNamespace* nsObject, EnumeratorFlags flags, ScriptContext* scriptContext, EnumeratorCache * enumeratorCache)
{
ModuleNamespaceEnumerator* enumerator = RecyclerNew(scriptContext->GetRecycler(), ModuleNamespaceEnumerator, nsObject, flags, scriptContext);
if (enumerator->Init(forInCache))
if (enumerator->Init(enumeratorCache))
{
return enumerator;
}
return nullptr;
}

BOOL ModuleNamespaceEnumerator::Init(ForInCache * forInCache)
BOOL ModuleNamespaceEnumerator::Init(EnumeratorCache * enumeratorCache)
{
if (!nsObject->DynamicObject::GetEnumerator(&symbolEnumerator, flags, GetScriptContext(), forInCache))
if (!nsObject->DynamicObject::GetEnumerator(&symbolEnumerator, flags, GetScriptContext(), enumeratorCache))
{
return FALSE;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Language/ModuleNamespaceEnumerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ namespace Js
protected:
DEFINE_VTABLE_CTOR(ModuleNamespaceEnumerator, JavascriptEnumerator);
ModuleNamespaceEnumerator(ModuleNamespace* nsObject, EnumeratorFlags flags, ScriptContext* scriptContext);
BOOL Init(ForInCache * forInCache);
BOOL Init(EnumeratorCache * enumeratorCache);

public:
static ModuleNamespaceEnumerator* New(ModuleNamespace* nsObject, EnumeratorFlags flags, ScriptContext* scriptContext, ForInCache * forInCache);
static ModuleNamespaceEnumerator* New(ModuleNamespace* nsObject, EnumeratorFlags flags, ScriptContext* scriptContext, EnumeratorCache * enumeratorCache);
virtual void Reset() override;
virtual JavascriptString * MoveAndGetNext(PropertyId& propertyId, PropertyAttributes* attributes = nullptr) override;
virtual Var GetCurrentValue() { Assert(false); return nullptr; }
Expand Down
8 changes: 4 additions & 4 deletions lib/Runtime/Library/ArgumentsObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

namespace Js
{
BOOL ArgumentsObject::GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, ForInCache * forInCache)
BOOL ArgumentsObject::GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, EnumeratorCache * enumeratorCache)
{
return GetEnumeratorWithPrefix(
RecyclerNew(GetScriptContext()->GetRecycler(), ArgumentsObjectPrefixEnumerator, this, flags, requestContext),
enumerator, flags, requestContext, forInCache);
enumerator, flags, requestContext, enumeratorCache);
}

BOOL ArgumentsObject::GetDiagValueString(StringBuilder<ArenaAllocator>* stringBuilder, ScriptContext* requestContext)
Expand Down Expand Up @@ -593,9 +593,9 @@ namespace Js
return this->DynamicObject::SetPropertyWithAttributes(propertyId, value, attributes, info, flags, possibleSideEffects);
}

BOOL ES5HeapArgumentsObject::GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, ForInCache * forInCache)
BOOL ES5HeapArgumentsObject::GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, EnumeratorCache * enumeratorCache)
{
ES5ArgumentsObjectEnumerator * es5HeapArgumentsObjectEnumerator = ES5ArgumentsObjectEnumerator::New(this, flags, requestContext, forInCache);
ES5ArgumentsObjectEnumerator * es5HeapArgumentsObjectEnumerator = ES5ArgumentsObjectEnumerator::New(this, flags, requestContext, enumeratorCache);
if (es5HeapArgumentsObjectEnumerator == nullptr)
{
return false;
Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Library/ArgumentsObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Js

virtual BOOL GetDiagValueString(StringBuilder<ArenaAllocator>* stringBuilder, ScriptContext* requestContext) override;
virtual BOOL GetDiagTypeString(StringBuilder<ArenaAllocator>* stringBuilder, ScriptContext* requestContext) override;
virtual BOOL GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, ForInCache * forInCache = nullptr) override;
virtual BOOL GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, EnumeratorCache * enumeratorCache = nullptr) override;

virtual uint32 GetNumberOfArguments() const = 0;
virtual uint32 GetNextFormalArgIndex(uint32 index, BOOL enumNonEnumerable = FALSE, PropertyAttributes* attributes = nullptr) const = 0;
Expand Down Expand Up @@ -190,7 +190,7 @@ namespace Js
virtual BOOL SetWritable(PropertyId propertyId, BOOL value) override;
virtual BOOL SetAccessors(PropertyId propertyId, Var getter, Var setter, PropertyOperationFlags flags) override;
virtual BOOL SetPropertyWithAttributes(PropertyId propertyId, Var value, PropertyAttributes attributes, PropertyValueInfo* info, PropertyOperationFlags flags = PropertyOperation_None, SideEffects possibleSideEffects = SideEffects_Any) override;
virtual BOOL GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, ForInCache * forInCache = nullptr) override;
virtual BOOL GetEnumerator(JavascriptStaticEnumerator * enumerator, EnumeratorFlags flags, ScriptContext* requestContext, EnumeratorCache * enumeratorCache = nullptr) override;
virtual BOOL PreventExtensions() override;
virtual BOOL Seal() override;
virtual BOOL Freeze() override;
Expand Down
8 changes: 4 additions & 4 deletions lib/Runtime/Library/ArgumentsObjectEnumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ namespace Js
}

//---------------------- ES5ArgumentsObjectEnumerator -------------------------------
ES5ArgumentsObjectEnumerator * ES5ArgumentsObjectEnumerator::New(ArgumentsObject* argumentsObject, EnumeratorFlags flags, ScriptContext* requestContext, ForInCache * forInCache)
ES5ArgumentsObjectEnumerator * ES5ArgumentsObjectEnumerator::New(ArgumentsObject* argumentsObject, EnumeratorFlags flags, ScriptContext* requestContext, EnumeratorCache * enumeratorCache)
{
ES5ArgumentsObjectEnumerator * enumerator = RecyclerNew(requestContext->GetRecycler(), ES5ArgumentsObjectEnumerator, argumentsObject, flags, requestContext);
if (!enumerator->Init(forInCache))
if (!enumerator->Init(enumeratorCache))
{
return nullptr;
}
Expand All @@ -56,11 +56,11 @@ namespace Js
{
}

BOOL ES5ArgumentsObjectEnumerator::Init(ForInCache * forInCache)
BOOL ES5ArgumentsObjectEnumerator::Init(EnumeratorCache * enumeratorCache)
{
__super::Reset();
this->enumeratedFormalsInObjectArrayCount = 0;
return argumentsObject->DynamicObject::GetEnumerator(&objectEnumerator, flags, GetScriptContext(), forInCache);
return argumentsObject->DynamicObject::GetEnumerator(&objectEnumerator, flags, GetScriptContext(), enumeratorCache);
}

JavascriptString * ES5ArgumentsObjectEnumerator::MoveAndGetNext(PropertyId& propertyId, PropertyAttributes* attributes)
Expand Down
Loading