Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1084)

Unified Diff: vm/native_arguments.h

Issue 10664004: Fix issue 1968, replace usage of inline 'asm' constructs in 'stack alignment', 'jump to exception h… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/exceptions.cc ('k') | vm/os.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « vm/exceptions.cc ('k') | vm/os.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698