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

【优化】对IL代码中出现的变量名作优化 #4

Open
bd4sur opened this issue Sep 2, 2019 · 0 comments
Open

【优化】对IL代码中出现的变量名作优化 #4

bd4sur opened this issue Sep 2, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@bd4sur
Copy link
Owner

bd4sur commented Sep 2, 2019

特性描述:目前,变量名是直接以原始形式被保留在编译得到的AIL代码中,这很冗长,且字符串形式的变量名并不利于后续的处理。因此,有必要将IL代码中出现的变量,全部替换为全局唯一的数字形式(变量编号),这样VM就可以使用数组之类的简单数据结构去实现闭包,也便于以后用C语言实现VM。

实现思路:在适当位置保留变量名与变量编号的映射表,也就是所谓的符号表。

@bd4sur bd4sur added the enhancement New feature or request label Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant