blob: 9cf8d57de704ac5cae071bbb1830499399bf26d3 [file] [log] [blame]
Ian Rogersdf20fe02011-07-20 20:34:16 -07001// 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 Carlstrom578bbdc2011-07-21 14:07:47 -07007
8#include "assembler.h"
9#include "macros.h"
Elliott Hughesbbd76712011-08-17 10:25:24 -070010#include "reference_table.h"
Ian Rogersdf20fe02011-07-20 20:34:16 -070011
12namespace art {
13
Elliott Hughesf2682d52011-08-15 16:37:04 -070014class Runtime;
Elliott Hughes40ef99e2011-08-11 17:44:34 -070015class Thread;
Ian Rogersdf20fe02011-07-20 20:34:16 -070016
Elliott Hughesf2682d52011-08-15 16:37:04 -070017struct JavaVMExt {
Elliott Hughes515a5bc2011-08-17 11:08:34 -070018 JavaVMExt(Runtime* runtime, bool check_jni);
Elliott Hughesbbd76712011-08-17 10:25:24 -070019
Elliott Hughesf2682d52011-08-15 16:37:04 -070020 // Must be first to correspond with JNIEnv.
21 const struct JNIInvokeInterface* fns;
22
23 Runtime* runtime;
Elliott Hughesbbd76712011-08-17 10:25:24 -070024
Elliott Hughes515a5bc2011-08-17 11:08:34 -070025 bool check_jni;
26
Elliott Hughesbbd76712011-08-17 10:25:24 -070027 // Used to hold references to pinned primitive arrays.
28 ReferenceTable pin_table;
Elliott Hughesf2682d52011-08-15 16:37:04 -070029};
30
Elliott Hughes40ef99e2011-08-11 17:44:34 -070031struct JNIEnvExt {
Elliott Hughes515a5bc2011-08-17 11:08:34 -070032 JNIEnvExt(Thread* self, bool check_jni);
Elliott Hughesbbd76712011-08-17 10:25:24 -070033
Elliott Hughesf2682d52011-08-15 16:37:04 -070034 // Must be first to correspond with JavaVM.
35 const struct JNINativeInterface* fns;
Ian Rogersdf20fe02011-07-20 20:34:16 -070036
Elliott Hughes40ef99e2011-08-11 17:44:34 -070037 Thread* self;
Carl Shapiroea4dca82011-08-01 13:45:38 -070038
Elliott Hughes515a5bc2011-08-17 11:08:34 -070039 bool check_jni;
40
Elliott Hughes40ef99e2011-08-11 17:44:34 -070041 // Are we in a "critical" JNI call?
42 bool critical;
Carl Shapiro2ed144c2011-07-26 16:52:08 -070043
Elliott Hughesbbd76712011-08-17 10:25:24 -070044 // Entered JNI monitors, for bulk exit on thread detach.
45 ReferenceTable monitor_table;
Carl Shapiroea4dca82011-08-01 13:45:38 -070046};
47
Ian Rogersdf20fe02011-07-20 20:34:16 -070048} // namespace art
Carl Shapiroea4dca82011-08-01 13:45:38 -070049
Ian Rogersdf20fe02011-07-20 20:34:16 -070050#endif // ART_SRC_JNI_INTERNAL_H_