Obsolete repository. Moved to oracle/graal.

Overview

Obsolete Repository

This repository is obsolete.

Sulong is now integrated in the Graal repository.

Please open new issues or pull requests directly in the Graal repository. Existing issues and pull requests can stay on this repository. We will migrate them as necessary before merging.

Sulong Logo

Comments
  • sulong not exiting from va_start call

    sulong not exiting from va_start call

    I've traced sulong execution to va_start where it is not exiting for a particular invocation. Some calls do work correctly. Here is the case that is not working:

    test_func(int op, ...) {
      va_list ap;
      va_start(ap, op);
    }
    
    struct Forward *data = ...;
    static void fp(void *arg1, int arg2, const char *arg3) {..}
    
    test_func(100, fp, data);
    
    opened by dotnwat 13
  • Error when following README.md Getting Started

    Error when following README.md Getting Started

    I get the following error when I follow the readme "Getting Started" section. Do I need to install this dependency locally?

    Do you have a recommended way to install this dependency on Mac OSX?

    Thank you.

    Exception in thread "main" java.lang.AssertionError: java.io.IOException: java.lang.UnsatisfiedLinkError: libgfortran.so.3
        at com.oracle.truffle.llvm.LLVM.evaluateFromSource(LLVM.java:144)
        at com.oracle.truffle.llvm.LLVM.executeMain(LLVM.java:123)
        at com.oracle.truffle.llvm.LLVM.main(LLVM.java:99)
    Caused by: java.io.IOException: java.lang.UnsatisfiedLinkError: libgfortran.so.3
        at com.oracle.truffle.api.TruffleLanguage$AccessAPI.eval(TruffleLanguage.java:588)
        at com.oracle.truffle.api.impl.Accessor.eval(Accessor.java:163)
        at com.oracle.truffle.api.vm.PolyglotEngine$SPIAccessor.eval(PolyglotEngine.java:1177)
        at com.oracle.truffle.api.vm.PolyglotEngine.evalImpl(PolyglotEngine.java:541)
        at com.oracle.truffle.api.vm.PolyglotEngine.access$300(PolyglotEngine.java:106)
        at com.oracle.truffle.api.vm.PolyglotEngine$2.compute(PolyglotEngine.java:525)
        at com.oracle.truffle.api.vm.ComputeInExecutor.run(ComputeInExecutor.java:93)
        at com.oracle.truffle.api.vm.ComputeInExecutor.perform(ComputeInExecutor.java:83)
        at com.oracle.truffle.api.vm.PolyglotEngine.eval(PolyglotEngine.java:528)
        at com.oracle.truffle.api.vm.PolyglotEngine.eval(PolyglotEngine.java:464)
        at com.oracle.truffle.llvm.LLVM.evaluateFromSource(LLVM.java:141)
        ... 2 more
    Caused by: java.lang.UnsatisfiedLinkError: libgfortran.so.3
        at com.oracle.graal.truffle.hotspot.nfi.HotSpotNativeFunctionInterface.getLibraryHandle(HotSpotNativeFunctionInterface.java:71)
        at com.oracle.graal.truffle.hotspot.nfi.HotSpotNativeFunctionInterface.getLibraryHandle(HotSpotNativeFunctionInterface.java:39)
        at com.oracle.truffle.llvm.nativeint.NativeLookup.getNativeFunctionHandles(NativeLookup.java:93)
        at com.oracle.truffle.llvm.nativeint.NativeLookup.getLibraryHandles(NativeLookup.java:82)
        at com.oracle.truffle.llvm.nativeint.NativeLookup.uncachedGetNativeFunctionHandle(NativeLookup.java:171)
        at com.oracle.truffle.llvm.nativeint.NativeLookup.getNativeHandle(NativeLookup.java:151)
        at com.oracle.truffle.llvm.nodes.impl.base.LLVMContext.getNativeHandle(LLVMContext.java:74)
        at com.oracle.truffle.llvm.nodes.impl.func.LLVMCallNode$LLVMUnresolvedCallNode.executeGeneric(LLVMCallNode.java:122)
        at com.oracle.truffle.llvm.nodes.impl.func.LLVMCallUnboxNodeFactory$LLVMI32CallUnboxNodeGen.executeI32(LLVMCallUnboxNodeFactory.java:188)
        at com.oracle.truffle.llvm.nodes.impl.vars.LLVMWriteNodeFactory$LLVMWriteI32NodeGen.executeVoid(LLVMWriteNodeFactory.java:189)
        at com.oracle.truffle.llvm.nodes.impl.others.LLVMBlockNode$LLVMBlockNoControlFlowNode.executeVoid(LLVMBlockNode.java:105)
        at com.oracle.truffle.llvm.nodes.impl.func.LLVMFunctionBodyNode.executeGeneric(LLVMFunctionBodyNode.java:49)
        at com.oracle.truffle.llvm.nodes.impl.func.LLVMFunctionStartNode.execute(LLVMFunctionStartNode.java:63)
        at com.oracle.graal.truffle.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:443)
        at com.oracle.graal.truffle.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:317)
        at com.oracle.graal.truffle.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:303)
        at com.oracle.graal.truffle.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:291)
        at com.oracle.graal.truffle.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:206)
        at com.oracle.graal.truffle.OptimizedDirectCallNode.callProxy(OptimizedDirectCallNode.java:69)
        at com.oracle.graal.truffle.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:60)
        at com.oracle.truffle.llvm.nodes.impl.func.LLVMGlobalRootNode.executeProgram(LLVMGlobalRootNode.java:104)
        at com.oracle.truffle.llvm.nodes.impl.func.LLVMGlobalRootNode.execute(LLVMGlobalRootNode.java:84)
        at com.oracle.graal.truffle.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:443)
        at com.oracle.graal.truffle.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:317)
        at com.oracle.graal.truffle.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:303)
        at com.oracle.graal.truffle.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:291)
        at com.oracle.graal.truffle.OptimizedCallTarget.call(OptimizedCallTarget.java:199)
        at com.oracle.truffle.llvm.nodes.impl.base.LLVMMainFunctionReturnValueRootNode$LLVMMainFunctionReturnNumberRootNode.execute(LLVMMainFunctionReturnValueRootNode.java:81)
        at com.oracle.graal.truffle.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:443)
        at com.oracle.graal.truffle.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:317)
        at com.oracle.graal.truffle.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:303)
        at com.oracle.graal.truffle.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:291)
        at com.oracle.graal.truffle.OptimizedCallTarget.call(OptimizedCallTarget.java:199)
        at com.oracle.truffle.api.TruffleLanguage$AccessAPI.eval(TruffleLanguage.java:584)
        ... 12 more
    
    opened by bjfish 11
  • Test against JRuby

    Test against JRuby

    I'm not sure if it's your job to test against JRuby or JRuby's job to test against Sulong, but building Sulong is more complex, so I'll reuse that by doing it in this repository.

    This checks that JRuby can use this version of Sulong to build and run C extensions.

    oracle-emp tests interop 
    opened by chrisseaton 10
  • Are AVX instructions supported?

    Are AVX instructions supported?

    I might not have understood the code but I don't see any vector instructions in AsmFactory. Is this the right place to look for supported instructions?

    opened by richardstartin 9
  • Use the MessageResolution DSL for LLVMFunctionDescriptor

    Use the MessageResolution DSL for LLVMFunctionDescriptor

    • This allows EXECUTE messages to compile.
    • Still slightly hacky in LLVMFunctionDescriptor, one possible fix would be to move LLVMFunctionDescriptor behind a facade entirely.
    • Interop EXECUTE is still slow due to native to Java String and byte-by-byte comparisons (Could we detect if it's a literal by seeing it's in read-only memory or so and then just compare pointers adresses?).
    oca-signed interop 
    opened by eregon 8
  • longjmp/setjmp Not Supported

    longjmp/setjmp Not Supported

    We cannot directly call the native implementations of longjmp/setjmp since they implement non-local jumps which manipulate the stack. We will have to implement them through Java intrinsifications.

    I refrained from implementing them since they would probably make the interpreter more complicated. However, since longjmp/setjmp can be used to implement exceptions, we still have to support them in the long term.

    c 
    opened by mrigger 8
  • Cannot return types other than i32 from main

    Cannot return types other than i32 from main

    The following snippet:

    short main() {
        return 0 ;
    }
    

    compiles correctly (while outputing a warning because of the return type) to the following ir:

    define signext i16 @main() {
      ret i16 0
    }
    

    There seems to be a regression in sulong since a few days, because this snippet is no longer able to be executed:

    C stack trace:
    	 LLVM IR Function @_start in libsulong.bc in Block {id: 4 name: implicit21}
    
    	at com.oracle.truffle.llvm.nodes.base.LLVMBasicBlockNode.executeStatements(LLVMBasicBlockNode.java:114)
    	at com.oracle.truffle.llvm.nodes.control.LLVMDispatchBasicBlockNode.executeGeneric(LLVMDispatchBasicBlockNode.java:75)
    	at com.oracle.truffle.llvm.nodes.func.LLVMFunctionStartNode.execute(LLVMFunctionStartNode.java:74)
    	at com.oracle.truffle.api.impl.DefaultCallTarget.callDirectOrIndirect(DefaultCallTarget.java:64)
    	at com.oracle.truffle.api.impl.DefaultDirectCallNode.call(DefaultDirectCallNode.java:43)
    	at com.oracle.truffle.llvm.nodes.func.LLVMGlobalRootNode.executeIteration(LLVMGlobalRootNode.java:131)
    	at com.oracle.truffle.llvm.nodes.func.LLVMGlobalRootNode.execute(LLVMGlobalRootNode.java:94)
    	at com.oracle.truffle.api.impl.DefaultCallTarget.callDirectOrIndirect(DefaultCallTarget.java:64)
    	at com.oracle.truffle.api.impl.DefaultDirectCallNode.call(DefaultDirectCallNode.java:43)
    	at com.oracle.truffle.llvm.nodes.base.LLVMMainFunctionReturnValueRootNode$LLVMMainFunctionReturnNumberRootNode.execute(LLVMMainFunctionReturnValueRootNode.java:84)
    	at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:81)
    	at com.oracle.truffle.api.vm.PolyglotContextImpl.eval(PolyglotContextImpl.java:645)
    	at org.graalvm.polyglot.Context.eval(Context.java:148)
    	at com.oracle.truffle.llvm.Sulong.executeMain(Sulong.java:142)
    	at com.oracle.truffle.llvm.Sulong.main(Sulong.java:134)
    Caused by: java.lang.ClassCastException: java.lang.Short cannot be cast to java.lang.Integer
    	at com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode.executeI32(LLVMExpressionNode.java:108)
    	at com.oracle.truffle.llvm.nodes.others.LLVMValueProfilingNodeFactory$LLVMI32ProfiledValueNodeGen.executeI32(LLVMValueProfilingNodeFactory.java:504)
    	at com.oracle.truffle.llvm.nodes.vars.LLVMWriteNodeFactory$LLVMWriteI32NodeGen.executeGeneric(LLVMWriteNodeFactory.java:495)
    	at com.oracle.truffle.llvm.nodes.base.LLVMBasicBlockNode.executeStatements(LLVMBasicBlockNode.java:99)
    	... 14 more
    Caused by: com.oracle.truffle.api.TruffleStackTrace
    
    opened by pointhi 7
  • Support atexit taking function descriptors as well as function handles.

    Support atexit taking function descriptors as well as function handles.

    Correct the atexit return type and add some documentation.

    Note, I have signed and sent off the OCA today. I will hopefully appear on the list in a day or two. I figured I could as well get code review started early.

    oca-signed 
    opened by mikehearn 7
  • Escaping Function Pointers from Sulong to Native Code

    Escaping Function Pointers from Sulong to Native Code

    It can happen that programs pass Sulong function pointers to a native function. Since a Sulong function pointer is not a function that can be called by the native side, we currently throw an error and exit the program.

    Passing a Sulong function pointer to the native side is not uncommon, since the C standard library has functions that expect function pointers that are usually implemented by the user, e.g., the qsort function.

    opened by mrigger 7
  • How to pass native arrays of primitive types into other polyglot languages

    How to pass native arrays of primitive types into other polyglot languages

    In the reference documentation for llvm on the polyglot engine, you have a macro and methods demonstrated to pass native arrays of structs into other languages:

    POLYGLOT_DECLARE_STRUCT(Point)
    void *allocNativePointArray(int length) {
        struct Point *ret = calloc(length, sizeof(*ret));
        return polyglot_from_Point_array(ret, length);
    }
    

    However, when I look at polyglot.h, there doesn't appear to be any similar methods for the primitive types. How would one do the same as above, but for a double* instead?

    opened by markehammons 6
  • Fix cross-module managed global variables

    Fix cross-module managed global variables

    At the moment each IR file creates a new LLVMGlobalVariableStorage for each global variable it knows about. This breaks the system for storing managed objects in global variables, as the storage and specialisation information for that lives in LLVMGlobalVariableStorage. We need to share LLVMGlobalVariableStorage objects globally.

    bug oracle-emp c 
    opened by chrisseaton 6
  • Polyglot docs missing some detail

    Polyglot docs missing some detail

    1. It's not clear to me if the "convert polyglot value to a struct" trick can handle function pointers inside the struct to emulate OO method calls. The header file says accessing members is equivalent to get/put member, so perhaps not, but it seems an obvious feature to have? Then you can map objects to structs (or perhaps even to C++ classes which would be neat)

    2. The docs go into a lot more detail than the website does and it's annoying to figure out how to get to polyglot.h from the tiny example on graalvm.org - it'd be great to have more thorough examples on the website.

    opened by mikehearn 4
  • Build failing on arm64

    Build failing on arm64

    I'm trying to compile GraalVM with sulong using mx --dynamicimports /sulong build

    Build fails with:

    In file included from /home/tic/graal/sulong/tests/com.oracle.truffle.llvm.tests.sulong/c/intrinsics/movemask.c:30: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size

    After ignoring the tests files I get a bunch of

    error: invalid output constraint '=a' in asm

    opened by thiagogcm 2
  • Add On-Stack Replacement for Sulong.

    Add On-Stack Replacement for Sulong.

    This PR adds On-Stack Replacement (OSR) for Sulong.

    Based on the block based structure of LLVM IR bitcodes, loops are detected and for each loop a new node is created, which conforms to Truffle interface for loop nodes and replaces the basic block which was identified as the header of the loop.

    Thus, Graal can replace loops during (interpreted) execution with optimized (compiled) versions, yielding a faster warmup. However, due to additional nodes, peak performance can be negatively affected.

    Parameters (with default values) for playing around with OSR:

    • -Dgraal.TruffleOSR=true ... toggle OSR
    • -Dgraal.TruffleOSRCompilationThreshold=100000 ... threshold for loop iterations after which a loop is OSR compiled
    oca-signed 
    opened by rmosaner 0
  • Add implementation of @llvm.x86.avx2.psrli.d and @llvm.x86.avx2.pslli…

    Add implementation of @llvm.x86.avx2.psrli.d and @llvm.x86.avx2.pslli…

    FIX: #847

    Test seems to export different code as expected. Probably -march=native is required for avx2 testcase built

    I was only able to create avx2 instructions. @mrigger on the other hand had sse2 instructions with the same name. If possible he should try to run the testcases as well to check if the sse2 implementation does not differ. (I was not able to test it for now)

    oca-signed 
    opened by pointhi 0
  • Dragonegg, SSE and GCC builtins

    Dragonegg, SSE and GCC builtins

    I have some Dragonegg-derived C code that used extensive GCC features and has some SSE instructions. Is there generally any way around the following without re-writing?

    Caused by: org.graalvm.polyglot.PolyglotException: com.oracle.truffle.llvm.runtime.SulongRuntimeException: IllegalStateException Missing GCC builtin: @__builtin_ia32_ldmxcsr

    opened by jdenheen 1
