Skip to content

Commit e381509

Browse files
author
Meghana Gupta
committed
[MERGE #5224 @meg-gupta] Fix REM instruction's profile info
Merge pull request #5224 from meg-gupta:fixrem We use the valueType to overload info where it is a modulus by 2. Fix the case were we were always setting this bit to represent modulus by 2.
2 parents a518668 + 17b4988 commit e381509

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

lib/Runtime/Language/DynamicProfileInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ namespace Js
12111211
/* allow one op of the modulus to be optimized - anyway */
12121212
if (divideTypeInfo[profileId].IsUninitialized())
12131213
{
1214-
divideTypeInfo[profileId] = ValueType::GetInt(true);
1214+
divideTypeInfo[profileId] = isModByPowerOf2 ? ValueType::GetInt(true) : ValueType::Float;
12151215
}
12161216
else
12171217
{

test/Optimizer/rembug.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//-------------------------------------------------------------------------------------------------------
2+
// Copyright (C) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
//-------------------------------------------------------------------------------------------------------
5+
var protoObj1 = {};
6+
var arrObj0 = {};
7+
var uic8 = new Uint8ClampedArray(256);
8+
var IntArr0 = [];
9+
arrObj0[undefined] = protoObj1;
10+
arrObj0.length = undefined;
11+
function v43() {
12+
for (var _strvar0 in uic8) {
13+
for (var _strvar0 in arrObj0) {
14+
arrObj0[_strvar0] = 1[1];
15+
if (!arrObj0[0]) {
16+
IntArr0[-1 % 2147483647 >= 0 ? 1 : 0] = 1;
17+
arrObj0[0] = 1;
18+
}
19+
}
20+
}
21+
}
22+
v43();
23+
if (IntArr0[1] === undefined) {
24+
print("Passed");
25+
}

test/Optimizer/rlexe.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,4 +1550,10 @@
15501550
<tags>exclude_dynapogo,exclude_nonative</tags>
15511551
</default>
15521552
</test>
1553+
<test>
1554+
<default>
1555+
<files>rembug.js</files>
1556+
<compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:1 -loopinterpretcount:1 -oopjit- -bgjit-</compile-flags>
1557+
</default>
1558+
</test>
15531559
</regress-exe>

0 commit comments

Comments
 (0)