Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions lib/Runtime/Language/JavascriptStackWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ namespace Js
{
if (this->IsJavascriptFrame())
{
if (this->interpreterFrame && this->lastInternalFrameInfo.codeAddress == nullptr)
if (this->interpreterFrame
#if ENABLE_NATIVE_CODEGEN
&& this->lastInternalFrameInfo.codeAddress == nullptr
#endif
)
{
uint32 offset = this->interpreterFrame->GetReader()->GetCurrentOffset();
if (offset == 0)
Expand Down Expand Up @@ -754,10 +758,12 @@ namespace Js

bool JavascriptStackWalker::CheckJavascriptFrame(bool includeInlineFrames)
{
#if ENABLE_NATIVE_CODEGEN
if (this->lastInternalFrameInfo.frameConsumed)
{
ClearCachedInternalFrameInfo();
}
#endif

this->isNativeLibraryFrame = false; // Clear previous result

Expand Down Expand Up @@ -795,7 +801,8 @@ namespace Js

this->tempInterpreterFrame = this->interpreterFrame->GetPreviousFrame();

#if DBG && ENABLE_NATIVE_CODEGEN
#if ENABLE_NATIVE_CODEGEN
#if DBG
if (((CallInfo const *)&argv[JavascriptFunctionArgIndex_CallInfo])->Flags & CallFlags_InternalFrame)
{
// The return address of the interpreterFrame is the same as the entryPoint for a jitted loop body.
Expand All @@ -807,7 +814,7 @@ namespace Js
true /*fromBailout*/, this->tempInterpreterFrame->GetCurrentLoopNum(), this, true /*noAlloc*/));
tmpFrameWalker.Close();
}
#endif
#endif //DBG

if (!this->interpreterFrame->IsCurrentLoopNativeAddr(this->lastInternalFrameInfo.codeAddress))
{
Expand All @@ -818,6 +825,7 @@ namespace Js
Assert(this->lastInternalFrameInfo.codeAddress);
this->lastInternalFrameInfo.frameConsumed = true;
}
#endif //ENABLE_NATIVE_CODEGEN

return true;
}
Expand Down Expand Up @@ -1010,6 +1018,7 @@ namespace Js
return this->GetCurrentArgv()[JavascriptFunctionArgIndex_This];
}

#if ENABLE_NATIVE_CODEGEN
void JavascriptStackWalker::ClearCachedInternalFrameInfo()
{
this->lastInternalFrameInfo.Clear();
Expand All @@ -1023,6 +1032,7 @@ namespace Js
}
this->lastInternalFrameInfo.loopBodyFrameType = loopBodyFrameType;
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same #endif // ENABLE_NATIVE_CODEGEN here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems pretty clear as to which #if it corresponds to

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. This one is fine.


bool JavascriptStackWalker::IsCurrentPhysicalFrameForLoopBody() const
{
Expand Down
6 changes: 4 additions & 2 deletions lib/Runtime/Language/JavascriptStackWalker.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ namespace Js

void ClearCachedInternalFrameInfo();
void SetCachedInternalFrameInfo(InternalFrameType frameType, InternalFrameType loopBodyFrameType);
#if ENABLE_NATIVE_CODEGEN
InternalFrameInfo GetCachedInternalFrameInfo() const { return this->lastInternalFrameInfo; }
#endif
bool IsCurrentPhysicalFrameForLoopBody() const;

// noinline, we want to use own stack frame.
Expand Down Expand Up @@ -326,9 +328,9 @@ namespace Js
void SetCurrentArgumentsObject(Var args);
Var GetCurrentNativeArgumentsObject() const;
void SetCurrentNativeArgumentsObject(Var args);

#if ENABLE_NATIVE_CODEGEN
InternalFrameInfo lastInternalFrameInfo;

#endif
mutable StackFrame currentFrame;

Js::JavascriptFunction * UpdateFrame(bool includeInlineFrames);
Expand Down