-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[vm] Recognize unmodifiabled typed data views."
This reverts commit d1112d3. Reason for revert: b/242043014 Original change's description: > [vm] Recognize unmodifiabled typed data views. > > These types now work with Dart_TypedDataAcquireData. > > The presence of these types no longer degrades the performance of typed data indexed loads. > > The presence of these types degrades the performance of typed data indexed stores much less. The performance of indexed stores is somewhat regressed if these types were not used. > > TEST=ci > Bug: #32028 > Bug: #40924 > Bug: #42785 > Change-Id: I05ac5c9543f6f61ac37533b9efe511254778caed > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253700 > Reviewed-by: Aske Simon Christensen <askesc@google.com> > Reviewed-by: Martin Kustermann <kustermann@google.com> > Commit-Queue: Ryan Macnak <rmacnak@google.com> TBR=kustermann@google.com,rmacnak@google.com,askesc@google.com TEST=ci Change-Id: I32c1c460fc30c51bc0d42e7cfaafe72bf5630069 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: #32028 Bug: #40924 Bug: #42785 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254560 Reviewed-by: Siva Annamalai <asiva@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
- Loading branch information
1 parent
b7439ef
commit 10bf1cf
Showing
57 changed files
with
3,006 additions
and
5,886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
runtime/tests/vm/dart/typed_data_aot_not_inlining_il_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2021, 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. | ||
|
||
// This test asserts that we are not inlining accesses to typed data interfaces | ||
// (e.g. Uint8List) if there are instantiated 3rd party classes (e.g. | ||
// UnmodifiableUint8ListView). | ||
|
||
import 'dart:typed_data'; | ||
import 'package:vm/testing/il_matchers.dart'; | ||
|
||
createThirdPartyUint8List() => UnmodifiableUint8ListView(Uint8List(10)); | ||
|
||
@pragma('vm:never-inline') | ||
@pragma('vm:testing:print-flow-graph') | ||
void foo(Uint8List list, int from) { | ||
if (from >= list.length) { | ||
list[from]; | ||
} | ||
} | ||
|
||
void matchIL$foo(FlowGraph graph) { | ||
graph.match([ | ||
match.block('Graph'), | ||
match.block('Function', [ | ||
'list' << match.Parameter(index: 0), | ||
'from' << match.Parameter(index: 1), | ||
'v13' << match.LoadClassId('list'), | ||
match.PushArgument('list'), | ||
match.DispatchTableCall('v13', selector_name: 'get:length'), | ||
match.Branch(match.RelationalOp(match.any, match.any, kind: '>='), | ||
ifTrue: 'B3'), | ||
]), | ||
'B3' << | ||
match.block('Target', [ | ||
'v15' << match.LoadClassId('list'), | ||
match.PushArgument('list'), | ||
match.PushArgument(/* BoxInt64(Parameter) or Parameter */), | ||
match.DispatchTableCall('v15', selector_name: '[]'), | ||
]), | ||
]); | ||
} | ||
|
||
void main() { | ||
foo(int.parse('1') == 1 ? createThirdPartyUint8List() : Uint8List(1), | ||
int.parse('0')); | ||
} |
47 changes: 47 additions & 0 deletions
47
runtime/tests/vm/dart_2/typed_data_aot_not_inlining_il_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2021, 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. | ||
|
||
// This test asserts that we are not inlining accesses to typed data interfaces | ||
// (e.g. Uint8List) if there are instantiated 3rd party classes (e.g. | ||
// UnmodifiableUint8ListView). | ||
|
||
import 'dart:typed_data'; | ||
import 'package:vm/testing/il_matchers.dart'; | ||
|
||
createThirdPartyUint8List() => UnmodifiableUint8ListView(Uint8List(10)); | ||
|
||
@pragma('vm:never-inline') | ||
@pragma('vm:testing:print-flow-graph') | ||
void foo(Uint8List list, int from) { | ||
if (from >= list.length) { | ||
list[from]; | ||
} | ||
} | ||
|
||
void matchIL$foo(FlowGraph graph) { | ||
graph.match([ | ||
match.block('Graph'), | ||
match.block('Function', [ | ||
'list' << match.Parameter(index: 0), | ||
'from' << match.Parameter(index: 1), | ||
'v13' << match.LoadClassId('list'), | ||
match.PushArgument('list'), | ||
match.DispatchTableCall('v13', selector_name: 'get:length'), | ||
match.Branch(match.RelationalOp(match.any, match.any, kind: '>='), | ||
ifTrue: 'B3'), | ||
]), | ||
'B3' << | ||
match.block('Target', [ | ||
'v15' << match.LoadClassId('list'), | ||
match.PushArgument('list'), | ||
match.PushArgument(/* BoxInt64(Parameter) or Parameter */), | ||
match.DispatchTableCall('v15', selector_name: '[]'), | ||
]), | ||
]); | ||
} | ||
|
||
void main() { | ||
foo(int.parse('1') == 1 ? createThirdPartyUint8List() : Uint8List(1), | ||
int.parse('0')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.