ARM: Reduce the stack requirements of GetNoCodeAgeSequence.

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

BUG=v8:3111
LOG=y

Patch from Cosmin Truta <ctruta@blackberry.com>.

R=svenpanne@chromium.org

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

Patch from Cosmin Truta <ctruta@blackberry.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18815 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
svenpanne@chromium.org 2014-01-24 11:48:09 +00:00
parent 21532ddfdc
commit c19d55f801

View File

@ -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;