Skip to content

Commit 7b3eefe

Browse files
committed
Bug 1828724 - Add frame pointer to StringConcatStub. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D176080 UltraBlame original commit: 5dfdf003c06aae6875343177d6b0e0930f3d0a11
1 parent 01470dc commit 7b3eefe

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

js/src/jit/CodeGenerator.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10895,8 +10895,6 @@ static void ConcatInlineString(MacroAssembler& masm, Register lhs, Register rhs,
1089510895

1089610896

1089710897
copyChars(rhs);
10898-
10899-
masm.ret();
1090010898
}
1090110899

1090210900
void CodeGenerator::visitSubstr(LSubstr* lir) {
@@ -11068,6 +11066,9 @@ JitCode* JitRealm::generateStringConcatStub(JSContext* cx) {
1106811066
#ifdef JS_USE_LINK_REGISTER
1106911067
masm.pushReturnAddress();
1107011068
#endif
11069+
masm.Push(FramePointer);
11070+
masm.moveStackPtrTo(FramePointer);
11071+
1107111072

1107211073
Label leftEmpty;
1107311074
masm.loadStringLength(lhs, temp1);
@@ -11122,29 +11123,37 @@ JitCode* JitRealm::generateStringConcatStub(JSContext* cx) {
1112211123

1112311124

1112411125
masm.storeRopeChildren(lhs, rhs, output);
11126+
masm.pop(FramePointer);
1112511127
masm.ret();
1112611128

1112711129
masm.bind(&leftEmpty);
1112811130
masm.mov(rhs, output);
11131+
masm.pop(FramePointer);
1112911132
masm.ret();
1113011133

1113111134
masm.bind(&rightEmpty);
1113211135
masm.mov(lhs, output);
11136+
masm.pop(FramePointer);
1113311137
masm.ret();
1113411138

1113511139
masm.bind(&isInlineTwoByte);
1113611140
ConcatInlineString(masm, lhs, rhs, output, temp1, temp2, temp3,
1113711141
initialStringHeap, &failure, CharEncoding::TwoByte);
11142+
masm.pop(FramePointer);
11143+
masm.ret();
1113811144

1113911145
masm.bind(&isInlineLatin1);
1114011146
ConcatInlineString(masm, lhs, rhs, output, temp1, temp2, temp3,
1114111147
initialStringHeap, &failure, CharEncoding::Latin1);
11148+
masm.pop(FramePointer);
11149+
masm.ret();
1114211150

1114311151
masm.pop(temp2);
1114411152
masm.pop(temp1);
1114511153

1114611154
masm.bind(&failure);
1114711155
masm.movePtr(ImmPtr(nullptr), output);
11156+
masm.pop(FramePointer);
1114811157
masm.ret();
1114911158

1115011159
Linker linker(masm);

0 commit comments

Comments
 (0)