diff --git a/Build/NuGet/.pack-version b/Build/NuGet/.pack-version
index 3e383a67127..a52b6ed9087 100644
--- a/Build/NuGet/.pack-version
+++ b/Build/NuGet/.pack-version
@@ -1 +1 @@
-1.11.20
+1.11.21
diff --git a/lib/Common/ChakraCoreVersion.h b/lib/Common/ChakraCoreVersion.h
index 2a9889902fc..f2d0e024c3b 100644
--- a/lib/Common/ChakraCoreVersion.h
+++ b/lib/Common/ChakraCoreVersion.h
@@ -17,7 +17,7 @@
// ChakraCore version number definitions (used in ChakraCore binary metadata)
#define CHAKRA_CORE_MAJOR_VERSION 1
#define CHAKRA_CORE_MINOR_VERSION 11
-#define CHAKRA_CORE_PATCH_VERSION 20
+#define CHAKRA_CORE_PATCH_VERSION 21
#define CHAKRA_CORE_VERSION_RELEASE_QFE 0 // Redundant with PATCH_VERSION. Keep this value set to 0.
// -------------
diff --git a/lib/Runtime/Base/FunctionBody.cpp b/lib/Runtime/Base/FunctionBody.cpp
index 011634f33b3..e44a83a1011 100644
--- a/lib/Runtime/Base/FunctionBody.cpp
+++ b/lib/Runtime/Base/FunctionBody.cpp
@@ -6283,7 +6283,7 @@ namespace Js
Assert(polymorphicInlineCache && polymorphicInlineCache->CanAllocateBigger());
uint16 polymorphicInlineCacheSize = polymorphicInlineCache->GetSize();
uint16 newPolymorphicInlineCacheSize = PolymorphicInlineCache::GetNextSize(polymorphicInlineCacheSize);
- Assert(newPolymorphicInlineCacheSize > polymorphicInlineCacheSize);
+ AssertOrFailFast(newPolymorphicInlineCacheSize > polymorphicInlineCacheSize);
PolymorphicInlineCache * newPolymorphicInlineCache = CreatePolymorphicInlineCache(index, newPolymorphicInlineCacheSize);
polymorphicInlineCache->CopyTo(propertyId, m_scriptContext, newPolymorphicInlineCache);
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS
diff --git a/lib/Runtime/Language/CacheOperators.h b/lib/Runtime/Language/CacheOperators.h
index 1ab8fb1240e..524ba728dee 100644
--- a/lib/Runtime/Language/CacheOperators.h
+++ b/lib/Runtime/Language/CacheOperators.h
@@ -18,7 +18,7 @@ namespace Js
bool IsAccessor,
bool IsRead,
bool IncludeTypePropertyCache>
- static void Cache(const bool isProto, DynamicObject *const objectWithProperty, const bool isRoot, Type *const type, Type *const typeWithoutProperty, const PropertyId propertyId, const PropertyIndex propertyIndex, const bool isInlineSlot, const bool isMissing, const int requiredAuxSlotCapacity, const PropertyValueInfo *const info, ScriptContext *const requestContext);
+ static void Cache(const bool isProto, DynamicObject *const objectWithProperty, const bool isRoot, Type *const type, Type *const typeWithoutProperty, const PropertyId propertyId, const PropertyIndex propertyIndex, const bool isInlineSlot, const bool isMissing, const int requiredAuxSlotCapacity, PropertyValueInfo *const info, ScriptContext *const requestContext);
template<
bool CheckLocal,
diff --git a/lib/Runtime/Language/CacheOperators.inl b/lib/Runtime/Language/CacheOperators.inl
index fd93341aba6..f1851326207 100644
--- a/lib/Runtime/Language/CacheOperators.inl
+++ b/lib/Runtime/Language/CacheOperators.inl
@@ -312,7 +312,7 @@ namespace Js
const bool isInlineSlot,
const bool isMissing,
const int requiredAuxSlotCapacity,
- const PropertyValueInfo *const info,
+ PropertyValueInfo *const info,
ScriptContext *const requestContext)
{
CompileAssert(!IsAccessor || !IncludeTypePropertyCache);
@@ -375,6 +375,9 @@ namespace Js
: !PHASE_OFF1(Js::TypePropertyCachePhase)
);
bool createTypePropertyCache = false;
+
+ // Side-effects may have changed the cache, so make sure the info has the latest.
+ info->UpdatePolymorphicInlineCache(IsRead);
PolymorphicInlineCache *polymorphicInlineCache = info->GetPolymorphicInlineCache();
if(!polymorphicInlineCache && info->GetFunctionBody())
{
diff --git a/lib/Runtime/Types/RecyclableObject.cpp b/lib/Runtime/Types/RecyclableObject.cpp
index 35dcda679f6..05e785583ba 100644
--- a/lib/Runtime/Types/RecyclableObject.cpp
+++ b/lib/Runtime/Types/RecyclableObject.cpp
@@ -109,6 +109,14 @@ namespace Js
}
}
+ void PropertyValueInfo::UpdatePolymorphicInlineCache(bool isRead)
+ {
+ if (GetPropertyRecordUsageCache())
+ {
+ this->polymorphicInlineCache = isRead ? GetPropertyRecordUsageCache()->GetLdElemInlineCache() : GetPropertyRecordUsageCache()->GetStElemInlineCache();
+ }
+ }
+
#if DBG || defined(PROFILE_TYPES)
// Used only by the GlobalObject, because it's typeHandler can't be fully initialized
// with the globalobject which is currently being created.
diff --git a/lib/Runtime/Types/RecyclableObject.h b/lib/Runtime/Types/RecyclableObject.h
index 14ee2da6a3b..6b94447c927 100644
--- a/lib/Runtime/Types/RecyclableObject.h
+++ b/lib/Runtime/Types/RecyclableObject.h
@@ -93,6 +93,7 @@ namespace Js {
bool allowResizing);
static void SetCacheInfo(_Out_ PropertyValueInfo* info, _In_ PolymorphicInlineCache *const polymorphicInlineCache, bool allowResizing);
static void ClearCacheInfo(PropertyValueInfo* info);
+ void UpdatePolymorphicInlineCache(bool isRead);
InlineCache * GetInlineCache() const
{
diff --git a/test/AsmJs/rlexe.xml b/test/AsmJs/rlexe.xml
index 998445a9c3f..da07dac6a7c 100644
--- a/test/AsmJs/rlexe.xml
+++ b/test/AsmJs/rlexe.xml
@@ -977,7 +977,7 @@
-testtrace:asmjs -args 14000 -endargs -EnableFatalErrorOnOOM-
- exclude_dynapogo,exclude_mac
+ exclude_dynapogo,exclude_mac,Slow