Improve performance of invokevirtual/invokeinterface with embedded imt/vtable
Add an embedded version of imt/vtable into class object. Both tables start at
fixed offset within class object so method/entry point can be loaded directly
from class object for invokeinterface/invokevirtual.
Bug: 8142917
Change-Id: I4240d58cfbe9250107c95c0708c036854c455968
diff --git a/runtime/mirror/string-inl.h b/runtime/mirror/string-inl.h
index 315f7b1..6736497 100644
--- a/runtime/mirror/string-inl.h
+++ b/runtime/mirror/string-inl.h
@@ -18,6 +18,7 @@
#define ART_RUNTIME_MIRROR_STRING_INL_H_
#include "array.h"
+#include "class.h"
#include "intern_table.h"
#include "runtime.h"
#include "string.h"
@@ -26,6 +27,11 @@
namespace art {
namespace mirror {
+inline uint32_t String::ClassSize() {
+ uint32_t vtable_entries = Object::kVTableLength + 51;
+ return Class::ComputeClassSize(true, vtable_entries, 1, 1, 2);
+}
+
inline CharArray* String::GetCharArray() {
return GetFieldObject<CharArray>(ValueOffset());
}