Skip to content

Commit

Permalink
Version 3.6.0-241.0.dev
Browse files Browse the repository at this point in the history
Merge f725998 into dev
  • Loading branch information
Dart CI committed Sep 11, 2024
2 parents db77a42 + f725998 commit 8b46d2e
Show file tree
Hide file tree
Showing 37 changed files with 958 additions and 685 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ deps = {
Var("dart_root") + "/third_party/gsutil": {
"packages": [{
"package": "infra/3pp/tools/gsutil",
"version": "version:2@5.5",
"version": "version:3@5.30",
}],
"dep_type": "cipd",
},
Expand Down
3 changes: 2 additions & 1 deletion runtime/bin/io_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ void IOServiceCallback(Dart_Port dest_port_id, Dart_CObject* message) {
}

Dart_Port IOService::GetServicePort() {
return Dart_NewNativePort("IOService", IOServiceCallback, true);
return Dart_NewConcurrentNativePort("IOService", IOServiceCallback,
/*max_concurrency=*/32);
}

void FUNCTION_NAME(IOService_NewServicePort)(Dart_NativeArguments args) {
Expand Down
3 changes: 2 additions & 1 deletion runtime/bin/io_service_no_ssl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void IOServiceCallback(Dart_Port dest_port_id, Dart_CObject* message) {
}

Dart_Port IOService::GetServicePort() {
return Dart_NewNativePort("IOService", IOServiceCallback, true);
return Dart_NewConcurrentNativePort("IOService", IOServiceCallback,
/*max_concurrency=*/32);
}

void FUNCTION_NAME(IOService_NewServicePort)(Dart_NativeArguments args) {
Expand Down
74 changes: 38 additions & 36 deletions runtime/include/dart_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
#endif

#if __GNUC__
#define DART_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#define DART_DEPRECATED(msg) __attribute__((deprecated(msg)))
#define DART_API_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#define DART_API_DEPRECATED(msg) __attribute__((deprecated(msg)))
#elif _MSC_VER
#define DART_WARN_UNUSED_RESULT _Check_return_
#define DART_DEPRECATED(msg) __declspec(deprecated(msg))
#define DART_API_WARN_UNUSED_RESULT _Check_return_
#define DART_API_DEPRECATED(msg) __declspec(deprecated(msg))
#else
#define DART_WARN_UNUSED_RESULT
#define DART_DEPRECATED(msg)
#define DART_API_WARN_UNUSED_RESULT
#define DART_API_DEPRECATED(msg)
#endif

/*
Expand Down Expand Up @@ -1000,7 +1000,7 @@ typedef struct {
* \return NULL if initialization is successful. Returns an error message
* otherwise. The caller is responsible for freeing the error message.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Initialize(
DART_EXPORT DART_API_WARN_UNUSED_RESULT char* Dart_Initialize(
Dart_InitializeParams* params);

/**
Expand All @@ -1012,7 +1012,7 @@ DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Initialize(
* NOTE: This function must not be called on a thread that was created by the VM
* itself.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Cleanup(void);
DART_EXPORT DART_API_WARN_UNUSED_RESULT char* Dart_Cleanup(void);

/**
* Sets command line flags. Should be called before Dart_Initialize.
Expand All @@ -1025,8 +1025,9 @@ DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Cleanup(void);
*
* NOTE: This call does not store references to the passed in c-strings.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_SetVMFlags(int argc,
const char** argv);
DART_EXPORT DART_API_WARN_UNUSED_RESULT char* Dart_SetVMFlags(
int argc,
const char** argv);

/**
* Returns true if the named VM flag is of boolean type, specified, and set to
Expand Down Expand Up @@ -1480,7 +1481,7 @@ DART_EXPORT void Dart_ExitIsolate(void);
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateSnapshot(uint8_t** vm_snapshot_data_buffer,
intptr_t* vm_snapshot_data_size,
uint8_t** isolate_snapshot_data_buffer,
Expand Down Expand Up @@ -1510,7 +1511,7 @@ DART_EXPORT bool Dart_IsKernel(const uint8_t* buffer, intptr_t buffer_size);
* \return NULL if successful. Returns an error message otherwise. The caller
* is responsible for freeing the error message.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_IsolateMakeRunnable(
DART_EXPORT DART_API_WARN_UNUSED_RESULT char* Dart_IsolateMakeRunnable(
Dart_Isolate isolate);

/*
Expand Down Expand Up @@ -1680,7 +1681,7 @@ DART_EXPORT Dart_Handle Dart_GetStickyError(void);
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_HandleMessage(void);
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle Dart_HandleMessage(void);

/**
* Handles any pending messages for the vm service for the current
Expand Down Expand Up @@ -1720,7 +1721,7 @@ DART_EXPORT bool Dart_HasServiceMessages(void);
* exception or other error occurs while processing messages, an
* error handle is returned.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_RunLoop(void);
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle Dart_RunLoop(void);

/**
* Lets the VM run message processing for the isolate.
Expand All @@ -1740,7 +1741,7 @@ DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_RunLoop(void);
* of its message loop. If not successful the caller retains ownership of the
* isolate.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT bool Dart_RunLoopAsync(
DART_EXPORT DART_API_WARN_UNUSED_RESULT bool Dart_RunLoopAsync(
bool errors_are_fatal,
Dart_Port on_error_port,
Dart_Port on_exit_port,
Expand Down Expand Up @@ -2785,7 +2786,7 @@ DART_EXPORT Dart_Handle Dart_GetDataFromByteBuffer(Dart_Handle byte_buffer);
* then the new object. If an error occurs during execution, then an
* error handle is returned.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_New(Dart_Handle type,
Dart_Handle constructor_name,
int number_of_arguments,
Expand All @@ -2799,7 +2800,8 @@ Dart_New(Dart_Handle type,
* \return The new object. If an error occurs during execution, then an
* error handle is returned.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_Allocate(Dart_Handle type);
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_Allocate(Dart_Handle type);

/**
* Allocate a new object without invoking a constructor, and sets specified
Expand Down Expand Up @@ -2840,7 +2842,7 @@ Dart_AllocateWithNativeFields(Dart_Handle type,
* successfully, then the return value is returned. If an error
* occurs during execution, then an error handle is returned.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_Invoke(Dart_Handle target,
Dart_Handle name,
int number_of_arguments,
Expand All @@ -2856,7 +2858,7 @@ Dart_Invoke(Dart_Handle target,
* invoking the closure is returned. If an error occurs during
* execution, then an error handle is returned.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_InvokeClosure(Dart_Handle closure,
int number_of_arguments,
Dart_Handle* arguments);
Expand All @@ -2881,7 +2883,7 @@ Dart_InvokeClosure(Dart_Handle closure,
* successfully, then the object is returned. If an error
* occurs during execution, then an error handle is returned.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_InvokeConstructor(Dart_Handle object,
Dart_Handle name,
int number_of_arguments,
Expand All @@ -2907,7 +2909,7 @@ Dart_InvokeConstructor(Dart_Handle object,
* \return If no error occurs, then the value of the field is
* returned. Otherwise an error handle is returned.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_GetField(Dart_Handle container, Dart_Handle name);

/**
Expand All @@ -2930,7 +2932,7 @@ Dart_GetField(Dart_Handle container, Dart_Handle name);
*
* \return A valid handle if no error occurs.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_SetField(Dart_Handle container, Dart_Handle name, Dart_Handle value);

/*
Expand Down Expand Up @@ -3505,7 +3507,7 @@ Dart_SetDeferredLoadHandler(Dart_DeferredLoadHandler handler);
* Requires the current isolate to be the same current isolate during the
* invocation of the Dart_DeferredLoadHandler.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_DeferredLoadComplete(intptr_t loading_unit_id,
const uint8_t* snapshot_data,
const uint8_t* snapshot_instructions);
Expand All @@ -3522,7 +3524,7 @@ Dart_DeferredLoadComplete(intptr_t loading_unit_id,
* Requires the current isolate to be the same current isolate during the
* invocation of the Dart_DeferredLoadHandler.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_DeferredLoadCompleteError(intptr_t loading_unit_id,
const char* error_message,
bool transient);
Expand All @@ -3538,7 +3540,7 @@ Dart_DeferredLoadCompleteError(intptr_t loading_unit_id,
*
* \return A handle to the root library, or an error.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_LoadScriptFromKernel(const uint8_t* kernel_buffer, intptr_t kernel_size);

/**
Expand Down Expand Up @@ -3706,10 +3708,10 @@ DART_EXPORT Dart_Handle Dart_LibraryHandleError(Dart_Handle library,
*
* \return A handle to the main library of the compilation unit, or an error.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_LoadLibraryFromKernel(const uint8_t* kernel_buffer,
intptr_t kernel_buffer_size);
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_LoadLibrary(Dart_Handle kernel_buffer);

/**
Expand All @@ -3725,7 +3727,7 @@ Dart_LoadLibrary(Dart_Handle kernel_buffer);
* \return Success if all classes have been finalized and deferred library
* futures are completed. Otherwise, returns an error.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_FinalizeLoading(bool complete_futures);

/*
Expand Down Expand Up @@ -3994,12 +3996,12 @@ DART_EXPORT Dart_Handle Dart_LoadingUnitLibraryUris(intptr_t loading_unit_id);
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* callback_data,
bool stripped,
void* debug_callback_data);
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppAOTSnapshotAsAssemblies(
Dart_CreateLoadingUnitCallback next_callback,
void* next_callback_data,
Expand Down Expand Up @@ -4034,12 +4036,12 @@ Dart_CreateAppAOTSnapshotAsAssemblies(
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppAOTSnapshotAsElf(Dart_StreamingWriteCallback callback,
void* callback_data,
bool stripped,
void* debug_callback_data);
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppAOTSnapshotAsElfs(Dart_CreateLoadingUnitCallback next_callback,
void* next_callback_data,
bool stripped,
Expand All @@ -4052,7 +4054,7 @@ Dart_CreateAppAOTSnapshotAsElfs(Dart_CreateLoadingUnitCallback next_callback,
* not strip DWARF information from the generated assembly or allow for
* separate debug information.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* callback_data);

Expand All @@ -4063,7 +4065,7 @@ Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses(void);
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses(void);

/**
* Creates a snapshot that caches compiled code and type feedback for faster
Expand All @@ -4086,7 +4088,7 @@ DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses(void);
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppJITSnapshotAsBlobs(uint8_t** isolate_snapshot_data_buffer,
intptr_t* isolate_snapshot_data_size,
uint8_t** isolate_snapshot_instructions_buffer,
Expand All @@ -4101,7 +4103,7 @@ Dart_CreateAppJITSnapshotAsBlobs(uint8_t** isolate_snapshot_data_buffer,
* \return Returns an error handler if the VM was built in a mode that does not
* support obfuscation.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_GetObfuscationMap(uint8_t** buffer, intptr_t* buffer_length);

/**
Expand Down
8 changes: 4 additions & 4 deletions runtime/include/dart_embedder_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace embedder {
//
// Returns true on success and false otherwise, in which case error would
// contain error message.
DART_WARN_UNUSED_RESULT bool InitOnce(char** error);
DART_API_WARN_UNUSED_RESULT bool InitOnce(char** error);

// Cleans up all subsystems of the embedder.
//
Expand Down Expand Up @@ -51,7 +51,7 @@ struct IsolateCreationData {
// script_uri.
// The isolate is created from the given snapshot (might be kernel data or
// app-jit snapshot).
DART_WARN_UNUSED_RESULT Dart_Isolate
DART_API_WARN_UNUSED_RESULT Dart_Isolate
CreateKernelServiceIsolate(const IsolateCreationData& data,
const uint8_t* buffer,
intptr_t buffer_size,
Expand Down Expand Up @@ -81,7 +81,7 @@ struct VmServiceConfiguration {
// is expected to contain all necessary 'vm-service' libraries.
// This method should be used when VM invokes isolate creation callback with
// DART_VM_SERVICE_ISOLATE_NAME as script_uri.
DART_WARN_UNUSED_RESULT Dart_Isolate
DART_API_WARN_UNUSED_RESULT Dart_Isolate
CreateVmServiceIsolate(const IsolateCreationData& data,
const VmServiceConfiguration& config,
const uint8_t* isolate_data,
Expand All @@ -92,7 +92,7 @@ CreateVmServiceIsolate(const IsolateCreationData& data,
// is expected to contain all necessary 'vm-service' libraries.
// This method should be used when VM invokes isolate creation callback with
// DART_VM_SERVICE_ISOLATE_NAME as script_uri.
DART_WARN_UNUSED_RESULT Dart_Isolate
DART_API_WARN_UNUSED_RESULT Dart_Isolate
CreateVmServiceIsolateFromKernel(const IsolateCreationData& data,
const VmServiceConfiguration& config,
const uint8_t* kernel_buffer,
Expand Down
23 changes: 20 additions & 3 deletions runtime/include/dart_native_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,23 @@ typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id,
DART_EXPORT Dart_Port Dart_NewNativePort(const char* name,
Dart_NativeMessageHandler handler,
bool handle_concurrently);
/* TODO(turnidge): Currently handle_concurrently is ignored. */

/**
* Creates a new native port. When messages are received on this
* native port, then they will be dispatched to the provided native
* message handler using up to |max_concurrency| concurrent threads.
*
* \param name The name of this port in debugging messages.
* \param handler The C handler to run when messages arrive on the port.
* \param max_concurrency Size of the thread pool used by the native port.
*
* \return If successful, returns the port id for the native port. In
* case of error, returns ILLEGAL_PORT.
*/
DART_EXPORT Dart_Port
Dart_NewConcurrentNativePort(const char* name,
Dart_NativeMessageHandler handler,
intptr_t max_concurrency);

/**
* Closes the native port with the given id.
Expand All @@ -191,12 +207,13 @@ DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id);
*
* TODO(turnidge): Document.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_CompileAll(void);
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle Dart_CompileAll(void);

/**
* Finalizes all classes.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_FinalizeAllClasses(void);
DART_EXPORT DART_API_WARN_UNUSED_RESULT Dart_Handle
Dart_FinalizeAllClasses(void);

/* This function is intentionally undocumented.
*
Expand Down
2 changes: 1 addition & 1 deletion runtime/include/dart_tools_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ DART_EXPORT Dart_Handle Dart_SetCurrentUserTag(Dart_Handle user_tag);
* \return The UserTag's label. NULL if the user_tag is invalid. The caller is
* responsible for freeing the returned label.
*/
DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_GetUserTagLabel(
DART_EXPORT DART_API_WARN_UNUSED_RESULT char* Dart_GetUserTagLabel(
Dart_Handle user_tag);

/*
Expand Down
Loading

0 comments on commit 8b46d2e

Please sign in to comment.