File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,12 @@ namespace Js
108
108
PropertyId propertyId,
109
109
ScriptContext* requestContext)
110
110
{
111
- if (!info || !CacheOperators::CanCachePropertyRead (info, info->GetInstance (), requestContext))
111
+ RecyclableObject* originalObj = JavascriptOperators::TryFromVar<RecyclableObject>(originalInstance);
112
+ if (!info || !originalObj || !CacheOperators::CanCachePropertyRead (info, info->GetInstance (), requestContext))
112
113
{
113
114
return ;
114
115
}
115
116
116
- Assert (RecyclableObject::Is (originalInstance));
117
117
Assert (DynamicType::Is (info->GetInstance ()->GetTypeId ()));
118
118
119
119
DynamicObject * dynamicInstance = DynamicObject::FromVar (info->GetInstance ());
@@ -122,11 +122,7 @@ namespace Js
122
122
dynamicInstance->GetDynamicType ()->GetTypeHandler ()->PropertyIndexToInlineOrAuxSlotIndex (info->GetPropertyIndex (), &slotIndex, &isInlineSlot);
123
123
124
124
const bool isProto = info->GetInstance () != originalInstance;
125
- if (isProto &&
126
- (
127
- !RecyclableObject::Is (originalInstance) ||
128
- RecyclableObject::FromVar (originalInstance)->GetScriptContext () != requestContext
129
- ))
125
+ if (isProto && originalObj->GetScriptContext () != requestContext)
130
126
{
131
127
// Don't need to cache if the beginning property is number etc.
132
128
return ;
@@ -147,7 +143,7 @@ namespace Js
147
143
isProto,
148
144
dynamicInstance,
149
145
false ,
150
- RecyclableObject::FromVar (originalInstance) ->GetType (),
146
+ originalObj ->GetType (),
151
147
nullptr ,
152
148
propertyId,
153
149
slotIndex,
You can’t perform that action at this time.
0 commit comments