Giter VIP home page Giter VIP logo

Comments (6)

0-x-2-2 avatar 0-x-2-2 commented on July 17, 2024

https://twitter.com/dbg_nsk/status/1061467605221982209

The usage of Reference#reachabilityFence can be abstracted and replaced with Objects#requireNonNull or a no-op function. Hotspots JIT will still function the same but it was not defined in the spec till Java 9+ with an addition of the function in the stdlib.

public static void reachabilityFence(Object ref) {
        // Does nothing. This method is annotated with @ForceInline to eliminate
        // most of the overhead that using @DontInline would cause with the
        // HotSpot JVM, when this fence is used in a wide variety of situations.
        // HotSpot JVM retains the ref and does not GC it before a call to
        // this method, because the JIT-compilers do not have GC-only safepoints.
    }

Creating an equivalent function such as defined in Java 9+ will have the same functionality on hotspot for Java 8 but using Objects#requireNonNull may work on other JVMs such as IBM JVM if they don't function the same but that is very unlikely.

from skija.

0-x-2-2 avatar 0-x-2-2 commented on July 17, 2024

This does seem to be enough to get the shared java sources to compile with about 10 minutes of work. Multi-release jar files may also be useful but regular abstraction will work perfectly fine and maybe is the better solution to the problem.

from skija.

tonsky avatar tonsky commented on July 17, 2024

Would be great if you could check with all the other JVMs before going in

from skija.

0-x-2-2 avatar 0-x-2-2 commented on July 17, 2024

There are only two major desktop JVMs that follow spec closely but the JVM that is the most used is Hotspot. The only real way to test this is by testing the example projects before and after but it may be possible that Skija in its current form may not even work with the IBM JVM or have horrible performance such as the case with LWJGL but that may have changed.

from skija.

tonsky avatar tonsky commented on July 17, 2024

The test case that forced us to add reachabilityFence is described here JetBrains/compose-multiplatform#124

from skija.

Glavo avatar Glavo commented on July 17, 2024

Java 8 support is available in 0.109.0, I think we can close this issue.

from skija.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.