diff options
| author | 2011-11-30 16:24:48 -0800 | |
|---|---|---|
| committer | 2011-12-06 14:02:09 -0800 | |
| commit | 6d4d9fcb4f01e287ee29e81cd1c941ee5d11d379 (patch) | |
| tree | 4c715bef86a3c5a47f9cea43c4a092cf4766ed4b /src/compiler/codegen/arm/ArmRallocUtil.cc | |
| parent | 86b0010c79ef95b5333cd540b7d3af34a9f1a643 (diff) | |
Reduce meta-data object sizes, introduce meta-data helper classes.
Change-Id: Id14ad218f1c74c659701352fdf1a45bf6444daa3
Diffstat (limited to 'src/compiler/codegen/arm/ArmRallocUtil.cc')
| -rw-r--r-- | src/compiler/codegen/arm/ArmRallocUtil.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/compiler/codegen/arm/ArmRallocUtil.cc b/src/compiler/codegen/arm/ArmRallocUtil.cc index 5d2c4e67b9..60a5f383b3 100644 --- a/src/compiler/codegen/arm/ArmRallocUtil.cc +++ b/src/compiler/codegen/arm/ArmRallocUtil.cc @@ -263,17 +263,19 @@ extern int oatSRegOffset(CompilationUnit* cUnit, int sReg) /* 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); } |