Owner
GraalVM
Universal VM for a polyglot world. Our mission: Make development more productive and run programs faster anywhere.
GraalVM
Removal of JndiLookup in now obsolete Minecraft versions, or versions that still have log4j < 2.10 and is unable to use

NukeJndiLookupFromLog4j Removal of JndiLookup in now obsolete Minecraft versions, or versions that still have log4j < 2.10 and is unable to use -Dlog4

THONK Monarchy 11 Dec 15, 2022
Fork of tagtraum industries' GCViewer. Tagtraum stopped development in 2008, I aim to improve support for Sun's / Oracle's java 1.6+ garbage collector logs (including G1 collector)

GCViewer 1.36 GCViewer is a little tool that visualizes verbose GC output generated by Sun / Oracle, IBM, HP and BEA Java Virtual Machines. It is free

null 4.1k Jan 4, 2023
Fork of tagtraum industries' GCViewer. Tagtraum stopped development in 2008, I aim to improve support for Sun's / Oracle's java 1.6+ garbage collector logs (including G1 collector)

GCViewer 1.36 GCViewer is a little tool that visualizes verbose GC output generated by Sun / Oracle, IBM, HP and BEA Java Virtual Machines. It is free

null 4.1k Jan 4, 2023
R2DBC Driver for Oracle Database

