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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 return OFFSET_OF(NativeArguments, argc_tag_); | 128 return OFFSET_OF(NativeArguments, argc_tag_); |
129 } | 129 } |
130 static intptr_t argv_offset() { return OFFSET_OF(NativeArguments, argv_); } | 130 static intptr_t argv_offset() { return OFFSET_OF(NativeArguments, argv_); } |
131 static intptr_t retval_offset() { | 131 static intptr_t retval_offset() { |
132 return OFFSET_OF(NativeArguments, retval_); | 132 return OFFSET_OF(NativeArguments, retval_); |
133 } | 133 } |
134 static intptr_t AutoSetupScopeMask() { | 134 static intptr_t AutoSetupScopeMask() { |
135 return AutoSetupScopeBits::mask_in_place(); | 135 return AutoSetupScopeBits::mask_in_place(); |
136 } | 136 } |
137 | 137 |
138 static int ParameterCountForResolution(const Function& function) { | 138 static intptr_t ParameterCountForResolution(const Function& function) { |
139 ASSERT(function.is_native()); | 139 ASSERT(function.is_native()); |
140 ASSERT(!function.IsConstructor()); // Not supported. | 140 ASSERT(!function.IsConstructor()); // Not supported. |
141 int count = function.NumParameters(); | 141 intptr_t count = function.NumParameters(); |
142 if (function.is_static() && function.IsClosureFunction()) { | 142 if (function.is_static() && function.IsClosureFunction()) { |
143 // The closure object is hidden and not accessible from native code. | 143 // The closure object is hidden and not accessible from native code. |
144 // However, if the function is an instance closure function, the captured | 144 // However, if the function is an instance closure function, the captured |
145 // receiver located in the context is made accessible in native code at | 145 // receiver located in the context is made accessible in native code at |
146 // index 0, thereby hidding the closure object at index 0. | 146 // index 0, thereby hidding the closure object at index 0. |
147 count--; | 147 count--; |
148 } | 148 } |
149 return count; | 149 return count; |
150 } | 150 } |
151 | 151 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 Isolate* isolate_; // Current isolate pointer. | 218 Isolate* isolate_; // Current isolate pointer. |
219 int argc_tag_; // Encodes argument count and invoked native call type. | 219 int argc_tag_; // Encodes argument count and invoked native call type. |
220 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. | 220 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. |
221 RawObject** retval_; // Pointer to the return value area. | 221 RawObject** retval_; // Pointer to the return value area. |
222 }; | 222 }; |
223 | 223 |
224 } // namespace dart | 224 } // namespace dart |
225 | 225 |
226 #endif // VM_NATIVE_ARGUMENTS_H_ | 226 #endif // VM_NATIVE_ARGUMENTS_H_ |
OLD | NEW |