Skip to content

Commit

Permalink
Fix NoJIT build
Browse files Browse the repository at this point in the history
  • Loading branch information
pleath committed Nov 13, 2018
1 parent 68e1e9d commit 0b6dc52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/Runtime/Language/InterpreterStackFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6727,10 +6727,12 @@ namespace Js
// Finally exited with LeaveNull, We don't throw for early returns
if (finallyEndOffset == 0 && exceptionObj)
{
#if ENABLE_NATIVE_CODEGEN
if (scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr() != nullptr)
{
JavascriptExceptionOperators::WalkStackForCleaningUpInlineeInfo(scriptContext, nullptr, scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr());
}
#endif
JavascriptExceptionOperators::DoThrow(const_cast<Js::JavascriptExceptionObject *>(exceptionObj), scriptContext);
}
if (finallyEndOffset != 0)
Expand Down
15 changes: 12 additions & 3 deletions lib/Runtime/Language/JavascriptExceptionOperators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,12 @@ namespace Js
{
// Clone static exception object early in case finally block overwrites it
exception = exception->CloneIfStaticExceptionObject(scriptContext);

#if ENABLE_NATIVE_CODEGEN
if (exception->GetExceptionContext() && exception->GetExceptionContext()->ThrowingFunction())
{
WalkStackForCleaningUpInlineeInfo(scriptContext, nullptr /* start stackwalk from the current frame */, tryHandlerAddrOfReturnAddr);
}
#endif
}

finallyContinuation = amd64_CallWithFakeFrame(finallyAddr, frame, spillSize, argsSize);
Expand All @@ -280,10 +281,12 @@ namespace Js

if (exception)
{
#if ENABLE_NATIVE_CODEGEN
if (scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr() != nullptr)
{
WalkStackForCleaningUpInlineeInfo(scriptContext, nullptr, scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr());
}
#endif
JavascriptExceptionOperators::DoThrow(exception, scriptContext);
}

Expand Down Expand Up @@ -401,12 +404,12 @@ namespace Js
{
// Clone static exception object early in case finally block overwrites it
exception = exception->CloneIfStaticExceptionObject(scriptContext);

#if ENABLE_NATIVE_CODEGEN
if (exception->GetExceptionContext() && exception->GetExceptionContext()->ThrowingFunction())
{
WalkStackForCleaningUpInlineeInfo(scriptContext, nullptr /* start stackwalk from the current frame */, tryHandlerAddrOfReturnAddr);
}

#endif
bool hasBailedOut = *(bool*)((char*)localsPtr + hasBailedOutOffset); // stack offsets are sp relative
if (hasBailedOut)
{
Expand Down Expand Up @@ -467,10 +470,12 @@ namespace Js
// Clone static exception object early in case finally block overwrites it
exception = exception->CloneIfStaticExceptionObject(scriptContext);

#if ENABLE_NATIVE_CODEGEN
if (exception->GetExceptionContext() && exception->GetExceptionContext()->ThrowingFunction())
{
WalkStackForCleaningUpInlineeInfo(scriptContext, nullptr /* start stackwalk from the current frame */, tryHandlerAddrOfReturnAddr);
}
#endif
}

#if defined(_M_ARM)
Expand All @@ -486,10 +491,12 @@ namespace Js

if (exception)
{
#if ENABLE_NATIVE_CODEGEN
if (scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr() != nullptr)
{
WalkStackForCleaningUpInlineeInfo(scriptContext, nullptr, scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr());
}
#endif
JavascriptExceptionOperators::DoThrow(exception, scriptContext);
}

Expand Down Expand Up @@ -976,10 +983,12 @@ namespace Js

if (pExceptionObject)
{
#if ENABLE_NATIVE_CODEGEN
if (scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr() != nullptr)
{
WalkStackForCleaningUpInlineeInfo(scriptContext, nullptr, scriptContext->GetThreadContext()->GetTryHandlerAddrOfReturnAddr());
}
#endif
JavascriptExceptionOperators::DoThrow(pExceptionObject, scriptContext);
}

Expand Down

0 comments on commit 0b6dc52

Please sign in to comment.