Git Product home page Git Product logo

Comments (2)

xclerc avatar xclerc commented on July 16, 2024

Well, section 4.9.1 of the same document mentions the following constraint:

The value of the code_length item must be less than 65536

It still stands for Java 1.8, but the restriction is then mentioned in section 4.7.3:

http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3

However, the fact that some methods from the standard library have a greater
length is interesting. I am wondering whether loading classes from the boot
class path may allow to overcome the constraint - pure speculation though.

A temporary workaround may be to compile the file(s) with -inline 0, thus
avoiding any kind of inlining. However, there is little hope to go from 94429
to 65535 by just banning inlining.

In the longer term, the code generator of ocamljava (or the underlying Barista
library) may provide a way to split into several methods. It is of course not
obvious, has one has to pass live variables back an forth between the original
method and auxiliary one(s).

from ocamljava.

xavierleroy avatar xavierleroy commented on July 16, 2024

When I wrote "you'll find static class initialization methods greater than 64k in code", that was my experience a while ago when I was working on class file transformers. The typical example was some of the Unicode classes that had big tables character code -> flags. This may no longer be true. Indeed, looking at the sources of OpenJDK, the check method code size < 64K is hardwired in the class loader and has no exception, save turning off bytecode verification altogether.

Concerning inlining, I doubt it will help given that the OCaml function in question calls no other function. (It's just a table encoded as a pattern-matching.)

So, the problem remains, but it blocks the use of ocamljava as a "second-source" alternative to ocamlopt for building CompCert.

from ocamljava.

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.