diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt index 25796e06ab42..ea343170995f 100644 --- a/pkg/front_end/test/spell_checking_list_code.txt +++ b/pkg/front_end/test/spell_checking_list_code.txt @@ -34,6 +34,7 @@ alexmarkov aligned alive allocate +allocator altered analogous analogy diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart index 97b91dd2fd77..a4246748ba89 100644 --- a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart +++ b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart @@ -20,8 +20,9 @@ class Coordinate extends Struct { Pointer next; - factory Coordinate.allocate(double x, double y, Pointer next) { - return allocate().ref + factory Coordinate.allocate( + Allocator allocator, double x, double y, Pointer next) { + return allocator().ref ..x = x ..y = y ..next = next; diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline.expect b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline.expect index e4af7293fe74..299f7842b9eb 100644 --- a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline.expect +++ b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline.expect @@ -8,7 +8,8 @@ class Coordinate extends Struct { @Double() double y; Pointer next; - factory Coordinate.allocate(double x, double y, Pointer next) {} + factory Coordinate.allocate( + Allocator allocator, double x, double y, Pointer next) {} } main() {} diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline_modelled.expect index a7af7c28f82a..2f9972271889 100644 --- a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline_modelled.expect +++ b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.textual_outline_modelled.expect @@ -8,7 +8,8 @@ class Coordinate extends Struct { double x; @Double() double y; - factory Coordinate.allocate(double x, double y, Pointer next) {} + factory Coordinate.allocate( + Allocator allocator, double x, double y, Pointer next) {} } main() {} diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.expect b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.expect index 0b7ee1a711cd..3d65f9e7307c 100644 --- a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.expect +++ b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.expect @@ -2,7 +2,6 @@ library; import self as self; import "dart:ffi" as ffi; import "dart:core" as core; -import "package:ffi/src/allocation.dart" as all; import "dart:ffi"; import "package:ffi/ffi.dart"; @@ -13,8 +12,8 @@ class Coordinate extends ffi::Struct { @#C1 field core::double* y = null; field ffi::Pointer* next = null; - static factory allocate(core::double* x, core::double* y, ffi::Pointer* next) → self::Coordinate* { - return let final self::Coordinate* #t1 = ffi::StructPointer|get#ref(all::allocate()) in block { + static factory allocate(ffi::Allocator* allocator, core::double* x, core::double* y, ffi::Pointer* next) → self::Coordinate* { + return let final self::Coordinate* #t1 = ffi::StructPointer|get#ref(ffi::AllocatorAlloc|call(allocator)) in block { #t1.{self::Coordinate::x} = x; #t1.{self::Coordinate::y} = y; #t1.{self::Coordinate::next} = next; diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.transformed.expect index ce991f15fe20..ce1ae9de011e 100644 --- a/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/general_nnbd_opt_out/ffi_sample.dart.weak.transformed.expect @@ -2,7 +2,6 @@ library; import self as self; import "dart:core" as core; import "dart:ffi" as ffi; -import "package:ffi/src/allocation.dart" as all; import "dart:ffi"; import "package:ffi/ffi.dart"; @@ -16,8 +15,8 @@ class Coordinate extends ffi::Struct { constructor #fromTypedDataBase(dynamic #pointer) → dynamic : super ffi::Struct::_fromPointer(#pointer) ; - static factory allocate(core::double* x, core::double* y, ffi::Pointer* next) → self::Coordinate* { - return let final self::Coordinate* #t1 = ffi::StructPointer|get#ref(all::allocate()) in block { + static factory allocate(ffi::Allocator* allocator, core::double* x, core::double* y, ffi::Pointer* next) → self::Coordinate* { + return let final self::Coordinate* #t1 = ffi::StructPointer|get#ref(ffi::AllocatorAlloc|call(allocator)) in block { #t1.{self::Coordinate::x} = x; #t1.{self::Coordinate::y} = y; #t1.{self::Coordinate::next} = next; diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart b/pkg/front_end/testcases/nnbd/ffi_sample.dart index 0c7f87021b41..c45b492185fd 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart @@ -18,8 +18,9 @@ class Coordinate extends Struct { external Pointer next; - factory Coordinate.allocate(double x, double y, Pointer next) { - return allocate().ref + factory Coordinate.allocate( + Allocator allocator, double x, double y, Pointer next) { + return allocator().ref ..x = x ..y = y ..next = next; diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart.outline.expect b/pkg/front_end/testcases/nnbd/ffi_sample.dart.outline.expect index 915c14230834..ad4664a1c1ae 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart.outline.expect +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart.outline.expect @@ -17,7 +17,7 @@ class Coordinate extends ffi::Struct { external set y(core::double #externalFieldValue) → void; external get next() → ffi::Pointer; external set next(ffi::Pointer #externalFieldValue) → void; - static factory allocate(core::double x, core::double y, ffi::Pointer next) → self::Coordinate + static factory allocate(ffi::Allocator allocator, core::double x, core::double y, ffi::Pointer next) → self::Coordinate ; } static method main() → dynamic diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.expect b/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.expect index d0832bc305dd..ff9675365210 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.expect +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.expect @@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/; import self as self; import "dart:ffi" as ffi; import "dart:core" as core; -import "package:ffi/src/allocation.dart" as all; import "dart:ffi"; import "package:ffi/ffi.dart"; @@ -18,8 +17,8 @@ class Coordinate extends ffi::Struct { external set y(core::double #externalFieldValue) → void; external get next() → ffi::Pointer; external set next(ffi::Pointer #externalFieldValue) → void; - static factory allocate(core::double x, core::double y, ffi::Pointer next) → self::Coordinate { - return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(all::allocate()) in block { + static factory allocate(ffi::Allocator allocator, core::double x, core::double y, ffi::Pointer next) → self::Coordinate { + return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(ffi::AllocatorAlloc|call(allocator)) in block { #t1.{self::Coordinate::x} = x; #t1.{self::Coordinate::y} = y; #t1.{self::Coordinate::next} = next; diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.transformed.expect index 4719e5071489..601d9fb70378 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart.strong.transformed.expect @@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/; import self as self; import "dart:core" as core; import "dart:ffi" as ffi; -import "package:ffi/src/allocation.dart" as all; import "dart:ffi"; import "package:ffi/ffi.dart"; @@ -32,8 +31,8 @@ class Coordinate extends ffi::Struct { return ffi::_fromAddress(ffi::_loadIntPtr(this.{ffi::Struct::_addressOf}, (#C18).{core::List::[]}(ffi::_abi()))); set next(ffi::Pointer #externalFieldValue) → void return ffi::_storeIntPtr(this.{ffi::Struct::_addressOf}, (#C18).{core::List::[]}(ffi::_abi()), #externalFieldValue.{ffi::Pointer::address}); - static factory allocate(core::double x, core::double y, ffi::Pointer next) → self::Coordinate { - return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(all::allocate()) in block { + static factory allocate(ffi::Allocator allocator, core::double x, core::double y, ffi::Pointer next) → self::Coordinate { + return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(ffi::AllocatorAlloc|call(allocator)) in block { #t1.{self::Coordinate::x} = x; #t1.{self::Coordinate::y} = y; #t1.{self::Coordinate::next} = next; diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline.expect index f21ecbe9864d..326d793fd1ae 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline.expect +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline.expect @@ -7,7 +7,8 @@ class Coordinate extends Struct { @Double() external double y; external Pointer next; - factory Coordinate.allocate(double x, double y, Pointer next) {} + factory Coordinate.allocate( + Allocator allocator, double x, double y, Pointer next) {} } main() {} diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline_modelled.expect index 263267c1ba74..88e9317f72ac 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline_modelled.expect +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart.textual_outline_modelled.expect @@ -7,7 +7,8 @@ class Coordinate extends Struct { external double x; @Double() external double y; - factory Coordinate.allocate(double x, double y, Pointer next) {} + factory Coordinate.allocate( + Allocator allocator, double x, double y, Pointer next) {} } main() {} diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.expect b/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.expect index d0832bc305dd..ff9675365210 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.expect +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.expect @@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/; import self as self; import "dart:ffi" as ffi; import "dart:core" as core; -import "package:ffi/src/allocation.dart" as all; import "dart:ffi"; import "package:ffi/ffi.dart"; @@ -18,8 +17,8 @@ class Coordinate extends ffi::Struct { external set y(core::double #externalFieldValue) → void; external get next() → ffi::Pointer; external set next(ffi::Pointer #externalFieldValue) → void; - static factory allocate(core::double x, core::double y, ffi::Pointer next) → self::Coordinate { - return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(all::allocate()) in block { + static factory allocate(ffi::Allocator allocator, core::double x, core::double y, ffi::Pointer next) → self::Coordinate { + return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(ffi::AllocatorAlloc|call(allocator)) in block { #t1.{self::Coordinate::x} = x; #t1.{self::Coordinate::y} = y; #t1.{self::Coordinate::next} = next; diff --git a/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.transformed.expect index 4719e5071489..601d9fb70378 100644 --- a/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/nnbd/ffi_sample.dart.weak.transformed.expect @@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/; import self as self; import "dart:core" as core; import "dart:ffi" as ffi; -import "package:ffi/src/allocation.dart" as all; import "dart:ffi"; import "package:ffi/ffi.dart"; @@ -32,8 +31,8 @@ class Coordinate extends ffi::Struct { return ffi::_fromAddress(ffi::_loadIntPtr(this.{ffi::Struct::_addressOf}, (#C18).{core::List::[]}(ffi::_abi()))); set next(ffi::Pointer #externalFieldValue) → void return ffi::_storeIntPtr(this.{ffi::Struct::_addressOf}, (#C18).{core::List::[]}(ffi::_abi()), #externalFieldValue.{ffi::Pointer::address}); - static factory allocate(core::double x, core::double y, ffi::Pointer next) → self::Coordinate { - return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(all::allocate()) in block { + static factory allocate(ffi::Allocator allocator, core::double x, core::double y, ffi::Pointer next) → self::Coordinate { + return let final self::Coordinate #t1 = ffi::StructPointer|get#ref(ffi::AllocatorAlloc|call(allocator)) in block { #t1.{self::Coordinate::x} = x; #t1.{self::Coordinate::y} = y; #t1.{self::Coordinate::next} = next;