Skip to content

Commit ded4d02

Browse files
committed
Don't allocate DFG register after a slow path
https://bugs.webkit.org/show_bug.cgi?id=283063 rdar://139747120 Reviewed by Yusuke Suzuki. Allocating a DFG register after a slow path means that if the slow path is taken, we end up with an incorrect global state. * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): Canonical link: https://commits.webkit.org/283286.475@safari-7620-branch
1 parent 9700aa3 commit ded4d02

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3559,6 +3559,14 @@ void SpeculativeJIT::compilePutByValForIntTypedArray(Node* node, TypedArrayType
35593559
}
35603560
}
35613561

3562+
GPRReg scratch2GPR = InvalidGPRReg;
3563+
#if USE(JSVALUE64)
3564+
if (node->arrayMode().mayBeResizableOrGrowableSharedTypedArray()) {
3565+
scratch2.emplace(this);
3566+
scratch2GPR = scratch2->gpr();
3567+
}
3568+
#endif
3569+
35623570
bool result = getIntTypedArrayStoreOperand(
35633571
value, propertyReg,
35643572
#if USE(JSVALUE32_64)
@@ -3570,14 +3578,6 @@ void SpeculativeJIT::compilePutByValForIntTypedArray(Node* node, TypedArrayType
35703578
return;
35713579
}
35723580

3573-
GPRReg scratch2GPR = InvalidGPRReg;
3574-
#if USE(JSVALUE64)
3575-
if (node->arrayMode().mayBeResizableOrGrowableSharedTypedArray()) {
3576-
scratch2.emplace(this);
3577-
scratch2GPR = scratch2->gpr();
3578-
}
3579-
#endif
3580-
35813581
GPRReg valueGPR = value.gpr();
35823582
GPRReg scratchGPR = scratch.gpr();
35833583
#if USE(JSVALUE32_64)

0 commit comments

Comments
 (0)