@@ -431,8 +431,6 @@ IRBuilder::Build()
431
431
432
432
AssertMsg (sizeof (SymID) >= sizeof (Js::RegSlot), " sizeof(SymID) != sizeof(Js::RegSlot)!!" );
433
433
434
- offset = m_functionStartOffset;
435
-
436
434
// Skip the last EndOfBlock opcode
437
435
Assert (!OpCodeAttr::HasMultiSizeLayout (Js::OpCode::EndOfBlock));
438
436
uint32 lastOffset = m_func->GetJITFunctionBody ()->GetByteCodeLength () - Js::OpCodeUtil::EncodedSize (Js::OpCode::EndOfBlock, Js::SmallLayout);
@@ -489,19 +487,15 @@ IRBuilder::Build()
489
487
if (m_func->IsJitInDebugMode ())
490
488
{
491
489
// This is first bailout in the function, the locals at stack have not initialized to undefined, so do not restore them.
492
- this ->InsertBailOutForDebugger (offset , IR::BailOutForceByFlag | IR::BailOutBreakPointInFunction | IR::BailOutStep, nullptr );
490
+ this ->InsertBailOutForDebugger (m_functionStartOffset , IR::BailOutForceByFlag | IR::BailOutBreakPointInFunction | IR::BailOutStep, nullptr );
493
491
}
494
492
495
493
#ifdef BAILOUT_INJECTION
496
494
// Start bailout inject after the constant and arg load. We don't bailout before that
497
495
IR::Instr * lastInstr = m_lastInstr;
498
496
#endif
499
497
500
- if (m_statementReader.AtStatementBoundary (&m_jnReader))
501
- {
502
- statementIndex = this ->AddStatementBoundary (statementIndex, offset);
503
- }
504
-
498
+ offset = Js::Constants::NoByteCodeOffset;
505
499
if (!this ->IsLoopBody ())
506
500
{
507
501
IR::Instr *instr;
@@ -544,7 +538,7 @@ IRBuilder::Build()
544
538
{
545
539
IR::RegOpnd *funcExprScopeOpnd = BuildDstOpnd (funcExprScopeReg);
546
540
instr = IR::Instr::New (Js::OpCode::NewPseudoScope, funcExprScopeOpnd, m_func);
547
- this ->AddInstr (instr, (uint)- 1 );
541
+ this ->AddInstr (instr, offset );
548
542
}
549
543
550
544
Js::RegSlot closureReg = m_func->GetJITFunctionBody ()->GetLocalClosureReg ();
@@ -593,15 +587,15 @@ IRBuilder::Build()
593
587
this ->AddInstr (
594
588
IR::Instr::New (
595
589
Js::OpCode::InitLocalClosure, this ->BuildDstOpnd (m_func->GetLocalClosureSym ()->m_id ), m_func),
596
- (uint32)- 1 );
590
+ offset );
597
591
598
592
this ->AddInstr (
599
593
IR::Instr::New (
600
594
Js::OpCode::StSlot,
601
595
this ->BuildFieldOpnd (
602
596
Js::OpCode::StSlot, m_func->GetLocalClosureSym ()->m_id , 0 , (Js::PropertyIdIndexType)-1 , PropertyKindSlots),
603
597
closureOpnd, m_func),
604
- (uint32)- 1 );
598
+ offset );
605
599
}
606
600
}
607
601
@@ -658,19 +652,25 @@ IRBuilder::Build()
658
652
this ->AddInstr (
659
653
IR::Instr::New (
660
654
Js::OpCode::InitLocalClosure, this ->BuildDstOpnd (m_func->GetLocalFrameDisplaySym ()->m_id ), m_func),
661
- (uint32)- 1 );
655
+ offset );
662
656
663
657
this ->AddInstr (
664
658
IR::Instr::New (
665
659
Js::OpCode::StSlot,
666
660
this ->BuildFieldOpnd (Js::OpCode::StSlot, m_func->GetLocalFrameDisplaySym ()->m_id , 0 , (Js::PropertyIdIndexType)-1 , PropertyKindSlots),
667
661
dstOpnd, m_func),
668
- (uint32)- 1 );
662
+ offset );
669
663
}
670
664
}
671
665
}
672
666
}
673
667
668
+ offset = m_functionStartOffset;
669
+ if (m_statementReader.AtStatementBoundary (&m_jnReader))
670
+ {
671
+ statementIndex = this ->AddStatementBoundary (statementIndex, offset);
672
+ }
673
+
674
674
// For label instr we can add bailout only after all labels were finalized. Put to list/add in the end.
675
675
JsUtil::BaseDictionary<IR::Instr*, int , JitArenaAllocator> ignoreExBranchInstrToOffsetMap (m_tempAlloc);
676
676
0 commit comments