About Oracle R2DBC The Oracle R2DBC Driver is a Java library that supports reactive programming with Oracle Database. Oracle R2DBC implements the R2DB

Oracle 159 Dec 13, 2022
又名大狼狗代码生成器,基于SpringBoot2+Freemarker的JAVA代码生成器,以释放双手为目的,支持mysql/oracle/pgsql三大数据库, 用DDL-SQL语句生成JPA/JdbcTemplate/Mybatis/MybatisPlus/BeetlSQL等相关代码.

又名大狼狗代码生成器,基于SpringBoot2+Freemarker的JAVA代码生成器,以释放双手为目的,支持mysql/oracle/pgsql三大数据库, 用DDL-SQL语句生成JPA/JdbcTemplate/Mybatis/MybatisPlus/BeetlSQL等相关代码.

Moshow郑锴 1.4k Jan 7, 2023
Short Java programs for practice (OCP) Oracle Certified Professional Java SE 11

OCP-study Short Java programs to practice for (OCP) Oracle Certified Professional Java SE 11 Exam Google document with notes: https://docs.google.com/

Sabina Matjašič 1 May 24, 2022
Spring REST API for financial management, developed with Java 11, JWT for authentication, JUnit for unit testing and Oracle Database

control_financial Spring REST API for financial management, developed with Java 11, JWT for authentication, JUnit for unit testing and Oracle Database

