Reviewers: Sven Panne, Michael Starzinger, Yang, Jakob, dcarney, danno, Benedikt Meurer,

Message:
Hi, may I please a review for bugfix 3111?

Although I replaced a fast automatic stack allocation with a heap allocation, I considered it to be ok because it's only a one-time thing. Having a much smaller
stack growth might actually be a benefit in all subsequent calls, due to
potentially lesser paging involved in stress conditions.

Description:
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=n

Patch from Cosmin Truta <[email protected]>.

Please review this at https://codereview.chromium.org/144933002/

SVN Base: git://github.com/v8/v8.git@master

Affected files (+10, -6 lines):
  M src/arm/codegen-arm.cc


Index: src/arm/codegen-arm.cc
diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc
index 0b268e7a8b05e44b04c2f8034765887a50623c97..b0f2e2f069437a8b31f1690273f52b2f7046ef16 100644
--- a/src/arm/codegen-arm.cc
+++ b/src/arm/codegen-arm.cc
@@ -857,13 +857,17 @@ 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.
+    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;
+    delete patcher;
   }
   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