| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 * for details. All rights reserved. Use of this source code is governed by a | 3 * for details. All rights reserved. Use of this source code is governed by a |
| 4 * BSD-style license that can be found in the LICENSE file. | 4 * BSD-style license that can be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef RUNTIME_INCLUDE_DART_API_H_ | 7 #ifndef RUNTIME_INCLUDE_DART_API_H_ |
| 8 #define RUNTIME_INCLUDE_DART_API_H_ | 8 #define RUNTIME_INCLUDE_DART_API_H_ |
| 9 | 9 |
| 10 /** \mainpage Dart Embedding API Reference | 10 /** \mainpage Dart Embedding API Reference |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 568 |
| 569 /** | 569 /** |
| 570 * Gets the version string for the Dart VM. | 570 * Gets the version string for the Dart VM. |
| 571 * | 571 * |
| 572 * The version of the Dart VM can be accessed without initializing the VM. | 572 * The version of the Dart VM can be accessed without initializing the VM. |
| 573 * | 573 * |
| 574 * \return The version string for the embedded Dart VM. | 574 * \return The version string for the embedded Dart VM. |
| 575 */ | 575 */ |
| 576 DART_EXPORT const char* Dart_VersionString(); | 576 DART_EXPORT const char* Dart_VersionString(); |
| 577 | 577 |
| 578 typedef struct { |
| 579 const char* library_uri; |
| 580 const char* class_name; |
| 581 const char* function_name; |
| 582 } Dart_QualifiedFunctionName; |
| 583 |
| 578 /** | 584 /** |
| 579 * Isolate specific flags are set when creating a new isolate using the | 585 * Isolate specific flags are set when creating a new isolate using the |
| 580 * Dart_IsolateFlags structure. | 586 * Dart_IsolateFlags structure. |
| 581 * | 587 * |
| 582 * Current version of flags is encoded in a 32-bit integer with 16 bits used | 588 * Current version of flags is encoded in a 32-bit integer with 16 bits used |
| 583 * for each part. | 589 * for each part. |
| 584 */ | 590 */ |
| 585 | 591 |
| 586 #define DART_FLAGS_CURRENT_VERSION (0x00000003) | 592 #define DART_FLAGS_CURRENT_VERSION (0x00000004) |
| 587 | 593 |
| 588 typedef struct { | 594 typedef struct { |
| 589 int32_t version; | 595 int32_t version; |
| 590 bool enable_type_checks; | 596 bool enable_type_checks; |
| 591 bool enable_asserts; | 597 bool enable_asserts; |
| 592 bool enable_error_on_bad_type; | 598 bool enable_error_on_bad_type; |
| 593 bool enable_error_on_bad_override; | 599 bool enable_error_on_bad_override; |
| 594 bool use_field_guards; | 600 bool use_field_guards; |
| 595 bool use_osr; | 601 bool use_osr; |
| 596 bool use_dart_frontend; | 602 bool use_dart_frontend; |
| 603 bool obfuscate; |
| 604 Dart_QualifiedFunctionName* entry_points; |
| 597 } Dart_IsolateFlags; | 605 } Dart_IsolateFlags; |
| 598 | 606 |
| 607 DART_EXPORT void Dart_IsolateFlagsInitialize(Dart_IsolateFlags* flags); |
| 608 |
| 599 /** | 609 /** |
| 600 * An isolate creation and initialization callback function. | 610 * An isolate creation and initialization callback function. |
| 601 * | 611 * |
| 602 * This callback, provided by the embedder, is called when the vm | 612 * This callback, provided by the embedder, is called when the vm |
| 603 * needs to create an isolate. The callback should create an isolate | 613 * needs to create an isolate. The callback should create an isolate |
| 604 * by calling Dart_CreateIsolate and load any scripts required for | 614 * by calling Dart_CreateIsolate and load any scripts required for |
| 605 * execution. | 615 * execution. |
| 606 * | 616 * |
| 607 * When the function returns false, it is the responsibility of this | 617 * When the function returns false, it is the responsibility of this |
| 608 * function to ensure that Dart_ShutdownIsolate has been called if | 618 * function to ensure that Dart_ShutdownIsolate has been called if |
| (...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3185 * - are running the same Dart program | 3195 * - are running the same Dart program |
| 3186 * - are built from the same version of the VM | 3196 * - are built from the same version of the VM |
| 3187 * - agree on whether type checks and assertions are enabled | 3197 * - agree on whether type checks and assertions are enabled |
| 3188 * | 3198 * |
| 3189 * \return Returns an error handler if the VM was built in a mode that does not | 3199 * \return Returns an error handler if the VM was built in a mode that does not |
| 3190 * support saving JIT feedback. | 3200 * support saving JIT feedback. |
| 3191 */ | 3201 */ |
| 3192 DART_EXPORT Dart_Handle Dart_SaveJITFeedback(uint8_t** buffer, | 3202 DART_EXPORT Dart_Handle Dart_SaveJITFeedback(uint8_t** buffer, |
| 3193 intptr_t* buffer_length); | 3203 intptr_t* buffer_length); |
| 3194 | 3204 |
| 3195 typedef struct { | |
| 3196 const char* library_uri; | |
| 3197 const char* class_name; | |
| 3198 const char* function_name; | |
| 3199 } Dart_QualifiedFunctionName; | |
| 3200 | |
| 3201 /** | 3205 /** |
| 3202 * Compiles all functions reachable from the provided entry points and marks | 3206 * Compiles all functions reachable from the provided entry points and marks |
| 3203 * the isolate to disallow future compilation. | 3207 * the isolate to disallow future compilation. |
| 3204 * | 3208 * |
| 3205 * \param entry_points A list of functions that may be invoked through the | 3209 * \param entry_points A list of functions that may be invoked through the |
| 3206 * embedding API, e.g. Dart_Invoke/GetField/SetField/New/InvokeClosure. | 3210 * embedding API, e.g. Dart_Invoke/GetField/SetField/New/InvokeClosure. |
| 3207 * | 3211 * |
| 3208 * \param reset_fields Controls whether static fields are reset. Fields without | 3212 * \param reset_fields Controls whether static fields are reset. Fields without |
| 3209 * an initializer will be set to null, and fields with an initializer will have | 3213 * an initializer will be set to null, and fields with an initializer will have |
| 3210 * their initializer run the next time they are accessed. | 3214 * their initializer run the next time they are accessed. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3329 * compiled with DART_PRECOMPILED_RUNTIME). | 3333 * compiled with DART_PRECOMPILED_RUNTIME). |
| 3330 */ | 3334 */ |
| 3331 DART_EXPORT bool Dart_IsPrecompiledRuntime(); | 3335 DART_EXPORT bool Dart_IsPrecompiledRuntime(); |
| 3332 | 3336 |
| 3333 /** | 3337 /** |
| 3334 * Print a native stack trace. Used for crash handling. | 3338 * Print a native stack trace. Used for crash handling. |
| 3335 */ | 3339 */ |
| 3336 DART_EXPORT void Dart_DumpNativeStackTrace(void* context); | 3340 DART_EXPORT void Dart_DumpNativeStackTrace(void* context); |
| 3337 | 3341 |
| 3338 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 3342 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
| OLD | NEW |