| 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/handles_impl.h" | 10 #include "vm/handles_impl.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class Isolate; | 22 class Isolate; |
| 23 class Object; | 23 class Object; |
| 24 class RawObject; | 24 class RawObject; |
| 25 class Simulator; | 25 class Simulator; |
| 26 | 26 |
| 27 #if defined(TESTING) || defined(DEBUG) | 27 #if defined(TESTING) || defined(DEBUG) |
| 28 | 28 |
| 29 #if defined(USING_SIMULATOR) | 29 #if defined(USING_SIMULATOR) |
| 30 #define CHECK_STACK_ALIGNMENT { \ | 30 #define CHECK_STACK_ALIGNMENT { \ |
| 31 uword current_sp = Simulator::Current()->get_register(SPREG); \ | 31 uword current_sp = Simulator::Current()->get_register(SPREG); \ |
| 32 ASSERT((OS::ActivationFrameAlignment() == 0) || \ | 32 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \ |
| 33 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \ | |
| 34 } | 33 } |
| 35 #elif defined(TARGET_OS_WINDOWS) | 34 #elif defined(TARGET_OS_WINDOWS) |
| 36 // The compiler may dynamically align the stack on Windows, so do not check. | 35 // The compiler may dynamically align the stack on Windows, so do not check. |
| 37 #define CHECK_STACK_ALIGNMENT { } | 36 #define CHECK_STACK_ALIGNMENT { } |
| 38 #else | 37 #else |
| 39 #define CHECK_STACK_ALIGNMENT { \ | 38 #define CHECK_STACK_ALIGNMENT { \ |
| 40 uword (*func)() = \ | 39 uword (*func)() = \ |
| 41 reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); \ | 40 reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); \ |
| 42 uword current_sp = func(); \ | 41 uword current_sp = func(); \ |
| 43 ASSERT((OS::ActivationFrameAlignment() == 0) || \ | 42 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \ |
| 44 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \ | |
| 45 } | 43 } |
| 46 #endif | 44 #endif |
| 47 | 45 |
| 48 #define VERIFY_ON_TRANSITION \ | 46 #define VERIFY_ON_TRANSITION \ |
| 49 if (FLAG_verify_on_transition) { \ | 47 if (FLAG_verify_on_transition) { \ |
| 50 VerifyPointersVisitor::VerifyPointers(); \ | 48 VerifyPointersVisitor::VerifyPointers(); \ |
| 51 Isolate::Current()->heap()->Verify(); \ | 49 Isolate::Current()->heap()->Verify(); \ |
| 52 } | 50 } |
| 53 #define TRACE_NATIVES(name) \ | 51 #define TRACE_NATIVES(name) \ |
| 54 if (FLAG_trace_natives) { \ | 52 if (FLAG_trace_natives) { \ |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 191 |
| 194 Isolate* isolate_; // Current isolate pointer. | 192 Isolate* isolate_; // Current isolate pointer. |
| 195 int argc_tag_; // Encodes argument count and invoked native call type. | 193 int argc_tag_; // Encodes argument count and invoked native call type. |
| 196 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. | 194 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. |
| 197 RawObject** retval_; // Pointer to the return value area. | 195 RawObject** retval_; // Pointer to the return value area. |
| 198 }; | 196 }; |
| 199 | 197 |
| 200 } // namespace dart | 198 } // namespace dart |
| 201 | 199 |
| 202 #endif // VM_NATIVE_ARGUMENTS_H_ | 200 #endif // VM_NATIVE_ARGUMENTS_H_ |
| OLD | NEW |