Make native field operations call instrumentation listeners.

Previously native reads and writes of fields would not be reported to
instrumentation listeners.

We filter these events out from the debugger since currently the
debugger will deadlock if it tries to propagate them through JDWP.

Bug: 62712031

Test: ./test.py --host --trace -j40
Test: ./art/tools/run-jdwp-tests.sh --mode=host
Test: Manual
Change-Id: Ibc75248bdca06537d8b4ff7bb890546136ffa161
diff --git a/runtime/jvalue-inl.h b/runtime/jvalue-inl.h
index b33686c..25e34b2 100644
--- a/runtime/jvalue-inl.h
+++ b/runtime/jvalue-inl.h
@@ -27,6 +27,24 @@
   l = new_l.Ptr();
 }
 
+#define DEFINE_FROM(type, chr) \
+    template <> inline JValue JValue::FromPrimitive(type v) { \
+      JValue res; \
+      res.Set ## chr(v); \
+      return res; \
+    }
+
+DEFINE_FROM(uint8_t, Z);
+DEFINE_FROM(int8_t, B);
+DEFINE_FROM(uint16_t, C);
+DEFINE_FROM(int16_t, S);
+DEFINE_FROM(int32_t, I);
+DEFINE_FROM(int64_t, J);
+DEFINE_FROM(float, F);
+DEFINE_FROM(double, D);
+
+#undef DEFINE_FROM
+
 }  // namespace art
 
 #endif  // ART_RUNTIME_JVALUE_INL_H_