x86 JNI compiler and unit tests.
Change-Id: I4c2e10328961a2e8e27c90777fe2a93737b21143
diff --git a/src/jni_compiler.h b/src/jni_compiler.h
new file mode 100644
index 0000000..4a6b1ba
--- /dev/null
+++ b/src/jni_compiler.h
@@ -0,0 +1,40 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+// Author: irogers@google.com (Ian Rogers)
+#ifndef ART_SRC_JNI_COMPILER_H_
+#define ART_SRC_JNI_COMPILER_H_
+
+#include "globals.h"
+#include "macros.h"
+
+namespace art {
+
+class Assembler;
+class Method;
+
+// A JNI compiler generates code that acts as the bridge between managed code
+// and native code.
+// TODO: move the responsibility of managing memory to somewhere else
+class JniCompiler {
+ public:
+ JniCompiler();
+ ~JniCompiler();
+ void Compile(Assembler* jni_asm, Method* method);
+ private:
+ // A poor man's code cache
+ void* AllocateCode(size_t size);
+
+ // Base of memory region for allocated code
+ byte* jni_code_;
+
+ // Allocated code size
+ size_t jni_code_size_;
+
+ // Pointer to the free space
+ byte* jni_code_top_;
+
+ DISALLOW_COPY_AND_ASSIGN(JniCompiler);
+};
+
+} // namespace art
+
+#endif // ART_SRC_JNI_COMPILER_H_