Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,729,690 Members 46,813 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
Ivan Dimkovic
Old
(Last edited by Ivan Dimkovic; 28th March 2010 at 02:39 AM.)
#1  
Senior Member - OP
Thanks Meter 0
Posts: 170
Join Date: Oct 2006
Default [EXPERIMENTAL] Dalvik with JIT enabled for CyanogenMod 5.0.5.x

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)
 
Gimpeh
Old
#2  
Gimpeh's Avatar
Senior Member
Thanks Meter 4
Posts: 1,218
Join Date: Feb 2009
Location: Springfield
Try JIT with a none sense rom like Cyanogen.
"To err is human... to really foul up requires the root password."
 
MarcusMaximus04@gmail.com
Old
#3  
Senior Member
Thanks Meter 9
Posts: 1,075
Join Date: Jun 2007
Quote:
Originally Posted by Gimpeh View Post
Try JIT with a none sense rom like Cyanogen.
Bah! What nonsense..... sorry.
Device: Nexus 4/Nexus 7/Nexus 10
 
Gimpeh
Old
#4  
Gimpeh's Avatar
Senior Member
Thanks Meter 4
Posts: 1,218
Join Date: Feb 2009
Location: Springfield
Quote:
Originally Posted by MarcusMaximus04@gmail.com View Post
Bah! What nonsense..... sorry.
Don't be so senseless!
"To err is human... to really foul up requires the root password."
 
neva dinova
Old
#5  
neva dinova's Avatar
Senior Member
Thanks Meter 0
Posts: 347
Join Date: Mar 2007
Location: austin
it seems people were running it on the g1 for at least a little while what do you think is the difference
 
Ivan Dimkovic
Old
#6  
Senior Member - OP
Thanks Meter 0
Posts: 170
Join Date: Oct 2006
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.
 
melterx12
Old
#7  
melterx12's Avatar
Senior Member
Thanks Meter 15
Posts: 716
Join Date: Dec 2009
Location: New York City

 
DONATE TO ME
Quote:
Originally Posted by Gimpeh View Post
Don't be so senseless!
that makes no sense whatsoever.
 
spyz88
Old
#8  
Senior Member
Thanks Meter 32
Posts: 419
Join Date: 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 ;/
 
Ivan Dimkovic
Old
#9  
Senior Member - OP
Thanks Meter 0
Posts: 170
Join Date: Oct 2006
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)
 
Ivan Dimkovic
Old
#10  
Senior Member - OP
Thanks Meter 0
Posts: 170
Join Date: Oct 2006
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Make Your Own DIY Capacitive Stylus

The XDA Portal is a place where we like to talkabout things that are interesting, fun, and sometimes … more

Remove Unnecessary WhatsApp Elements with Xposed

In modern life, you can’t underestimate the power ofthe dark sidemessaging … more