| 55 | } |
| 56 | |
| 57 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { |
| 58 | try { |
| 59 | Runtime::Init(vm, reserved); |
| 60 | |
| 61 | JNIEnv* env = nullptr; |
| 62 | if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) == JNI_OK && env != nullptr) { |
| 63 | RegisterOptimizedNatives(env); |
| 64 | } |
| 65 | } catch (NativeScriptException& e) { |
| 66 | e.ReThrowToJava(); |
| 67 | } catch (std::exception e) { |
| 68 | stringstream ss; |
| 69 | ss << "Error: c++ exception: " << e.what() << endl; |
| 70 | NativeScriptException nsEx(ss.str()); |
| 71 | nsEx.ReThrowToJava(); |
| 72 | } catch (...) { |
| 73 | NativeScriptException nsEx(std::string("Error: c++ exception!")); |
| 74 | nsEx.ReThrowToJava(); |
| 75 | } |
| 76 | |
| 77 | return JNI_VERSION_1_6; |
| 78 | } |
| 79 | |
| 80 | static void setManualInstrumentationModeFast_impl(JNIEnv* env, jclass clazz, jstring mode) { |
| 81 | try { |
nothing calls this directly
no test coverage detected