Index: src/arm/codegen-arm.cc |
diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc |
index 0b268e7a8b05e44b04c2f8034765887a50623c97..cfc9dfec4dc6a3e1d905a3182ceb4635887a9596 100644 |
--- a/src/arm/codegen-arm.cc |
+++ b/src/arm/codegen-arm.cc |
@@ -857,12 +857,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); |
- PredictableCodeSizeScope scope(patcher.masm(), *length); |
- patcher.masm()->PushFixedFrame(r1); |
- patcher.masm()->nop(ip.code()); |
- patcher.masm()->add(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()->PushFixedFrame(r1); |
+ patcher->masm()->nop(ip.code()); |
+ patcher->masm()->add( |
+ fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
initialized = true; |
} |
return byte_sequence; |