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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 static intptr_t ParameterCountForResolution(const Function& function) { | 152 static intptr_t ParameterCountForResolution(const Function& function) { |
153 ASSERT(function.is_native()); | 153 ASSERT(function.is_native()); |
154 ASSERT(!function.IsGeneric()); // Not supported. | 154 ASSERT(!function.IsGeneric()); // Not supported. |
155 ASSERT(!function.IsGenerativeConstructor()); // Not supported. | 155 ASSERT(!function.IsGenerativeConstructor()); // Not supported. |
156 intptr_t count = function.NumParameters(); | 156 intptr_t count = function.NumParameters(); |
157 if (function.is_static() && function.IsClosureFunction()) { | 157 if (function.is_static() && function.IsClosureFunction()) { |
158 // The closure object is hidden and not accessible from native code. | 158 // The closure object is hidden and not accessible from native code. |
159 // However, if the function is an instance closure function, the captured | 159 // However, if the function is an instance closure function, the captured |
160 // receiver located in the context is made accessible in native code at | 160 // receiver located in the context is made accessible in native code at |
161 // index 0, thereby hidding the closure object at index 0. | 161 // index 0, thereby hiding the closure object at index 0. |
162 count--; | 162 count--; |
163 } | 163 } |
164 return count; | 164 return count; |
165 } | 165 } |
166 | 166 |
167 static int ComputeArgcTag(const Function& function) { | 167 static int ComputeArgcTag(const Function& function) { |
168 ASSERT(function.is_native()); | 168 ASSERT(function.is_native()); |
169 ASSERT(!function.IsGeneric()); // Not supported. | 169 ASSERT(!function.IsGeneric()); // Not supported. |
170 ASSERT(!function.IsGenerativeConstructor()); // Not supported. | 170 ASSERT(!function.IsGenerativeConstructor()); // Not supported. |
171 int tag = ArgcBits::encode(function.NumParameters()); | 171 int tag = ArgcBits::encode(function.NumParameters()); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 Thread* thread_; // Current thread pointer. | 237 Thread* thread_; // Current thread pointer. |
238 intptr_t argc_tag_; // Encodes argument count and invoked native call type. | 238 intptr_t argc_tag_; // Encodes argument count and invoked native call type. |
239 RawObject** argv_; // Pointer to an array of arguments to runtime call. | 239 RawObject** argv_; // Pointer to an array of arguments to runtime call. |
240 RawObject** retval_; // Pointer to the return value area. | 240 RawObject** retval_; // Pointer to the return value area. |
241 }; | 241 }; |
242 | 242 |
243 } // namespace dart | 243 } // namespace dart |
244 | 244 |
245 #endif // RUNTIME_VM_NATIVE_ARGUMENTS_H_ | 245 #endif // RUNTIME_VM_NATIVE_ARGUMENTS_H_ |
OLD | NEW |