From c41e5b5ae1befe2c602d55de1dbc04d1914f4a6c Mon Sep 17 00:00:00 2001 From: buzbee Date: Fri, 23 Sep 2011 12:46:19 -0700 Subject: Add tables to map between callee saves and vregs Also added function to return sp-relative offset for Dalvik virtual registers using Method* [Note: must be matched with corresponding libcore change to reflect new field in Method] Change-Id: Id739908c6232ce60763d8199bc05111e960da46e --- src/compiler/Frontend.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/compiler/Frontend.cc') diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc index 6a01e36481..9659903ae8 100644 --- a/src/compiler/Frontend.cc +++ b/src/compiler/Frontend.cc @@ -889,7 +889,21 @@ bool oatCompileMethod(const Compiler& compiler, Method* method, art::Instruction memcpy(mapping_table->GetData(), reinterpret_cast(&cUnit.mappingTable[0]), mapping_table->GetLength() * sizeof(cUnit.mappingTable[0])); - method->SetCode(managed_code, art::kThumb2, mapping_table); + // Add a marker to take place of lr + cUnit.coreVmapTable.push_back(-1); + // Combine vmap tables - core regs, then fp regs + for (uint32_t i = 0; i < cUnit.fpVmapTable.size(); i++) { + cUnit.coreVmapTable.push_back(cUnit.fpVmapTable[i]); + } + DCHECK(cUnit.coreVmapTable.size() == (uint32_t) + (__builtin_popcount(cUnit.coreSpillMask) + + __builtin_popcount(cUnit.fpSpillMask))); + art::ShortArray* vmap_table = + art::ShortArray::Alloc(cUnit.coreVmapTable.size()); + memcpy(vmap_table->GetData(), + reinterpret_cast(&cUnit.coreVmapTable[0]), + vmap_table->GetLength() * sizeof(cUnit.coreVmapTable[0])); + method->SetCode(managed_code, art::kThumb2, mapping_table, vmap_table); method->SetFrameSizeInBytes(cUnit.frameSize); method->SetReturnPcOffsetInBytes(cUnit.frameSize - sizeof(intptr_t)); method->SetCoreSpillMask(cUnit.coreSpillMask); -- cgit v1.2.3-59-g8ed1b