Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7534721
repro_nan4.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
875 B
Referenced Files
None
Subscribers
None
repro_nan4.js
View Options
// Test: many SHORT calls to trigger call_count JIT (not OSR back-edge)
function
test_short
(
n
)
{
function
f
(
a
)
{
sum
++
;
}
var
j
,
sum
;
sum
=
0
;
for
(
j
=
0
;
j
<
n
;
j
++
)
{
f
(
j
);
}
return
n
;
}
// Call with small n many times to trigger call_count threshold
var
fails
=
0
;
for
(
var
i
=
0
;
i
<
200
;
i
++
)
{
var
result
=
test_short
(
5
);
if
(
result
!==
5
)
{
if
(
fails
<
3
)
console
.
log
(
"FAIL iter "
+
i
+
": test_short(5) = "
+
result
);
fails
++
;
}
}
console
.
log
(
"call_count path: "
+
(
fails
>
0
?
fails
+
" failures"
:
"PASS"
));
// Now test with large n to trigger OSR
fails
=
0
;
for
(
var
i
=
0
;
i
<
20
;
i
++
)
{
var
n
=
2000
;
var
result
=
test_short
(
n
);
if
(
result
!==
n
)
{
if
(
fails
<
3
)
console
.
log
(
"FAIL iter "
+
i
+
": test_short("
+
n
+
") = "
+
result
);
fails
++
;
}
}
console
.
log
(
"OSR path: "
+
(
fails
>
0
?
fails
+
" failures"
:
"PASS"
));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 17, 11:53 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
537048
Default Alt Text
repro_nan4.js (875 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment