Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions JSTests/stress/double-inlined-call-argument.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function foo(a, b, c, p) {
a = b + c;
if (p) {
a++;
return a;
}
}

function bar(a, b) {
return foo("hello", a, b, a <= b);
}

noInline(bar);

for (var i = 0; i < 100000; ++i) {
var result = bar(2000000000, 2000000000.5);
if (result != 4000000001.5)
throw new Error(`Bad result: ${result}!`);
}

if (reoptimizationRetryCount(bar) != 0)
throw new Error(`Should not have reoptimized bar, but reoptimized ${reoptimizationRetryCount(bar)} times.`);
16 changes: 16 additions & 0 deletions JSTests/stress/regress-116397731.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var out;

function func0(value) {
if (value) {}
out = value;
value = value + 1 + 2;
}

function main() {
for (let i = 0; i < 0x100000; i++)
func0(undefined);
if (out !== undefined)
throw new Error(`Bad value: ${out}!`);
}

main();
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/dfg/DFGVariableAccessData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bool VariableAccessData::tallyVotesForShouldUseDoubleFormat()
if (!newValueOfShouldUseDoubleFormat) {
// We monotonically convert to double. Hence, if the fixpoint leads us to conclude that we should
// switch back to int, we instead ignore this and stick with double.
return false;
return DFG::mergeDoubleFormatState(m_doubleFormatState, NotUsingDoubleFormat);
}

if (m_doubleFormatState == UsingDoubleFormat)
Expand Down