| 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 "platform/memory_sanitizer.h" | 9 #include "platform/memory_sanitizer.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 #else | 57 #else |
| 58 | 58 |
| 59 #define CHECK_STACK_ALIGNMENT { } | 59 #define CHECK_STACK_ALIGNMENT { } |
| 60 #define VERIFY_ON_TRANSITION { } | 60 #define VERIFY_ON_TRANSITION { } |
| 61 #define DEOPTIMIZE_ALOT { } | 61 #define DEOPTIMIZE_ALOT { } |
| 62 | 62 |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 #ifndef PRODUCT |
| 65 #define TRACE_NATIVE_CALL(format, name) \ | 66 #define TRACE_NATIVE_CALL(format, name) \ |
| 66 if (FLAG_trace_natives) { \ | 67 if (FLAG_trace_natives) { \ |
| 67 OS::Print("Calling native: " format "\n", name); \ | 68 OS::Print("Calling native: " format "\n", name); \ |
| 68 } | 69 } |
| 69 | 70 #else |
| 71 #define TRACE_NATIVE_CALL(format, name) \ |
| 72 do { } while (0) |
| 73 #endif |
| 70 | 74 |
| 71 // Class NativeArguments is used to access arguments passed in from | 75 // Class NativeArguments is used to access arguments passed in from |
| 72 // generated dart code to a runtime function or a dart library native | 76 // generated dart code to a runtime function or a dart library native |
| 73 // function. It is also used to set the return value if any at the slot | 77 // function. It is also used to set the return value if any at the slot |
| 74 // reserved for return values. | 78 // reserved for return values. |
| 75 // All runtime function/dart library native functions have the | 79 // All runtime function/dart library native functions have the |
| 76 // following signature: | 80 // following signature: |
| 77 // void function_name(NativeArguments arguments); | 81 // void function_name(NativeArguments arguments); |
| 78 // Inside the function, arguments are accessed as follows: | 82 // Inside the function, arguments are accessed as follows: |
| 79 // const Instance& arg0 = Instance::CheckedHandle(arguments.ArgAt(0)); | 83 // const Instance& arg0 = Instance::CheckedHandle(arguments.ArgAt(0)); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 237 |
| 234 Thread* thread_; // Current thread pointer. | 238 Thread* thread_; // Current thread pointer. |
| 235 intptr_t argc_tag_; // Encodes argument count and invoked native call type. | 239 intptr_t argc_tag_; // Encodes argument count and invoked native call type. |
| 236 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. | 240 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. |
| 237 RawObject** retval_; // Pointer to the return value area. | 241 RawObject** retval_; // Pointer to the return value area. |
| 238 }; | 242 }; |
| 239 | 243 |
| 240 } // namespace dart | 244 } // namespace dart |
| 241 | 245 |
| 242 #endif // VM_NATIVE_ARGUMENTS_H_ | 246 #endif // VM_NATIVE_ARGUMENTS_H_ |
| OLD | NEW |