Jelajahi Sumber

AND canUseJitFastPath with previous value so that if it is already false we don’t call CanUseJITFastPath function

Sandeep Agarwal 9 tahun lalu
induk
melakukan
f8a44322c2
1 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 6 2
      lib/Runtime/Library/ForInObjectEnumerator.cpp

+ 6 - 2
lib/Runtime/Library/ForInObjectEnumerator.cpp

@@ -161,8 +161,12 @@ namespace Js
             propertyId = Constants::NoProperty;
             Var currentIndex = enumerator.MoveAndGetNext(propertyId, &attributes);
 
-            // The object type may have changed and we may not be able to use fast path anymore.
-            this->canUseJitFastPath = enumerator.CanUseJITFastPath();
+            // The object type may have changed and we may not be able to use Jit fast path anymore.
+            // canUseJitFastPath is determined in ForInObjectEnumerator::Initialize, once we decide we can't use
+            // Jit fast path we will never go back to use fast path so && with current value  - if it's already
+            // false we don't call CanUseJITFastPath()
+
+            this->canUseJitFastPath = this->canUseJitFastPath && enumerator.CanUseJITFastPath();
 
             if (currentIndex)
             {