Commit 387e6cc3 authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Reduce the stack requirements of GetNoCodeAgeSequence.

Port r18815 (f93582a)

Original commit message:
Allocate the patcher object on the heap, to avoid occasional stack
overflows on QNX/ARM when entering GetNoCodeAgeSequence.

BUG=v8:3111
LOG=y
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/146993002

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f4a470d5
......@@ -1048,11 +1048,15 @@ static byte* GetNoCodeAgeSequence(uint32_t* length) {
byte* byte_sequence = reinterpret_cast<byte*>(sequence);
*length = kNoCodeAgeSequenceLength * Assembler::kInstrSize;
if (!initialized) {
CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength);
patcher.masm()->Push(ra, fp, cp, a1);
patcher.masm()->nop(Assembler::CODE_AGE_SEQUENCE_NOP);
patcher.masm()->Addu(fp, sp,
Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
// Since patcher is a large object, allocate it dynamically when needed,
// to avoid overloading the stack in stress conditions.
SmartPointer<CodePatcher>
patcher(new CodePatcher(byte_sequence, kNoCodeAgeSequenceLength));
PredictableCodeSizeScope scope(patcher->masm(), *length);
patcher->masm()->Push(ra, fp, cp, a1);
patcher->masm()->nop(Assembler::CODE_AGE_SEQUENCE_NOP);
patcher->masm()->Addu(
fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
initialized = true;
}
return byte_sequence;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment