Skip to content

Commit 3a68197

Browse files
committed
more
1 parent 9270bb2 commit 3a68197

File tree

4 files changed

+13
-57
lines changed

4 files changed

+13
-57
lines changed

lib/Runtime/Base/FunctionBody.cpp

+2-19
Original file line numberDiff line numberDiff line change
@@ -3302,11 +3302,6 @@ namespace Js
33023302
{
33033303
entryPoint = currentEntryPoint;
33043304
}
3305-
if (currentEntryPoint->lboNativeAddr <= codeAddress && currentEntryPoint->lboNativeAddr + currentEntryPoint->lboCodeSize > codeAddress)
3306-
{
3307-
entryPoint = currentEntryPoint;
3308-
}
3309-
33103305
});
33113306

33123307
return entryPoint;
@@ -8386,11 +8381,7 @@ namespace Js
83868381
bool isValid = hasSharedPropertyGuard && sharedPropertyGuard->IsValid();
83878382
if (isValid)
83888383
{
8389-
scriptContext->GetThreadContext()->RegisterLazyBailout(
8390-
propertyId,
8391-
this,
8392-
GetNativeEntryPointData()->GetHasLazyBailOut()
8393-
);
8384+
scriptContext->GetThreadContext()->RegisterLazyBailout(propertyId, this);
83948385
}
83958386
else
83968387
{
@@ -9140,7 +9131,7 @@ namespace Js
91409131
jitMode(ExecutionMode::Interpreter),
91419132
functionProxy(functionProxy),
91429133
nextEntryPoint(nullptr),
9143-
shouldNotDelete(false)
9134+
retAddrNotModified(false)
91449135
{
91459136
}
91469137

@@ -9284,12 +9275,6 @@ namespace Js
92849275
}
92859276

92869277
void FunctionEntryPointInfo::Invalidate(bool prolongEntryPoint)
9287-
{
9288-
return;
9289-
}
9290-
9291-
9292-
FunctionEntryPointInfo* FunctionEntryPointInfo::InvalidateRet(bool prolongEntryPoint)
92939278
{
92949279
Assert(!this->functionProxy->IsDeferred());
92959280
FunctionBody* functionBody = this->functionProxy->GetFunctionBody();
@@ -9348,8 +9333,6 @@ namespace Js
93489333
ThreadContext* threadContext = this->functionProxy->GetScriptContext()->GetThreadContext();
93499334
threadContext->QueueFreeOldEntryPointInfoIfInScript(this);
93509335
}
9351-
9352-
return entryPoint;
93539336
}
93549337

93559338
void FunctionEntryPointInfo::Expire()

lib/Runtime/Base/FunctionBody.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,7 @@ namespace Js
622622

623623
Field(uint32) callsCount;
624624
Field(uint32) lastCallsCount;
625-
Field(DWORD_PTR) lboNativeAddr;
626-
Field(ptrdiff_t) lboCodeSize;
627-
Field(bool) shouldNotDelete;
625+
Field(bool) retAddrNotModified;
628626

629627
private:
630628
Field(ExecutionMode) jitMode;
@@ -641,7 +639,6 @@ namespace Js
641639
ExecutionMode GetJitMode() const;
642640
void SetJitMode(const ExecutionMode jitMode);
643641

644-
FunctionEntryPointInfo* InvalidateRet(bool prolongEntryPoint);
645642
virtual void Invalidate(bool prolongEntryPoint) override;
646643
virtual void Expire() override;
647644
virtual void EnterExpirableCollectMode() override;

lib/Runtime/Base/ThreadContext.cpp

+8-29
Original file line numberDiff line numberDiff line change
@@ -3568,7 +3568,7 @@ ThreadContext::RegisterSharedPropertyGuard(Js::PropertyId propertyId)
35683568
}
35693569

35703570
void
3571-
ThreadContext::RegisterLazyBailout(Js::PropertyId propertyId, Js::EntryPointInfo* entryPoint, bool hasLazyBailOut)
3571+
ThreadContext::RegisterLazyBailout(Js::PropertyId propertyId, Js::EntryPointInfo* entryPoint)
35723572
{
35733573
Assert(entryPoint);
35743574

@@ -3584,11 +3584,6 @@ ThreadContext::RegisterLazyBailout(Js::PropertyId propertyId, Js::EntryPointInfo
35843584
// We use lazyBailOutEntryPoints' EntryPointDictionary functionality not as a value lookup but
35853585
// rather as a means to verify that an entryPoint for the given propertyGuardEntry exists.
35863586
propertyGuardEntry->lazyBailOutEntryPoints->UncheckedAdd(entryPoint, NULL);
3587-
3588-
if (hasLazyBailOut)
3589-
{
3590-
propertyGuardEntry->hasLazyBailOut = true;
3591-
}
35923587
}
35933588

35943589
void
@@ -3711,11 +3706,7 @@ ThreadContext::InvalidatePropertyGuardEntry(
37113706
this->recyclableData->constructorCacheInvalidationCount = 0;
37123707
}
37133708
}
3714-
3715-
/*
3716-
if (propertyGuardEntry->hasLazyBailOut)
3717-
{
3718-
*/
3709+
37193710
if (propertyGuardEntry->lazyBailOutEntryPoints && propertyGuardEntry->lazyBailOutEntryPoints->Count() > 0)
37203711
{
37213712
Assert(propertyGuardEntry->lazyBailOutEntryPoints);
@@ -3759,45 +3750,33 @@ ThreadContext::InvalidatePropertyGuardEntry(
37593750

37603751
if (!didConvertRetAddrToThunk)
37613752
{
3762-
functionEntryPoint->shouldNotDelete = true;
3753+
functionEntryPoint->retAddrNotModified = true;
37633754
}
37643755
}
37653756
}
37663757
}
37673758
}
37683759
}
3769-
/*
3770-
}
3771-
*/
37723760

