@@ -8399,17 +8399,9 @@ LowererMD::GenerateFastInlineBuiltInMathFloor(IR::Instr* instr)
83998399 IR::RegOpnd* floatOpnd = IR::RegOpnd::New (TyFloat64, this ->m_func );
84008400 this ->m_lowerer ->InsertMove (floatOpnd, src, instr);
84018401
8402- IR::LabelInstr * bailoutLabel;
8402+ IR::LabelInstr * bailoutLabel = IR::LabelInstr::New (Js::OpCode::Label, this -> m_func , /* helperLabel */ true ); ;
84038403 bool sharedBailout = (instr->GetBailOutInfo ()->bailOutInstr != instr) ? true : false ;
8404- if (sharedBailout)
8405- {
8406- bailoutLabel = instr->GetBailOutInfo ()->bailOutInstr ->AsLabelInstr ();
8407- }
8408- else
8409- {
8410- bailoutLabel = IR::LabelInstr::New (Js::OpCode::Label, this ->m_func , true );
8411- }
8412-
8404+
84138405 // NaN check
84148406 IR::Instr *instrCmp = IR::Instr::New (Js::OpCode::VCMPF64, this ->m_func );
84158407 instrCmp->SetSrc1 (floatOpnd);
@@ -8481,7 +8473,10 @@ LowererMD::GenerateFastInlineBuiltInMathFloor(IR::Instr* instr)
84818473 {
84828474 instr->InsertBefore (bailoutLabel);
84838475 }
8484- this ->m_lowerer ->GenerateBailOut (instr);
8476+
8477+ // In case of a shared bailout, we should jump to the code that sets some data on the bailout record which is specific
8478+ // to this bailout. Pass the bailoutLabel to GenerateFunction so that it may use the label as the collectRuntimeStatsLabel.
8479+ this ->m_lowerer ->GenerateBailOut (instr, nullptr , nullptr , sharedBailout ? bailoutLabel : nullptr );
84858480
84868481 // MOV dst, intOpnd
84878482 IR::Instr* movInstr = IR::Instr::New (Js::OpCode::MOV, dst, intOpnd, this ->m_func );
@@ -8502,16 +8497,8 @@ LowererMD::GenerateFastInlineBuiltInMathCeil(IR::Instr* instr)
85028497 IR::RegOpnd* floatOpnd = IR::RegOpnd::New (TyFloat64, this ->m_func );
85038498 this ->m_lowerer ->InsertMove (floatOpnd, src, instr);
85048499
8505- IR::LabelInstr * bailoutLabel;
8500+ IR::LabelInstr * bailoutLabel = IR::LabelInstr::New (Js::OpCode::Label, this -> m_func , /* helperLabel */ true ); ;
85068501 bool sharedBailout = (instr->GetBailOutInfo ()->bailOutInstr != instr) ? true : false ;
8507- if (sharedBailout)
8508- {
8509- bailoutLabel = instr->GetBailOutInfo ()->bailOutInstr ->AsLabelInstr ();
8510- }
8511- else
8512- {
8513- bailoutLabel = IR::LabelInstr::New (Js::OpCode::Label, this ->m_func , true );
8514- }
85158502
85168503 // NaN check
85178504 IR::Instr *instrCmp = IR::Instr::New (Js::OpCode::VCMPF64, this ->m_func );
@@ -8589,7 +8576,10 @@ LowererMD::GenerateFastInlineBuiltInMathCeil(IR::Instr* instr)
85898576 {
85908577 instr->InsertBefore (bailoutLabel);
85918578 }
8592- this ->m_lowerer ->GenerateBailOut (instr);
8579+
8580+ // In case of a shared bailout, we should jump to the code that sets some data on the bailout record which is specific
8581+ // to this bailout. Pass the bailoutLabel to GenerateFunction so that it may use the label as the collectRuntimeStatsLabel.
8582+ this ->m_lowerer ->GenerateBailOut (instr, nullptr , nullptr , sharedBailout ? bailoutLabel : nullptr );
85938583
85948584 // MOV dst, intOpnd
85958585 IR::Instr* movInstr = IR::Instr::New (Js::OpCode::MOV, dst, intOpnd, this ->m_func );
@@ -8610,17 +8600,9 @@ LowererMD::GenerateFastInlineBuiltInMathRound(IR::Instr* instr)
86108600 IR::RegOpnd* floatOpnd = IR::RegOpnd::New (TyFloat64, this ->m_func );
86118601 this ->m_lowerer ->InsertMove (floatOpnd, src, instr);
86128602
8613- IR::LabelInstr * bailoutLabel;
8603+ IR::LabelInstr * bailoutLabel = IR::LabelInstr::New (Js::OpCode::Label, this -> m_func , /* helperLabel */ true ); ;
86148604 bool sharedBailout = (instr->GetBailOutInfo ()->bailOutInstr != instr) ? true : false ;
8615- if (sharedBailout)
8616- {
8617- bailoutLabel = instr->GetBailOutInfo ()->bailOutInstr ->AsLabelInstr ();
8618- }
8619- else
8620- {
8621- bailoutLabel = IR::LabelInstr::New (Js::OpCode::Label, this ->m_func , true );
8622- }
8623-
8605+
86248606 // NaN check
86258607 IR::Instr *instrCmp = IR::Instr::New (Js::OpCode::VCMPF64, this ->m_func );
86268608 instrCmp->SetSrc1 (floatOpnd);
@@ -8701,7 +8683,10 @@ LowererMD::GenerateFastInlineBuiltInMathRound(IR::Instr* instr)
87018683 {
87028684 instr->InsertBefore (bailoutLabel);
87038685 }
8704- this ->m_lowerer ->GenerateBailOut (instr);
8686+
8687+ // In case of a shared bailout, we should jump to the code that sets some data on the bailout record which is specific
8688+ // to this bailout. Pass the bailoutLabel to GenerateFunction so that it may use the label as the collectRuntimeStatsLabel.
8689+ this ->m_lowerer ->GenerateBailOut (instr, nullptr , nullptr , sharedBailout ? bailoutLabel : nullptr );
87058690
87068691 // MOV dst, intOpnd
87078692 IR::Instr* movInstr = IR::Instr::New (Js::OpCode::MOV, dst, intOpnd, this ->m_func );
0 commit comments