| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const Function& function, | 47 const Function& function, |
| 48 const GrowableArray<const Object*>& arguments, | 48 const GrowableArray<const Object*>& arguments, |
| 49 const Array& optional_arguments_names); | 49 const Array& optional_arguments_names); |
| 50 | 50 |
| 51 // Invoke the specified closure object. | 51 // Invoke the specified closure object. |
| 52 // On success, returns a RawInstance. On failure, a RawError. | 52 // On success, returns a RawInstance. On failure, a RawError. |
| 53 static RawObject* InvokeClosure( | 53 static RawObject* InvokeClosure( |
| 54 const Closure& closure, | 54 const Closure& closure, |
| 55 const GrowableArray<const Object*>& arguments, | 55 const GrowableArray<const Object*>& arguments, |
| 56 const Array& optional_arguments_names); | 56 const Array& optional_arguments_names); |
| 57 |
| 58 // Allocate and return an arguments descriptor. |
| 59 // Let 'num_names' be the length of 'optional_arguments_names'. |
| 60 // Treat the first 'num_arguments - num_names' arguments as positional and |
| 61 // treat the following 'num_names' arguments as named optional arguments. |
| 62 static const Array& ArgumentsDescriptor( |
| 63 int num_arguments, |
| 64 const Array& optional_arguments_names); |
| 57 }; | 65 }; |
| 58 | 66 |
| 59 | 67 |
| 60 // Utility functions to call from VM into Dart bootstrap libraries. | 68 // Utility functions to call from VM into Dart bootstrap libraries. |
| 61 // Each may return an exception object. | 69 // Each may return an exception object. |
| 62 class DartLibraryCalls : public AllStatic { | 70 class DartLibraryCalls : public AllStatic { |
| 63 public: | 71 public: |
| 64 // On success, returns a RawInstance. On failure, a RawError. | 72 // On success, returns a RawInstance. On failure, a RawError. |
| 65 static RawObject* ExceptionCreate( | 73 static RawObject* ExceptionCreate( |
| 66 const Library& library, | 74 const Library& library, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 | 98 |
| 91 // Gets the _id field of a SendPort/ReceivePort. | 99 // Gets the _id field of a SendPort/ReceivePort. |
| 92 // | 100 // |
| 93 // Returns the value of _id on success, a RawError on failure. | 101 // Returns the value of _id on success, a RawError on failure. |
| 94 static RawObject* PortGetId(const Instance& port); | 102 static RawObject* PortGetId(const Instance& port); |
| 95 }; | 103 }; |
| 96 | 104 |
| 97 } // namespace dart | 105 } // namespace dart |
| 98 | 106 |
| 99 #endif // VM_DART_ENTRY_H_ | 107 #endif // VM_DART_ENTRY_H_ |
| OLD | NEW |