diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2016-10-12 22:03:31 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2016-10-12 22:27:38 +0100 |
commit | 96eeb4e2bb21afe8783d62e06b91fd1aef682dbb (patch) | |
tree | 097907f294206c45a03c4b63bf986b9e144116af /compiler/optimizing/code_generator_mips.cc | |
parent | e2ced0db78b89b778cd1c9ef4ace5dec7dbc66b0 (diff) |
Update HInstruction::NeedsCurrentMethod.
HLoadString and HLoadClass when sharpened may not need it
anymore. Instead just rely on the HCurrentMethod being the
SSA dependency of those instructions.
Also save storing the current method in the stack if the
graph actually doesn't need it.
test: m test-art-host test-art-target
Change-Id: I235d8275230637cbbd38fc0d2f9b822f6d2a9c1e
Diffstat (limited to 'compiler/optimizing/code_generator_mips.cc')
-rw-r--r-- | compiler/optimizing/code_generator_mips.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index 990bbcc85b..bc8bb480ec 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -743,9 +743,12 @@ void CodeGeneratorMIPS::GenerateFrameEntry() { // TODO: __ cfi().RelOffset(DWARFReg(reg), ofs); } - // Store the current method pointer. - // TODO: can we not do this if RequiresCurrentMethod() returns false? - __ StoreToOffset(kStoreWord, kMethodRegisterArgument, SP, kCurrentMethodStackOffset); + // Save the current method if we need it. Note that we do not + // do this in HCurrentMethod, as the instruction might have been removed + // in the SSA graph. + if (RequiresCurrentMethod()) { + __ StoreToOffset(kStoreWord, kMethodRegisterArgument, SP, kCurrentMethodStackOffset); + } } void CodeGeneratorMIPS::GenerateFrameExit() { |