coolc

command module
v0.0.0-...-5e5e2fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2015 License: MIT Imports: 9 Imported by: 0

README

(Yet another) Cool compiler

Build Status

Note: This is not the coolc that outputs BIT. This coolc outputs 32-bit x86 assembly with AT&T (GNU as) syntax.

Calling convention

  • The reciever is pushed onto the stack first, followed by the arguments in the same order that they are listed in the source code. That is, 8(%ebp) is the last argument, 12(%ebp) is the second-last, and so on.
  • The return value is in the AX register.

Memory layout

  • Heap consists of objects end to end.
  • Objects have a tag, a size, and a garbage collector tag, followed by the data of the object. The 3-word header is not included in the size.
  • The tag is either -2 for raw memory (managed by something other than the garbage collector), -1 for garbage, 0 for the end of the heap, or a number from 1 to max_tag, inclusive, for a class type.
  • Each positive tag number has an associated method table, name, and pointer coount.
  • GC tags are negative for certain special cases like permanent objects and garbage, and otherwise contain the number of stack references to the object. Non-garbage objects with a non-zero GC tag are considered roots of the heap.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ast

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL