Skip to content

Instantly share code, notes, and snippets.

View lrytz's full-sized avatar
🦉

Lukas Rytz lrytz

🦉
View GitHub Profile
@lrytz
lrytz / asm
Last active October 16, 2015 08:15
asm shell script
#!/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
[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
@lrytz
lrytz / A.java
Last active November 6, 2015 13:52
➜ 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$;
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 November 24, 2015 09:41
Backend Todos

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)

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
#!/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.
##############################################################################
// 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
@lrytz
lrytz / C.java
Last active February 2, 2016 09:21
/*
* 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;
$ 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