| 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 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 Isolate* isolate() const { return isolate_; } | 36 Isolate* isolate() const { return isolate_; } |
| 37 int Count() const { return argc_; } | 37 int Count() const { return argc_; } |
| 38 | 38 |
| 39 RawObject* At(int index) const { | 39 RawObject* At(int index) const { |
| 40 ASSERT(index >=0 && index < argc_); | 40 ASSERT(index >=0 && index < argc_); |
| 41 return (*argv_)[-index]; | 41 return (*argv_)[-index]; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void SetReturn(const Object& value) const; | 44 void SetReturn(const Object& value) const; |
| 45 void SetReturn(RawObject* value) const; |
| 45 | 46 |
| 46 static intptr_t isolate_offset() { | 47 static intptr_t isolate_offset() { |
| 47 return OFFSET_OF(NativeArguments, isolate_); | 48 return OFFSET_OF(NativeArguments, isolate_); |
| 48 } | 49 } |
| 49 static intptr_t argc_offset() { return OFFSET_OF(NativeArguments, argc_); } | 50 static intptr_t argc_offset() { return OFFSET_OF(NativeArguments, argc_); } |
| 50 static intptr_t argv_offset() { return OFFSET_OF(NativeArguments, argv_); } | 51 static intptr_t argv_offset() { return OFFSET_OF(NativeArguments, argv_); } |
| 51 static intptr_t retval_offset() { | 52 static intptr_t retval_offset() { |
| 52 return OFFSET_OF(NativeArguments, retval_); | 53 return OFFSET_OF(NativeArguments, retval_); |
| 53 } | 54 } |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 Isolate* isolate_; // Current isolate pointer. | 57 Isolate* isolate_; // Current isolate pointer. |
| 57 int argc_; // Number of arguments passed to the runtime call. | 58 int argc_; // Number of arguments passed to the runtime call. |
| 58 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. | 59 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. |
| 59 RawObject** retval_; // Pointer to the return value area. | 60 RawObject** retval_; // Pointer to the return value area. |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace dart | 63 } // namespace dart |
| 63 | 64 |
| 64 #endif // VM_NATIVE_ARGUMENTS_H_ | 65 #endif // VM_NATIVE_ARGUMENTS_H_ |
| OLD | NEW |