In the development of modern programming languages, how to efficiently generate and maintain abstract syntax trees (AST) is the key to improve the ability of program design and optimization. Abstract syntax trees not only play a core role in compilers, but also are widely used in code refactoring, performance analysis and other automation fields. With the popularity of multi-core processors, concurrent programming has become an important means to improve performance, and the choice of threading mechanism is very important to the efficiency and maintainability of programs. Therefore, it is of practical significance to design a framework for automatically generating and maintaining abstract syntax trees to help code optimization. This paper proposes an automatic abstract syntax tree generation and maintenance framework for multithreading in Java language. It uses static code analysis to transform and optimize the thread model, especially in the process of migrating traditional thread model to efficient thread pool framework. The framework automatically completes code refactoring and performance improvement by parsing program structure layer by layer. Through the experimental evaluation in Eclipse environment, the results show that the framework can quickly complete the transformation of thread mechanism, significantly improve the efficiency of concurrent program development, optimize the performance and maintainability of programs, and provide a new idea of parallel programming in multi-core processor environment.
Boyang Liu (Thu,) studied this question.