OO 语言的堆对象表示
作为我硕士论文的一部分,我正在为我所在大学开发的面向对象语言编写一个编译器。目前编译器输出在虚拟机上运行的汇编程序。虚拟机处理堆栈操作、对象生成、堆管理和垃圾收集等所有事务。
我的编译器的目标架构是类似 MIPS 的 CPU。
我正在寻找开发对象布局的策略以及在运行时实现和触发垃圾收集的想法。我当然可以分析 GCC 如何用 C++ 实现这一点,但我更希望有人指出一些好的出版物/资源。
As part of my masters thesis I am writing a compiler for an object oriented language that was developed at my home university. Currently the compiler outputs assembler that runs on a virtual machine. The virtual machine handles all things like stack operations, object generation, heap management and garbage collection.
Target architecture for my compiler is a MIPS-alike CPU.
I am searching for strategies to develop an object layout and ideas to implement and trigger garbage collection during runtime. I could of course analyze how GCC implements this with C++, but I'd prefer to be pointed to some good publications/ressources.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读 Python 的内部对象管理。他们使用引用计数并在引用计数为零时处置对象。
这是一个较旧的(但仍然有用)文档: http://docs.python .org/release/2.5.2/ext/refcounts.html
这是一般内容:http:// /en.wikipedia.org/wiki/Reference_counting
还有更多:http:// /code.google.com/p/augustus/wiki/OptionalGarbageCollection
Read up on Python's internal object management. They use reference counting and dispose of objects when the reference count goes to zero.
Here's an older (but still helpful) document: http://docs.python.org/release/2.5.2/ext/refcounts.html
Here's general stuff: http://en.wikipedia.org/wiki/Reference_counting
And some more: http://code.google.com/p/augustus/wiki/OptionalGarbageCollection