Reduce meta-data object sizes, introduce meta-data helper classes.
Change-Id: Id14ad218f1c74c659701352fdf1a45bf6444daa3
diff --git a/src/compiler/codegen/arm/ArmRallocUtil.cc b/src/compiler/codegen/arm/ArmRallocUtil.cc
index 5d2c4e6..60a5f38 100644
--- a/src/compiler/codegen/arm/ArmRallocUtil.cc
+++ b/src/compiler/codegen/arm/ArmRallocUtil.cc
@@ -263,17 +263,19 @@
/* Return sp-relative offset in bytes using Method* */
-extern int oatVRegOffsetFromMethod(Method* method, int reg)
+extern int oatVRegOffset(const art::DexFile::CodeItem* code_item,
+ uint32_t core_spills, uint32_t fp_spills,
+ size_t frame_size, int reg)
{
- int numIns = method->NumIns();
- int numRegs = method->NumRegisters() - numIns;
- int numOuts = method->NumOuts();
- int numSpills = __builtin_popcount(method->GetCoreSpillMask()) +
- __builtin_popcount(method->GetFpSpillMask());
+ int numIns = code_item->ins_size_;
+ int numRegs = code_item->registers_size_ - numIns;
+ int numOuts = code_item->outs_size_;
+ int numSpills = __builtin_popcount(core_spills) +
+ __builtin_popcount(fp_spills);
int numPadding = (STACK_ALIGN_WORDS -
(numSpills + numRegs + numOuts + 2)) & (STACK_ALIGN_WORDS-1);
int regsOffset = (numOuts + numPadding + 1) * 4;
- int insOffset = method->GetFrameSizeInBytes() + 4;
+ int insOffset = frame_size + 4;
return (reg < numRegs) ? regsOffset + (reg << 2) :
insOffset + ((reg - numRegs) << 2);
}
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 15fd1ba..2c3ee0d 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#include "object_utils.h"
+
#define DISPLAY_MISSING_TARGETS (cUnit->enableDebug & \
(1 << kDebugDisplayMissingTargets))
@@ -192,7 +194,7 @@
// See if we can find a dex reference for the storage class.
// we may not if the dex file never references the super class,
// but usually it will.
- std::string descriptor = field->GetDeclaringClass()->GetDescriptor()->ToModifiedUtf8();
+ std::string descriptor(art::FieldHelper(field).GetDeclaringClassDescriptor());
const art::DexFile::StringId* string_id =
cUnit->dex_file->FindStringId(descriptor);
if (string_id == NULL) {