Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.

Fix associated errors about unused paramenters and implict sign conversions.
For sign conversion this was largely in the area of enums, so add ostream
operators for the effected enums and fix tools/generate-operator-out.py.
Tidy arena allocation code and arena allocated data types, rather than fixing
new and delete operators.
Remove dead code.

Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc
index b2df091..ef5ccb6 100644
--- a/runtime/check_jni.cc
+++ b/runtime/check_jni.cc
@@ -512,7 +512,7 @@
     return true;
   }
 
-  bool CheckReferenceKind(IndirectRefKind expected_kind, JavaVMExt* vm, Thread* self, jobject obj) {
+  bool CheckReferenceKind(IndirectRefKind expected_kind, Thread* self, jobject obj) {
     IndirectRefKind found_kind;
     if (expected_kind == kLocal) {
       found_kind = GetIndirectRefKind(obj);
@@ -2398,7 +2398,7 @@
       }
       if (sc.Check(soa, false, "L", &result)) {
         DCHECK_EQ(IsSameObject(env, obj, result.L), JNI_TRUE);
-        DCHECK(sc.CheckReferenceKind(kind, soa.Vm(), soa.Self(), result.L));
+        DCHECK(sc.CheckReferenceKind(kind, soa.Self(), result.L));
         return result.L;
       }
     }
@@ -2410,7 +2410,7 @@
     ScopedCheck sc(kFlag_ExcepOkay, function_name);
     JniValueType args[2] = {{.E = env}, {.L = obj}};
     sc.Check(soa, true, "EL", args);
-    if (sc.CheckReferenceKind(kind, soa.Vm(), soa.Self(), obj)) {
+    if (sc.CheckReferenceKind(kind, soa.Self(), obj)) {
       JniValueType result;
       switch (kind) {
         case kGlobal:
@@ -3116,7 +3116,7 @@
   static jarray NewPrimitiveArray(const char* function_name, JNIEnv* env, jsize length,
                                   Primitive::Type type) {
     ScopedObjectAccess soa(env);
-    ScopedCheck sc(kFlag_Default, __FUNCTION__);
+    ScopedCheck sc(kFlag_Default, function_name);
     JniValueType args[2] = {{.E = env}, {.z = length}};
     if (sc.Check(soa, true, "Ez", args)) {
       JniValueType result;