Skip to content

Commit

Permalink
Version 2.17.0-69.2.beta
Browse files Browse the repository at this point in the history
* Cherry-pick e4942db to beta
  • Loading branch information
whesse committed Feb 14, 2022
2 parents 65d0119 + 9e16846 commit fa166c2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
3 changes: 2 additions & 1 deletion runtime/vm/compiler/frontend/kernel_to_il.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,8 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfRecognizedMethod(
// Initialize the result's data pointer field.
body += LoadLocal(typed_data_object);
body += LoadLocal(arg_pointer);
body += LoadNativeField(Slot::Pointer_data_field());
body += LoadUntagged(compiler::target::Pointer::data_field_offset());
body += ConvertUntaggedToUnboxed(kUnboxedIntPtr);
body += StoreNativeField(Slot::TypedDataBase_data_field(),
StoreInstanceFieldInstr::Kind::kInitializing,
kNoStoreBarrier);
Expand Down
21 changes: 21 additions & 0 deletions tests/ffi/regress_flutter97301_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Verifies that there are no deoptimizing IntConverter instructions
// used when converting Pointer to TypedData.
// Regression test for https://github.com/flutter/flutter/issues/97301.

import "dart:ffi";
import "package:ffi/ffi.dart";

@pragma("vm:never-inline")
Pointer<Uint32> foo() => calloc(4);

main() {
final Pointer<Uint32> offsetsPtr = foo();

for (var i = 0; i < 2; i++) {
print(offsetsPtr.asTypedList(1));
}
}
23 changes: 23 additions & 0 deletions tests/ffi_2/regress_flutter97301_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Verifies that there are no deoptimizing IntConverter instructions
// used when converting Pointer to TypedData.
// Regression test for https://github.com/flutter/flutter/issues/97301.

// @dart = 2.9

import "dart:ffi";
import "package:ffi/ffi.dart";

@pragma("vm:never-inline")
Pointer<Uint32> foo() => calloc(4);

main() {
final Pointer<Uint32> offsetsPtr = foo();

for (var i = 0; i < 2; i++) {
print(offsetsPtr.asTypedList(1));
}
}
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ MAJOR 2
MINOR 17
PATCH 0
PRERELEASE 69
PRERELEASE_PATCH 1
PRERELEASE_PATCH 2

0 comments on commit fa166c2

Please sign in to comment.