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 RUNTIME_VM_NATIVE_ARGUMENTS_H_ | 5 #ifndef RUNTIME_VM_NATIVE_ARGUMENTS_H_ |
6 #define RUNTIME_VM_NATIVE_ARGUMENTS_H_ | 6 #define RUNTIME_VM_NATIVE_ARGUMENTS_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/memory_sanitizer.h" | 9 #include "platform/memory_sanitizer.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #if defined(TARGET_ARCH_DBC) | 27 #if defined(TARGET_ARCH_DBC) |
28 // C-stack is always aligned on DBC because we don't have any native code. | 28 // C-stack is always aligned on DBC because we don't have any native code. |
29 #define CHECK_STACK_ALIGNMENT | 29 #define CHECK_STACK_ALIGNMENT |
30 #elif defined(USING_SIMULATOR) | 30 #elif defined(USING_SIMULATOR) |
31 #define CHECK_STACK_ALIGNMENT \ | 31 #define CHECK_STACK_ALIGNMENT \ |
32 { \ | 32 { \ |
33 uword current_sp = Simulator::Current()->get_register(SPREG); \ | 33 uword current_sp = Simulator::Current()->get_register(SPREG); \ |
34 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \ | 34 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \ |
35 } | 35 } |
36 #elif defined(TARGET_OS_WINDOWS) | 36 #elif defined(HOST_OS_WINDOWS) |
37 // The compiler may dynamically align the stack on Windows, so do not check. | 37 // The compiler may dynamically align the stack on Windows, so do not check. |
38 #define CHECK_STACK_ALIGNMENT \ | 38 #define CHECK_STACK_ALIGNMENT \ |
39 {} | 39 {} |
40 #else | 40 #else |
41 #define CHECK_STACK_ALIGNMENT \ | 41 #define CHECK_STACK_ALIGNMENT \ |
42 { \ | 42 { \ |
43 uword (*func)() = reinterpret_cast<uword (*)()>( \ | 43 uword (*func)() = reinterpret_cast<uword (*)()>( \ |
44 StubCode::GetStackPointer_entry()->EntryPoint()); \ | 44 StubCode::GetStackPointer_entry()->EntryPoint()); \ |
45 uword current_sp = func(); \ | 45 uword current_sp = func(); \ |
46 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \ | 46 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \ |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 Thread* thread_; // Current thread pointer. | 259 Thread* thread_; // Current thread pointer. |
260 intptr_t argc_tag_; // Encodes argument count and invoked native call type. | 260 intptr_t argc_tag_; // Encodes argument count and invoked native call type. |
261 RawObject** argv_; // Pointer to an array of arguments to runtime call. | 261 RawObject** argv_; // Pointer to an array of arguments to runtime call. |
262 RawObject** retval_; // Pointer to the return value area. | 262 RawObject** retval_; // Pointer to the return value area. |
263 }; | 263 }; |
264 | 264 |
265 } // namespace dart | 265 } // namespace dart |
266 | 266 |
267 #endif // RUNTIME_VM_NATIVE_ARGUMENTS_H_ | 267 #endif // RUNTIME_VM_NATIVE_ARGUMENTS_H_ |
OLD | NEW |