Commit 88c9fa5d authored by kasperl@chromium.org's avatar kasperl@chromium.org

Allow platforms (linux and win32) to not force 16-byte alignment

of activation frames (needed on Mac OS X).
Review URL: http://codereview.chromium.org/4211

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a9e4a68e
......@@ -5209,11 +5209,11 @@ void CEntryStub::GenerateReserveCParameterSpace(MacroAssembler* masm,
if (num_parameters > 0) {
__ sub(Operand(esp), Immediate(num_parameters * kPointerSize));
}
// OS X activation frames are 16 byte-aligned
// (see "Mac OS X ABI Function Call Guide").
const int kFrameAlignment = 16;
static const int kFrameAlignment = OS::ActivationFrameAlignment();
if (kFrameAlignment > 0) {
ASSERT(IsPowerOf2(kFrameAlignment));
__ and_(esp, -kFrameAlignment);
}
}
......
......@@ -195,7 +195,16 @@ char *OS::StrDup(const char* str) {
}
double OS::nan_value() { return NAN; }
double OS::nan_value() {
return NAN;
}
int OS::ActivationFrameAlignment() {
// No constraint on Linux.
return 0;
}
// We keep the lowest and highest addresses mapped as a quick way of
// determining that pointers are outside the heap (used mostly in assertions
......
......@@ -300,7 +300,16 @@ void OS::LogSharedLibraryAddresses() {
}
double OS::nan_value() { return NAN; }
double OS::nan_value() {
return NAN;
}
int OS::ActivationFrameAlignment() {
// OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
// Function Call Guide".
return 16;
}
int OS::StackWalk(StackFrame* frames, int frames_size) {
......
......@@ -1206,6 +1206,13 @@ double OS::nan_value() {
return *reinterpret_cast<const double*>(&nanval);
}
int OS::ActivationFrameAlignment() {
// No constraint on Windows.
return 0;
}
bool VirtualMemory::IsReserved() {
return address_ != NULL;
}
......
......@@ -217,6 +217,10 @@ class OS {
// Returns the double constant NAN
static double nan_value();
// Returns the activation frame alignment constraint or zero if
// the platform doesn't care. Guaranteed to be a power of two.
static int ActivationFrameAlignment();
private:
static const int msPerSecond = 1000;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment