You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep classOf[Prim] as Constant until the back-end.
The translation of `classOf[Prim]` (e.g., `classOf[Int]`) to
`BoxedPrimClass.TYPE` (e.g., `j.l.Integer.TYPE`) is specific to the
JVM back-end, because the JVM bytecode does not have any
instruction to load them. Other back-ends have appropriate opcodes
and prefer to receive them as `Constant(Literal(primType))`, so
that they don't have to reverse-engineer the `Select`s.
Since that transformation is not harder to do in the back-end, we
move it directly to the JVM codegen. The code is actually shorter
there.
This also helps to keep the trees a bit smaller across the phases
after erasure.
0 commit comments