Comments (2)
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.
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)
- The notation for Java classes cannot specify inner-classes.
- The "-cp" and "-classpath" should be passed by ocamlbuild when compiling an interface
- ocamljava error during linking on Windows; ocaml, ocamlc, & ocamlrun all work HOT 5
- Error when installing ocamlfind with ocamljava HOT 4
- ocamljava for 32-bit windows HOT 4
- ocamljava has exit code 0 even on an error HOT 1
- ocamllex always fails on java.nio.channels.ClosedChannelException HOT 1
- ocamljava fatal error "exception Not_found" HOT 3
- Some *.cmj files from camlp4 are not installed.
- Some *.cmj files from ocamldoc are not installed
- Where are the sources to the runtime? HOT 2
- OCaml 4.02.X support HOT 19
- Installation instruction for windows
- Support for Facebook's Reason source format HOT 3
- ocamlfind won't build with ocamljava HOT 3
- Can't build from source HOT 4
- Failing to link a module/dependency in an OCaml script HOT 3
- Failing to add C stubs with ocamljava HOT 2
- Inheritance of Java classes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocamljava.