10000 Optimize divisions and remainders by constants. · scala-js/scala-js@864ebae · GitHub
[go: up one dir, main page]

Skip to content

Commit 864ebae

Browse files
committed
Optimize divisions and remainders by constants.
Following the techniques described in Hacker's Delight, Chapter 10.
1 parent c0b6ce2 commit 864ebae

File tree

7 files changed

+1387
-11
lines changed

7 files changed

+1387
-11
lines changed

ir/shared/src/main/scala/org/scalajs/ir/Trees.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ object Trees {
125125

126126
override def toString(): String =
127127
stats.mkString("Block(", ",", ")")
128+
129+
override def equals(that: Any): Boolean = that match {
130+
case that: Block => this.stats == that.stats
131+
case _ => false
132+
}
133+
134+
override def hashCode(): Int = stats.##
128135
}
129136

130137
object Block {

0 commit comments

Comments
 (0)
0