Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: runtime/vm/native_arguments.h

Issue 1663613002: Dart_SetReturnValue now accepts and propagates error handles. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code review Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698