diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-05 12:46:03 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-06 16:49:52 +0000 |
commit | de58ab2c03ff8112b07ab827c8fa38f670dfc656 (patch) | |
tree | c872bfbcad1e90845008140bbddcc43e56dc19d2 /compiler/optimizing/code_generator_x86.cc | |
parent | 3ed86e4e98dfe1b05c9a03aa2aee42c145a018c3 (diff) | |
download | art-de58ab2c03ff8112b07ab827c8fa38f670dfc656.tar.gz art-de58ab2c03ff8112b07ab827c8fa38f670dfc656.tar.bz2 art-de58ab2c03ff8112b07ab827c8fa38f670dfc656.zip |
Implement try/catch/throw in optimizing.
- We currently don't run optimizations in the presence of a try/catch.
- We therefore implement Quick's mapping table.
- Also fix a missing null check on array-length.
Change-Id: I6917dfcb868e75c1cf6eff32b7cbb60b6cfbd68f
Diffstat (limited to 'compiler/optimizing/code_generator_x86.cc')
-rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index b2d9187b3b..2a8eded0cc 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -2596,5 +2596,29 @@ void InstructionCodeGeneratorX86::VisitLoadString(HLoadString* load) { __ Bind(slow_path->GetExitLabel()); } +void LocationsBuilderX86::VisitLoadException(HLoadException* load) { + LocationSummary* locations = + new (GetGraph()->GetArena()) LocationSummary(load, LocationSummary::kNoCall); + locations->SetOut(Location::RequiresRegister()); +} + +void InstructionCodeGeneratorX86::VisitLoadException(HLoadException* load) { + Address address = Address::Absolute(Thread::ExceptionOffset<kX86WordSize>().Int32Value()); + __ fs()->movl(load->GetLocations()->Out().As<Register>(), address); + __ fs()->movl(address, Immediate(0)); +} + +void LocationsBuilderX86::VisitThrow(HThrow* instruction) { + LocationSummary* locations = + new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kCall); + InvokeRuntimeCallingConvention calling_convention; + locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0))); +} + +void InstructionCodeGeneratorX86::VisitThrow(HThrow* instruction) { + __ fs()->call(Address::Absolute(QUICK_ENTRYPOINT_OFFSET(kX86WordSize, pDeliverException))); + codegen_->RecordPcInfo(instruction, instruction->GetDexPc()); +} + } // namespace x86 } // namespace art |