summaryrefslogtreecommitdiffstats
path: root/src/jni_internal.h
blob: e1474abae3e86f9911c068f77563c630c5562f2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2011 Google Inc. All Rights Reserved.

#ifndef ART_SRC_JNI_INTERNAL_H_
#define ART_SRC_JNI_INTERNAL_H_

#include "jni.h"

#include "assembler.h"
#include "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_