Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHolman committed Mar 21, 2018
1 parent b3365dc commit 4bf64c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/Runtime/Library/JavascriptLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6356,12 +6356,14 @@ namespace Js

EnumeratorCache* JavascriptLibrary::GetObjectAssignCache(Type* type)
{
// Size must be power of 2 for cache indexing to work
CompileAssert((Cache::AssignCacheSize & (Cache::AssignCacheSize - 1)) == 0);

if (this->cache.assignCache == nullptr)
{
this->cache.assignCache = AllocatorNewArrayZ(CacheAllocator, scriptContext->GetEnumeratorAllocator(), EnumeratorCache, Cache::AssignCacheSize);
}

return &this->cache.assignCache[(((size_t)type) >> PolymorphicInlineCacheShift) & (Cache::AssignCacheSize - 1)];
return &this->cache.assignCache[(((uintptr_t)type) >> PolymorphicInlineCacheShift) & (Cache::AssignCacheSize - 1)];
}

SymbolCacheMap* JavascriptLibrary::EnsureSymbolMap()
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Library/JavascriptLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace Js
Field(DynamicProfileInfoList*) profileInfoList;
#endif
#endif
Cache() : toStringTagCache(nullptr), toJSONCache(nullptr) { }
Cache() : toStringTagCache(nullptr), toJSONCache(nullptr), assignCache(nullptr) { }
};

class MissingPropertyTypeHandler;
Expand Down

0 comments on commit 4bf64c1

Please sign in to comment.