Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of newer Java methods fail on Android #2982

Open
donv opened this issue May 25, 2015 · 4 comments
Open

Use of newer Java methods fail on Android #2982

donv opened this issue May 25, 2015 · 4 comments

Comments

@donv
Copy link
Member

donv commented May 25, 2015

Hi!

I have made a branch for not loading the IR compiler when setting compile mode OFF (or truffle).

https://github.com/jruby/jruby/tree/test-optional_compiler

It seems to do the job, but when running JRuby 9000 master on Android (Ruboto), I get an error in Kernel#puts:

https://gist.github.com/donv/9896b7c3890d34726efa

The source for the failing line is here:

https://github.com/android/platform_frameworks_base/blob/master/core/java/com/android/internal/os/LoggingPrintStream.java#L64

I have not found exactly how it fails, but my guess is that LoggingPrintStream implements all known methods for PrintStream for Java 6, but JRuby 9K uses a method for Java 7 or later that then falls through to OutputStream#write which throws an AssertionError.

My guess it is

org.jruby.util.io.PosixShim.write(PosixShim.java:92)

I guess JRuby can be made to have different behaviour under Android...

Any help with this is appreciated.

@chrisseaton
Copy link
Contributor

I have made a branch for not loading the IR compiler when setting compile mode OFF (or truffle).

Your mean the IR JIT, right? The bit that compiles AST to IR is still needed as there's no way to execute an AST any more is there? Are the IR optimisations part of the IR compiler? You might want those anyway.

@donv
Copy link
Member Author

donv commented May 25, 2015

The change on the branch is minimal. I am still exploring the code to find where the boundaries are. Pretty fuzzy boundaries so far :) Without solving this issue, I won't get any error messages :(

@donv
Copy link
Member Author

donv commented May 25, 2015

The following line triggered the error:

https://github.com/ruboto/ruboto/blob/master/assets/src/org/ruboto/JRubyAdapter.java#L310

Changing the puts to java.lang.System.println lets JRuby be initialised and continue.

It then fails on this:

https://gist.github.com/donv/1836c1a4707c508038dc

So I guess I removed too much. The "Compiler" is needed, but the JitCompiler should be removed, but the Compiler loads MethodHandle...

@nirvdrum
Copy link
Contributor

nirvdrum commented Jul 7, 2015

@donv FYI, the link you supplied was to ruboto master and the JRubyAdapter.java file changed since then. Line 310 is currently a blank line. You may want to update the link to a known revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants