This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +76
-4
lines changed
runtime/vm/compiler/backend Expand file tree Collapse file tree 5 files changed +76
-4
lines changed Original file line number Diff line number Diff line change @@ -1613,6 +1613,10 @@ void FlowGraph::ValidatePhis() {
16131613 return ;
16141614 }
16151615
1616+ // Current_context_var is never pruned, it is artificially kept alive, so
1617+ // it should not be checked here.
1618+ const intptr_t current_context_var_index = CurrentContextEnvIndex ();
1619+
16161620 for (intptr_t i = 0 , n = preorder ().length (); i < n; ++i) {
16171621 BlockEntryInstr* block_entry = preorder ()[i];
16181622 Instruction* last_instruction = block_entry->last_instruction ();
@@ -1624,7 +1628,7 @@ void FlowGraph::ValidatePhis() {
16241628 if (successor->phis () != NULL ) {
16251629 for (intptr_t j = 0 ; j < successor->phis ()->length (); ++j) {
16261630 PhiInstr* phi = (*successor->phis ())[j];
1627- if (phi == nullptr ) {
1631+ if (phi == nullptr && j != current_context_var_index ) {
16281632 // We have no phi node for the this variable.
16291633 // Double check we do not have a different value in our env.
16301634 // If we do, we would have needed a phi-node in the successsor.
Original file line number Diff line number Diff line change @@ -651,8 +651,8 @@ class LivenessAnalysis : public ValueObject {
651651 const GrowableArray<BlockEntryInstr*>& postorder_;
652652
653653 // Live-out sets for each block. They contain indices of variables
654- // that are live out from this block: that is values that were either
655- // defined in this block or live into it and that are used in some
654+ // that are live out from this block. That is values that were (1) either
655+ // defined in this block or live into it, and (2) that are used in some
656656 // successor block.
657657 GrowableArray<BitVector*> live_out_;
658658
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
2+ // for details. All rights reserved. Use of this source code is governed by a
3+ // BSD-style license that can be found in the LICENSE file.
4+ //
5+ // VMOptions=--optimization-counter-threshold=100 --deterministic
6+ //
7+ // The Dart Project Fuzz Tester (1.89).
8+ // Program generated as:
9+ // dart dartfuzz.dart --seed 928581289 --no-fp --ffi --no-flat
10+ //
11+ // Minimized.
12+
13+ @pragma ('vm:never-inline' )
14+ void main2 (bool ? boolParam) {
15+ for (int i = 0 ; i < 200 ; i++ ) {
16+ final bool1 = boolParam ?? false ;
17+ if (bool1) {
18+ () {
19+ // Force creating a new current context.
20+ i.toString ();
21+ };
22+ // Force having multiple paths to the exit, popping the current context.
23+ break ;
24+ }
25+ }
26+ }
27+
28+ void main () {
29+ // Test OSR.
30+ main2 (null );
31+
32+ // Test non-OSR.
33+ main2 (null );
34+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
2+ // for details. All rights reserved. Use of this source code is governed by a
3+ // BSD-style license that can be found in the LICENSE file.
4+ //
5+ // VMOptions=--optimization-counter-threshold=100 --deterministic
6+ //
7+ // The Dart Project Fuzz Tester (1.89).
8+ // Program generated as:
9+ // dart dartfuzz.dart --seed 928581289 --no-fp --ffi --no-flat
10+ //
11+ // Minimized.
12+
13+ @pragma ('vm:never-inline' )
14+ void main2 (bool boolParam) {
15+ for (int i = 0 ; i < 200 ; i++ ) {
16+ final bool1 = boolParam ?? false ;
17+ if (bool1) {
18+ () {
19+ // Force creating a new current context.
20+ i.toString ();
21+ };
22+ // Force having multiple paths to the exit, popping the current context.
23+ break ;
24+ }
25+ }
26+ }
27+
28+ void main () {
29+ // Test OSR.
30+ main2 (null );
31+
32+ // Test non-OSR.
33+ main2 (null );
34+ }
Original file line number Diff line number Diff line change @@ -27,5 +27,5 @@ CHANNEL dev
2727MAJOR 2
2828MINOR 14
2929PATCH 0
30- PRERELEASE 69
30+ PRERELEASE 70
3131PRERELEASE_PATCH 0
You can’t perform that action at this time.
0 commit comments