Revision: 16007
Author: [email protected]
Date: Thu Aug 1 05:55:19 2013
Log: Fix mozilla regress-398085-01 failure on windows.
Make sure that all stack pages are mapped before accessing them.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/20607005
http://code.google.com/p/v8/source/detail?r=16007
Modified:
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.h
/branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
/branches/bleeding_edge/src/x64/lithium-codegen-x64.h
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Thu Aug 1
01:42:47 2013
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Thu Aug 1
05:55:19 2013
@@ -135,6 +135,16 @@
OS::MemCopy(copy.start(), builder.Finalize(), copy.length());
masm()->RecordComment(copy.start());
}
+
+
+#ifdef _MSC_VER
+void LCodeGen::MakeSureStackPagesMapped(int offset) {
+ const int kPageSize = 4 * KB;
+ for (offset -= kPageSize; offset > 0; offset -= kPageSize) {
+ __ mov(Operand(esp, offset), eax);
+ }
+}
+#endif
bool LCodeGen::GeneratePrologue() {
@@ -226,6 +236,9 @@
} else {
if (FLAG_debug_code) {
__ sub(Operand(esp), Immediate(slots * kPointerSize));
+#ifdef _MSC_VER
+ MakeSureStackPagesMapped(slots * kPointerSize);
+#endif
__ push(eax);
__ mov(Operand(eax), Immediate(slots));
Label loop;
@@ -238,15 +251,7 @@
} else {
__ sub(Operand(esp), Immediate(slots * kPointerSize));
#ifdef _MSC_VER
- // On windows, you may not access the stack more than one page
below
- // the most recently mapped page. To make the allocated area
randomly
- // accessible, we write to each page in turn (the value is
irrelevant).
- const int kPageSize = 4 * KB;
- for (int offset = slots * kPointerSize - kPageSize;
- offset > 0;
- offset -= kPageSize) {
- __ mov(Operand(esp, offset), eax);
- }
+ MakeSureStackPagesMapped(slots * kPointerSize);
#endif
}
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.h Mon Jul 29
06:56:51 2013
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.h Thu Aug 1
05:55:19 2013
@@ -408,6 +408,14 @@
int X87ArrayIndex(X87Register reg);
int x87_st2idx(int pos);
+#ifdef _MSC_VER
+ // On windows, you may not access the stack more than one page below
+ // the most recently mapped page. To make the allocated area randomly
+ // accessible, we write an arbitrary value to each page in range
+ // esp + offset - page_size .. esp in turn.
+ void MakeSureStackPagesMapped(int offset);
+#endif
+
Zone* zone_;
LPlatformChunk* const chunk_;
MacroAssembler* const masm_;
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu Aug 1
01:42:47 2013
+++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu Aug 1
05:55:19 2013
@@ -118,6 +118,16 @@
OS::MemCopy(copy.start(), builder.Finalize(), copy.length());
masm()->RecordComment(copy.start());
}
+
+
+#ifdef _MSC_VER
+void LCodeGen::MakeSureStackPagesMapped(int offset) {
+ const int kPageSize = 4 * KB;
+ for (offset -= kPageSize; offset > 0; offset -= kPageSize) {
+ __ movq(Operand(rsp, offset), rax);
+ }
+}
+#endif
bool LCodeGen::GeneratePrologue() {
@@ -169,6 +179,9 @@
if (slots > 0) {
if (FLAG_debug_code) {
__ subq(rsp, Immediate(slots * kPointerSize));
+#ifdef _MSC_VER
+ MakeSureStackPagesMapped(slots * kPointerSize);
+#endif
__ push(rax);
__ Set(rax, slots);
__ movq(kScratchRegister, kSlotsZapValue, RelocInfo::NONE64);
@@ -182,15 +195,7 @@
} else {
__ subq(rsp, Immediate(slots * kPointerSize));
#ifdef _MSC_VER
- // On windows, you may not access the stack more than one page below
- // the most recently mapped page. To make the allocated area randomly
- // accessible, we write to each page in turn (the value is
irrelevant).
- const int kPageSize = 4 * KB;
- for (int offset = slots * kPointerSize - kPageSize;
- offset > 0;
- offset -= kPageSize) {
- __ movq(Operand(rsp, offset), rax);
- }
+ MakeSureStackPagesMapped(slots * kPointerSize);
#endif
}
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.h Mon Jul 29
06:56:51 2013
+++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.h Thu Aug 1
05:55:19 2013
@@ -345,6 +345,13 @@
void DoStoreKeyedExternalArray(LStoreKeyed* instr);
void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr);
void DoStoreKeyedFixedArray(LStoreKeyed* instr);
+#ifdef _MSC_VER
+ // On windows, you may not access the stack more than one page below
+ // the most recently mapped page. To make the allocated area randomly
+ // accessible, we write an arbitrary value to each page in range
+ // rsp + offset - page_size .. rsp in turn.
+ void MakeSureStackPagesMapped(int offset);
+#endif
Zone* zone_;
LPlatformChunk* const chunk_;
--
--
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.