From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- js/src/jit/IonAnalysis.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'js/src/jit/IonAnalysis.cpp') diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index a0c9a51c39..543ed0eb83 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -747,13 +747,13 @@ static bool IsDiamondPattern(MBasicBlock* initialBlock) { MTest* initialTest = ins->toTest(); MBasicBlock* trueBranch = initialTest->ifTrue(); - if (trueBranch->numPredecessors() != 1 || trueBranch->numSuccessors() != 1) { + if (trueBranch->numPredecessors() != 1 || !trueBranch->lastIns()->isGoto()) { return false; } MBasicBlock* falseBranch = initialTest->ifFalse(); if (falseBranch->numPredecessors() != 1 || - falseBranch->numSuccessors() != 1) { + !falseBranch->lastIns()->isGoto()) { return false; } @@ -2228,6 +2228,7 @@ bool TypeAnalyzer::adjustPhiInputs(MPhi* phi) { phi->replaceOperand(i, in->toBox()->input()); } else { MInstruction* replacement; + MBasicBlock* predecessor = phi->block()->getPredecessor(i); if (phiType == MIRType::Double && IsFloatType(in->type())) { // Convert int32 operands to double. @@ -2239,14 +2240,14 @@ bool TypeAnalyzer::adjustPhiInputs(MPhi* phi) { // See comment below if (in->type() != MIRType::Value) { MBox* box = MBox::New(alloc(), in); - in->block()->insertBefore(in->block()->lastIns(), box); + predecessor->insertAtEnd(box); in = box; } MUnbox* unbox = MUnbox::New(alloc(), in, MIRType::Double, MUnbox::Fallible); unbox->setBailoutKind(BailoutKind::SpeculativePhi); - in->block()->insertBefore(in->block()->lastIns(), unbox); + predecessor->insertAtEnd(unbox); replacement = MToFloat32::New(alloc(), in); } } else { @@ -2255,7 +2256,7 @@ bool TypeAnalyzer::adjustPhiInputs(MPhi* phi) { // below. if (in->type() != MIRType::Value) { MBox* box = MBox::New(alloc(), in); - in->block()->insertBefore(in->block()->lastIns(), box); + predecessor->insertAtEnd(box); in = box; } @@ -2265,7 +2266,7 @@ bool TypeAnalyzer::adjustPhiInputs(MPhi* phi) { } replacement->setBailoutKind(BailoutKind::SpeculativePhi); - in->block()->insertBefore(in->block()->lastIns(), replacement); + predecessor->insertAtEnd(replacement); phi->replaceOperand(i, replacement); } } @@ -4452,6 +4453,10 @@ static bool NeedsKeepAlive(MInstruction* slotsOrElements, MInstruction* use) { if (use->type() == MIRType::BigInt) { return true; } + if (use->isLoadTypedArrayElementHole() && + Scalar::isBigIntType(use->toLoadTypedArrayElementHole()->arrayType())) { + return true; + } MBasicBlock* block = use->block(); MInstructionIterator iter(block->begin(slotsOrElements)); -- cgit v1.2.3