diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-04-03 10:38:37 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-04-03 17:09:22 +0100 |
commit | 4a34a428c6a2588e0857ef6baf88f1b73ce65958 (patch) | |
tree | a9f025c17752a175c4e6a203c01e935cb438efb1 /compiler/optimizing/code_generator.cc | |
parent | 8549cf9d83688f7decbbea2a8de761ce29e95f3c (diff) | |
download | art-4a34a428c6a2588e0857ef6baf88f1b73ce65958.zip art-4a34a428c6a2588e0857ef6baf88f1b73ce65958.tar.gz art-4a34a428c6a2588e0857ef6baf88f1b73ce65958.tar.bz2 |
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
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 11 |
1 files changed, 4 insertions, 7 deletions
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 @@ void CodeGenerator::CompileBlock(HBasicBlock* block) { 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 @@ void CodeGenerator::InitLocations(HInstruction* instruction) { 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::BuildMappingTable(std::vector<uint8_t>* data) const { 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(); |