Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle deoptimizations while a node is being included. (#3327)
- Loading branch information
1 parent
35e127c
commit b3d610f
Showing
9 changed files
with
65 additions
and
6 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
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
3 changes: 3 additions & 0 deletions
3
test/form/samples/conditional-expression-deopzimize-while-included/_config.js
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,3 @@ | ||
module.exports = { | ||
description: 'handles deoptimizations of logical expression while they are inlcuded (#3324)' | ||
}; |
9 changes: 9 additions & 0 deletions
9
test/form/samples/conditional-expression-deopzimize-while-included/_expected.js
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,9 @@ | ||
let isReassigned = false; | ||
|
||
const result = (foo(), reassign() ? first() : second()); | ||
console.log(result); | ||
|
||
function reassign() { | ||
isReassigned = true; | ||
return isReassigned; | ||
} |
9 changes: 9 additions & 0 deletions
9
test/form/samples/conditional-expression-deopzimize-while-included/main.js
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,9 @@ | ||
let isReassigned = false; | ||
|
||
const result = (foo(), reassign() ? first() : second()); | ||
console.log(result); | ||
|
||
function reassign() { | ||
isReassigned = true; | ||
return isReassigned; | ||
} |
3 changes: 3 additions & 0 deletions
3
test/form/samples/logical-expression/deopzimize-while-included/_config.js
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,3 @@ | ||
module.exports = { | ||
description: 'handles deoptimizations of logical expression while they are inlcuded (#3324)' | ||
}; |
15 changes: 15 additions & 0 deletions
15
test/form/samples/logical-expression/deopzimize-while-included/_expected.js
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,15 @@ | ||
let isFirstReassigned = false; | ||
|
||
const result1 = (foo(), isFirstReassigned ); | ||
console.log(result1); | ||
|
||
let isSecondReassigned = false; | ||
|
||
const result2 = (foo(), reassign2() || foo()); | ||
console.log(result1); | ||
|
||
function reassign2() { | ||
// this needs to be included | ||
isSecondReassigned = true; | ||
return isSecondReassigned; | ||
} |
20 changes: 20 additions & 0 deletions
20
test/form/samples/logical-expression/deopzimize-while-included/main.js
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,20 @@ | ||
let isFirstReassigned = false; | ||
|
||
const result1 = (foo(), isFirstReassigned && reassign1()); | ||
console.log(result1); | ||
|
||
function reassign1() { | ||
// this should never be triggered | ||
isFirstReassigned = true; | ||
} | ||
|
||
let isSecondReassigned = false; | ||
|
||
const result2 = (foo(), reassign2() || foo()); | ||
console.log(result1); | ||
|
||
function reassign2() { | ||
// this needs to be included | ||
isSecondReassigned = true; | ||
return isSecondReassigned; | ||
} |