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

How to check if it's runing v8-jit ? #68

Open
Rohan-ult opened this issue Mar 25, 2021 · 1 comment
Open

How to check if it's runing v8-jit ? #68

Rohan-ult opened this issue Mar 25, 2021 · 1 comment

Comments

@Rohan-ult
Copy link

Rohan-ult commented Mar 25, 2021

I used v8-android-jit-nointl But, How can I check that "My app running on JIT version of v8?"

console.log(global._v8runtime().version);  // 8.8.278.15

My android\build.gradle

allprojects {
    repositories {
        mavenLocal()
        maven {
            // Replace AAR from original RN with AAR from react-native-v8
            url("$rootDir/../node_modules/react-native-v8/dist")
        }
        maven {
            // prebuilt libv8android.so
            url("$rootDir/../node_modules/v8-android-jit-nointl/dist")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
          // ...
          // ...
    }
}

Also is it safe to remove ?

-  maven {
-      // Android JSC is installed from npm
-      url("$rootDir/../node_modules/jsc-android/dist")
-  }

Thanks from your hard work ❤

@Kudo
Copy link
Owner

Kudo commented Mar 26, 2021

Unfortunately, V8 seems not have this in public API and there are no ways to get the runtime information (e.g. JIT mode) through a programmatically way.

You could, however, to check the MD5 of libv8android.so.

md5sum /path/to/RNProject/android/app/build/intermediates/merged_native_libs/debug/out/lib/arm64-v8a/libv8android.so

mkdir temp && cd temp
unzip /path/to/RNProject/node_modules/v8-android-jit-nointl/dist/org/chromium/v8-android/9.88.0/v8-android-9.88.0.aar
md5sum jni/arm64-v8a/libv8android.so

And check if the MD5 is matched or not.

For jsc-android, if you want to remove this, please also remove the implementation jscFlavor in /path/to/RNProject/android/app/build.gradle.
Otherwise, gradle cannot find the jsc-android accordingly.

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

No branches or pull requests

2 participants