summaryrefslogtreecommitdiff
path: root/src/compiler/Frontend.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2011-09-23 12:46:19 -0700
committer buzbee <buzbee@google.com> 2011-09-23 13:53:25 -0700
commitc41e5b5ae1befe2c602d55de1dbc04d1914f4a6c (patch)
treefa122d75b64193d7c2dee7a1be871a5ae8511493 /src/compiler/Frontend.cc
parentf4afb7aec4e51c2e682cf3af4d6511add74d2f38 (diff)
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
Diffstat (limited to 'src/compiler/Frontend.cc')
-rw-r--r--src/compiler/Frontend.cc16
1 files changed, 15 insertions, 1 deletions
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<const int32_t*>(&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<const int16_t*>(&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);