Skip to content

Commit c8c8050

Browse files
committed
Mark RuntimeLong.toDouble as fully inline.
Its implementation is shorter than many of the methods we already inline, like additions and multiplications. We do pay a little code size cost for this change. This will be particularly useful for the following commit, which will rely on folding to happen within `toDouble`, once inlined at call site.
1 parent 5fe402b commit c8c8050

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

linker-private-library/src/main/scala/org/scalajs/linker/runtime/RuntimeLong.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,9 @@ object RuntimeLong {
695695
a.lo
696696

697697
@inline
698-
def toDouble(a: RuntimeLong): Double =
699-
toDouble(a.lo, a.hi)
700-
701-
private def toDouble(lo: Int, hi: Int): Double = {
698+
def toDouble(a: RuntimeLong): Double = {
699+
val lo = a.lo
700+
val hi = a.hi
702701
if (hi < 0) {
703702
// We do asUint() on the hi part specifically for MinValue
704703
val neg = inline_negate(lo, hi)

project/Build.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,17 +2060,17 @@ object Build {
20602060
))
20612061
} else {
20622062
Some(ExpectedSizes(
2063-
fastLink = 425000 to 426000,
2064-
fullLink = 282000 to 283000,
2065-
fastLinkGz = 60000 to 61000,
2063+
fastLink = 426000 to 427000,
2064+
fullLink = 283000 to 284000,
2065+
fastLinkGz = 61000 to 62000,
20662066
fullLinkGz = 43000 to 44000,
20672067
))
20682068
}
20692069

20702070
case `default213Version` =>
20712071
if (!useMinifySizes) {
20722072
Some(ExpectedSizes(
2073-
fastLink = 442000 to 443000,
2073+
fastLink = 443000 to 444000,
20742074
fullLink = 90000 to 91000,
20752075
fastLinkGz = 57000 to 58000,
20762076
fullLinkGz = 24000 to 25000,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy