Support passing arguments to invoke-static* instructions.
- Stop using the frame pointer for accessing locals.
- Stop emulating a stack when doing code generation. Instead,
rely on dex register model, where instructions only reference
registers.
Change-Id: Id51bd7d33ac430cb87a53c9f4b0c864eeb1006f9
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index b86665b..8f07d89 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -30,6 +30,7 @@
namespace art {
void CodeGenerator::Compile(CodeAllocator* allocator) {
+ frame_size_ = GetGraph()->GetMaximumNumberOfOutVRegs() * kWordSize;
const GrowableArray<HBasicBlock*>* blocks = GetGraph()->GetBlocks();
DCHECK(blocks->Get(0) == GetGraph()->GetEntryBlock());
DCHECK(GoesToNextBlock(GetGraph()->GetEntryBlock(), blocks->Get(1)));
@@ -73,9 +74,6 @@
current->Accept(location_builder);
InitLocations(current);
current->Accept(instruction_visitor);
- if (current->GetLocations() != nullptr && current->GetLocations()->Out().IsValid()) {
- Push(current, current->GetLocations()->Out());
- }
}
}
@@ -85,7 +83,7 @@
Location location = instruction->GetLocations()->InAt(i);
if (location.IsValid()) {
// Move the input to the desired location.
- Move(instruction->InputAt(i), location);
+ Move(instruction->InputAt(i), location, instruction);
}
}
}
@@ -204,11 +202,10 @@
void CodeGenerator::BuildVMapTable(std::vector<uint8_t>* data) const {
Leb128EncodingVector vmap_encoder;
- size_t size = 1 + 1 /* marker */ + 0;
+ // We currently don't use callee-saved registers.
+ size_t size = 0 + 1 /* marker */ + 0;
vmap_encoder.Reserve(size + 1u); // All values are likely to be one byte in ULEB128 (<128).
vmap_encoder.PushBackUnsigned(size);
- // We're currently always saving the frame pointer, so set it in the table as a temporary.
- vmap_encoder.PushBackUnsigned(kVRegTempBaseReg + VmapTable::kEntryAdjustment);
vmap_encoder.PushBackUnsigned(VmapTable::kAdjustedFpMarker);
*data = vmap_encoder.GetData();