OSDN Git Service

Merge commit '1b6dd57975aefbb28d66f0e58ecdf4abe56648b4' into manual_merge_1b6dd57975
authorDimitry Ivanov <dimitry@google.com>
Fri, 11 Dec 2015 22:05:08 +0000 (14:05 -0800)
committerDimitry Ivanov <dimitry@google.com>
Fri, 11 Dec 2015 22:05:08 +0000 (14:05 -0800)
1  2 
runtime/Android.mk
runtime/runtime.cc
runtime/well_known_classes.cc

Simple merge
@@@ -1215,25 -1216,15 +1215,25 @@@ void Runtime::InitNativeMethods() 
    // Then set up the native methods provided by the runtime itself.
    RegisterRuntimeNativeMethods(env);
  
 -  // Then set up libcore, which is just a regular JNI library with a regular JNI_OnLoad.
 -  // Most JNI libraries can just use System.loadLibrary, but libcore can't because it's
 -  // the library that implements System.loadLibrary!
 +  // Initialize classes used in JNI. The initialization requires runtime native
 +  // methods to be loaded first.
 +  WellKnownClasses::Init(env);
 +
 +  // Then set up libjavacore / libopenjdk, which are just a regular JNI libraries with
 +  // a regular JNI_OnLoad. Most JNI libraries can just use System.loadLibrary, but
 +  // libcore can't because it's the library that implements System.loadLibrary!
    {
-     std::string reason;
-     if (!java_vm_->LoadNativeLibrary(env, "libjavacore.so", nullptr, &reason)) {
-       LOG(FATAL) << "LoadNativeLibrary failed for \"libjavacore.so\": " << reason;
+     std::string error_msg;
+     if (!java_vm_->LoadNativeLibrary(env, "libjavacore.so", nullptr, nullptr, nullptr, &error_msg)) {
+       LOG(FATAL) << "LoadNativeLibrary failed for \"libjavacore.so\": " << error_msg;
      }
    }
 +  {
 +    std::string reason;
 +    if (!java_vm_->LoadNativeLibrary(env, "libopenjdk.so", nullptr, &reason)) {
 +      LOG(FATAL) << "LoadNativeLibrary failed for \"libopenjdk.so\": " << reason;
 +    }
 +  }
  
    // Initialize well known classes that may invoke runtime native methods.
    WellKnownClasses::LateInit(env);
Simple merge