add little bit docs
This commit is contained in:
parent
17023fdeb1
commit
357490ff5f
@ -19,8 +19,8 @@ And thus parfait can be used at run-time.
|
|||||||
|
|
||||||
It's too simple: just slips off the mind like a fish into water.
|
It's too simple: just slips off the mind like a fish into water.
|
||||||
|
|
||||||
Parfait has a brother, the Builtin module. Builtin contains everything that can not be coded in ruby,
|
Parfait has a brother, the Builtin module. Builtin contains everything that can not be coded in
|
||||||
but we still need (things like List access).
|
ruby, but we still need (things like List access).
|
||||||
|
|
||||||
### Vm vs language- core
|
### Vm vs language- core
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# A method object is a description of the method, it's name etc
|
# A typed method object is a description of the method, it's name etc
|
||||||
#
|
#
|
||||||
# But the code that the method represents, the binary, is held as an array
|
# But the code that the method represents, the binary, is held as an array
|
||||||
# in one of these.
|
# in one of these.
|
||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
module Parfait
|
module Parfait
|
||||||
# obviously not a "Word" but a ByteArray , but no such class yet
|
# obviously not a "Word" but a ByteArray , but no such class yet
|
||||||
# As String on the other hand has no encoding (yet) it is close enough
|
# As our String (Word) on the other hand has no encoding (yet) it is close enough
|
||||||
class BinaryCode < Word
|
class BinaryCode < Word
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
# A Page (from the traditionally a memory page) represents a collection of
|
# A Page (from the traditional memory page) represents a collection of
|
||||||
# objects in a physically form. Ie the page holds the memory or data, that
|
# objects in a physically form. Ie the page holds the memory or data, that
|
||||||
# the objects are made up of.
|
# the objects are made up of.
|
||||||
|
|
||||||
# Pages have a total size, but more importantly and object size.
|
# Pages have a total size, but more importantly an object size.
|
||||||
# All objects of a Page are same sized, and multiples of the smallest
|
# All objects of a Page are same sized, and multiples of the smallest
|
||||||
# object. The smallest object is usually a cache line, 16 bytes or
|
# object. The smallest object is usually a cache line, 16 bytes or
|
||||||
# an exponent of two larger.
|
# an exponent of two larger.
|
||||||
|
@ -6,21 +6,20 @@
|
|||||||
# meaning one RubyMethod (untyped) has many TypedMethod implementations.
|
# meaning one RubyMethod (untyped) has many TypedMethod implementations.
|
||||||
# The RubyMethod only holds ruby code, no binary.
|
# The RubyMethod only holds ruby code, no binary.
|
||||||
|
|
||||||
# For reflection also holds arguments and such
|
# The Typed method has the following instance variables
|
||||||
|
# - name : This is the same as the ruby method name it implements
|
||||||
|
# - source: is currently the ast (or string) that represents the "code". This is historic
|
||||||
|
# and will change to the RubyMethod that it implements
|
||||||
|
# - instructions: The sequence of instructions the source (ast) was compiled to
|
||||||
|
# Instructions derive from class Instruction and form a linked list
|
||||||
|
# - binary: The binary (jumpable) code that the instructions get assembled into
|
||||||
|
# - arguments: A List of Variables that can/are passed
|
||||||
|
# - locals: A List of Variables that the method has
|
||||||
|
# - for_class: The class the Method is for (TODO, should be Type)
|
||||||
|
|
||||||
#
|
|
||||||
|
|
||||||
module Parfait
|
module Parfait
|
||||||
|
|
||||||
# static description of a method
|
|
||||||
# name
|
|
||||||
# arguments
|
|
||||||
# known local variable names
|
|
||||||
# executable code
|
|
||||||
|
|
||||||
# ps, the compiler injects its own info
|
|
||||||
|
|
||||||
|
|
||||||
class TypedMethod < Object
|
class TypedMethod < Object
|
||||||
|
|
||||||
attributes [:name , :source , :instructions , :binary ,:arguments , :for_class, :locals ]
|
attributes [:name , :source , :instructions , :binary ,:arguments , :for_class, :locals ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user