Skip to content

Commit

Permalink
CSE Machine: Avoid pushing unnecessary env instructions (exhaustive v…
Browse files Browse the repository at this point in the history
…ersion) (#1706)

* check if env instruction is necessary

* Add test cases

* Implement helper functions

* Fix format

* Cache isEnvDependent results

* Delete unnecessary comments

* Speed up env dependent checking, approach 2

* merge

* Implement exhaustive environment depedent logic 1

* Modify test cases

* resolve conflict

* fix format

* remove obsolete test cases

* Fix equality check

* Clean up and add a test case

* remove incompatible instr checks

* Double checked the logic

* Fix format

* Remove unused logic and update test cases

---------

Co-authored-by: Martin Henz <[email protected]>
  • Loading branch information
DiligentPenguinn and martin-henz authored Sep 11, 2024
1 parent d3c1191 commit 56d8d6b
Show file tree
Hide file tree
Showing 8 changed files with 3,109 additions and 3,035 deletions.
12 changes: 6 additions & 6 deletions src/cse-machine/__tests__/__snapshots__/cse-machine-heap.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7467,7 +7467,7 @@ EnvTree {
"type": "Literal",
"value": [Function],
},
"isEnvDependent": true,
"isEnvDependent": false,
"loc": undefined,
"optional": false,
"type": "CallExpression",
Expand Down Expand Up @@ -8313,7 +8313,7 @@ EnvTree {
"type": "Literal",
"value": [Function],
},
"isEnvDependent": true,
"isEnvDependent": false,
"loc": undefined,
"optional": false,
"type": "CallExpression",
Expand Down Expand Up @@ -9258,7 +9258,7 @@ EnvTree {
"type": "Literal",
"value": [Function],
},
"isEnvDependent": true,
"isEnvDependent": false,
"loc": undefined,
"optional": false,
"type": "CallExpression",
Expand Down Expand Up @@ -10222,7 +10222,7 @@ EnvTree {
"type": "Literal",
"value": [Function],
},
"isEnvDependent": true,
"isEnvDependent": false,
"loc": undefined,
"optional": false,
"type": "CallExpression",
Expand Down Expand Up @@ -10976,7 +10976,7 @@ EnvTree {
"type": "Literal",
"value": [Function],
},
"isEnvDependent": true,
"isEnvDependent": false,
"loc": undefined,
"optional": false,
"type": "CallExpression",
Expand Down Expand Up @@ -11229,7 +11229,7 @@ EnvTree {
"type": "Literal",
"value": [Function],
},
"isEnvDependent": true,
"isEnvDependent": false,
"loc": undefined,
"optional": false,
"type": "CallExpression",
Expand Down
Loading

0 comments on commit 56d8d6b

Please sign in to comment.