Gaming Console with Lollipop? Ouya Gets an Android TV Port

Android is a very flexible platform, and it can be used on a large variety of … more

Android App Review: Manage Your Connections Automagically – XDA TV

Material Design is all the buzz in the Android world right now. … more

Official TWRP Recovery Lands on Micromax Canvas Magnus

With the recent release of Android One, Micromax and MediaTek released fully buildable … more

Update Overload: SuperSU Heavily Updated

There are apps and apps out there. Very few can reach the level of popularity required to stay at … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[EXPERIMENTAL] Dalvik with JIT enabled for CyanogenMod 5.0.5.x

OP Ivan Dimkovic

26th March 2010, 07:12 PM   |  #1  
OP Senior Member
Thanks Meter: 0
 
170 posts
Join Date:Joined: Oct 2006
More
Just rebuilt CM from the source, with JIT enabled (and fixed the code to compile)

* With "plain" CyanogenMod 5.0.x ROM it appears to be at least partly functional (people reporting Linpack jump from 7 to 17 Mflops) but I expect instabilities so JIT is definitely still far from the "prime time"

* It appears that HTC Desire ROM and JIT do not mix well. You will get reboots as soon as you try to unlock via. slider. I am trying to figure out what is causing this

For people that want to experiment - I am providing the precompiled Dalvik libraries with JIT enabled. DO NOT TRY THIS IF YOU ARE INEXPERIENCED!!! I assume no liabilities for any problems. Please read the readme first!

Code:
JIT Support for Nexus One CyanogenMod 5.0.x / Kernel 2.6.33.1  (Eclair) 

By Ivan Dimkovic (psyq321)
--------------------------

NOTE:  JIT is totally unsupported and known to be NOT stable!!!  There is no guarantee your system will boot at all!!!  ALWAYS BACK UP YOUR SYSTEM WITH NANDROID FIRST!!!   This package is provided for TESTING PURPOSES ONLY.  Author assumes NO LIABILITY WHATSOEVER if you brick your phone!!!

1. What is this?

This package contains several Android system files that enable JIT ("Just in Time") feature in the Dalvik VM.  JIT is very unstable and it is not built-in the AOSP or Cyanogen's ROMs.  This package contains system files built with JIT feature ON and it could be useful for testing for people that do not wish to recompile the entire ROM

extra_tuning directory contains Dalvik JIT library compiled with WITH_JIT_TUNING option. This option presumably enables even more optimizations for the JIT, but it appears to be totally unstable (I get endless reboot cycle)

2. How to make JIT enabled?

Follow these steps:

   - BACK UP YOUR SYSTEM WITH NANDROID (IMPORTANT!!!)
   - Connect your phone to the PC

   - Copy the Dalvik files to the system directories:

     adb remount
     adb push libdvm.so /system/lib/libdvm.so
     adb push libnativehelper.so /system/lib/libnativehelper.so
     adb push dalvikvm /system/bin/dalvikvm

   - Go to the shell (e.g. via adb shell, or via ssh) and change the permissions:

     chmod 755 /system/bin/dalvikvm
     chmod 644 /system/lib/libdvm.so
     chmod 644 /system/lib/libnativehelper.so

   - Add this line at the end of your system's build.prop

     dalvik.vm.execution-mode=int:jit

   - Reboot into RECOVERY and wipe Dalvik cache!
   
   - Reboot

    
3. It does not work?  My system keeps rebooting / My system crashes randomly?

Unfortunately, this can happen and this is known issue with JIT.  This is the reason why it is not enabled.  You are free to look in the AOSP code and try to fix it by yourself, but I suggest to wait until original developers make it stable

Enjoy!
Attached Files
File Type: zip cm5.0.5_jit_test.zip - [Click for QR Code] (769.5 KB, 450 views)
Last edited by Ivan Dimkovic; 28th March 2010 at 03:39 AM.
26th March 2010, 07:15 PM   |  #2  
Gimpeh's Avatar
Senior Member
Flag Springfield
Thanks Meter: 5
 
1,222 posts
Join Date:Joined: Feb 2009
More
Try JIT with a none sense rom like Cyanogen.
26th March 2010, 07:35 PM   |  #3  
Senior Member
Thanks Meter: 9
 
1,075 posts
Join Date:Joined: Jun 2007
More
Quote:
Originally Posted by Gimpeh

Try JIT with a none sense rom like Cyanogen.

Bah! What nonsense..... sorry.
26th March 2010, 07:40 PM   |  #4  
Gimpeh's Avatar
Senior Member
Flag Springfield
Thanks Meter: 5
 
1,222 posts
Join Date:Joined: Feb 2009
More
Quote:
Originally Posted by MarcusMaximus04@gmail.com

Bah! What nonsense..... sorry.

Don't be so senseless!
26th March 2010, 08:00 PM   |  #5  
neva dinova's Avatar
Senior Member
Flag austin
Thanks Meter: 0
 
347 posts
Join Date:Joined: Mar 2007
More
it seems people were running it on the g1 for at least a little while what do you think is the difference
26th March 2010, 08:15 PM   |  #6  
OP Senior Member
Thanks Meter: 0
 
170 posts
Join Date:Joined: Oct 2006
More
I am not really sure, maybe HTC Sense components are much more intensive and force the JIT bugs to appear earlier.

Just tried everything (replaced libdvb.so, libnativehelper.so and dalvikvm - and cleaned up the dalvik cache) - and it is a no-go

If JIT is ON, SIM card is not accessed at all, I just get the lock screen, which triggers the system reboot if I slide it.

This is all on the HTC Desire a19 ROM... I guess JIT is a bit more stable on a stock ROM.
26th March 2010, 08:19 PM   |  #7  
melterx12's Avatar
Senior Member
Flag New York City
Thanks Meter: 15
 
716 posts
Join Date:Joined: Dec 2009
Donate to Me
More
Quote:
Originally Posted by Gimpeh

Don't be so senseless!

that makes no sense whatsoever.
26th March 2010, 08:29 PM   |  #8  
Senior Member
Thanks Meter: 32
 
419 posts
Join Date:Joined: Oct 2008
I thought the last time JIT was in CyanogenMod was in cm-5.0 beta 3. I'm pretty sure it wont work on any ROM except that. I would use it but the multi-touch included in it is still the hacked together version.

I miss JIT ;/
26th March 2010, 08:34 PM   |  #9  
OP Senior Member
Thanks Meter: 0
 
170 posts
Join Date:Joined: Oct 2006
More
JIT is just not compiled-in by default in CyanogenMod but it is definitely in the code.

You can still enable it manually, but you need to rebuild the ROM from the source.

If you wish to try it - put this line in the buildspec.mk:

Code:
WITH_JIT:=true
Then rebuild everything - and the Dalvik VM will have JIT features inside. Then you need to enable JIT in the build.prop (or by adb manually on runtime)
27th March 2010, 03:48 AM   |  #10  
OP Senior Member
Thanks Meter: 0
 
170 posts
Join Date:Joined: Oct 2006
More
Doh...

Just fetched the latest source from Cyanogen's github...

Looks like CM+JIT compilation is broken now There are some asserts in the code (Jit.c, line 48 for example) that are referencing missing structure members (looks like they reorganized structure layouts and moved JIT-specific stuff to another one) so the JIT-enabled code won't compile.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes