Skip to content
Permalink
Browse files
[mips] Implemented emitFunctionPrologue/Epilogue
https://bugs.webkit.org/show_bug.cgi?id=152947

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-01-15
Reviewed by Michael Saboff.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::popPair):
(JSC::MacroAssemblerMIPS::pushPair):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitFunctionPrologue):
(JSC::AssemblyHelpers::emitFunctionEpilogueWithEmptyFrame):
(JSC::AssemblyHelpers::emitFunctionEpilogue):

Canonical link: https://commits.webkit.org/171221@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
annulen authored and webkit-commit-queue committed Jan 15, 2016
1 parent b9581ef commit df7c9fbcabbad31b2abcad885ab4f6295c979dd4
Showing with 46 additions and 0 deletions.
  1. +15 −0 Source/JavaScriptCore/ChangeLog
  2. +14 −0 Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h
  3. +17 −0 Source/JavaScriptCore/jit/AssemblyHelpers.h
@@ -1,3 +1,18 @@
2016-01-15 Konstantin Tokarev <annulen@yandex.ru>

[mips] Implemented emitFunctionPrologue/Epilogue
https://bugs.webkit.org/show_bug.cgi?id=152947

Reviewed by Michael Saboff.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::popPair):
(JSC::MacroAssemblerMIPS::pushPair):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitFunctionPrologue):
(JSC::AssemblyHelpers::emitFunctionEpilogueWithEmptyFrame):
(JSC::AssemblyHelpers::emitFunctionEpilogue):

2016-01-15 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r195084.
@@ -1253,6 +1253,13 @@ class MacroAssemblerMIPS : public AbstractMacroAssembler<MIPSAssembler, MacroAss
m_assembler.addiu(MIPSRegisters::sp, MIPSRegisters::sp, 4);
}

void popPair(RegisterID dest1, RegisterID dest2)
{
m_assembler.lw(dest1, MIPSRegisters::sp, 0);
m_assembler.lw(dest2, MIPSRegisters::sp, 4);
m_assembler.addiu(MIPSRegisters::sp, MIPSRegisters::sp, 8);
}

void push(RegisterID src)
{
m_assembler.addiu(MIPSRegisters::sp, MIPSRegisters::sp, -4);
@@ -1271,6 +1278,13 @@ class MacroAssemblerMIPS : public AbstractMacroAssembler<MIPSAssembler, MacroAss
push(immTempRegister);
}

void pushPair(RegisterID src1, RegisterID src2)
{
m_assembler.addiu(MIPSRegisters::sp, MIPSRegisters::sp, -8);
m_assembler.sw(src2, MIPSRegisters::sp, 4);
m_assembler.sw(src1, MIPSRegisters::sp, 0);
}

// Register move operations:
//
// Move values in registers.
@@ -447,6 +447,23 @@ class AssemblyHelpers : public MacroAssembler {
return 2 * sizeof(void*);
}

void emitFunctionPrologue()
{
pushPair(framePointerRegister, returnAddressRegister);
move(stackPointerRegister, framePointerRegister);
}

void emitFunctionEpilogueWithEmptyFrame()
{
popPair(framePointerRegister, returnAddressRegister);
}

void emitFunctionEpilogue()
{
move(framePointerRegister, stackPointerRegister);
emitFunctionEpilogueWithEmptyFrame();
}

ALWAYS_INLINE void preserveReturnAddressAfterCall(RegisterID reg)
{
move(returnAddressRegister, reg);

0 comments on commit df7c9fb

Please sign in to comment.