Overall clean up of gbc_expander and intrinsics.

Change-Id: I4afbafbaa3f2ecb82a55e609b3f276225c06f117
diff --git a/src/compiler_llvm/gbc_expander.cc b/src/compiler_llvm/gbc_expander.cc
index 89dcf1d..d482526 100644
--- a/src/compiler_llvm/gbc_expander.cc
+++ b/src/compiler_llvm/gbc_expander.cc
@@ -43,6 +43,10 @@
 
 using art::greenland::IntrinsicHelper;
 
+namespace art {
+extern char remapShorty(char shortyType);
+};
+
 namespace {
 
 class GBCExpanderPass : public llvm::FunctionPass {
@@ -2490,13 +2494,7 @@
 
   char ret_shorty = shorty[0];
 #if defined(ART_USE_QUICK_COMPILER)
-  switch(ret_shorty) {
-    case 'Z' : ret_shorty = 'I'; break;
-    case 'B' : ret_shorty = 'I'; break;
-    case 'S' : ret_shorty = 'I'; break;
-    case 'C' : ret_shorty = 'I'; break;
-    default: break;
-  }
+  ret_shorty = art::remapShorty(ret_shorty);
 #endif
   llvm::Type* ret_type = irb_.getJType(ret_shorty, kAccurate);
 
@@ -2511,14 +2509,7 @@
 
   for (uint32_t i = 1; i < shorty_size; ++i) {
 #if defined(ART_USE_QUICK_COMPILER)
-    char shorty_type = shorty[i];
-    switch(shorty_type) {
-      case 'Z' : shorty_type = 'I'; break;
-      case 'B' : shorty_type = 'I'; break;
-      case 'S' : shorty_type = 'I'; break;
-      case 'C' : shorty_type = 'I'; break;
-      default: break;
-    }
+    char shorty_type = art::remapShorty(shorty[i]);
     args_type.push_back(irb_.getJType(shorty_type, kAccurate));
 #else
     args_type.push_back(irb_.getJType(shorty[i], kAccurate));
@@ -2653,13 +2644,7 @@
   // Emit the code to return default value (zero) for the given return type.
   char ret_shorty = oat_compilation_unit_->GetShorty()[0];
 #if defined(ART_USE_QUICK_COMPILER)
-  switch(ret_shorty) {
-    case 'Z' : ret_shorty = 'I'; break;
-    case 'B' : ret_shorty = 'I'; break;
-    case 'S' : ret_shorty = 'I'; break;
-    case 'C' : ret_shorty = 'I'; break;
-    default: break;
-  }
+  ret_shorty = art::remapShorty(ret_shorty);
 #endif
   if (ret_shorty == 'V') {
     irb_.CreateRetVoid();
@@ -3521,16 +3506,6 @@
                                 call_inst.getArgOperand(1));
     }
 
-    //==- Switch -----------------------------------------------------------==//
-    case IntrinsicHelper::SparseSwitch: {
-      // Nothing to be done.
-      return NULL;
-    }
-    case IntrinsicHelper::PackedSwitch: {
-      // Nothing to be done.
-      return NULL;
-    }
-
     //==- Const ------------------------------------------------------------==//
     case IntrinsicHelper::ConstInt:
     case IntrinsicHelper::ConstLong: {
@@ -3551,7 +3526,8 @@
 
     //==- Method Info ------------------------------------------------------==//
     case IntrinsicHelper::MethodInfo: {
-      // Nothing to be done.
+      // Nothing to be done, because MethodInfo carries optional hints that are
+      // not needed by the portable path.
       return NULL;
     }
 
@@ -3636,6 +3612,7 @@
 } // anonymous namespace
 
 namespace art {
+
 namespace compiler_llvm {
 
 llvm::FunctionPass*