Skip to content

Instantly share code, notes, and snippets.

Avatar
🦉

Lukas Rytz lrytz

🦉
View GitHub Profile
@lrytz
lrytz / asm
Last active Oct 16, 2015
asm shell script
View asm
#!/bin/sh
files="$@"
asm_jar=~/Applications/bin/asm-5.0.2/lib/all/asm-all-5.0.2.jar
asm_main=org.objectweb.asm.util.Textifier
debug=""
for f in $files; do
View gist:9c6b18297981594d828a
[scala-js] [info] java.util.Collections.sort
[scala-js] [error] x should implement sort[T<:Comparable[T]](List[T]) and behave correctly with java.util.ArrayList
[scala-js] org.scalajs.jasminetest.JasmineTestException: scala.scalajs.runtime.UndefinedBehaviorError: An undefined behavior was detected: 0 is not an instance of java.lang.Integer
[scala-js] at <jscode>.(file:/home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.1/project-builds/scala-js-3530eb213d2adadac19d6295ca29104fece2aa2d/library/src/main/scala/scala/scalajs/runtime/StackTrace.scala:39)
[scala-js] at <jscode>.(file:/home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.1/project-builds/scala-js-3530eb213d2adadac19d6295ca29104fece2aa2d/library/src/main/scala/scala/scalajs/runtime/StackTrace.scala:33)
[scala-js] at <jscode>.(file:/home/jenkins/workspace/scala-2.12.x-integrate-community-build/target-0.9.1/project-builds/scala-js-3530eb213d2adadac19d6295ca29104fece2aa2d/javalanglib/src/main/scala/java/lang
View A.java
sandbox git:(removeIcode) cat Test.scala
class C {
def f(l: List[String]) = l foreach println
}
sandbox git:(removeIcode) ~/scala/scala3/build/pack/bin/scalac -Yopt:l:classpath Test.scala
sandbox git:(removeIcode) cfr-decompiler C.class
public class C {
private static /* synthetic */ Map $deserializeLambdaCache$;
View box-elim.md
class C {
  @inline final def m8[T, U, V](f: (T, U) => V, x: T, y: U) = f(x, y)
  def t8 = {
    val fun = (x: Int, y: Double) => 1l + x + y.toLong
    m8(fun, 1, 2d)
  }
}
@lrytz
lrytz / file.md
Last active Nov 24, 2015
Backend Todos
View file.md

Boxing Elimination

  • Eliminate box-unbox operations, including *Ref boxes #11

Take Heuristics to the next level

  • Details in #53.
  • Also make sure to consider code size #2
  • Adapt the inliner heuristics to favor inlining that enables boxing elimination

Hoisting for eliminating unnecessary captures (outer references)

View gist:b34a4b585c84e05c4993
2016-01-08 11:41:34,404 [http-bio-127.0.0.1-8282-exec-118] [INFO ] (o.a.e.UploadServiceImpl:442) - Deploy to 'scala-pr-validation-snapshots:;build.timestamp=1452253289092/org/scala-lang/scala-library-all/2.11.8-34c7768-SNAPSHOT/scala-library-all-2.11.8-34c7768-SNAPSHOT.pom' Content-Length: 3086
2016-01-08 11:41:34,412 [http-bio-127.0.0.1-8282-exec-118] [ERROR] (o.a.r.d.DbStoringRepoMixin:263) - IO error while trying to save resource scala-pr-validation-snapshots:;build/timestamp=1452253289092/org/scala-lang/scala-library-all/2.11.8-34c7768-SNAPSHOT/scala-library-all-2.11.8-34c7768-20160108.114134-1.pom'': org.artifactory.api.repo.exception.maven.BadPomException: The target deployment path ';build/timestamp=1452253289092/org/scala-lang/scala-library-all/2.11.8-34c7768-SNAPSHOT/scala-library-all-2.11.8-34c7768-20160108.114134-1.pom' does not match the POM's expected path prefix 'org/scala-lang/scala-library-all/2.11.8-34c7768-SNAPSHOT'. Please verify your POM content for correctness and make sure the source pat
View gist:d28f793b3338b948e352
#!/usr/bin/env bash
#
##############################################################################
# Copyright 2002-2013 LAMP/EPFL
#
# This is free software; see the distribution for copying conditions.
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
##############################################################################
View gist:e910be65d0bc95c1d5ca
// class version 52.0 (52)
// access flags 0x421
public abstract class scala/tools/nsc/typechecker/EtaExpansion$class {
// compiled from: EtaExpansion.scala
ATTRIBUTE Scala : unknown
ATTRIBUTE ScalaInlineInfo : unknown
// access flags 0x19
View C.java
/*
* Decompiled with CFR 0_110.
*
* Could not load the following classes:
* C
*/
public class C {
public int compare(boolean x, boolean y) {
int n = false == x && true == y ? -1 : (true == x && false == y ? 1 : 0);
return n;
View gist:1c05e0fa666b130e2d38
$ java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
$ scalac11 -version
Scala compiler version 2.11.7 -- Copyright 2002-2013, LAMP/EPFL
$ cat Test.scala
object ATest extends App {
def getX[T <: X](constr: ⇒ T = null.asInstanceOf[T]): Unit = {
constr