summaryrefslogtreecommitdiffstats
path: root/libjava/include
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/include')
-rw-r--r--libjava/include/jvm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index 57ba44fbfad..ada8e11a2e1 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -57,6 +57,12 @@ struct _Jv_VTable
#endif
static size_t vtable_elt_size() { return sizeof(vtable_elt); }
+
+ // Given a method index, return byte offset from the vtable pointer.
+ static jint idx_to_offset (int index)
+ {
+ return (2 * sizeof (void *)) + (index * vtable_elt_size ());
+ }
static _Jv_VTable *new_vtable (int count);
};
OpenPOWER on IntegriCloud