Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | #ifndef ART_SRC_JNI_INTERNAL_H_ |
| 4 | #define ART_SRC_JNI_INTERNAL_H_ |
| 5 | |
| 6 | #include "jni.h" |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 7 | |
| 8 | #include "assembler.h" |
| 9 | #include "macros.h" |
Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 10 | |
| 11 | namespace art { |
| 12 | |
Elliott Hughes | f2682d5 | 2011-08-15 16:37:04 -0700 | [diff] [blame^] | 13 | class Runtime; |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 14 | class Thread; |
Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 15 | |
Elliott Hughes | f2682d5 | 2011-08-15 16:37:04 -0700 | [diff] [blame^] | 16 | JavaVM* CreateJavaVM(Runtime* runtime); |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 17 | JNIEnv* CreateJNIEnv(); |
Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 18 | |
Elliott Hughes | f2682d5 | 2011-08-15 16:37:04 -0700 | [diff] [blame^] | 19 | struct JavaVMExt { |
| 20 | // Must be first to correspond with JNIEnv. |
| 21 | const struct JNIInvokeInterface* fns; |
| 22 | |
| 23 | Runtime* runtime; |
| 24 | }; |
| 25 | |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 26 | struct JNIEnvExt { |
Elliott Hughes | f2682d5 | 2011-08-15 16:37:04 -0700 | [diff] [blame^] | 27 | // Must be first to correspond with JavaVM. |
| 28 | const struct JNINativeInterface* fns; |
Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 29 | |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 30 | Thread* self; |
Carl Shapiro | ea4dca8 | 2011-08-01 13:45:38 -0700 | [diff] [blame] | 31 | |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 32 | // Are we in a "critical" JNI call? |
| 33 | bool critical; |
Carl Shapiro | 2ed144c | 2011-07-26 16:52:08 -0700 | [diff] [blame] | 34 | |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 35 | // Used to help call synchronized native methods. |
| 36 | // TODO: make jni_compiler.cc do the indirection itself. |
| 37 | void (*MonitorEnterHelper)(JNIEnv*, jobject); |
| 38 | void (*MonitorExitHelper)(JNIEnv*, jobject); |
Carl Shapiro | ea4dca8 | 2011-08-01 13:45:38 -0700 | [diff] [blame] | 39 | }; |
| 40 | |
Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 41 | } // namespace art |
Carl Shapiro | ea4dca8 | 2011-08-01 13:45:38 -0700 | [diff] [blame] | 42 | |
Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 43 | #endif // ART_SRC_JNI_INTERNAL_H_ |