Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: src/mips/builtins-mips.cc

Issue 1218743010: MIPS: Avoid use of a0 as return address in jalr. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/mips/codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/builtins-mips.cc
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
index b5a67b47dc59892991d1f785619f6191d77b8631..20b19295eb94ed8e46c2deb4d9581cc54c132a1a 100644
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -1024,9 +1024,12 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
// internal frame to make the code faster, since we shouldn't have to do stack
// crawls in MakeCodeYoung. This seems a bit fragile.
- // Set a0 to point to the head of the PlatformCodeAge sequence.
+ // Set a0 to point to the head of the PlatformCodeAge sequence, using ret adr.
+ __ mov(a0, ra);
__ Subu(a0, a0,
Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
+ // Restore the original return address of the function
+ __ mov(ra, at);
// The following registers must be saved and restored when calling through to
// the runtime:
@@ -1063,9 +1066,12 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// save/restore the registers without worrying about which of them contain
// pointers.
- // Set a0 to point to the head of the PlatformCodeAge sequence.
+ // Set a0 to point to the head of the PlatformCodeAge sequence, using ret adr.
+ __ mov(a0, ra);
__ Subu(a0, a0,
Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
+ // Restore the original return address of the function
+ __ mov(ra, at);
// The following registers must be saved and restored when calling through to
// the runtime:
« no previous file with comments | « no previous file | src/mips/codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698