Skip to content

Commit 764ce9c

Browse files
Avoid hoisting speculation guards in simplejit
There are issues with region determination for try/catch/finally and the blocks added for the speculation guard hoisting in simplejit (in fulljit, regions are determined earlier and avoid this issue).
1 parent bc2e55a commit 764ce9c

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lib/Backend/BackwardPass.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,7 +2839,10 @@ BackwardPass::ProcessBlock(BasicBlock * block)
28392839
if(IsCollectionPass())
28402840
{
28412841
#ifndef _M_ARM
2842-
if (this->collectionPassSubPhase == CollectionPassSubPhase::FirstPass)
2842+
if (
2843+
this->collectionPassSubPhase == CollectionPassSubPhase::FirstPass
2844+
&& !this->func->IsSimpleJit()
2845+
)
28432846
{
28442847
// In the collection pass we do multiple passes over loops. In these passes we keep
28452848
// track of sets of symbols, such that we can know whether or not they are used in
@@ -3232,7 +3235,11 @@ BackwardPass::ProcessBlock(BasicBlock * block)
32323235
if (this->tag == Js::DeadStorePhase)
32333236
{
32343237
#ifndef _M_ARM
3235-
if(block->loop && !this->isLoopPrepass)
3238+
if(
3239+
block->loop
3240+
&& !this->isLoopPrepass
3241+
&& !this->func->IsSimpleJit()
3242+
)
32363243
{
32373244
// In the second pass, we mark instructions that we go by as being safe or unsafe.
32383245
//
@@ -3602,12 +3609,17 @@ BackwardPass::ProcessBlock(BasicBlock * block)
36023609
NEXT_INSTR_BACKWARD_IN_BLOCK_EDITING;
36033610

36043611
#ifndef _M_ARM
3605-
if (this->tag == Js::DeadStorePhase
3612+
if (
3613+
this->tag == Js::DeadStorePhase
3614+
// We don't do the masking in simplejit due to reduced perf concerns and the issues
3615+
// with handling try/catch structures with late-added blocks
3616+
&& !this->func->IsSimpleJit()
36063617
// We don't need the masking blocks in asmjs/wasm mode
36073618
&& !block->GetFirstInstr()->m_func->GetJITFunctionBody()->IsAsmJsMode()
36083619
&& !block->GetFirstInstr()->m_func->GetJITFunctionBody()->IsWasmFunction()
36093620
&& !block->isDead
3610-
&& !block->isDeleted)
3621+
&& !block->isDeleted
3622+
)
36113623
{
36123624
FOREACH_PREDECESSOR_BLOCK(blockPred, block)
36133625
{

0 commit comments

Comments
 (0)