Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@9c23d506ad
Browse files Browse the repository at this point in the history
[MERGE #5528 @Cellule] Post Op Bailout before first instr

Merge pull request #5528 from Cellule:users/micfer/handlerscope

Handle cases where we try to bailout before the first bytecode instr.
OS#17686612
Right now, it is possible to have a post-op bailout on LdScopeHandler which is added in IRBuilder.
I am not sure how to write a test that triggers this path, it seems specific to browser/node scenario

I have checked with @rajatd that a bailout there is fine since we will re-execute the code in the bailout path (more specifically in the first iteration of the interpreter).

Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
  • Loading branch information
Cellule authored and chakrabot committed Jul 28, 2018
1 parent 7261e4b commit 692f208
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions deps/chakrashim/core/lib/Backend/IR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2717,11 +2717,21 @@ Instr::GetNextByteCodeInstr() const
{
nextInstr = getNext(nextInstr);
}
// This can happen due to break block removal
while (nextInstr->GetByteCodeOffset() == Js::Constants::NoByteCodeOffset ||
nextInstr->GetByteCodeOffset() < currentOffset)

// Do not check if the instr trying to bailout is in the function prologue
// nextInstr->GetByteCodeOffset() < currentOffset would always be true and we would crash
if (currentOffset != Js::Constants::NoByteCodeOffset)
{
nextInstr = getNext(nextInstr);
// This can happen due to break block removal
while (nextInstr->GetByteCodeOffset() == Js::Constants::NoByteCodeOffset ||
nextInstr->GetByteCodeOffset() < currentOffset)
{
nextInstr = getNext(nextInstr);
}
}
else
{
AssertMsg(nextInstr->GetByteCodeOffset() == 0, "Only instrs before the first one are allowed to not have a bytecode offset");
}
return nextInstr;
}
Expand Down

0 comments on commit 692f208

Please sign in to comment.