| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 DART_EXPORT const char* Dart_VersionString(); | 576 DART_EXPORT const char* Dart_VersionString(); |
| 577 | 577 |
| 578 /** | 578 /** |
| 579 * Isolate specific flags are set when creating a new isolate using the | 579 * Isolate specific flags are set when creating a new isolate using the |
| 580 * Dart_IsolateFlags structure. | 580 * Dart_IsolateFlags structure. |
| 581 * | 581 * |
| 582 * Current version of flags is encoded in a 32-bit integer with 16 bits used | 582 * Current version of flags is encoded in a 32-bit integer with 16 bits used |
| 583 * for each part. | 583 * for each part. |
| 584 */ | 584 */ |
| 585 | 585 |
| 586 #define DART_FLAGS_CURRENT_VERSION (0x00000002) | 586 #define DART_FLAGS_CURRENT_VERSION (0x00000003) |
| 587 | 587 |
| 588 typedef struct { | 588 typedef struct { |
| 589 int32_t version; | 589 int32_t version; |
| 590 bool enable_type_checks; | 590 bool enable_type_checks; |
| 591 bool enable_asserts; | 591 bool enable_asserts; |
| 592 bool enable_error_on_bad_type; | 592 bool enable_error_on_bad_type; |
| 593 bool enable_error_on_bad_override; | 593 bool enable_error_on_bad_override; |
| 594 bool use_field_guards; | 594 bool use_field_guards; |
| 595 bool use_osr; | 595 bool use_osr; |
| 596 bool use_dart_frontend; |
| 596 } Dart_IsolateFlags; | 597 } Dart_IsolateFlags; |
| 597 | 598 |
| 598 /** | 599 /** |
| 599 * An isolate creation and initialization callback function. | 600 * An isolate creation and initialization callback function. |
| 600 * | 601 * |
| 601 * This callback, provided by the embedder, is called when the vm | 602 * This callback, provided by the embedder, is called when the vm |
| 602 * needs to create an isolate. The callback should create an isolate | 603 * needs to create an isolate. The callback should create an isolate |
| 603 * by calling Dart_CreateIsolate and load any scripts required for | 604 * by calling Dart_CreateIsolate and load any scripts required for |
| 604 * execution. | 605 * execution. |
| 605 * | 606 * |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 * | 757 * |
| 757 * \return The embedder must return a handle to a Uint8List containing an | 758 * \return The embedder must return a handle to a Uint8List containing an |
| 758 * uncompressed tar archive or null. | 759 * uncompressed tar archive or null. |
| 759 */ | 760 */ |
| 760 typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)(); | 761 typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)(); |
| 761 | 762 |
| 762 /** | 763 /** |
| 763 * The current version of the Dart_InitializeFlags. Should be incremented every | 764 * The current version of the Dart_InitializeFlags. Should be incremented every |
| 764 * time Dart_InitializeFlags changes in a binary incompatible way. | 765 * time Dart_InitializeFlags changes in a binary incompatible way. |
| 765 */ | 766 */ |
| 766 #define DART_INITIALIZE_PARAMS_CURRENT_VERSION (0x00000002) | 767 #define DART_INITIALIZE_PARAMS_CURRENT_VERSION (0x00000003) |
| 767 | 768 |
| 768 /** | 769 /** |
| 769 * Describes how to initialize the VM. Used with Dart_Initialize. | 770 * Describes how to initialize the VM. Used with Dart_Initialize. |
| 770 * | 771 * |
| 771 * \param version Identifies the version of the struct used by the client. | 772 * \param version Identifies the version of the struct used by the client. |
| 772 * should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION. | 773 * should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION. |
| 773 * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate | 774 * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate |
| 774 * or NULL if no snapshot is provided. | 775 * or NULL if no snapshot is provided. |
| 775 * \param instructions_snapshot A buffer containing a snapshot of precompiled | 776 * \param instructions_snapshot A buffer containing a snapshot of precompiled |
| 776 * instructions, or NULL if no snapshot is provided. | 777 * instructions, or NULL if no snapshot is provided. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 791 Dart_IsolateCreateCallback create; | 792 Dart_IsolateCreateCallback create; |
| 792 Dart_IsolateShutdownCallback shutdown; | 793 Dart_IsolateShutdownCallback shutdown; |
| 793 Dart_IsolateCleanupCallback cleanup; | 794 Dart_IsolateCleanupCallback cleanup; |
| 794 Dart_ThreadExitCallback thread_exit; | 795 Dart_ThreadExitCallback thread_exit; |
| 795 Dart_FileOpenCallback file_open; | 796 Dart_FileOpenCallback file_open; |
| 796 Dart_FileReadCallback file_read; | 797 Dart_FileReadCallback file_read; |
| 797 Dart_FileWriteCallback file_write; | 798 Dart_FileWriteCallback file_write; |
| 798 Dart_FileCloseCallback file_close; | 799 Dart_FileCloseCallback file_close; |
| 799 Dart_EntropySource entropy_source; | 800 Dart_EntropySource entropy_source; |
| 800 Dart_GetVMServiceAssetsArchive get_service_assets; | 801 Dart_GetVMServiceAssetsArchive get_service_assets; |
| 802 bool start_kernel_isolate; |
| 801 } Dart_InitializeParams; | 803 } Dart_InitializeParams; |
| 802 | 804 |
| 803 /** | 805 /** |
| 804 * Initializes the VM. | 806 * Initializes the VM. |
| 805 * | 807 * |
| 806 * \param flags A struct containing initialization information. The version | 808 * \param flags A struct containing initialization information. The version |
| 807 * field of the struct must be DART_INITIALIZE_PARAMS_CURRENT_VERSION. | 809 * field of the struct must be DART_INITIALIZE_PARAMS_CURRENT_VERSION. |
| 808 * | 810 * |
| 809 * \return NULL if initialization is successful. Returns an error message | 811 * \return NULL if initialization is successful. Returns an error message |
| 810 * otherwise. The caller is responsible for freeing the error message. | 812 * otherwise. The caller is responsible for freeing the error message. |
| (...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3348 * compiled with DART_PRECOMPILED_RUNTIME). | 3350 * compiled with DART_PRECOMPILED_RUNTIME). |
| 3349 */ | 3351 */ |
| 3350 DART_EXPORT bool Dart_IsPrecompiledRuntime(); | 3352 DART_EXPORT bool Dart_IsPrecompiledRuntime(); |
| 3351 | 3353 |
| 3352 /** | 3354 /** |
| 3353 * Print a native stack trace. Used for crash handling. | 3355 * Print a native stack trace. Used for crash handling. |
| 3354 */ | 3356 */ |
| 3355 DART_EXPORT void Dart_DumpNativeStackTrace(void* context); | 3357 DART_EXPORT void Dart_DumpNativeStackTrace(void* context); |
| 3356 | 3358 |
| 3357 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 3359 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
| OLD | NEW |