Skip to content

Commit 56d8d6b

Browse files
CSE Machine: Avoid pushing unnecessary env instructions (exhaustive version) (#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 <henz@comp.nus.edu.sg>
1 parent d3c1191 commit 56d8d6b

File tree

8 files changed

+3109
-3035
lines changed

8 files changed

+3109
-3035
lines changed

src/cse-machine/__tests__/__snapshots__/cse-machine-heap.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7467,7 +7467,7 @@ EnvTree {
74677467
"type": "Literal",
74687468
"value": [Function],
74697469
},
7470-
"isEnvDependent": true,
7470+
"isEnvDependent": false,
74717471
"loc": undefined,
74727472
"optional": false,
74737473
"type": "CallExpression",
@@ -8313,7 +8313,7 @@ EnvTree {
83138313
"type": "Literal",
83148314
"value": [Function],
83158315
},
8316-
"isEnvDependent": true,
8316+
"isEnvDependent": false,
83178317
"loc": undefined,
83188318
"optional": false,
83198319
"type": "CallExpression",
@@ -9258,7 +9258,7 @@ EnvTree {
92589258
"type": "Literal",
92599259
"value": [Function],
92609260
},
9261-
"isEnvDependent": true,
9261+
"isEnvDependent": false,
92629262
"loc": undefined,
92639263
"optional": false,
92649264
"type": "CallExpression",
@@ -10222,7 +10222,7 @@ EnvTree {
1022210222
"type": "Literal",
1022310223
"value": [Function],
1022410224
},
10225-
"isEnvDependent": true,
10225+
"isEnvDependent": false,
1022610226
"loc": undefined,
1022710227
"optional": false,
1022810228
"type": "CallExpression",
@@ -10976,7 +10976,7 @@ EnvTree {
1097610976
"type": "Literal",
1097710977
"value": [Function],
1097810978
},
10979-
"isEnvDependent": true,
10979+
"isEnvDependent": false,
1098010980
"loc": undefined,
1098110981
"optional": false,
1098210982
"type": "CallExpression",
@@ -11229,7 +11229,7 @@ EnvTree {
1122911229
"type": "Literal",
1123011230
"value": [Function],
1123111231
},
11232-
"isEnvDependent": true,
11232+
"isEnvDependent": false,
1123311233
"loc": undefined,
1123411234
"optional": false,
1123511235
"type": "CallExpression",

0 commit comments

Comments
 (0)