summaryrefslogtreecommitdiffstats
path: root/runtime/native_bridge.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-07-25 02:32:19 -0700
committerAndreas Gampe <agampe@google.com>2014-07-26 18:35:08 -0700
commit855564b83db7b106d2995d0e784f1f4b62e52371 (patch)
treede3caa3f36b24acb9279a8cb85d4879baeed1798 /runtime/native_bridge.h
parent3bcac48f23094fa0f46315a080ec47fc368fd4c2 (diff)
downloadart-855564b83db7b106d2995d0e784f1f4b62e52371.zip
art-855564b83db7b106d2995d0e784f1f4b62e52371.tar.gz
art-855564b83db7b106d2995d0e784f1f4b62e52371.tar.bz2
ART: Native bridge command-line parameter
Add a command-line parameter for the native bridge library, slight refactor/cleanup. Add run-test 115 to test the native bridge interface. Currently the tests are black-listed for the target, as the setup for the test is too complicated in the current infrastructure. Change-Id: I6ccf19485e8c30b96e9f2fd5425278cb1ebd403f
Diffstat (limited to 'runtime/native_bridge.h')
-rw-r--r--runtime/native_bridge.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/runtime/native_bridge.h b/runtime/native_bridge.h
index dd895d2..3d20fe4 100644
--- a/runtime/native_bridge.h
+++ b/runtime/native_bridge.h
@@ -19,23 +19,38 @@
#include "base/mutex.h"
+#include <string>
+
namespace art {
struct NativeBridgeCallbacks;
class NativeBridge {
public:
+ // Initialize the native bridge, if any. Should be called by Runtime::Init(). An empty string
+ // signals that we do not want to load a native bridge.
+ static void SetNativeBridgeLibraryString(std::string& native_bridge_library_string);
+
// Load a shared library that is supported by the native-bridge.
static void* LoadLibrary(const char* libpath, int flag);
// Get a native-bridge trampoline for specified native method.
static void* GetTrampoline(void* handle, const char* name, const char* shorty, uint32_t len);
// True if native library is valid and is for an ABI that is supported by native-bridge.
- static bool IsSupported(const char* libpath);
+ static bool IsSupported(const char* libpath);
private:
- static bool Init();
- static bool initialized_ GUARDED_BY(lock_);
+ static bool Initialize();
+
+ // The library name we are supposed to load.
+ static std::string native_bridge_library_string_;
+
+ // Whether we have already initialized (or tried to).
+ static bool initialized_ GUARDED_BY(lock_);
static Mutex lock_;
+
+ // Whether a native bridge is available (loaded and ready).
+ static bool available_;
+
static NativeBridgeCallbacks* callbacks_;
};