ART: More header cleanup - jni_internal.h
Move jni_macros.h to the clients (users of RegisterNativeMethods).
Test: mmma art
Change-Id: I052ac9f703ec69f0a2df1efcaf9f4a450eb7be1c
diff --git a/runtime/jni_internal.h b/runtime/jni_internal.h
index 580a42b..24bee6f 100644
--- a/runtime/jni_internal.h
+++ b/runtime/jni_internal.h
@@ -19,7 +19,6 @@
#include <jni.h>
#include <iosfwd>
-#include "nativehelper/jni_macros.h"
#include "base/macros.h"
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index e618323..870402d 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -19,6 +19,7 @@
#include <sstream>
#include "android-base/stringprintf.h"
+#include "nativehelper/jni_macros.h"
#include "base/logging.h"
#include "base/stl_util.h"
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 5c4e242..bb8233b 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -21,6 +21,8 @@
#include <sstream>
+#include "nativehelper/jni_macros.h"
+
#include "base/histogram-inl.h"
#include "base/time_utils.h"
#include "class_linker.h"
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index ff4d931..18b871c 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -30,6 +30,7 @@
#pragma GCC diagnostic pop
#include "android-base/stringprintf.h"
+#include "nativehelper/jni_macros.h"
#include "art_method-inl.h"
#include "arch/instruction_set.h"
diff --git a/runtime/native/dalvik_system_VMStack.cc b/runtime/native/dalvik_system_VMStack.cc
index 0dfafa4..6c41d51 100644
--- a/runtime/native/dalvik_system_VMStack.cc
+++ b/runtime/native/dalvik_system_VMStack.cc
@@ -16,6 +16,8 @@
#include "dalvik_system_VMStack.h"
+#include "nativehelper/jni_macros.h"
+
#include "art_method-inl.h"
#include "gc/task_processor.h"
#include "jni_internal.h"
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index 0515ec6..4c6f530 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include "android-base/stringprintf.h"
+#include "nativehelper/jni_macros.h"
#include "arch/instruction_set.h"
#include "art_method-inl.h"
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 4f99947..9e07a5c 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -18,6 +18,8 @@
#include <iostream>
+#include "nativehelper/jni_macros.h"
+
#include "art_field-inl.h"
#include "art_method-inl.h"
#include "base/enums.h"
diff --git a/runtime/native/java_lang_Object.cc b/runtime/native/java_lang_Object.cc
index fb4f99a..c9841d1 100644
--- a/runtime/native/java_lang_Object.cc
+++ b/runtime/native/java_lang_Object.cc
@@ -16,6 +16,8 @@
#include "java_lang_Object.h"
+#include "nativehelper/jni_macros.h"
+
#include "jni_internal.h"
#include "mirror/object-inl.h"
#include "scoped_fast_native_object_access-inl.h"
diff --git a/runtime/native/java_lang_String.cc b/runtime/native/java_lang_String.cc
index bf33bf2..4928c01 100644
--- a/runtime/native/java_lang_String.cc
+++ b/runtime/native/java_lang_String.cc
@@ -16,6 +16,8 @@
#include "java_lang_String.h"
+#include "nativehelper/jni_macros.h"
+
#include "common_throws.h"
#include "jni_internal.h"
#include "mirror/array.h"
diff --git a/runtime/native/java_lang_StringFactory.cc b/runtime/native/java_lang_StringFactory.cc
index ec3c7c2..c1292ef 100644
--- a/runtime/native/java_lang_StringFactory.cc
+++ b/runtime/native/java_lang_StringFactory.cc
@@ -16,6 +16,8 @@
#include "java_lang_StringFactory.h"
+#include "nativehelper/jni_macros.h"
+
#include "common_throws.h"
#include "jni_internal.h"
#include "mirror/object-inl.h"
diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc
index 2cabce8..264b427 100644
--- a/runtime/native/java_lang_System.cc
+++ b/runtime/native/java_lang_System.cc
@@ -16,6 +16,8 @@
#include "java_lang_System.h"
+#include "nativehelper/jni_macros.h"
+
#include "common_throws.h"
#include "gc/accounting/card_table-inl.h"
#include "jni_internal.h"
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc
index 346bd30..f3254c4 100644
--- a/runtime/native/java_lang_Thread.cc
+++ b/runtime/native/java_lang_Thread.cc
@@ -16,6 +16,8 @@
#include "java_lang_Thread.h"
+#include "nativehelper/jni_macros.h"
+
#include "common_throws.h"
#include "jni_internal.h"
#include "monitor.h"
diff --git a/runtime/native/java_lang_Throwable.cc b/runtime/native/java_lang_Throwable.cc
index 654b8a8..b69fbef 100644
--- a/runtime/native/java_lang_Throwable.cc
+++ b/runtime/native/java_lang_Throwable.cc
@@ -16,6 +16,8 @@
#include "java_lang_Throwable.h"
+#include "nativehelper/jni_macros.h"
+
#include "jni_internal.h"
#include "scoped_fast_native_object_access-inl.h"
#include "thread.h"
diff --git a/runtime/native/java_lang_VMClassLoader.cc b/runtime/native/java_lang_VMClassLoader.cc
index 32cc98e..55955e7 100644
--- a/runtime/native/java_lang_VMClassLoader.cc
+++ b/runtime/native/java_lang_VMClassLoader.cc
@@ -16,6 +16,8 @@
#include "java_lang_VMClassLoader.h"
+#include "nativehelper/jni_macros.h"
+
#include "class_linker.h"
#include "jni_internal.h"
#include "mirror/class_loader.h"
diff --git a/runtime/native/java_lang_Void.cc b/runtime/native/java_lang_Void.cc
index e2b4b82..b0d63ef 100644
--- a/runtime/native/java_lang_Void.cc
+++ b/runtime/native/java_lang_Void.cc
@@ -16,6 +16,8 @@
#include "java_lang_Void.h"
+#include "nativehelper/jni_macros.h"
+
#include "class_linker-inl.h"
#include "jni_internal.h"
#include "runtime.h"
diff --git a/runtime/native/java_lang_invoke_MethodHandleImpl.cc b/runtime/native/java_lang_invoke_MethodHandleImpl.cc
index 9113841..63168ce 100644
--- a/runtime/native/java_lang_invoke_MethodHandleImpl.cc
+++ b/runtime/native/java_lang_invoke_MethodHandleImpl.cc
@@ -16,6 +16,8 @@
#include "java_lang_invoke_MethodHandleImpl.h"
+#include "nativehelper/jni_macros.h"
+
#include "art_method.h"
#include "handle_scope-inl.h"
#include "jni_internal.h"
diff --git a/runtime/native/java_lang_ref_FinalizerReference.cc b/runtime/native/java_lang_ref_FinalizerReference.cc
index afedc5e..c75837a 100644
--- a/runtime/native/java_lang_ref_FinalizerReference.cc
+++ b/runtime/native/java_lang_ref_FinalizerReference.cc
@@ -16,6 +16,8 @@
#include "java_lang_ref_FinalizerReference.h"
+#include "nativehelper/jni_macros.h"
+
#include "gc/heap.h"
#include "gc/reference_processor.h"
#include "jni_internal.h"
diff --git a/runtime/native/java_lang_ref_Reference.cc b/runtime/native/java_lang_ref_Reference.cc
index b1cb2f2..606e656 100644
--- a/runtime/native/java_lang_ref_Reference.cc
+++ b/runtime/native/java_lang_ref_Reference.cc
@@ -16,6 +16,8 @@
#include "java_lang_ref_Reference.h"
+#include "nativehelper/jni_macros.h"
+
#include "gc/heap.h"
#include "gc/reference_processor.h"
#include "jni_internal.h"
diff --git a/runtime/native/java_lang_reflect_Array.cc b/runtime/native/java_lang_reflect_Array.cc
index 54c2109..9662395 100644
--- a/runtime/native/java_lang_reflect_Array.cc
+++ b/runtime/native/java_lang_reflect_Array.cc
@@ -16,6 +16,8 @@
#include "java_lang_reflect_Array.h"
+#include "nativehelper/jni_macros.h"
+
#include "class_linker-inl.h"
#include "common_throws.h"
#include "dex_file-inl.h"
diff --git a/runtime/native/java_lang_reflect_Constructor.cc b/runtime/native/java_lang_reflect_Constructor.cc
index fb78046..d1953ad 100644
--- a/runtime/native/java_lang_reflect_Constructor.cc
+++ b/runtime/native/java_lang_reflect_Constructor.cc
@@ -16,6 +16,8 @@
#include "java_lang_reflect_Constructor.h"
+#include "nativehelper/jni_macros.h"
+
#include "art_method-inl.h"
#include "base/enums.h"
#include "class_linker.h"
diff --git a/runtime/native/java_lang_reflect_Executable.cc b/runtime/native/java_lang_reflect_Executable.cc
index 8f226ce..256a3d0 100644
--- a/runtime/native/java_lang_reflect_Executable.cc
+++ b/runtime/native/java_lang_reflect_Executable.cc
@@ -17,6 +17,7 @@
#include "java_lang_reflect_Executable.h"
#include "android-base/stringprintf.h"
+#include "nativehelper/jni_macros.h"
#include "art_method-inl.h"
#include "dex_file_annotations.h"
diff --git a/runtime/native/java_lang_reflect_Field.cc b/runtime/native/java_lang_reflect_Field.cc
index 0fb3903..e38bcd6 100644
--- a/runtime/native/java_lang_reflect_Field.cc
+++ b/runtime/native/java_lang_reflect_Field.cc
@@ -17,6 +17,7 @@
#include "java_lang_reflect_Field.h"
#include "android-base/stringprintf.h"
+#include "nativehelper/jni_macros.h"
#include "art_field-inl.h"
#include "class_linker.h"
diff --git a/runtime/native/java_lang_reflect_Method.cc b/runtime/native/java_lang_reflect_Method.cc
index 6f0130e..c9e8dba 100644
--- a/runtime/native/java_lang_reflect_Method.cc
+++ b/runtime/native/java_lang_reflect_Method.cc
@@ -16,6 +16,8 @@
#include "java_lang_reflect_Method.h"
+#include "nativehelper/jni_macros.h"
+
#include "art_method-inl.h"
#include "base/enums.h"
#include "class_linker.h"
diff --git a/runtime/native/java_lang_reflect_Parameter.cc b/runtime/native/java_lang_reflect_Parameter.cc
index 37aa16c..92a7ac9 100644
--- a/runtime/native/java_lang_reflect_Parameter.cc
+++ b/runtime/native/java_lang_reflect_Parameter.cc
@@ -17,6 +17,7 @@
#include "java_lang_reflect_Parameter.h"
#include "android-base/stringprintf.h"
+#include "nativehelper/jni_macros.h"
#include "art_method-inl.h"
#include "common_throws.h"
diff --git a/runtime/native/java_lang_reflect_Proxy.cc b/runtime/native/java_lang_reflect_Proxy.cc
index 0279b5f..518aaa7 100644
--- a/runtime/native/java_lang_reflect_Proxy.cc
+++ b/runtime/native/java_lang_reflect_Proxy.cc
@@ -16,6 +16,8 @@
#include "java_lang_reflect_Proxy.h"
+#include "nativehelper/jni_macros.h"
+
#include "class_linker.h"
#include "jni_internal.h"
#include "mirror/class_loader.h"
diff --git a/runtime/native/java_util_concurrent_atomic_AtomicLong.cc b/runtime/native/java_util_concurrent_atomic_AtomicLong.cc
index 4d2ea67..101f386 100644
--- a/runtime/native/java_util_concurrent_atomic_AtomicLong.cc
+++ b/runtime/native/java_util_concurrent_atomic_AtomicLong.cc
@@ -16,6 +16,8 @@
#include "java_util_concurrent_atomic_AtomicLong.h"
+#include "nativehelper/jni_macros.h"
+
#include "arch/instruction_set.h"
#include "atomic.h"
#include "jni_internal.h"
diff --git a/runtime/native/libcore_util_CharsetUtils.cc b/runtime/native/libcore_util_CharsetUtils.cc
index 4138ccc..c388ea1 100644
--- a/runtime/native/libcore_util_CharsetUtils.cc
+++ b/runtime/native/libcore_util_CharsetUtils.cc
@@ -14,15 +14,19 @@
* limitations under the License.
*/
+#include "libcore_util_CharsetUtils.h"
+
+#include <string.h>
+
+#include "nativehelper/jni_macros.h"
+
#include "jni_internal.h"
#include "mirror/string.h"
#include "mirror/string-inl.h"
-#include "native/libcore_util_CharsetUtils.h"
#include "scoped_fast_native_object_access-inl.h"
#include "ScopedPrimitiveArray.h"
#include "unicode/utf16.h"
-#include <string.h>
namespace art {
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
index 5809708..a860977 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc
@@ -16,6 +16,8 @@
#include "org_apache_harmony_dalvik_ddmc_DdmServer.h"
+#include "nativehelper/jni_macros.h"
+
#include "base/logging.h"
#include "debugger.h"
#include "jni_internal.h"
diff --git a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
index 69ef59e..ac504cc 100644
--- a/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
+++ b/runtime/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
@@ -16,6 +16,8 @@
#include "org_apache_harmony_dalvik_ddmc_DdmVmInternal.h"
+#include "nativehelper/jni_macros.h"
+
#include "base/logging.h"
#include "base/mutex.h"
#include "debugger.h"
diff --git a/runtime/native/sun_misc_Unsafe.cc b/runtime/native/sun_misc_Unsafe.cc
index cc5a41a..b42cedf 100644
--- a/runtime/native/sun_misc_Unsafe.cc
+++ b/runtime/native/sun_misc_Unsafe.cc
@@ -15,6 +15,14 @@
*/
#include "sun_misc_Unsafe.h"
+
+#include <atomic>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "nativehelper/jni_macros.h"
+
#include "common_throws.h"
#include "gc/accounting/card_table-inl.h"
#include "jni_internal.h"
@@ -23,10 +31,6 @@
#include "mirror/object-inl.h"
#include "scoped_fast_native_object_access-inl.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <atomic>
namespace art {