| Index: src/mips/codegen-mips.cc
|
| diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc
|
| index ff5658a190f3cedf76b7f3322171e8df373cb9cf..e5338dbcc15adbcc69b05e77681260ec13c937e2 100644
|
| --- a/src/mips/codegen-mips.cc
|
| +++ b/src/mips/codegen-mips.cc
|
| @@ -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;
|
|
|