Support for synchronized native methods.

This change adds support for synchronized native methods by using
calls to MonitorEnter and MonitorExit on the JNIEnv*. There is
some tidying of the assembler and a straw man JNIEnv implementation.
The JNIEnv implementation just warns when MonitorEnter/Exit are called
and doesn't adhere to the correct JNIEnv layout.

Change-Id: I90ed6ec8f85f5b01b929f16e0dbdecadd0b01359
diff --git a/src/jni_internal.h b/src/jni_internal.h
new file mode 100644
index 0000000..64941cc
--- /dev/null
+++ b/src/jni_internal.h
@@ -0,0 +1,32 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+
+#ifndef ART_SRC_JNI_INTERNAL_H_
+#define ART_SRC_JNI_INTERNAL_H_
+
+#include "jni.h"
+#include "src/assembler.h"
+#include "src/macros.h"
+
+namespace art {
+
+// TODO: This is a place holder for a true JNIEnv used to provide limited
+// functionality for the JNI compiler
+class JniEnvironment {
+ public:
+  explicit JniEnvironment();
+
+  static Offset MonitorEnterOffset() {
+    return Offset(OFFSETOF_MEMBER(JniEnvironment, monitor_enter_));
+  }
+
+  static Offset MonitorExitOffset() {
+    return Offset(OFFSETOF_MEMBER(JniEnvironment, monitor_exit_));
+  }
+
+ private:
+  void (*monitor_enter_)(JniEnvironment*, jobject);
+  void (*monitor_exit_)(JniEnvironment*, jobject);
+};
+
+}  // namespace art
+#endif  // ART_SRC_JNI_INTERNAL_H_