-#define HVrhek_PV 0x10 /* Value is a string. */
-#define HVrhek_IV 0x20 /* Value is IV/UV. */
-#define HVrhek_delete 0x30 /* Value is placeholder - signifies delete. */
-#define HVrhek_typemask 0x30
-#define HVrhek_UTF8 0x40 /* string value is utf8. */
-#define HVrhek_UV 0x40 /* integer value is UV. */
+#define HVrhek_delete 0x10 /* Value is placeholder - signifies delete. */
+#define HVrhek_IV 0x20 /* Value is IV. */
+#define HVrhek_UV 0x30 /* Value is UV. */
+#define HVrhek_PV 0x40 /* Value is a (byte) string. */
+#define HVrhek_PV_UTF8 0x50 /* Value is a (utf8) string. */
+/* Two spare. As these have to live in the optree, you can't store anything
+ interpreter specific, such as SVs. :-( */
+#define HVrhek_typemask 0x70
+
+#ifdef USE_ITHREADS
+/* A big expression to find the key offset */
+#define REF_HE_KEY(chain) \
+ ((((chain->refcounted_he_data[0] & 0x60) == 0x40) \
+ ? chain->refcounted_he_val.refcounted_he_u_len + 1 : 0) \
+ + 1 + chain->refcounted_he_data)
+#endif