8000 Optimizer: Fail if we cannot inline RuntimeLong · scala-js/scala-js@a3fb06f · GitHub
[go: up one dir, main page]

Skip to content

Commit a3fb06f

Browse files
committed
Optimizer: Fail if we cannot inline RuntimeLong
1 parent 0da8942 commit a3fb06f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

linker/shared/src/main/scala/org/scalajs/linker/frontend/optimizer/OptimizerCore.scala

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,11 +3598,15 @@ private[optimizer] abstract class OptimizerCore(
35983598
withBinding(rtLongBinding) { (scope1, cont1) =>
35993599
implicit val scope = scope1
36003600
val tRef = VarRef(LocalIdent(tName))(rtLongClassType)
3601-
val newTree = New(LongImpl.RuntimeLongClass,
3602- MethodIdent(LongImpl.initFromParts),
3603-
List(Apply(ApplyFlags.empty, tRef, MethodIdent(LongImpl.lo), Nil)(IntType),
3604-
Apply(ApplyFlags.empty, tRef, MethodIdent(LongImpl.hi), Nil)(IntType)))
3605-
pretransformExpr(newTree)(cont1)
3601+
3602+
val lo = Apply(ApplyFlags.empty, tRef, MethodIdent(LongImpl.lo), Nil)(IntType)
3603+
val hi = Apply(ApplyFlags.empty, tRef, MethodIdent(LongImpl.hi), Nil)(IntType)
3604+
3605+
pretransformExprs(lo, hi) { (tlo, thi) =>
3606+
inlineClassConstructor(AllocationSite.Anonymous, LongImpl.RuntimeLongClass,
3607+
inlinedRTLongStructure, MethodIdent(LongImpl.initFromParts), List(tlo, thi),
3608+
() => throw new AssertionError(s"rolled-back RuntimeLong inlining at $pos"))(cont1)
3609+
}
36063610
} (cont)
36073611
}
36083612

0 commit comments

Comments
 (0)
0