Skip to content

Commit

Permalink
[vm/compiler] Don't drop null initialization on non-Dart objects.
Browse files Browse the repository at this point in the history
TEST=ffi/vmspecific_handle_test on vm-aot-optimization-level-linux-release-x64

Fixes: #55399
Cq-Include-Trybots: luci.dart.try:vm-aot-optimization-level-linux-release-x64-try
Change-Id: I90ef44d6bd678d56a3d183b78a51e80b475a2764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361601
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
  • Loading branch information
sstrickl authored and Commit Queue committed Apr 8, 2024
1 parent b449e99 commit b574dab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/vm/compiler/backend/il.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,8 @@ Instruction* StoreFieldInstr::Canonicalize(FlowGraph* flow_graph) {
// Context objects can be allocated uninitialized as a performance
// optimization in JIT mode - however in AOT mode we always allocate them
// null initialized.
if (is_initialization_ && slot().representation() == kTagged &&
if (is_initialization_ && !slot().has_untagged_instance() &&
slot().representation() == kTagged &&
(!slot().IsContextSlot() ||
!instance()->definition()->IsAllocateUninitializedContext()) &&
value()->BindsToConstantNull()) {
Expand Down

0 comments on commit b574dab

Please sign in to comment.