Index: vm/native_arguments.h |
=================================================================== |
--- vm/native_arguments.h (revision 9040) |
+++ vm/native_arguments.h (working copy) |
@@ -7,6 +7,7 @@ |
#include "platform/assert.h" |
#include "vm/globals.h" |
+#include "vm/stub_code.h" |
namespace dart { |
@@ -16,6 +17,28 @@ |
class RawObject; |
+#if defined(TESTING) || defined(DEBUG) |
+ |
+#if defined(TARGET_OS_WINDOWS) |
+// The compiler may dynamically align the stack on Windows, so do not check. |
+#define CHECK_STACK_ALIGNMENT { } |
+#else |
+#define CHECK_STACK_ALIGNMENT { \ |
+ uword (*func)() = \ |
+ reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); \ |
+ uword current_sp = func(); \ |
+ ASSERT((OS::ActivationFrameAlignment() == 0) || \ |
+ (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \ |
+} |
+#endif |
+ |
+#else |
+ |
+#define CHECK_STACK_ALIGNMENT { } |
+ |
+#endif |
+ |
+ |
// Class NativeArguments is used to access arguments passed in from |
// generated dart code to a runtime function or a dart library native |
// function. It is also used to set the return value if any at the slot |