A few 64bit fixes.

Change-Id: I1fe189d638b9cb5127b897da6cecdad6902db930
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 6255c8c..b709da3 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1597,7 +1597,10 @@
   }
   const void* result = GetOatMethodFor(method).GetQuickCode();
   if (result == nullptr) {
-    if (method->IsPortableCompiled()) {
+    if (method->IsNative()) {
+      // No code and native? Use generic trampoline.
+      result = GetQuickGenericJniTrampoline();
+    } else if (method->IsPortableCompiled()) {
       // No code? Do we expect portable code?
       result = GetQuickToPortableBridge();
     } else {
@@ -1707,12 +1710,12 @@
     bool have_portable_code = false;
     if (enter_interpreter) {
       // Use interpreter entry point.
-
-      // check whether the method is native, in which case it's generic JNI
-      portable_code = GetPortableToInterpreterBridge();
+      // Check whether the method is native, in which case it's generic JNI.
       if (quick_code == nullptr && portable_code == nullptr && method->IsNative()) {
         quick_code = GetQuickGenericJniTrampoline();
+        portable_code = GetPortableToQuickBridge();
       } else {
+        portable_code = GetPortableToInterpreterBridge();
         quick_code = GetQuickToInterpreterBridge();
       }
     } else {