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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 int function_bits = FunctionBits::decode(argc_tag_); | 125 int function_bits = FunctionBits::decode(argc_tag_); |
126 const int actual_index = index + NumHiddenArgs(function_bits); | 126 const int actual_index = index + NumHiddenArgs(function_bits); |
127 return ArgAt(actual_index); | 127 return ArgAt(actual_index); |
128 } | 128 } |
129 | 129 |
130 void SetReturn(const Object& value) const { | 130 void SetReturn(const Object& value) const { |
131 *retval_ = value.raw(); | 131 *retval_ = value.raw(); |
132 } | 132 } |
133 | 133 |
| 134 RawObject* ReturnValue() const { |
| 135 return *retval_; |
| 136 } |
| 137 |
134 static intptr_t thread_offset() { | 138 static intptr_t thread_offset() { |
135 return OFFSET_OF(NativeArguments, thread_); | 139 return OFFSET_OF(NativeArguments, thread_); |
136 } | 140 } |
137 static intptr_t argc_tag_offset() { | 141 static intptr_t argc_tag_offset() { |
138 return OFFSET_OF(NativeArguments, argc_tag_); | 142 return OFFSET_OF(NativeArguments, argc_tag_); |
139 } | 143 } |
140 static intptr_t argv_offset() { return OFFSET_OF(NativeArguments, argv_); } | 144 static intptr_t argv_offset() { return OFFSET_OF(NativeArguments, argv_); } |
141 static intptr_t retval_offset() { | 145 static intptr_t retval_offset() { |
142 return OFFSET_OF(NativeArguments, retval_); | 146 return OFFSET_OF(NativeArguments, retval_); |
143 } | 147 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 233 |
230 Thread* thread_; // Current thread pointer. | 234 Thread* thread_; // Current thread pointer. |
231 intptr_t argc_tag_; // Encodes argument count and invoked native call type. | 235 intptr_t argc_tag_; // Encodes argument count and invoked native call type. |
232 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. | 236 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. |
233 RawObject** retval_; // Pointer to the return value area. | 237 RawObject** retval_; // Pointer to the return value area. |
234 }; | 238 }; |
235 | 239 |
236 } // namespace dart | 240 } // namespace dart |
237 | 241 |
238 #endif // VM_NATIVE_ARGUMENTS_H_ | 242 #endif // VM_NATIVE_ARGUMENTS_H_ |
OLD | NEW |