Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 28, 2011
  1. Tell llvm that the vtables don't change

    This should cause LLVM to optimize away multiple loads of
    the same slot in a given vtable.
  2. Fix calls of externalEquals

    LLVMPlatform no longer extends JavaPlatform but the LOAD_MODULE
    instruction for BoxesRunTimeClass was guarded by a pattern match
    for JavaPlatform. Simply move the emission outside of the pattern
Commits on Jul 26, 2011
  1. Fix printing of class names in llvmrt

    The name length was being used as the field width, not the precision
  2. Provide Math.sqrt in runtime.scala

    Needed for nbody shootout program
Commits on Jul 25, 2011
  1. Don't provide ScalaObject in llvmrt

    It can and should be compiled from the library source.
  2. Lazify {Min,Max}Long in Big{Int,Decimal}

    If they are evaluated eagerly a real implementation of
    j.l.Big{Int,Decimal} is needed just to load Predef.
  3. Fix casting between interface types

    A search of the instance's class info is required for all casts
    to interface types. It should be possible to eliminate it in some
    cases by being clever. For example, group the methods in an
    interface vtable by the super-interfaces and let the resulting
    vtable point to the middle of the sub-interface vtable.
  4. Provide a boxed unit

    Right now this is done in llvmrt/object.c. At some point it
    should be done in a scala source file.
  5. Fix instanceof tests for arrays

Commits on Jul 23, 2011
  1. @league

    Revert "Move moduleSuffix method from GenJVM into Symbols."

    league authored
    This reverts commit 2622c36.
    I ended up NOT needing to use moduleSuffix in GenLLVM, so reverting
    this to the way it was upstream may simplify future merges.
  2. @league
  3. Uniformly omit parens on Number xxxValue calls

    With the LLVM backend these classes are written in scala so the presence of the parens is not flexible. I chose to omit the parens since the methods are not side-affecting.
  4. Exclude non-reachable predecessors from phi node

    Phi nodes for incoming value values were not excluding non-reachable blocks. This caused undefined values problems in the LLVM IR.
  5. Disable ""+x => String.valueOf(x) for LLVM

    With the String object defined in scala this generates
    the wrong call convention. Revisit sometime to load the
    object and use a static-instance call.
  6. Cache virtual method lists and implementations

    These were hotspots for the GenLLVM phase. Caching gives a quite good speedup.
  7. @league

    Attempt to separately compile runtime.scala (somewhat broken).

    league authored
    One fix was needed on finding the right symbol to output for
    java.lang.System; that part now works. However, we have to arrange for
    the System.sym to be loaded before the System.class in rt.jar; for new
    we set sun.boot.class.path in the Makefile.
    With these fixes, runtime.scala is separately compiled, however
    running it produces the wrong output.
    runscala bin/separate2.bc separate2 # works
    runscala bin/separate3.bc separate2 # compiles but output wrong!
Commits on Jul 22, 2011
  1. @league

    Separate compilation of classes and objects.

    league authored
    From docs/examples/llvm, try: make bin/separate2.bc
    It will run the compiler twice, for each source file.
    Unclear for now whether it works to compile the runtime.scala, ffi
    sources, etc. in advance.
  2. @league
  3. @league

    Dump classname$.sym for module classes (objects).

    league authored
    This represents a somewhat more sophisticated understanding of
    symbols we are asked to compile in GenLLVM. I dump symbol information
    to different files depending on whether it's a class or a module class
    (object). Reading back in the classes works okay, although I'm still
    not able to read back objects correctly.
Commits on Jul 21, 2011
  1. @league

    Move moduleSuffix method from GenJVM into Symbols.

    league authored
    This method, previously defined in GenJVM, produces either "$" or ""
    depending on certain conditions of the Symbol argument. The same logic
    is needed in GenMSIL (and GenLLVM), so it was being copy/pasted.
    Even for JVM backend, in Erasure, we needed to access it as
    global.genJVM.moduleSuffix. Seems more reasonable to make it a method
    of Symbol.
    Ideally, this is a change which could be accepted upstream.
  2. Rename vtable typedef to vtable_t

    Having members and typedefs with the same name seems to cause problems
    sometimes for g++. It's also less confusing for people reading the code.
  3. Merge changes from Chris League

  4. Make mallocBytes take a CSizeT

  5. Fix externalEquals forLLVM

    Because BoxesRuntime for LLVM is implemented in scala there is no true
    static and since JavaPlatform externalEquals method is named equals it
    resolved to an OverloadedSymbol between the external equals and object
    equals. Could have kept using equals and filter to get the right symbol
    but it was much simpler to just change the name. We also need to fix up
    the call type and load the BoxesRunTimeClass module.
  6. Use a portable ABI for fat references

    Passing and returning structures in LLVM is bad for portability. As much
    as possible we want the IR to be target independent so we pass fat
    references as two separate arguments and return fat references by
    returning the object pointer and storing the result vtable in a pointer
    argument passed for that purpose.
Commits on Jul 20, 2011
  1. @league

    Separate compilation, in an embryonic stage.

    league authored
    Very broken with respect to companion objects (modules) but I can
    compile the class `a.scala` first, and then `b.scala` (without
    specifying `a`) and it will pick up `a` from `irfiles/a.sym`.
    cd docs/examples/llvm
    ../../../build/quick/bin/scalac -no-specialization -cp irfiles \
      -d irfiles -target:llvm a.scala runtime.scala @ffi.sources
    ../../../build/quick/bin/scalac -no-specialization -cp irfiles \
      -d irfiles -target:llvm b.scala runtime.scala @ffi.sources
  2. @league

    The ClassFile traversal can now find .sym files too.

    league authored
    However, for now it still tries (and fails) to read them as .class
  3. @league

    Detach LLVMPlatform from JavaPlatform.

    league authored
    First step in enhancing classPath/rootLoader for separate compilation
    with LLVM. Also removed exploratory printfs from GenJVM.
Commits on Jul 19, 2011
  1. @league

    Generalize PathResolver to with a factory method for ClassPath instance.

    league authored
    PathResolver hard-coded `new JavaClassPath`. For LLVM, I'd like to
    substitute a subclass instead. This patch turns PathResolver into an
    abstract class, and references to it are replaced by JavaPathResolver.
    It would be helpful if this change could be adopted upstream. It is
    just a generalization, and contains no LLVM-specific functionality. I
    tested that the resulting compiler can compile itself.
  2. @league

    Arrange exported signature pickles into file hierarchy just like .class

    league authored
    This should make loading them easier (more Java-like).
Commits on Jul 18, 2011
Commits on Jul 17, 2011
  1. @league

    Toward separate compilation, dump symbol pickle in .sym files.

    league authored
    Pickles of inner classes are not kept around, and are noted as MISSING
    when encountered. Unclear whether they will cause problems with
    GenJVM also lightly instrumented to print out which pickles it
Something went wrong with that request. Please try again.