Roll Dart to f1ebe2bd5cfcb6b522e5b4fd406cdabb1a2d2091. (flutter/engine#4800)
This commit is contained in:
@@ -418,7 +418,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
|
||||
clazz.constructors.forEach(handleConstructor);
|
||||
}
|
||||
|
||||
Program _computeFullProgram(Program deltaProgram) {
|
||||
Component _computeFullProgram(Component deltaProgram) {
|
||||
final Set<Library> libraries = new Set<Library>();
|
||||
final List<Library> workList = <Library>[];
|
||||
for (Library library in deltaProgram.libraries) {
|
||||
@@ -434,7 +434,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Program()..libraries.addAll(libraries);
|
||||
return new Component()..libraries.addAll(libraries);
|
||||
}
|
||||
|
||||
/// Transform the given [program].
|
||||
@@ -442,7 +442,7 @@ class WidgetCreatorTracker implements ProgramTransformer {
|
||||
/// It is safe to call this method on a delta program generated as part of
|
||||
/// performing a hot reload.
|
||||
@override
|
||||
void transform(Program program) {
|
||||
void transform(Component program) {
|
||||
final List<Library> libraries = program.libraries;
|
||||
|
||||
if (libraries.isEmpty) {
|
||||
|
||||
@@ -139,29 +139,13 @@ bool DartController::SendStartMessage(Dart_Handle root_library,
|
||||
return LogIfError(result);
|
||||
}
|
||||
|
||||
static void CopyVectorBytes(const std::vector<uint8_t>& vector,
|
||||
uint8_t*& bytes) {
|
||||
bytes = (uint8_t*)malloc(vector.size());
|
||||
memcpy(bytes, vector.data(), vector.size());
|
||||
}
|
||||
|
||||
static void ReleaseFetchedBytes(uint8_t* buffer) {
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
tonic::DartErrorHandleType DartController::RunFromKernel(
|
||||
const std::vector<uint8_t>& kernel,
|
||||
const std::string& entrypoint) {
|
||||
tonic::DartState::Scope scope(dart_state());
|
||||
tonic::DartErrorHandleType error = tonic::kNoError;
|
||||
if (Dart_IsNull(Dart_RootLibrary())) {
|
||||
// Copy kernel bytes and pass ownership of the copy to the Dart_LoadKernel,
|
||||
// which is expected to release them.
|
||||
uint8_t* kernel_bytes = nullptr;
|
||||
CopyVectorBytes(kernel, kernel_bytes);
|
||||
|
||||
Dart_Handle result = Dart_LoadKernel(Dart_ReadKernelBinary(
|
||||
kernel_bytes, kernel.size(), ReleaseFetchedBytes));
|
||||
Dart_Handle result = Dart_LoadScriptFromKernel(kernel.data(), kernel.size());
|
||||
LogIfError(result);
|
||||
error = tonic::GetErrorHandleType(result);
|
||||
}
|
||||
|
||||
@@ -396,10 +396,8 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
|
||||
|
||||
if (!kernel_data.empty()) {
|
||||
// We are running kernel code.
|
||||
uint8_t* kernel_buf = static_cast<uint8_t*>(malloc(kernel_data.size()));
|
||||
memcpy(kernel_buf, kernel_data.data(), kernel_data.size());
|
||||
FXL_CHECK(!LogIfError(Dart_LoadKernel(Dart_ReadKernelBinary(
|
||||
kernel_buf, kernel_data.size(), ReleaseFetchedBytes))));
|
||||
FXL_CHECK(!LogIfError(Dart_LoadScriptFromKernel(kernel_data.data(),
|
||||
kernel_data.size())));
|
||||
} else if (!snapshot_data.empty()) {
|
||||
// We are running from a script snapshot.
|
||||
FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(),
|
||||
|
||||
Reference in New Issue
Block a user