Generic JNI implementation for x86_64

Starting implementation for generic JNI on x86_64. Frames are of
large static size (>4K) right now, should be compacted later. Passes
the whole of jni_compiler_test.

Change-Id: I88ac3e13a534afe7568d62a1ef97cb766e8260e4
diff --git a/compiler/jni/quick/calling_convention.cc b/compiler/jni/quick/calling_convention.cc
index 5d5eaf2..ac962af 100644
--- a/compiler/jni/quick/calling_convention.cc
+++ b/compiler/jni/quick/calling_convention.cc
@@ -106,7 +106,7 @@
 }
 
 FrameOffset JniCallingConvention::SavedLocalReferenceCookieOffset() const {
-  size_t start_of_sirt = SirtLinkOffset().Int32Value() +  kPointerSize;
+  size_t start_of_sirt = SirtNumRefsOffset().Int32Value() +  kPointerSize;
   size_t references_size = kPointerSize * ReferenceCount();  // size excluding header
   return FrameOffset(start_of_sirt + references_size);
 }
@@ -158,11 +158,11 @@
 // position
 FrameOffset JniCallingConvention::CurrentParamSirtEntryOffset() {
   CHECK(IsCurrentParamAReference());
-  CHECK_GT(SirtLinkOffset(), SirtNumRefsOffset());
+  CHECK_LT(SirtLinkOffset(), SirtNumRefsOffset());
   // Address of 1st SIRT entry
-  int result = SirtLinkOffset().Int32Value() + kPointerSize;
+  int result = SirtNumRefsOffset().Int32Value() + kPointerSize;
   result += itr_refs_ * kPointerSize;
-  CHECK_GT(result, SirtLinkOffset().Int32Value());
+  CHECK_GT(result, SirtNumRefsOffset().Int32Value());
   return FrameOffset(result);
 }