![]() The full GC is a regular mark-and-sweep: it's marking all reachable objects (old and new), then unmarked old objects get removed (a very cheap operation in a linked list), and new objects (identified by their missing link) are added to the old-space list. This is like Squeak's incremental GC, which only looks at objects in new space. Therefore, unreferenced new objects will be automatically garbage-collected by Javascript. Old space is a linked list of objects, but newly allocated objects are not added to the list, yet. This hybrid GC is a generational GC with an old space and a new space. Only in relatively rare circumstances is a "manual" garbage collection needed. Spur's "immediate" characters are regular objects made unique using a character table.įor garbage collection, I came up with a hybrid scheme: the bulk of the work is delegated to the Javascript garbage collector. Float instances are not stored as words as in Squeak, but have a single "float" property that stores the actual number (and the words are generated on-the-fly when needed). ![]() CompiledMethod instances have both "pointers" and "bytes". Word and byte binary objects store their data in arrays named "bytes" or "words". Instance variables and indexable fields are held in a single array named "pointers". ![]() ![]() SmallIntegers are represented as Javascript numbers, there is no need for tagging. It represents regular Squeak objects as Javascript objects with direct object references. This VM is inspired by Dan Ingalls' "JSqueak/Potato" VM for Java. (work in progress - please visit the SqueakJS project homepage ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |