Skip to content

Commit 478ed00

Browse files
committed
Bug 1918166: Record Ion compilation times in new glean histogram javascript.ion.compile_time. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D229006 UltraBlame original commit: 154887438a23bf41d967bfb6f862f96cf301b5ba
1 parent bfb70b7 commit 478ed00

File tree

5 files changed

+240
-1
lines changed

5 files changed

+240
-1
lines changed

js/public/friend/UsageStatistics.h

+5
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@ FOR_EACH_JS_GLEAN_METRIC
530530
(
531531
_
532532
)
533+
_
534+
(
535+
ION_COMPILE_TIME
536+
TimeDuration_US
537+
)
533538
#
534539
define
535540
FOR_EACH_JS_METRIC

js/src/jit/CodeGenerator.h

+41
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,34 @@ data
12331233
;
12341234
#
12351235
endif
1236+
void
1237+
setCompilationTime
1238+
(
1239+
mozilla
1240+
:
1241+
:
1242+
TimeDuration
1243+
duration
1244+
)
1245+
{
1246+
compileTime_
1247+
=
1248+
duration
1249+
;
1250+
}
1251+
mozilla
1252+
:
1253+
:
1254+
TimeDuration
1255+
getCompilationTime
1256+
(
1257+
)
1258+
const
1259+
{
1260+
return
1261+
compileTime_
1262+
;
1263+
}
12361264
private
12371265
:
12381266
void
@@ -2594,6 +2622,19 @@ barriered
25942622
uint32_t
25952623
zoneStubsToReadBarrier_
25962624
;
2625+
/
2626+
/
2627+
Total
2628+
Ion
2629+
compilation
2630+
time
2631+
.
2632+
mozilla
2633+
:
2634+
:
2635+
TimeDuration
2636+
compileTime_
2637+
;
25972638
#
25982639
ifdef
25992640
FUZZING_JS_FUZZILLI

js/src/jit/Ion.cpp

+85-1
Original file line numberDiff line numberDiff line change
@@ -2699,6 +2699,44 @@ return
26992699
false
27002700
;
27012701
}
2702+
/
2703+
/
2704+
Record
2705+
Ion
2706+
compile
2707+
time
2708+
in
2709+
glean
2710+
.
2711+
if
2712+
(
2713+
mozilla
2714+
:
2715+
:
2716+
TimeDuration
2717+
compileTime
2718+
=
2719+
codegen
2720+
-
2721+
>
2722+
getCompilationTime
2723+
(
2724+
)
2725+
)
2726+
{
2727+
cx
2728+
-
2729+
>
2730+
metrics
2731+
(
2732+
)
2733+
.
2734+
ION_COMPILE_TIME
2735+
(
2736+
compileTime
2737+
)
2738+
;
2739+
}
27022740
return
27032741
true
27042742
;
@@ -10404,6 +10442,22 @@ spewEndFunction
1040410442
mir
1040510443
)
1040610444
;
10445+
mozilla
10446+
:
10447+
:
10448+
TimeStamp
10449+
compileStartTime
10450+
=
10451+
mozilla
10452+
:
10453+
:
10454+
TimeStamp
10455+
:
10456+
:
10457+
Now
10458+
(
10459+
)
10460+
;
1040710461
{
1040810462
WarpCompilation
1040910463
comp
@@ -10474,13 +10528,43 @@ return
1047410528
nullptr
1047510529
;
1047610530
}
10477-
return
10531+
CodeGenerator
10532+
*
10533+
codegen
10534+
=
1047810535
GenerateCode
1047910536
(
1048010537
mir
1048110538
lir
1048210539
)
1048310540
;
10541+
if
10542+
(
10543+
codegen
10544+
)
10545+
{
10546+
codegen
10547+
-
10548+
>
10549+
setCompilationTime
10550+
(
10551+
mozilla
10552+
:
10553+
:
10554+
TimeStamp
10555+
:
10556+
:
10557+
Now
10558+
(
10559+
)
10560+
-
10561+
compileStartTime
10562+
)
10563+
;
10564+
}
10565+
return
10566+
codegen
10567+
;
1048410568
}
1048510569
static
1048610570
AbortReasonOr

js/xpconnect/metrics.yaml

+82
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,88 @@ expires
348348
never
349349
javascript
350350
.
351+
ion
352+
:
353+
compile_time
354+
:
355+
type
356+
:
357+
timing_distribution
358+
time_unit
359+
:
360+
microsecond
361+
description
362+
:
363+
>
364+
Time
365+
in
366+
microseconds
367+
of
368+
an
369+
Ion
370+
compilation
371+
.
372+
bugs
373+
:
374+
-
375+
https
376+
:
377+
/
378+
/
379+
bugzilla
380+
.
381+
mozilla
382+
.
383+
org
384+
/
385+
show_bug
386+
.
387+
cgi
388+
?
389+
id
390+
=
391+
1918166
392+
data_reviews
393+
:
394+
-
395+
https
396+
:
397+
/
398+
/
399+
bugzilla
400+
.
401+
mozilla
402+
.
403+
org
404+
/
405+
show_bug
406+
.
407+
cgi
408+
?
409+
id
410+
=
411+
1918166
412+
notification_emails
413+
:
414+
-
415+
dpalmeiro
416+
mozilla
417+
.
418+
com
419+
-
420+
perf
421+
-
422+
telemetry
423+
-
424+
alerts
425+
mozilla
426+
.
427+
com
428+
expires
429+
:
430+
never
431+
javascript
432+
.
351433
gc
352434
:
353435
total_time

js/xpconnect/src/XPCJSRuntime.cpp

+27
Original file line numberDiff line numberDiff line change
@@ -19072,6 +19072,33 @@ sample
1907219072
;
1907319073
break
1907419074
;
19075+
case
19076+
JSMetric
19077+
:
19078+
:
19079+
ION_COMPILE_TIME
19080+
:
19081+
glean
19082+
:
19083+
:
19084+
javascript_ion
19085+
:
19086+
:
19087+
compile_time
19088+
.
19089+
AccumulateRawDuration
19090+
(
19091+
TimeDuration
19092+
:
19093+
:
19094+
FromMicroseconds
19095+
(
19096+
sample
19097+
)
19098+
)
19099+
;
19100+
break
19101+
;
1907519102
default
1907619103
:
1907719104
/

0 commit comments

Comments
 (0)