37733761
if (propertyGuardEntry->lazyBailOutEntryPoints && propertyGuardEntry->lazyBailOutEntryPoints->Count() > 0)
37743762
{
3775-
if (!propertyGuardEntry->hasLazyBailOut)
3776-
{
3777-
int a = 5;
3778-
a++;
3779-
3780-
}
3781-
37823763
propertyGuardEntry->lazyBailOutEntryPoints->Map([=](Js::EntryPointInfo* lazyBailOutEntryPoint, BYTE& dummy, const RecyclerWeakReference<Js::EntryPointInfo>* infoWeakRef)
37833764
{
37843765
if (lazyBailOutEntryPoint->IsCleanedUp())
37853766
{
37863767
return;
37873768
}
37883769
OUTPUT_TRACE2(Js::LazyBailoutPhase, lazyBailOutEntryPoint->GetFunctionBody(), _u("Lazy bailout - Invalidation due to property: %s \n"), propertyRecord->GetBuffer());
3789-
if (!((Js::FunctionEntryPointInfo*)(lazyBailOutEntryPoint))->shouldNotDelete)
3770+
3771+
if (!((Js::FunctionEntryPointInfo*)lazyBailOutEntryPoint)->retAddrNotModified)
37903772
{
3791-
/*Js::FunctionEntryPointInfo* newEntryPoint = */((Js::FunctionEntryPointInfo*)(lazyBailOutEntryPoint))->InvalidateRet(true);
3792-
((Js::FunctionEntryPointInfo*)(lazyBailOutEntryPoint))->shouldNotDelete = false;
3773+
lazyBailOutEntryPoint->Invalidate(true);
3774+
((Js::FunctionEntryPointInfo*)lazyBailOutEntryPoint)->retAddrNotModified = false;
37933775
}
3794-
//newEntryPoint->lboCodeSize = lazyBailOutEntryPoint->GetCodeSize();
3795-
//newEntryPoint->lboNativeAddr = lazyBailOutEntryPoint->GetNativeAddress();
3776+
37963777
});
37973778

3798-
// TODO: make function.
37993779
propertyGuardEntry->lazyBailOutEntryPoints->Clear();
3800-
propertyGuardEntry->hasLazyBailOut = false;
38013780
}
38023781
}
38033782

lib/Runtime/Base/ThreadContext.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,8 @@ class ThreadContext sealed :
479479
Field(Js::PropertyGuard*) sharedGuard;
480480
Field(PropertyGuardHashSet) uniqueGuards;
481481
Field(EntryPointDictionary*) lazyBailOutEntryPoints;
482-
Field(bool) hasLazyBailOut; // Even though this PropertyGuardEntry may have one or more lazyBailOutEntryPoints, that is not
483-
// enough information to verify that any one of thse lazyBailOutEntryPoints is connected to a
484-
// LazyBailOut bailout tag.
485482

486-
PropertyGuardEntry(Recycler* recycler) : sharedGuard(nullptr), uniqueGuards(recycler), lazyBailOutEntryPoints(nullptr), hasLazyBailOut(false) {}
483+
PropertyGuardEntry(Recycler* recycler) : sharedGuard(nullptr), uniqueGuards(recycler), lazyBailOutEntryPoints(nullptr) {}
487484
};
488485

489486
public:
@@ -1358,7 +1355,7 @@ class ThreadContext sealed :
13581355

13591356
#if ENABLE_NATIVE_CODEGEN
13601357
Js::PropertyGuard* RegisterSharedPropertyGuard(Js::PropertyId propertyId);
1361-
void RegisterLazyBailout(Js::PropertyId propertyId, Js::EntryPointInfo* entryPoint, bool hasLazyBailOut);
1358+
void RegisterLazyBailout(Js::PropertyId propertyId, Js::EntryPointInfo* entryPoint);
13621359
void RegisterUniquePropertyGuard(Js::PropertyId propertyId, Js::PropertyGuard* guard);
13631360
void RegisterUniquePropertyGuard(Js::PropertyId propertyId, RecyclerWeakReference<Js::PropertyGuard>* guardWeakRef);
13641361
void RegisterConstructorCache(Js::PropertyId propertyId, Js::ConstructorCache* cache);

0 commit comments

Comments
 (0)