Skip to content

Commit 0700a47

Browse files
committed
Optimize toBits in FlagSet
async-profiles have shown that toBits was not inlined by the JVM. Helping the JVM a bit here by making bits inline, so that toBits is one fewer call away. Not that we cannot inline toBits at typer since it is in the scope of an opaque type.
1 parent f2018f0 commit 0700a47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Flags.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object Flags {
2424

2525
extension (x: FlagSet) {
2626

27-
def bits: Long = opaques.toBits(x)
27+
inline def bits: Long = opaques.toBits(x)
2828

2929
/** The union of the given flag sets.
3030
* Combining two FlagSets with `|` will give a FlagSet

0 commit comments

Comments
 (0)