Revision: 18815
Author:   [email protected]
Date:     Fri Jan 24 11:48:09 2014 UTC
Log:      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 <[email protected]>.

[email protected]

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

Patch from Cosmin Truta <[email protected]>.
http://code.google.com/p/v8/source/detail?r=18815

Modified:
 /branches/bleeding_edge/src/arm/codegen-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/codegen-arm.cc Tue Jan 14 09:57:05 2014 UTC +++ /branches/bleeding_edge/src/arm/codegen-arm.cc Fri Jan 24 11:48:09 2014 UTC
@@ -857,12 +857,15 @@
   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;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to