@@ -3711,8 +3711,12 @@ ThreadContext::InvalidatePropertyGuardEntry(
3711
3711
this ->recyclableData ->constructorCacheInvalidationCount = 0 ;
3712
3712
}
3713
3713
}
3714
-
3714
+
3715
+ /*
3715
3716
if (propertyGuardEntry->hasLazyBailOut)
3717
+ {
3718
+ */
3719
+ if (propertyGuardEntry->lazyBailOutEntryPoints && propertyGuardEntry->lazyBailOutEntryPoints ->Count () > 0 )
3716
3720
{
3717
3721
Assert (propertyGuardEntry->lazyBailOutEntryPoints );
3718
3722
Assert (propertyGuardEntry->lazyBailOutEntryPoints ->Count () > 0 );
@@ -3748,15 +3752,23 @@ ThreadContext::InvalidatePropertyGuardEntry(
3748
3752
// should set a flag on functionEntryPoint->scriptContext when ConvertFuncRetAddrToLazyBailOutThunk
3749
3753
// returns false. Then, when an expected scenario completes, we should unset that flag. Once
3750
3754
// ScriptContext closes, we should assert that the flag should be off.
3751
- functionEntryPoint->ConvertFuncRetAddrToLazyBailOutThunk (
3755
+ bool didConvertRetAddrToThunk = functionEntryPoint->ConvertFuncRetAddrToLazyBailOutThunk (
3752
3756
stackWalker.GetCurrentAddressOfInstructionPointer (),
3753
3757
static_cast <BYTE*>(stackWalker.GetFramePointer ())
3754
3758
);
3759
+
3760
+ if (!didConvertRetAddrToThunk)
3761
+ {
3762
+ functionEntryPoint->shouldNotDelete = true ;
3763
+ }
3755
3764
}
3756
3765
}
3757
3766
}
3758
3767
}
3759
3768
}
3769
+ /*
3770
+ }
3771
+ */
3760
3772
3761
3773
if (propertyGuardEntry->lazyBailOutEntryPoints && propertyGuardEntry->lazyBailOutEntryPoints ->Count () > 0 )
3762
3774
{
@@ -3767,16 +3779,20 @@ ThreadContext::InvalidatePropertyGuardEntry(
3767
3779
3768
3780
}
3769
3781
3770
- propertyGuardEntry->lazyBailOutEntryPoints ->Map ([=](Js::FunctionEntryPointInfo * lazyBailOutEntryPoint, BYTE& dummy, const RecyclerWeakReference<Js::EntryPointInfo>* infoWeakRef)
3782
+ propertyGuardEntry->lazyBailOutEntryPoints ->Map ([=](Js::EntryPointInfo * lazyBailOutEntryPoint, BYTE& dummy, const RecyclerWeakReference<Js::EntryPointInfo>* infoWeakRef)
3771
3783
{
3772
3784
if (lazyBailOutEntryPoint->IsCleanedUp ())
3773
3785
{
3774
3786
return ;
3775
3787
}
3776
3788
OUTPUT_TRACE2 (Js::LazyBailoutPhase, lazyBailOutEntryPoint->GetFunctionBody (), _u (" Lazy bailout - Invalidation due to property: %s \n " ), propertyRecord->GetBuffer ());
3777
- Js::FunctionEntryPointInfo* newEntryPoint = lazyBailOutEntryPoint->InvalidateRet (true );
3778
- newEntryPoint->lboCodeSize = lazyBailOutEntryPoint->GetCodeSize ();
3779
- newEntryPoint->lboNativeAddr = lazyBailOutEntryPoint->GetNativeAddress ();
3789
+ if (!((Js::FunctionEntryPointInfo*)(lazyBailOutEntryPoint))->shouldNotDelete )
3790
+ {
3791
+ /* Js::FunctionEntryPointInfo* newEntryPoint = */ ((Js::FunctionEntryPointInfo*)(lazyBailOutEntryPoint))->InvalidateRet (true );
3792
+ ((Js::FunctionEntryPointInfo*)(lazyBailOutEntryPoint))->shouldNotDelete = false ;
3793
+ }
3794
+ // newEntryPoint->lboCodeSize = lazyBailOutEntryPoint->GetCodeSize();
3795
+ // newEntryPoint->lboNativeAddr = lazyBailOutEntryPoint->GetNativeAddress();
3780
3796
});
3781
3797
3782
3798
// TODO: make function.
0 commit comments