| 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/stub_code.h" | 10 #include "vm/stub_code.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 // Forward declarations. | 14 // Forward declarations. |
| 15 class BootstrapNatives; | 15 class BootstrapNatives; |
| 16 class Isolate; | 16 class Isolate; |
| 17 class Object; | 17 class Object; |
| 18 class RawObject; | 18 class RawObject; |
| 19 class Simulator; |
| 19 | 20 |
| 20 | 21 |
| 21 #if defined(TESTING) || defined(DEBUG) | 22 #if defined(TESTING) || defined(DEBUG) |
| 22 | 23 |
| 23 #if defined(TARGET_OS_WINDOWS) | 24 #if defined(TARGET_OS_WINDOWS) |
| 24 // The compiler may dynamically align the stack on Windows, so do not check. | 25 // The compiler may dynamically align the stack on Windows, so do not check. |
| 25 #define CHECK_STACK_ALIGNMENT { } | 26 #define CHECK_STACK_ALIGNMENT { } |
| 26 #else | 27 #else |
| 27 #define CHECK_STACK_ALIGNMENT { \ | 28 #define CHECK_STACK_ALIGNMENT { \ |
| 28 uword (*func)() = \ | 29 uword (*func)() = \ |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 enum ArgcTagBits { | 145 enum ArgcTagBits { |
| 145 kArgcBit = 0, | 146 kArgcBit = 0, |
| 146 kArgcSize = 24, | 147 kArgcSize = 24, |
| 147 kInstanceFunctionBit = 24, | 148 kInstanceFunctionBit = 24, |
| 148 kClosureFunctionBit = 25, | 149 kClosureFunctionBit = 25, |
| 149 }; | 150 }; |
| 150 class ArgcBits : public BitField<int, kArgcBit, kArgcSize> {}; | 151 class ArgcBits : public BitField<int, kArgcBit, kArgcSize> {}; |
| 151 class InstanceFunctionBit : public BitField<bool, kInstanceFunctionBit, 1> {}; | 152 class InstanceFunctionBit : public BitField<bool, kInstanceFunctionBit, 1> {}; |
| 152 class ClosureFunctionBit : public BitField<bool, kClosureFunctionBit, 1> {}; | 153 class ClosureFunctionBit : public BitField<bool, kClosureFunctionBit, 1> {}; |
| 153 friend class BootstrapNatives; | 154 friend class BootstrapNatives; |
| 155 friend class Simulator; |
| 154 friend void SetReturnValueHelper(Dart_NativeArguments, Dart_Handle); | 156 friend void SetReturnValueHelper(Dart_NativeArguments, Dart_Handle); |
| 155 | 157 |
| 156 // Since this function is passed a RawObject directly, we need to be | 158 // Since this function is passed a RawObject directly, we need to be |
| 157 // exceedingly careful when we use it. If there are any other side | 159 // exceedingly careful when we use it. If there are any other side |
| 158 // effects in the statement that may cause GC, it could lead to | 160 // effects in the statement that may cause GC, it could lead to |
| 159 // bugs. | 161 // bugs. |
| 160 void SetReturnUnsafe(RawObject* value) const; | 162 void SetReturnUnsafe(RawObject* value) const; |
| 161 | 163 |
| 162 Isolate* isolate_; // Current isolate pointer. | 164 Isolate* isolate_; // Current isolate pointer. |
| 163 int argc_tag_; // Encodes argument count and invoked native call type. | 165 int argc_tag_; // Encodes argument count and invoked native call type. |
| 164 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. | 166 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. |
| 165 RawObject** retval_; // Pointer to the return value area. | 167 RawObject** retval_; // Pointer to the return value area. |
| 166 }; | 168 }; |
| 167 | 169 |
| 168 } // namespace dart | 170 } // namespace dart |
| 169 | 171 |
| 170 #endif // VM_NATIVE_ARGUMENTS_H_ | 172 #endif // VM_NATIVE_ARGUMENTS_H_ |
| OLD | NEW |