Skip to content

Instantly share code, notes, and snippets.

View lrytz's full-sized avatar
🦉

Lukas Rytz lrytz

🦉
View GitHub Profile
@lrytz
lrytz / Test.scala
Last active September 15, 2016 08:21
class A {
def f = 1
}
trait T extends A
class B extends A {
override def f = 2
}
class C extends B with T {
// according to linearization, this should select `f` in
def t = super.f
hg clone http://hg.openjdk.java.net/jdk9/jdk9
cd jdk9
sh ./get_source.sh
brew install freetype
bash ./configure --enable-debug --with-freetype=/usr/local/Cellar/freetype/2.7 --with-boot-jdk=/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
CONF=macosx-x86_64-normal-server-fastdebug make clean all
@lrytz
lrytz / output.txt
Created November 28, 2016 14:01
Yopt-log-inline
➜ sandbox git:(sd259) ✗ qsc -opt:l:classpath -Yopt-log-inline _ `find ../src/library -name '*.scala'` -d o
Inline into scala/App.$anonfun$main$1$adapted: inlined scala/App.$anonfun$main$1. Before: 9 ins, inlined: 7 ins.
Inline into scala/App.main: inlined scala/collection/mutable/ListBuffer.foreach. Before: 50 ins, inlined: 8 ins.
inlined scala/collection/generic/TraversableForwarder.foreach$. Before: 64 ins, inlined: 8 ins.
inlined scala/collection/generic/TraversableForwarder.foreach. Before: 73 ins, inlined: 9 ins.
Inline into scala/App.main: inlined scala/compat/Platform$.currentTime. Before: 83 ins, inlined: 6 ins.
Inline into scala/Array.fill: inlined scala/Array$.fill. Before: 6 ins, inlined: 50 ins.
Inline into scala/Array.fill: inlined scala/Array$.fill. Before: 10 ins, inlined: 88 ins.
Inline into scala/Array.fill: inlined scala/Array$.fill. Before: 7 ins, inlined: 79 ins.
Inline into scala/Array.fill: inlined scala/Array$.fill. Before: 8 ins, inlined: 82 ins.
case class C(x: Int)
case class D(i: Int*,
)
object Test extends App {
C(1) match {
case C(x @ 1,
) => println(x)
case _ => println(0)
}
@lrytz
lrytz / Test.scala
Last active February 14, 2017 11:31
class C {
def fin(): Unit = ()
def m(x: Int) = ()
def inspect: Unit = {
try {
m(if (this == null) return else 1) // jump to finally block, `this` on stack
return // jump to finally block, empty stack
} finally {
fin()
}
➜ sandbox git:(lazyBTypes) ✗ diff before after
4674,4702d4673
< scala.collection.TraversableOnce
< scala.collection.TraversableOnce.ForceImplicitAmbiguity
< scala.collection.TraversableOnce.A
< scala.collection.TraversableOnce.trav
< scala.collection.TraversableOnce.A
< scala.collection.TraversableOnce.CC
< scala.collection.TraversableOnce._
< scala.collection.TraversableOnce.ev
<?xml version="1.0" encoding="UTF-8"?><triggers>
<notification_rules>
<notification_rule>
<rule_name>Exit Phase</rule_name>
<rule_path>Scala Compiler</rule_path>
<description/>
<trigger>
<trigger_limit_period>0</trigger_limit_period>
<trigger_sustain_time>0</trigger_sustain_time>
<trigger_on_what>1</trigger_on_what>
> hot -p source=scalap
[info] Updating {file:/home/scala/compiler-benchmark/}infrastructure...
[info] Resolving org.sonatype.oss#oss-parent;7 ...
[info] downloading https://repo1.maven.org/maven2/org/influxdb/influxdb-java/2.5/influxdb-java-2.5.jar ...
[info] [SUCCESSFUL ] org.influxdb#influxdb-java;2.5!influxdb-java.jar (21ms)
[info] downloading https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit/4.6.0.201612231935-r/org.eclipse.jgit-4.6.0.201612231935-r.jar ...
[info] [SUCCESSFUL ] org.eclipse.jgit#org.eclipse.jgit;4.6.0.201612231935-r!org.eclipse.jgit.jar (243ms)
[info] downloading https://repo1.maven.org/maven2/com/google/guava/guava/21.0/guava-21.0.jar ...
[info] [SUCCESSFUL ] com.google.guava#guava;21.0!guava.jar(bundle) (251ms)
[info] downloading https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar ...
scala@scalabench:~$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=64ababa6-cf06-401f-a05b-749630ec8fca ro quiet
scala@scalabench:~/compiler-benchmark$ sbt
[info] Loading project definition from /home/scala/compiler-benchmark/project
[info] Set current project to compiler-benchmark (in build file:/home/scala/compiler-benchmark/)
> hot -p source=scalap -wi 20 -i 10 -f 1
[info] Running org.openjdk.jmh.Main HotScalacBenchmark -p source=scalap -wi 20 -i 10 -f 1
[info] # JMH 1.14.1 (released 237 days ago, please consider updating!)
[info] # VM version: JDK 1.8.0_131, VM 25.131-b11
scala@scalabench:~$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=64ababa6-cf06-401f-a05b-749630ec8fca ro quiet
scala@scalabench:~/compiler-benchmark$ taskset -c 1-3 sbt
[info] Loading project definition from /home/scala/compiler-benchmark/project
[info] Set current project to compiler-benchmark (in build file:/home/scala/compiler-benchmark/)
> hot -p source=scalap -wi 20 -i 10 -f 1
[info] Running org.openjdk.jmh.Main HotScalacBenchmark -p source=scalap -wi 20 -i 10 -f 1
[info] # JMH 1.14.1 (released 237 days ago, please consider updating!)
[info] # VM version: JDK 1.8.0_131, VM 25.131-b11