Move code item to the data pointer and remove code_item_offset.
This saves 4 bytes on 32bit and 8 bytes on 64bit on ArtMethod.
Also update nterp to directly fetch the code item from the data pointer.
Test: test.py
Bug: 112676029
Change-Id: Ic01f43c7ccf2cbce1ec517478e81362232d36371
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index 45a6938..0a824e3 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -771,7 +771,7 @@
}
// Clear the data pointer, it will be set if needed by the caller.
- if (!src->IsNative()) {
+ if (!src->HasCodeItem() && !src->IsNative()) {
SetDataPtrSize(nullptr, image_pointer_size);
}
// Clear hotness to let the JIT properly decide when to compile this method.