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
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;
- ASSERT(IsPowerOf2(kFrameAlignment));
- __ and_(esp, -kFrameAlignment);
+ static const int kFrameAlignment = OS::ActivationFrameAlignment();
+ if (kFrameAlignment > 0) {
+ ASSERT(IsPowerOf2(kFrameAlignment));
+ __ and_(esp, -kFrameAlignment);
+ }
}
}
-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
}
-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) {
return *reinterpret_cast<const double*>(&nanval);
}
+
+int OS::ActivationFrameAlignment() {
+ // No constraint on Windows.
+ return 0;
+}
+
+
bool VirtualMemory::IsReserved() {
return address_ != NULL;
}
// 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;