OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_DART_ENTRY_H_ | 5 #ifndef VM_DART_ENTRY_H_ |
6 #define VM_DART_ENTRY_H_ | 6 #define VM_DART_ENTRY_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(ArgumentsDescriptor); | 94 DISALLOW_COPY_AND_ASSIGN(ArgumentsDescriptor); |
95 }; | 95 }; |
96 | 96 |
97 | 97 |
98 // DartEntry abstracts functionality needed to resolve dart functions | 98 // DartEntry abstracts functionality needed to resolve dart functions |
99 // and invoke them from C++. | 99 // and invoke them from C++. |
100 class DartEntry : public AllStatic { | 100 class DartEntry : public AllStatic { |
101 public: | 101 public: |
102 // On success, returns a RawInstance. On failure, a RawError. | 102 // On success, returns a RawInstance. On failure, a RawError. |
| 103 #if defined(TARGET_ARCH_X64) |
| 104 typedef RawObject* (*invokestub)(const Code& stub_code, |
| 105 const Code& target_code, |
| 106 const Array& arguments_descriptor, |
| 107 const Array& arguments, |
| 108 Thread* thread); |
| 109 #else |
103 typedef RawObject* (*invokestub)(uword entry_point, | 110 typedef RawObject* (*invokestub)(uword entry_point, |
104 const Array& arguments_descriptor, | 111 const Array& arguments_descriptor, |
105 const Array& arguments, | 112 const Array& arguments, |
106 Thread* thread); | 113 Thread* thread); |
| 114 #endif |
107 | 115 |
108 // Invokes the specified instance function or static function. | 116 // Invokes the specified instance function or static function. |
109 // The first argument of an instance function is the receiver. | 117 // The first argument of an instance function is the receiver. |
110 // On success, returns a RawInstance. On failure, a RawError. | 118 // On success, returns a RawInstance. On failure, a RawError. |
111 // This is used when there are no named arguments in the call. | 119 // This is used when there are no named arguments in the call. |
112 static RawObject* InvokeFunction(const Function& function, | 120 static RawObject* InvokeFunction(const Function& function, |
113 const Array& arguments); | 121 const Array& arguments); |
114 | 122 |
115 // Invokes the specified instance, static, or closure function. | 123 // Invokes the specified instance, static, or closure function. |
116 // On success, returns a RawInstance. On failure, a RawError. | 124 // On success, returns a RawInstance. On failure, a RawError. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // | 175 // |
168 // Returns null on success, a RawError on failure. | 176 // Returns null on success, a RawError on failure. |
169 static RawObject* MapSetAt(const Instance& map, | 177 static RawObject* MapSetAt(const Instance& map, |
170 const Instance& key, | 178 const Instance& key, |
171 const Instance& value); | 179 const Instance& value); |
172 }; | 180 }; |
173 | 181 |
174 } // namespace dart | 182 } // namespace dart |
175 | 183 |
176 #endif // VM_DART_ENTRY_H_ | 184 #endif // VM_DART_ENTRY_H_ |
OLD | NEW |