Skip to content
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

Code analysis, Common subexpression elimination #18

Closed
leventov opened this issue Sep 18, 2014 · 9 comments
Closed

Code analysis, Common subexpression elimination #18

leventov opened this issue Sep 18, 2014 · 9 comments

Comments

@leventov
Copy link
Contributor

Does the CodeModel project or particularly this fork contain any functionality like code analysis and performing simple optimizations, for exampe common subexpression elimination? If not, how do you think how difficult it could be to implement this and how friendly for such analysis/transformations the current API/library design/impl is?

@phax
Copy link
Owner

phax commented Sep 18, 2014

Unfortunately it does not support such advanced features. Compare to the original implementation it offers a more open API that lets you access most fields and modify or retrieve them, so that you have better control when creating code.
I think in general the API is suitable, but this is surely not an easy task to achieve.
Any contributions are welcome :)

@leventov
Copy link
Contributor Author

I will try to investigate this.

@phax
Copy link
Owner

phax commented Sep 18, 2014

👍

leventov added a commit to leventov/jcodemodel that referenced this issue Oct 6, 2014
leventov added a commit to leventov/jcodemodel that referenced this issue Oct 6, 2014
@leventov
Copy link
Contributor Author

In addition to field reads, array element reads and method calls, casts and divisions should be eliminated, bacause Java compilers are probably also not allowed to optimize them in certain cases, to throw ClassCastException, NullPointerException (on casts of null to primitive type) or ArithmeticException (on division by zero) at the "right" moment.

@phax
Copy link
Owner

phax commented Oct 23, 2014

Great work so far. Unfortunately I cannot help you much with this, because this is absolutely not my expertise and I'm busy with tons of other things. But keep up the good work, and I'm happy to merge new updates!

@leventov
Copy link
Contributor Author

@phax I haven't abandoned this because I will actually use this, but also very busy. Probably I will finish this at some moment within next couple of months.

@phax
Copy link
Owner

phax commented Aug 29, 2015

Any update on this one???

@leventov
Copy link
Contributor Author

@phax unfortunately no, for two reasons:

@phax
Copy link
Owner

phax commented Aug 29, 2015

Thanks for the update.
That means I could potentially revert your changes :)

All the best for your projects!

@phax phax closed this as completed Aug 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants