-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add optimization phase #1047
base: main
Are you sure you want to change the base?
Changes from 6 commits
bf955e7
b297ab2
50af1d5
c5d8678
e9f02f5
34b82b6
90bcde3
39ce816
d0e55d7
274182e
0c47ed9
c9e02f3
deb9e74
d9e7549
e33d97e
21578bc
9fb7586
4ee15ce
d60dd12
270b867
f859692
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,16 @@ | |
"default": false, | ||
"description": "False by default. If set to true, enables generation of a getter the information on the interfaces provided by the contract.\n\nRead more about supported interfaces: https://docs.tact-lang.org/ref/evolution/OTP-001." | ||
}, | ||
"skipTactOptimizationPhase": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "False by default. If set to true, skips the Tact code optimization phase." | ||
}, | ||
"dumpOptimizedTactCode": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "False by default. If set to true, dumps the code produced by the Tact code optimization phase. In case the optimization phase is skipped, this option is ignored." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Smooth" (in math sense) behavior would be to dump the code anyway, yet unoptimized. "Dump the optimized code" is just another separate optional compilation step that happens to be in the list after "optimize" step. |
||
}, | ||
"experimental": { | ||
"type": "object", | ||
"description": "Experimental options that might be removed in the future. Use with caution!", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -960,7 +960,7 @@ export class Interpreter { | |
if (foundContractConst.value !== undefined) { | ||
return foundContractConst.value; | ||
} else { | ||
throwErrorConstEval( | ||
throwNonFatalErrorConstEval( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I don't understand this change, and I suspect a future reader wouldn't either. When do we throw non-fatal errors in general? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When we want to stop the constant evaluation, but continue compiling the rest of the contract. Like, when not being able to compute something at compile-time with ability to fallback to run-time implementation for that something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, but the current pipeline kinda relies on throwing and catching errors and not on errors as values |
||
`cannot evaluate declared contract/trait constant ${idTextErr(ast.field)} as it does not have a body`, | ||
ast.field.loc, | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
irrelevant change