Skip to content

Commit

Permalink
Instead of using ehBailOutData, use interpreter flags to mark inlinee
Browse files Browse the repository at this point in the history
  • Loading branch information
meg-gupta committed Oct 6, 2017
1 parent c1c7339 commit 81c558b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 18 deletions.
4 changes: 4 additions & 0 deletions lib/Backend/BailOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,10 @@ BailOutRecord::BailOutHelper(Js::JavascriptCallStackLayout * layout, Js::ScriptF
{
newInstance->OrFlags(Js::InterpreterStackFrameFlags_ProcessingBailOutOnArrayAccessHelperCall);
}
if (isInlinee)
{
newInstance->OrFlags(Js::InterpreterStackFrameFlags_FromInlineeCodeInEHBailOut);
}

ThreadContext *threadContext = newInstance->GetScriptContext()->GetThreadContext();

Expand Down
11 changes: 1 addition & 10 deletions lib/Backend/LinearScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,11 +1373,6 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
if (currentRegionType == RegionTypeTry || currentRegionType == RegionTypeCatch || currentRegionType == RegionTypeFinally)
{
bailOutInfo->bailOutRecord->ehBailoutData = this->currentRegion->ehBailoutData;
if (this->func != instr->m_func)
{
bailOutInfo->bailOutRecord->ehBailoutData = NativeCodeDataNew(func->GetNativeCodeDataAllocator(), Js::EHBailoutData, this->currentRegion->ehBailoutData);
bailOutInfo->bailOutRecord->ehBailoutData->inlineeCode = true;
}
}
}

Expand Down Expand Up @@ -1422,11 +1417,7 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
RegionType currentRegionType = this->currentRegion->GetType();
if (currentRegionType == RegionTypeTry || currentRegionType == RegionTypeCatch || currentRegionType == RegionTypeFinally)
{
bailOutRecord->ehBailoutData = NativeCodeDataNew(func->GetNativeCodeDataAllocator(), Js::EHBailoutData, this->currentRegion->ehBailoutData);
if (currentFunc != this->func)
{
bailOutRecord->ehBailoutData->inlineeCode = true;
}
bailOutRecord->ehBailoutData = this->currentRegion->ehBailoutData;
}
}
funcBailOutData[funcIndex].bailOutRecord->parent = bailOutRecord;
Expand Down
5 changes: 1 addition & 4 deletions lib/Runtime/Language/EHBailoutData.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ namespace Js
HandlerType ht;
EHBailoutData * parent;
EHBailoutData * child;
bool inlineeCode;

public:
EHBailoutData() : nestingDepth(-1), catchOffset(0), finallyOffset(0), parent(nullptr), child(nullptr), ht(HT_None), inlineeCode(nullptr) {}
EHBailoutData() : nestingDepth(-1), catchOffset(0), finallyOffset(0), parent(nullptr), child(nullptr), ht(HT_None) {}
EHBailoutData(int32 nestingDepth, int32 catchOffset, int32 finallyOffset, HandlerType ht, EHBailoutData * parent)
{
this->nestingDepth = nestingDepth;
Expand All @@ -33,7 +32,6 @@ namespace Js
this->ht = ht;
this->parent = parent;
this->child = nullptr;
this->inlineeCode = false;
}
EHBailoutData(EHBailoutData * other)
{
Expand All @@ -43,7 +41,6 @@ namespace Js
this->ht = other->ht;
this->parent = other->parent;
this->child = nullptr;
this->inlineeCode = false;
}
#if ENABLE_NATIVE_CODEGEN
void Fixup(NativeCodeData::DataChunk* chunkList)
Expand Down
4 changes: 1 addition & 3 deletions lib/Runtime/Language/InterpreterStackFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ namespace Js
} autoRestore(this);
#endif

if (this->ehBailoutData && !this->ehBailoutData->inlineeCode)
if (this->ehBailoutData && !(m_flags & InterpreterStackFrameFlags_FromInlineeCodeInEHBailOut))
{
if ((m_flags & Js::InterpreterStackFrameFlags_FromBailOut) && !(m_flags & InterpreterStackFrameFlags_ProcessingBailOutFromEHCode))
{
Expand Down Expand Up @@ -6628,8 +6628,6 @@ const byte * InterpreterStackFrame::OP_ProfiledLoopBodyStart(const byte * ip)
int finallyOffset = ehBailoutData->finallyOffset;
Js::JavascriptExceptionObject* exception = NULL;

Assert(this->ehBailoutData->inlineeCode == false);

if (catchOffset != 0 || finallyOffset != 0)
{
try
Expand Down
1 change: 1 addition & 0 deletions lib/Runtime/Language/InterpreterStackFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace Js
InterpreterStackFrameFlags_FromBailOut = 8,
InterpreterStackFrameFlags_ProcessingBailOutOnArrayAccessHelperCall = 0x10,
InterpreterStackFrameFlags_ProcessingBailOutFromEHCode = 0x20,
InterpreterStackFrameFlags_FromInlineeCodeInEHBailOut = 0x40,
InterpreterStackFrameFlags_All = 0xFFFF,
};

Expand Down
2 changes: 1 addition & 1 deletion test/EH/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<files>tfinlinebug.js</files>
<compile-flags> -force:inline </compile-flags>
</default>
</test
</test>
<test>
<default>
<files>inlinestackwalkbug.js</files>
Expand Down

0 comments on commit 81c558b

Please sign in to comment.