Skip to content

Commit 2ed7144

Browse files
committed
[MERGE #5336 @Cellule] IsIn Array fast path with non-int 2.0
Merge pull request #5336 from Cellule:isin OS#16717501
2 parents ccb3fc0 + 95470df commit 2ed7144

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

lib/Backend/Lower.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20072,6 +20072,8 @@ void Lowerer::GenerateFastArrayIsIn(IR::Instr * instr)
2007220072

2007320073
if (
2007420074
!src1->GetValueType().IsLikelyInt() ||
20075+
// Do not do a fast path if we know for sure we don't have an int
20076+
src1->IsNotInt() ||
2007520077
!src2->GetValueType().IsLikelyArray() ||
2007620078
!src2->GetValueType().HasNoMissingValues())
2007720079
{

test/Array/bug16717501.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
6+
function test0() {
7+
for (var vnlgev in [1 .__parent__ = '']) {
8+
}
9+
// Value too big to be a tagged int on 32 bit platforms
10+
return 1518500249 in [];
11+
}
12+
// Trigger jit
13+
for (let i = 0; i < 1000; ++i) {
14+
test0();
15+
}
16+
17+
console.log("pass");

test/Array/rlexe.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,4 +764,9 @@
764764
<files>constructor_fastpath.js</files>
765765
</default>
766766
</test>
767+
<test>
768+
<default>
769+
<files>bug16717501.js</files>
770+
</default>
771+
</test>
767772
</regress-exe>

0 commit comments

Comments
 (0)