Vinicius Cassaro 1 May 27, 2022
GitHub Action to download and install Oracle's Java Development Kit builds

oracle-actions/setup-java This action downloads a Java Development Kit (JDK) built by Oracle and installs it using actions/setup-java. JDKs built by O

Oracle GitHub Actions 43 Dec 15, 2022
Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2

Visit the official web site for more information. Central Dogma Central Dogma is an open-source, highly-available and version-controlled service confi

LINE 503 Dec 20, 2022
Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)

Trino is a fast distributed SQL query engine for big data analytics. See the User Manual for deployment instructions and end user documentation. Devel

Trino 6.9k Dec 31, 2022
*old repository* --> this is now integrated in https://github.com/javaparser/javaparser

JavaSymbolSolver has been integrated in JavaParser: development will continue there! We will work on current issues opened here, but all new issues sh

JavaParser 288 Nov 25, 2022
JitPack is a novel package repository for JVM and Android projects.

JitPack is a novel package repository for JVM and Android projects. It builds Git projects on demand and provides you with ready-to-use artifacts (jar, aar).

JitPack 2.3k Dec 27, 2022
Sonatype Nexus Repository Open Source Codebase

Builds use Apache Maven and require Java 8. Apache Maven wrapper scripts are included in the source tree.

Sonatype 1.3k Jan 5, 2023
Master repository for the JGraphT project

JGraphT Released: June 14, 2020 Written by Barak Naveh and Contributors (C) Copyright 2003-2020, by Barak Naveh and Contributors. All rights reserved.

JGraphT 2.3k Dec 30, 2022
JGit project repository (jgit)

Java Git An implementation of the Git version control system in pure Java. This project is licensed under the EDL (Eclipse Distribution License). JGit

Eclipse Foundation 1k Jul 5, 2021
Official GeoTools repository

GeoTools is an open source Java library that provides tools for geospatial data. Our Users guide provides an overview of the core features, supported

GeoTools 1.4k Dec 30, 2022
Iris repository

iris analyzes the meaning of text and provides insights into how Cortical.io Retina technology can be applied to text-data comparison and information

cortical-io 25 Apr 24, 2021
This repository contains all java related sources of the Dolphin Platform.

Dolphin Platform This repository contains all Java related sources of the Dolphin Platform. Clients for other languages can be found in seperate repos

IMTF 74 Sep 5, 2022