| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_NATIVE_ARGUMENTS_H_ | 5 #ifndef VM_NATIVE_ARGUMENTS_H_ |
| 6 #define VM_NATIVE_ARGUMENTS_H_ | 6 #define VM_NATIVE_ARGUMENTS_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/simulator.h" |
| 10 #include "vm/stub_code.h" | 11 #include "vm/stub_code.h" |
| 11 | 12 |
| 12 namespace dart { | 13 namespace dart { |
| 13 | 14 |
| 14 // Forward declarations. | 15 // Forward declarations. |
| 15 class BootstrapNatives; | 16 class BootstrapNatives; |
| 16 class Isolate; | 17 class Isolate; |
| 17 class Object; | 18 class Object; |
| 18 class RawObject; | 19 class RawObject; |
| 19 class Simulator; | 20 class Simulator; |
| 20 | 21 |
| 21 | 22 |
| 22 #if defined(TESTING) || defined(DEBUG) | 23 #if defined(TESTING) || defined(DEBUG) |
| 23 | 24 |
| 24 #if defined(TARGET_OS_WINDOWS) | 25 #if defined(USING_SIMULATOR) |
| 26 #define CHECK_STACK_ALIGNMENT { \ |
| 27 uword current_sp = Simulator::Current()->get_register(SPREG); \ |
| 28 ASSERT((OS::ActivationFrameAlignment() == 0) || \ |
| 29 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \ |
| 30 } |
| 31 #elif defined(TARGET_OS_WINDOWS) |
| 25 // The compiler may dynamically align the stack on Windows, so do not check. | 32 // The compiler may dynamically align the stack on Windows, so do not check. |
| 26 #define CHECK_STACK_ALIGNMENT { } | 33 #define CHECK_STACK_ALIGNMENT { } |
| 27 #else | 34 #else |
| 28 #define CHECK_STACK_ALIGNMENT { \ | 35 #define CHECK_STACK_ALIGNMENT { \ |
| 29 uword (*func)() = \ | 36 uword (*func)() = \ |
| 30 reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); \ | 37 reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); \ |
| 31 uword current_sp = func(); \ | 38 uword current_sp = func(); \ |
| 32 ASSERT((OS::ActivationFrameAlignment() == 0) || \ | 39 ASSERT((OS::ActivationFrameAlignment() == 0) || \ |
| 33 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \ | 40 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \ |
| 34 } | 41 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 170 |
| 164 Isolate* isolate_; // Current isolate pointer. | 171 Isolate* isolate_; // Current isolate pointer. |
| 165 int argc_tag_; // Encodes argument count and invoked native call type. | 172 int argc_tag_; // Encodes argument count and invoked native call type. |
| 166 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. | 173 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. |
| 167 RawObject** retval_; // Pointer to the return value area. | 174 RawObject** retval_; // Pointer to the return value area. |
| 168 }; | 175 }; |
| 169 | 176 |
| 170 } // namespace dart | 177 } // namespace dart |
| 171 | 178 |
| 172 #endif // VM_NATIVE_ARGUMENTS_H_ | 179 #endif // VM_NATIVE_ARGUMENTS_H_ |
| OLD | NEW |