RSqueak/VM’s documentation¶
Building from Source¶
Common to all systems¶
We have scripts for installing dependencies, building, running the unit tests, and running JIT tests in the .build subdirectory. You need the PyPy source tree, and the rsdl source tree. If you already have all these, run .build/build.py –32bit to build 32-bit VM. Run .build/build.py to compile a 64-bit VM. The script passes all other arguments on to the rpython translator, so you can pass other options.
It will generate a config file .build/buildconfig.ini where you can set your paths. You can also run .build/download_dependencies.py to download the dependencies automatically. You will also need a Python and a C compiler for 32-bit compilation, if you plan to do 32-bit development.
Windows¶
On Windows, you will have to use the C compiler that comes with Visual Studio 2008, because newer ones crash the JIT. It suffices to just install the Microsoft C compiler V90 plus Windows SDK 7. Also, install the Python 2.7 Visual Studio compiler package. The packages provided in the link install it to the default paths. If you already have the compiler and SDK, you can also just update the paths in .build/buildconfig.ini.
Linux¶
RSqueak/VM can currently be compiled in both 32-bit and 64-bit configurations. For 32-bit, you need to use 32-bit python and SDL2 using 32-bit libraries for everything. The easiest way to ensure that is to use a chroot, but you can also install the :i386 versions of the SDL2 dependencies for your distro.
macOS¶
To compile RSqueak/VM for 32-bit, run
export VERSIONER_PYTHON_PREFER_32_BIT=yes
before you run any of the python scripts in the .build directory. You also need to download SDL2 as a framework (homebrew version is not tested). Check the .travis/build-osx.sh if you get stuck anywhere.
Development¶
The .build directory includes several scripts that make development easier. Once you’ve setup your system for building, you can use these to work on the RSqueak/VM.
run.py¶
This script executes RSqueak/VM in hosted mode, that is, it runs on top of a Python interpreter. This is very slow (we recommend using PyPy), but it can be useful to debug specific aspects of the VM quickly. Ideally, you set up an image so that it executes the code that you are interested in early during startup (DisplayScreen class>>startUp is a good candidate) and then you add your breakpoints to the source. You can also pass commandline arguments to the script or tweak the default arguments in the script itself.
Running a “Smalltalk REPL”
When you want to work on primitives or plugins, it is useful to prepare an image a little (for example, make it so test runs print to the console), and then run the following:
pypy .build/run.py --shell <PATH_TO_IMAGE>
This will load the image and dump you in a simple REPL for Smalltalk, but with some commands to help you execute Python code and, in particular, to reload the Python code you write in any plugin or primitive file. Thus, you can run some Smalltalk code, check for errors, change the primitive code, reload it, and try again. This avoids having to reload the image in interpreted mode all the time (which can be slow).
There is an integrated help that you can get by typing !help, and there is limited autocomplete, too.
Note that the REPL only loads the image, but does not process startup. For many things, you might want to run FileStream startUp: true or Delay startUp to get basic I/O working or delays working.
unittests.py¶
The second script that is useful for working on issues regarding the interpreter is unittests.py. By default it runs all tests under the rsqueakvm/test directory (but not those in rsqueakvm/test/jittest/). This is a standalone pytest script, so you can pass arguments or select single test files as you would for pytest.
jittests.py¶
This script requires that you have already built an rsqueak binary and that you have the C Squeak VM installed. It executes the tests in rsqueakvm/test/jittest/ and checks for the JIT output. We use these tests to ensure that development on the VM does not break JIT optimizations.
jit.py¶
This script is useful to figure out what the JIT is doing. Like run.py, it executes the RSqueak/VM in hosted mode, but this time it also simulates the JIT. This is even slower, but allows us to test small code snippets without having to retranslate the entire VM. The code snippets are configured directly in the file. When you run it, it does part of the translation process (but only enough to execute your specific code) and then runs the code. When the JIT kicks in, the compiled loop is shown in a PyGame window. You can then inspect it at your leisure and when you quit the window, the code continues executing. In order for this to work, you need to have pygame and graphviz installed and in your PATH.
shell.py¶
This script sets all the environment variables as if for translating the VM, and the drops you into an interactive Python prompt. You can type terminal() to drop into a system shell (%COMSPEC% on Windows $SHELL or /bin/sh on Unices) which then has all the environment variables set up that you need to do manual partial translations or similar things.
rsqueakvm package¶
Subpackages¶
rsqueakvm.model package¶
Submodules¶
rsqueakvm.model.base module¶
-
class
W_AbstractObjectWithClassReference
(space, w_class)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
Objects with arbitrary class (ie not CompiledMethod, SmallInteger or Float).
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
repr_classname
= 'W_AbstractObjectWithClassReference'¶
-
w_class
= None¶
-
-
class
W_AbstractObjectWithIdentityHash
[source]¶ Bases:
rsqueakvm.model.base.W_Object
Object with explicit hash (ie all except small ints and floats).
-
UNASSIGNED_HASH
= 0¶
-
hash
= 0¶
-
repr_classname
= 'W_AbstractObjectWithIdentityHash'¶
-
-
class
W_Object
[source]¶ Bases:
object
Root of Squeak model, abstract.
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
bytes_per_slot
= 4¶
-
bytesize
()[source]¶ Return bytesize that conforms to Blue Book.
The reported size may differ from the actual size in Spy’s object space, as memory representation varies depending on PyPy translation.
-
fetch
(space, n0)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
has_class
()[source]¶ All Smalltalk objects should have classes. Unfortuantely for bootstrapping the metaclass-cycle and during testing, that is not true for some W_PointersObjects
-
instsize
()[source]¶ Return the number of slots of the object reserved for instance variables (not number of bytes). Only returns something non-zero for W_PointersObjects, because all other classes in this model hierarchy represent varsized classes (except for SmallInteger).
-
is_class
(space)[source]¶ Return true, if the receiver seems to be a class. We can not be completely sure about this (non-class objects might be used as class).
-
is_nil
(space)[source]¶ Return True, if the receiver represents the nil object in the given Object Space.
-
is_same_object
(other)[source]¶ Compare object identity. This should be used instead of directly using is everywhere in the interpreter, in case we ever want to implement it differently (which is useful e.g. for proxies). Also, SmallIntegers and Floats need a different implementation.
-
repr_classname
= 'W_Object'¶
-
size
()[source]¶ Return the number of “slots” or “items” in the receiver object. This means different things for different objects. For ByteObject, this means the number of bytes, for WordObject the number of words, for PointerObject the number of pointers (regardless if it’s varsized or not).
-
rsqueakvm.model.block_closure module¶
-
class
W_BlockClosure
(space, w_outerctxt, startpc, numArgs, size, stack=None)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
bytes_per_slot
= 1¶
-
changed
()¶
-
empty_stack
= []¶
-
fetch
(space, index0)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
instsize
()[source]¶ Return the number of slots of the object reserved for instance variables (not number of bytes). Only returns something non-zero for W_PointersObjects, because all other classes in this model hierarchy represent varsized classes (except for SmallInteger).
-
repr_classname
= 'W_BlockClosure'¶
-
size
()[source]¶ Return the number of “slots” or “items” in the receiver object. This means different things for different objects. For ByteObject, this means the number of bytes, for WordObject the number of words, for PointerObject the number of pointers (regardless if it’s varsized or not).
-
store
(space, index0, w_value)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
varsize
()[source]¶ Return number of slots in the of variable-sized part (not number of bytes). Not necessarily number of bytes. Variable sized objects are those created with #new:.
-
version
= <rsqueakvm.util.version.Version object>¶
-
rsqueakvm.model.character module¶
-
class
W_Character
(value)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
Boxed char value.
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
fetch
(space, n0)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
is_same_object
(other)[source]¶ Compare object identity. This should be used instead of directly using is everywhere in the interpreter, in case we ever want to implement it differently (which is useful e.g. for proxies). Also, SmallIntegers and Floats need a different implementation.
-
repr_classname
= 'W_Character'¶
-
size
()[source]¶ Return the number of “slots” or “items” in the receiver object. This means different things for different objects. For ByteObject, this means the number of bytes, for WordObject the number of words, for PointerObject the number of pointers (regardless if it’s varsized or not).
-
rsqueakvm.model.compiled_methods module¶
-
class
SpurCompiledMethodHeader
(header_word)[source]¶ Bases:
rsqueakvm.model.compiled_methods.CompiledMethodHeader
-
class
V3CompiledMethodHeader
(header_word)[source]¶ Bases:
rsqueakvm.model.compiled_methods.CompiledMethodHeader
-
class
W_CompiledMethod
(space, bytecount=0, header=0)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
My instances are methods suitable for interpretation by the virtual machine. This is the only class in the system whose instances intermix both indexable pointer fields and indexable integer fields.
The current format of a CompiledMethod is as follows:
header (4 bytes) literals (4 bytes each) bytecodes (variable)An optional method trailer can be part of the bytecodes part.
-
at0
(space, index0)¶
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
bytecodeoffset
()¶
-
bytes_per_slot
= 1¶
-
compute_frame_size
()¶
-
constant_compiledin_class
()¶
-
constant_lookup_class
()¶
-
end_pc
()¶
-
fetch_bytecode
(pc)¶
-
getheader
()¶
-
getliteral
(index)¶
-
getliteralsize
()¶
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
literalat0
(space, index0)¶
-
lookup_class
= None¶
-
lookup_selector
= '<unknown>'¶
-
primitive
()¶
-
repr_classname
= 'W_CompiledMethod'¶
-
size
()¶
-
store
(space, index0, w_v)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
tempsize
()¶
-
-
class
W_SpurCompiledMethod
(space, bytecount=0, header=0)[source]¶ Bases:
rsqueakvm.model.compiled_methods.W_CompiledMethod
Handles the specialities of the method header in Spur
rsqueakvm.model.display module¶
-
class
W_16BitDisplayBitmap
(space, size, depth)[source]¶ Bases:
rsqueakvm.model.display.W_DirectDisplayBitmap
-
repr_classname
= 'W_16BitDisplayBitmap'¶
-
-
class
W_32BitDisplayBitmap
(space, size, depth)[source]¶ Bases:
rsqueakvm.model.display.W_DirectDisplayBitmap
-
repr_classname
= 'W_32BitDisplayBitmap'¶
-
-
class
W_DirectDisplayBitmap
(space, size, depth)[source]¶ Bases:
rsqueakvm.model.display.W_DisplayBitmap
-
repr_classname
= 'W_DirectDisplayBitmap'¶
-
-
class
W_DisplayBitmap
(space, size, depth)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
can_become
(w_other)[source]¶ TODO implement _become() for this class. Impossible due to _immutable_fields_?
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
repr_classname
= 'W_DisplayBitmap'¶
-
-
class
W_MappingDisplayBitmap
(space, size, depth)[source]¶ Bases:
rsqueakvm.model.display.W_DisplayBitmap
-
repr_classname
= 'W_MappingDisplayBitmap'¶
-
rsqueakvm.model.numeric module¶
-
class
W_AbstractFloat
(value)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
fetch
(space, n0)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
is_same_object
(other)[source]¶ Compare object identity. This should be used instead of directly using is everywhere in the interpreter, in case we ever want to implement it differently (which is useful e.g. for proxies). Also, SmallIntegers and Floats need a different implementation.
-
size
()[source]¶ Return the number of “slots” or “items” in the receiver object. This means different things for different objects. For ByteObject, this means the number of bytes, for WordObject the number of words, for PointerObject the number of pointers (regardless if it’s varsized or not).
-
-
class
W_Float
(value)[source]¶ Bases:
rsqueakvm.model.numeric.W_AbstractFloat
Boxed float value.
-
repr_classname
= 'W_Float'¶
-
-
class
W_LargeInteger
(space, w_class)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithClassReference
-
bytes_per_slot
= 1¶
-
repr_classname
= 'W_LargeInteger'¶
-
-
class
W_LargeIntegerBig
(space, w_class, value, size=0)[source]¶ Bases:
rsqueakvm.model.numeric.W_LargeInteger
Large integer using rbigints
-
at0
(space, n0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, n0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
repr_classname
= 'W_LargeIntegerBig'¶
-
-
class
W_LargeIntegerWord
(space, w_class, value, size)[source]¶ Bases:
rsqueakvm.model.numeric.W_LargeInteger
-
at0
(space, n0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, n0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
repr_classname
= 'W_LargeIntegerWord'¶
-
-
class
W_MutableFloat
(value)[source]¶ Bases:
rsqueakvm.model.numeric.W_AbstractFloat
Balloon frequently converts 32-bit words into Floats from within the image. If we give a normal W_Float and let Balloon mutate the words to fill it in, we always have to abort any trace because we’re forcing a quasi-immutable. So just for those cases where someone in the image is creating floats using `new’ (in storage_classes.py), we use W_MutableFloat instances, which do not declare they’re value as quasi-immutable.
-
repr_classname
= 'W_MutableFloat'¶
-
-
class
W_MutableSmallInteger
(value)[source]¶ Bases:
rsqueakvm.model.numeric.W_SmallInteger
-
value
¶
-
-
class
W_SmallInteger
(value)[source]¶ Bases:
rsqueakvm.model.base.W_Object
Boxed integer value
-
fillin
(space, g_self)[source]¶ This is only called for Large Integers that for us fit in SmallIntegers
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
is_same_object
(other)[source]¶ Compare object identity. This should be used instead of directly using is everywhere in the interpreter, in case we ever want to implement it differently (which is useful e.g. for proxies). Also, SmallIntegers and Floats need a different implementation.
-
repr_classname
= 'W_SmallInteger'¶
-
value
¶
-
rsqueakvm.model.pointers module¶
-
class
W_PointersObject
(space, w_class, size, weak=False)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
Common object.
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
fetch
(space, n0)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
fetch_all
(space)¶
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
has_class
()[source]¶ All Smalltalk objects should have classes. Unfortuantely for bootstrapping the metaclass-cycle and during testing, that is not true for some W_PointersObjects
-
instsize
()[source]¶ Return the number of slots of the object reserved for instance variables (not number of bytes). Only returns something non-zero for W_PointersObjects, because all other classes in this model hierarchy represent varsized classes (except for SmallInteger).
-
is_class
(space)[source]¶ Return true, if the receiver seems to be a class. We can not be completely sure about this (non-class objects might be used as class).
-
repr_classname
= 'W_PointersObject'¶
-
size
()[source]¶ Return the number of “slots” or “items” in the receiver object. This means different things for different objects. For ByteObject, this means the number of bytes, for WordObject the number of words, for PointerObject the number of pointers (regardless if it’s varsized or not).
-
store
(space, n0, w_value)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
store_all
(space, collection)¶
-
strategy
= None¶
-
unwrap_array
(space)¶
-
rsqueakvm.model.variable module¶
-
class
W_BytesObject
(space, w_class, size)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithClassReference
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
bytes_per_slot
= 1¶
-
getrbigint
()¶
-
repr_classname
= 'W_BytesObject'¶
-
-
class
W_WordsObject
(space, w_class, size)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithClassReference
-
at0
(space, index0)[source]¶ Access variable-sized part, as by Object>>at:.
Return value depends on layout of instance. Byte objects return bytes, word objects return words, pointer objects return pointers. Compiled method are treated special, if index0 within the literalsize returns pointer to literal, otherwise returns byte (ie byte code indexing starts at literalsize).
-
atput0
(space, index0, w_value)[source]¶ Access variable-sized part, as by Object>>at:put:.
Semantics depend on layout of instance. Byte objects set bytes, word objects set words, pointer objects set pointers. Compiled method are treated special, if index0 within the literalsize sets pointer to literal, otherwise patches bytecode (ie byte code indexing starts at literalsize).
-
repr_classname
= 'W_WordsObject'¶
-
size
()[source]¶ Return the number of “slots” or “items” in the receiver object. This means different things for different objects. For ByteObject, this means the number of bytes, for WordObject the number of words, for PointerObject the number of pointers (regardless if it’s varsized or not).
-
unwrap_string
(space)¶
-
Module contents¶
Squeak model.
- W_Object
- W_SmallInteger
- W_MutableSmallInteger
- W_AbstractObjectWithIdentityHash
- W_AbstractFloat
- W_Float W_MutableFloat
W_Character W_PointersObject W_AbstractObjectWithClassReference
- W_LargeInteger
- W_LargeIntegerWord W_LargeIntegerBig
W_BytesObject W_WordsObject
- W_CompiledMethod
- W_SpurCompiledMethod W_PreSpurCompiledMethod
rsqueakvm.plugins package¶
Subpackages¶
rsqueakvm.plugins.database package¶
-
class
W_DBObject
(space, w_class, size, weak=False, w_id=None, cache=None)[source]¶ Bases:
rsqueakvm.model.pointers.W_PointersObject
-
fetch
(space, n0)[source]¶ Access fixed-size part, maybe also variable-sized part (we have to consult the Blue Book).
-
is_same_object
(other)[source]¶ Compare object identity. This should be used instead of directly using is everywhere in the interpreter, in case we ever want to implement it differently (which is useful e.g. for proxies). Also, SmallIntegers and Floats need a different implementation.
-
repr_classname
= 'W_DBObject'¶
-
state
= <rsqueakvm.plugins.database.model.W_DBObject_State instance>¶
-
-
class
CConfig
[source]¶ -
SQLITE_BLOB
= None¶
-
SQLITE_DONE
= None¶
-
SQLITE_FLOAT
= None¶
-
SQLITE_INTEGER
= None¶
-
SQLITE_NULL
= None¶
-
SQLITE_ROW
= None¶
-
SQLITE_TEXT
= None¶
-
rsqueakvm.plugins.immutability package¶
Immutable W_BytesObject Implementation.
-
class
W_Immutable_BytesObject
(space, w_cls, bytes)[source]¶ Bases:
rsqueakvm.model.variable.W_BytesObject
W_BytesObject subclass with immutable bytes.
Immutable W_PointersObject Implementation.
-
POINTERS_CLASSES
¶
A list of all immutable W_PointersObject subclasses. The position of each class in the list correlates to its number of storage slots (0 no storage, 1 has one storage slot, …). The last class in the list is an immutable W_PointersObject subclass with variable storage size.
-
POINTERS_CLASS_ITER
¶
Unrolling iterable of POINTERS_CLASSES.
-
STORAGE_ATTR_TEMPLATE
¶
Storage attribute template.
-
MAX_FIXED_SLOTS
¶
Number of immutable subclasses with fixed number of slots to generate.
-
class
W_AbstractImmutable_PointersObject
(space, w_cls)[source]¶ Bases:
rsqueakvm.model.pointers.W_PointersObject
Abstract W_PointersObject subclass for immutable pointers objects.
-
class
W_Immutable_PointersObject
(space, w_cls, pointers_w)[source]¶ Bases:
rsqueakvm.plugins.immutability.pointers.W_AbstractImmutable_PointersObject
W_PointersObject subclass with immutable storage of variable size.
-
generate_fixed_immutable_subclass
(n_storage)[source]¶ Generate W_PointersObject subclass with immutable storage of fixed size.
Parameters: n_storage – Number of storage slots. Returns: Immutable W_PointersObject subclass with fixed slots.
-
select_immutable_pointers_class
(storage)[source]¶ Select immutable W_PointersObject subclass for a given pointers storage. If there is no immutable W_PointersObject subclass with the right fixed storage size, it returns the immutable subclass with variable storage size.
Parameters: storage – Pointers to store. Returns: Immutable W_PointersObject subclass.
Immutable W_WordsObject Implementation.
-
class
W_Immutable_WordsObject
(space, w_cls, words)[source]¶ Bases:
rsqueakvm.model.variable.W_WordsObject
W_WordsObject subclass with immutable words.
Base functions for ImmutabilityPlugin.
-
WRITE_OPERATIONS
¶
A list of all write operations to be stubbed out by immutable_class(cls) decorator.
rsqueakvm.plugins.vmdebugging package¶
-
class
JitIface
[source]¶ Bases:
rpython.rlib.jit.JitHookInterface
-
after_compile
(debug_info)[source]¶ A hook called after a loop has compiled assembler, called with JitDebugInfo instance. Overwrite for custom behavior
-
after_compile_bridge
(debug_info)[source]¶ A hook called after a bridge is compiled, called with JitDebugInfo instance, overwrite for custom behavior
-
before_compile
(debug_info)[source]¶ A hook called after a loop is optimized, before compiling assembler, called with JitDebugInfo instance. Overwrite for custom behavior
-
before_compile_bridge
(debug_info)[source]¶ A hook called before a bridge is compiled, but after optimizations are performed. Called with instance of debug_info, overwrite for custom behavior
-
on_abort
(reason, jitdriver, greenkey, greenkey_repr, logops, operations)¶
-
on_trace_too_long
(jitdriver, greenkey, greenkey_repr)¶
-
wrapped_compiled_hook
(jitdriver, debug_info, is_bridge)¶
-
Submodules¶
rsqueakvm.plugins.database_plugin module¶
rsqueakvm.plugins.immutability_plugin module¶
RSqueak/VM plugin which provides support for immutable objects.
Immutable objects can be created as copy of existing objects or from a list of arguments. The package ImmutableObjects, located in /repository, needs to be loaded in the image.
-
primitiveImmutableFrom
(interp, s_frame, w_cls, w_obj)[source]¶ Creates an immutable copy of a given Smalltalk object.
Parameters: - interp – The interpreter proxy.
- s_frame – The stack frame.
- w_cls – The imutable objects target class.
- w_obj – The Smalltalk object to produce an immutable copy from.
Returns: An immutable copy of w_obj with class w_cls.
Raises: PrimitiveFailedError
-
primitiveImmutableFromArgs
(interp, s_frame, argcount)[source]¶ Returns an immutable instance of the receiver (which is a class) with all fields initialized with the arguments given.
Parameters: - interp – The interpreter proxy.
- s_frame – The stack frame.
- argcount – The number of arguments.
Returns: An immutable object.
Raises: PrimitiveFailedError
rsqueakvm.plugins.profiler_plugin module¶
rsqueakvm.plugins.ruby_plugin module¶
rsqueakvm.plugins.simulation module¶
rsqueakvm.plugins.socket_plugin module¶
-
class
W_SocketHandle
(family, socketType)[source]¶ Bases:
rsqueakvm.model.base.W_AbstractObjectWithIdentityHash
-
guess_classname
()[source]¶ Get the name of the class of the receiver without using a space. If the shadow of the class of the receiver is not yet initialized, this might not return a correct name.
-
repr_classname
= 'W_SocketHandle'¶
-
-
primitiveSocketCreate3Semaphores
(interp, s_frame, w_rcvr, netType, socketType, rcvBufSize, sendBufSize, sema, readSema, writeSema)[source]¶
rsqueakvm.plugins.squeak_s_s_l module¶
rsqueakvm.plugins.unix_o_s_process_plugin module¶
rsqueakvm.plugins.v_m_debugging module¶
rsqueakvm.plugins.win32_o_s_process_plugin module¶
Module contents¶
-
class
PluginRegistry
[source]¶ Bases:
object
-
disabled_names
= ['RubyPlugin']¶
-
enabled_names
= ['SimulationPlugin', 'FilePlugin', 'ImmutabilityPlugin', 'LargeIntegers', 'LocalePlugin', 'MiscPrimitivePlugin', 'ProfilerPlugin', 'SocketPlugin', 'TailcallPlugin']¶
-
enabled_plugins
= [<rsqueakvm.plugins.simulation.SimulationPlugin object>, <rsqueakvm.plugins.file_plugin.FilePlugin object>, <rsqueakvm.plugins.immutability_plugin.ImmutabilityPlugin object>, <rsqueakvm.plugins.large_integers.LargeIntegers object>, <rsqueakvm.plugins.locale_plugin.LocalePlugin object>, <rsqueakvm.plugins.misc_primitive_plugin.MiscPrimitivePlugin object>, <rsqueakvm.plugins.profiler_plugin.ProfilerPlugin object>, <rsqueakvm.plugins.socket_plugin.SocketPlugin object>, <rsqueakvm.plugins.tailcall_plugin.TailcallPlugin object>]¶
-
rsqueakvm.primitives package¶
Submodules¶
rsqueakvm.primitives.arithmetic module¶
rsqueakvm.primitives.block_closure module¶
rsqueakvm.primitives.constants module¶
rsqueakvm.primitives.control module¶
rsqueakvm.primitives.misc module¶
rsqueakvm.primitives.storage module¶
rsqueakvm.primitives.system module¶
Module contents¶
rsqueakvm.util package¶
Submodules¶
rsqueakvm.util.cells module¶
rsqueakvm.util.progress module¶
rsqueakvm.util.stream module¶
rsqueakvm.util.version module¶
Module contents¶
Submodules¶
rsqueakvm.constants module¶
-
decode_alternate_compiled_method_header
(header)[source]¶ Decode 30-bit method header and apply new format.
(index 0) 16 bits: number of literals (#numLiterals) (index 16) 1 bit: has primitive (index 17) 1 bit: whether a large frame size is needed (#frameSize) (index 18) 6 bits: number of temporary variables (#numTemps) (index 24) 4 bits: number of arguments to the method (#numArgs) (index 28) 2 bits: reserved for an access modifier (00-unused, 01-private, 10-protected, 11-public)
-
decode_compiled_method_header
(header)[source]¶ Decode 30-bit method header and apply new format.
(index 0) 9 bits: main part of primitive number (#primitive) (index 9) 8 bits: number of literals (#numLiterals) (index 17) 1 bit: whether a large frame size is needed (#frameSize) (index 18) 6 bits: number of temporary variables (#numTemps) (index 24) 4 bits: number of arguments to the method (#numArgs) (index 28) 1 bit: high-bit of primitive number (#primitive) (index 29) 1 bit: flag bit, ignored by the VM (#flag)
rsqueakvm.display module¶
-
class
SDLCursorClass
[source]¶ Bases:
object
Cursor modification not yet implemented in RSDL2?
-
cursor_words_to_bytes
(bytenum, words)[source]¶ In Squeak, only the upper 16bits of the cursor form seem to count (I’m guessing because the code was ported over from 16-bit machines), so this ignores the lower 16-bits of each word.
-
instance
= None¶
-
-
class
SDLDisplay
(title, highdpi, software_renderer, altf4quit)[source]¶ Bases:
rsqueakvm.display.NullDisplay
rsqueakvm.error module¶
-
exception
BlockCannotReturnError
(msg='<no message>')[source]¶ Bases:
rsqueakvm.error.SmalltalkException
-
exception_type
= 'BlockCannotReturnError'¶
-
-
exception
CleanExit
(msg='')[source]¶ Bases:
rsqueakvm.error.Exit
-
exception
CorruptImageError
(msg)[source]¶ Bases:
rsqueakvm.error.Exit
-
exception
FatalError
(msg='<no message>')[source]¶ Bases:
rsqueakvm.error.SmalltalkException
-
exception_type
= 'FatalError'¶
-
-
exception
MissingBytecode
(bytecodename)[source]¶ Bases:
rsqueakvm.error.SmalltalkException
Bytecode not implemented yet.
-
exception_type
= 'MissingBytecode'¶
-
-
exception
PrimitiveFailedError
(msg='', name=None)[source]¶ Bases:
rsqueakvm.error.SmalltalkException
-
exception_type
= 'PrimitiveFailedError'¶
-
-
exception
PrimitiveNotYetWrittenError
(msg='', name=None)[source]¶ Bases:
rsqueakvm.error.PrimitiveFailedError
-
exception_type
= 'PrimitiveNotYetWrittenError'¶
-
-
exception
SimulatedPrimitiveFailedError
(msg, w_name, s_class)[source]¶ Bases:
rsqueakvm.error.PrimitiveFailedError
-
exception_type
= 'SimulatedPrimitiveFailedError'¶
-
-
exception
SmalltalkException
(msg='<no message>')[source]¶ Bases:
exceptions.Exception
Base class for Smalltalk exception hierarchy
-
exception_type
= 'SmalltalkException'¶
-
-
exception
UnwrappingError
(msg='', name=None)[source]¶ Bases:
rsqueakvm.error.PrimitiveFailedError
-
exception_type
= 'UnwrappingError'¶
-
-
exception
WrapperException
(msg='', name=None)[source]¶ Bases:
rsqueakvm.error.PrimitiveFailedError
-
exception_type
= 'WrapperException'¶
-
-
exception
WrappingError
(msg='', name=None)[source]¶ Bases:
rsqueakvm.error.PrimitiveFailedError
-
exception_type
= 'WrappingError'¶
-
rsqueakvm.interpreter module¶
-
exception
ContextSwitchException
(s_new_context)[source]¶ Bases:
exceptions.Exception
General Exception that causes the interpreter to leave the current context.
-
type
= 'ContextSwitch'¶
-
-
class
Interpreter
(space, image=None, trace_important=False, trace=False, evented=True, interrupts=True)[source]¶ Bases:
object
-
event_time_now
()[source]¶ Answer the number of milliseconds since the millisecond clock was last reset or rolled over.
-
jit_driver
= <rpython.rlib.jit.JitDriver object>¶
-
resume_driver
= <rpython.rlib.jit.JitDriver object>¶
-
-
exception
LocalReturn
[source]¶ Bases:
rsqueakvm.interpreter.Return
-
exception
NonLocalReturn
(s_home_context)[source]¶ Bases:
rsqueakvm.interpreter.Return
-
exception
NonVirtualReturn
(s_target_context, s_current_context, w_result)[source]¶ Bases:
exceptions.Exception
-
exception
ProcessSwitch
(s_new_context, forced=False)[source]¶ Bases:
rsqueakvm.interpreter.ContextSwitchException
This causes the interpreter to switch the executed context. Triggered when switching the process.
-
type
= 'Process Switch'¶
-
-
exception
StackOverflow
(s_new_context)[source]¶ Bases:
rsqueakvm.interpreter.ContextSwitchException
This causes the current jit-loop to be left, dumping all virtualized objects to the heap. This breaks performance, so it should rarely happen. In case of severe performance problems, execute with -t and check if this occurrs.
-
type
= 'Stack Overflow'¶
-
rsqueakvm.interpreter_bytecodes module¶
rsqueakvm.interpreter_debugging module¶
rsqueakvm.key_constants module¶
rsqueakvm.objspace module¶
-
class
ObjSpace
[source]¶ Bases:
object
-
set_w_display
(w_obj)¶
-
set_w_interrupt_semaphore
(w_obj)¶
-
set_w_jit_hook_receiver
(w_obj)¶
-
set_w_jit_hook_selector
(w_obj)¶
-
set_w_low_space_semaphore
(w_obj)¶
-
set_w_timerSemaphore
(w_obj)¶
-
w_display
()¶
-
w_interrupt_semaphore
()¶
-
w_jit_hook_receiver
()¶
-
w_jit_hook_selector
()¶
-
w_low_space_semaphore
()¶
-
w_timerSemaphore
()¶
-
rsqueakvm.squeakimage module¶
-
class
AncientReader
(imageReader, version, stream, space)[source]¶ Bases:
rsqueakvm.squeakimage.NonSpurReader
Reader strategy for pre-4.0 images
-
class
GenericObject
[source]¶ Bases:
object
Intermediate representation of squeak objects. To establish all pointers as object references, ImageReader creates instances of GenericObject from the image chunks, and uses them as starting point for the actual create of rsqueakvm.model classes.
-
format
¶
-
hash
¶
-
size
¶
-
-
class
ImageChunk
(size, format, classid, hash, data=None)[source]¶ Bases:
object
A chunk knows the information from the header, but the body of the object is not decoded yet.
-
class
ImageReader
(space, stream, logging_enabled=False)[source]¶ Bases:
object
-
chunklist
¶
-
chunks
¶
-
compactclasses
¶
-
intcache
¶
-
-
class
ImageVersion
(magic, is_big_endian, is_64bit, has_closures, has_floats_reversed, is_spur=False)[source]¶ Bases:
object
-
class
NonSpurReader
(imageReader, version, stream, space)[source]¶ Bases:
rsqueakvm.squeakimage.BaseReaderStrategy
-
init_compactclassesarray
()[source]¶ from the blue book (CompiledMethod Symbol Array PseudoContext LargePositiveInteger nil MethodDictionary Association Point Rectangle nil TranslatedMethod BlockContext MethodContext nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil )
-
instantiate
(g_object)[source]¶ - 0 no fields
1 fixed fields only (all containing pointers) 2 indexable fields only (all containing pointers) 3 both fixed and indexable fields (all containing pointers) 4 both fixed and indexable weak fields (all containing pointers).
5 unused 6 indexable word fields only (no pointers) 7 indexable long (64-bit) fields (only in 64-bit images)
8-11 indexable byte fields only (no pointers) (low 2 bits are low 2 bits of size)
- 12-15 compiled methods:
- # of literal oops specified in method header, followed by indexable bytes (same interpretation of low 2 bits as above)
-
-
class
SpurImageWriter
(interp, filename)[source]¶ Bases:
object
-
image_header_size
= 64¶
-
old_to_spur_specs
= [0, 1, 2, 3, 4, -1, 10, 9, 16, 16, 16, 16, 24, 24, 24, 24]¶
-
word_size
= 4¶
-
-
class
SpurReader
(imageReader, version, stream, space)[source]¶ Bases:
rsqueakvm.squeakimage.BaseReaderStrategy
-
FREE_OBJECT_CLASS_INDEX_PUN
= 0¶
-
SLOTS_MASK
= -72057594037927936¶
-
instantiate
(g_object)[source]¶ 0 no fields 1 fixed fields only (all containing pointers) 2 indexable fields only (all containing pointers) 3 both fixed and indexable fields (all containing pointers) 4 indexable weak fields (all containing pointers) 5 fixed weak fields (all containing pointers) 6-8 unused
9 indexable 64 bit fields (no pointers) 10-11 indexable 32 bit fields (no pointers) 12-15 indexable 16 bit fields (no pointers) 16-23 indexable byte fields (no pointers)
for the above, the lower bits are the lower bits of the size- 24-31 compiled methods:
- # of literal oops specified in method header, followed by indexable bytes (same interpretation of low bits as above)
-
rsqueakvm.storage module¶
-
class
AbstractCachingShadow
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.AbstractGenericShadow
Abstract shadow maintaining an empty version object for the underlying Smalltalk object. The version object allows jit-related optimizations.
-
changed
()¶
-
get_storage
(w_self)¶
-
repr_classname
= 'AbstractCachingShadow'¶
-
set_storage
(w_self, storage)¶
-
version
= None¶
-
-
class
AbstractGenericShadow
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.ListStrategy
This class behaves just like a generic list storage strategy, but allows safe subclassing for more specific, non-singleton strategies.
-
become
(w_other)¶
-
get_storage
(w_self)¶
-
is_shadow
()¶
-
onesided_become
(w_other)¶
-
own_fetch
(i)¶
-
own_size
()¶
-
own_store
(i, val)¶
-
promote_if_neccessary
()¶
-
set_storage
(w_self, storage)¶
-
w_self
()¶
-
-
class
AbstractStrategy
(space, w_self, size, w_class)[source]¶ Bases:
object
Subclasses of this handle the information contained in Smalltalk objects. The common API allows to store and fetch elements from object slots. Every object has some kind of storage representation attached. Some subclasses (those with *Shadow in their name) contain additional information, required by the VM. These ‘shadows’ not only manage the memory of their Smalltalk objects, but are also the VM-internal representation of these objects.
-
get_storage
(w_self)¶
-
provides_getname
= False¶
-
repr_classname
= 'AbstractStrategy'¶
-
set_storage
(w_self, storage)¶
-
-
class
AllNilStrategy
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.SimpleStorageStrategy
-
append
(w_self, list_w)¶
-
delete
(w_self, start, end)¶
-
fetch
(w_self, index0)¶
-
fetch_all
(w_self)¶
-
generalized_strategy_for
(value)¶
-
get_storage
(w_self)¶
-
insert
(w_self, index0, list_w)¶
-
instantiate_type
¶ alias of
AllNilStrategy
-
pop
(w_self, index0)¶
-
repr_classname
= 'AllNilStrategy'¶
-
set_storage
(w_self, storage)¶
-
size
(w_self)¶
-
slice
(w_self, start, end)¶
-
store
(w_self, index0, value)¶
-
store_all
(w_self, elements)¶
-
strategy_switched
(w_self)¶
-
-
class
CachedObjectShadow
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.AbstractCachingShadow
A shadow which treats its contents as jit constants as long as the object is not modified.
-
fetch
(arg0, arg1)¶
-
get_storage
(w_self)¶
-
instantiate_type
¶ alias of
CachedObjectShadow
-
repr_classname
= 'CachedObjectShadow'¶
-
set_storage
(w_self, storage)¶
-
-
class
CharacterOrNilStrategy
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.SimpleStorageStrategy
-
append
(w_self, list_w)¶
-
contained_type
¶
-
delete
(w_self, start, end)¶
-
fetch
(w_self, index0)¶
-
fetch_all
(w_self)¶
-
generalized_strategy_for
(value)¶
-
get_storage
(w_self)¶
-
insert
(w_self, start, list_w)¶
-
instantiate_type
¶ alias of
CharacterOrNilStrategy
-
pop
(w_self, index0)¶
-
repr_classname
= 'CharacterOrNilStrategy'¶
-
set_storage
(w_self, storage)¶
-
size
(w_self)¶
-
slice
(w_self, start, end)¶
-
store
(w_self, index0, wrapped_value)¶
-
store_all
(w_self, elements)¶
-
strategy_switched
(w_self)¶
-
-
class
ExtendableStrategyMetaclass
[source]¶ Bases:
rpython.tool.pairtype.extendabletype
,rpython.rlib.rstrategies.rstrategies.StrategyMetaclass
-
class
FloatOrNilStrategy
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.SimpleStorageStrategy
-
append
(w_self, list_w)¶
-
contained_type
¶ alias of
rsqueakvm.model.numeric.W_Float
-
delete
(w_self, start, end)¶
-
fetch
(w_self, index0)¶
-
fetch_all
(w_self)¶
-
generalized_strategy_for
(value)¶
-
get_storage
(w_self)¶
-
insert
(w_self, start, list_w)¶
-
instantiate_type
¶ alias of
FloatOrNilStrategy
-
pop
(w_self, index0)¶
-
repr_classname
= 'FloatOrNilStrategy'¶
-
set_storage
(w_self, storage)¶
-
size
(w_self)¶
-
slice
(w_self, start, end)¶
-
store
(w_self, index0, wrapped_value)¶
-
store_all
(w_self, elements)¶
-
strategy_switched
(w_self)¶
-
tag_float
= 1.7976931348623157e+308¶
-
-
class
ListStrategy
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.SimpleStorageStrategy
-
append
(w_self, list_w)¶
-
delete
(w_self, start, end)¶
-
fetch
(w_self, index0)¶
-
fetch_all
(w_self)¶
-
get_storage
(w_self)¶
-
insert
(w_self, start, list_w)¶
-
instantiate_type
¶ alias of
ListStrategy
-
pop
(w_self, index0)¶
-
repr_classname
= 'ListStrategy'¶
-
set_storage
(w_self, storage)¶
-
size
(w_self)¶
-
slice
(w_self, start, end)¶
-
store_all
(w_self, elements)¶
-
strategy_switched
(w_self)¶
-
-
class
ObserveeShadow
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.AbstractGenericShadow
A generic shadow that notifies a single observer object whenever changes are made.
-
get_storage
(w_self)¶
-
instantiate_type
¶ alias of
ObserveeShadow
-
repr_classname
= 'ObserveeShadow'¶
-
set_storage
(w_self, storage)¶
-
-
class
ShadowMixin
[source]¶ Bases:
object
Shadows are non-singleton strategies. They maintain a backpointer to their shadowed W_PointersObject instance. This is a mixin, because it is used at several places in the class tree.
-
class
SimpleStorageStrategy
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.AbstractStrategy
Singleton strategies handle ‘simple’ object storage in normal objects, without additional VM-internal information. Depending on the data inside an object, different optimizing strategies are used.
-
check_index_fetch
(w_self, index0)¶
-
check_index_range
(w_self, start, end)¶
-
check_index_store
(w_self, index0)¶
-
get_storage
(w_self)¶
-
repr_classname
= 'SimpleStorageStrategy'¶
-
set_storage
(w_self, storage)¶
-
-
class
SmallIntegerOrNilStrategy
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.SimpleStorageStrategy
-
append
(w_self, list_w)¶
-
contained_type
¶
-
delete
(w_self, start, end)¶
-
fetch
(w_self, index0)¶
-
fetch_all
(w_self)¶
-
generalized_strategy_for
(value)¶
-
get_storage
(w_self)¶
-
insert
(w_self, start, list_w)¶
-
instantiate_type
¶ alias of
SmallIntegerOrNilStrategy
-
pop
(w_self, index0)¶
-
repr_classname
= 'SmallIntegerOrNilStrategy'¶
-
set_storage
(w_self, storage)¶
-
size
(w_self)¶
-
slice
(w_self, start, end)¶
-
store
(w_self, index0, wrapped_value)¶
-
store_all
(w_self, elements)¶
-
strategy_switched
(w_self)¶
-
-
class
StrategyFactory
(space)[source]¶ Bases:
rpython.rlib.rstrategies.rstrategies.StrategyFactory
-
instantiate_strategy
(strategy_type, w_class, w_self=None, initial_size=0)[source]¶ Return a functional instance of strategy_type. Overwrite this if you need a non-default constructor. The two additional parameters should be ignored for singleton-strategies.
-
log
(w_self, new_strategy, old_strategy=None, new_element=None)[source]¶ This can be overwritten into a more appropriate call to self.logger.log
-
set_initial_strategy
(w_self, strategy_type, w_class, size, elements=None)[source]¶ Initialize the strategy and storage fields of w_self. This must be called before switch_strategy or any strategy method can be used. elements is an optional list of values initially stored in w_self. If given, then len(elements) == size must hold.
-
-
class
StrongListEntry
(value)[source]¶ Bases:
rsqueakvm.storage.ListEntry
-
class
WeakListEntry
(value)[source]¶ Bases:
rsqueakvm.storage.ListEntry
-
class
WeakListStrategy
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.SimpleStorageStrategy
-
append
(w_self, list_w)¶
-
fetch
(w_self, index0)¶
-
fetch_all
(w_self)¶
-
get_storage
(w_self)¶
-
instantiate_type
¶ alias of
WeakListStrategy
-
pop
(w_self, index0)¶
-
repr_classname
= 'WeakListStrategy'¶
-
set_storage
(w_self, storage)¶
-
size
(w_self)¶
-
slice
(w_self, start, end)¶
-
store_all
(w_self, elements)¶
-
strategy_switched
(w_self)¶
-
rsqueakvm.storage_classes module¶
-
class
ClassShadow
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.AbstractCachingShadow
A shadow for Smalltalk objects that are classes (i.e. used as the class of another Smalltalk object).
-
get_instance_kind
()¶
-
get_storage
(w_self)¶
-
getname
()¶
-
instantiate_type
¶ alias of
ClassShadow
-
instsize
()¶
-
isvariable
()¶
-
lookup
(arg0)¶
-
name
= '??? (incomplete class info)'¶
-
provides_getname
= True¶
-
repr_classname
= 'ClassShadow'¶
-
s_methoddict
()¶
-
s_superclass
()¶
-
set_storage
(w_self, storage)¶
-
w_methoddict
()¶
-
-
exception
ClassShadowError
(msg='<no message>')[source]¶ Bases:
rsqueakvm.error.SmalltalkException
-
exception_type
= 'ClassShadowError'¶
-
-
class
MethodDictionaryShadow
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.AbstractGenericShadow
-
get_storage
(w_self)¶
-
instantiate_type
¶ alias of
MethodDictionaryShadow
-
repr_classname
= 'MethodDictionaryShadow'¶
-
set_storage
(w_self, storage)¶
-
rsqueakvm.storage_contexts module¶
-
class
ContextPartShadow
(space, w_self, size, w_class)[source]¶ Bases:
rsqueakvm.storage.AbstractStrategy
This Shadow handles the entire object storage on its own, ignoring the _storage field in W_PointersObject. The w_self parameter in fetch/store/size etc. is ignored, and the own_fetch/own_store/own_size methods from ShadowMixin should be used instead. This shadow can exist without a W_PointersObject. In order to integrate well with the RPython toolchain (virtualizables and jit), this class actually represents one of two classes, determined by the is_block_context switch.
-
become
(w_other)¶
-
static
build_block_context
(space, s_home, argcnt, pc)¶
-
static
build_method_context
(space, w_method, w_receiver, arguments=[], closure=None, s_fallback=None)¶
-
bytecodePrimAdd
(interp, current_bytecode)¶
-
bytecodePrimAt
(interp, current_bytecode)¶
-
bytecodePrimAtEnd
(interp, current_bytecode)¶
-
bytecodePrimAtPut
(interp, current_bytecode)¶
-
bytecodePrimBitAnd
(interp, current_bytecode)¶
-
bytecodePrimBitOr
(interp, current_bytecode)¶
-
bytecodePrimBitShift
(interp, current_bytecode)¶
-
bytecodePrimBlockCopy
(interp, current_bytecode)¶
-
bytecodePrimClass
(interp, current_bytecode)¶
-
bytecodePrimDiv
(interp, current_bytecode)¶
-
bytecodePrimDivide
(interp, current_bytecode)¶
-
bytecodePrimDo
(interp, current_bytecode)¶
-
bytecodePrimEqual
(interp, current_bytecode)¶
-
bytecodePrimEquivalent
(interp, current_bytecode)¶
-
bytecodePrimGreaterOrEqual
(interp, current_bytecode)¶
-
bytecodePrimGreaterThan
(interp, current_bytecode)¶
-
bytecodePrimLessOrEqual
(interp, current_bytecode)¶
-
bytecodePrimLessThan
(interp, current_bytecode)¶
-
bytecodePrimMakePoint
(interp, current_bytecode)¶
-
bytecodePrimMod
(interp, current_bytecode)¶
-
bytecodePrimMultiply
(interp, current_bytecode)¶
-
bytecodePrimNew
(interp, current_bytecode)¶
-
bytecodePrimNewWithArg
(interp, current_bytecode)¶
-
bytecodePrimNext
(interp, current_bytecode)¶
-
bytecodePrimNextPut
(interp, current_bytecode)¶
-
bytecodePrimNotEqual
(interp, current_bytecode)¶
-
bytecodePrimPointX
(interp, current_bytecode)¶
-
bytecodePrimPointY
(interp, current_bytecode)¶
-
bytecodePrimSize
(interp, current_bytecode)¶
-
bytecodePrimSubtract
(interp, current_bytecode)¶
-
bytecodePrimValue
(interp, current_bytecode)¶
-
bytecodePrimValueWithArg
(interp, current_bytecode)¶
-
callPrimitiveBytecode
(interp, current_bytecode)¶
-
debug_bytecode
(interp)¶
-
doubleExtendedDoAnythingBytecode
(interp, current_bytecode)¶
-
duplicateTopBytecode
(interp, current_bytecode)¶
-
expected_argument_count
()¶
-
extendedPushBytecode
(interp, current_bytecode)¶
-
extendedStoreAndPopBytecode
(interp, current_bytecode)¶
-
extendedStoreBytecode
(interp, current_bytecode)¶
-
fetch_block_context
(n0)¶
-
fetch_method_context
(n0)¶
-
get_storage
(w_self)¶
-
gettemp_block_context
(index)¶
-
gettemp_method_context
(index0)¶
-
home_is_self_block_context
()¶
-
home_is_self_method_context
()¶
-
initialip
()¶
-
initialize_temps
(space, arguments)¶
-
instantiate_type
¶ alias of
ContextPartShadow
-
is_closure_context_block_context
()¶
-
is_closure_context_method_context
()¶
-
is_shadow
()¶
-
longJumpIfFalseBytecode
(interp, current_bytecode)¶
-
longJumpIfTrueBytecode
(interp, current_bytecode)¶
-
longUnconditionalJumpBytecode
(interp, current_bytecode)¶
-
method_str_block_context
()¶
-
method_str_method_context
()¶
-
onesided_become
(w_other)¶
-
own_fetch
(i)¶
-
own_size
()¶
-
own_store
(i, val)¶
-
popStackBytecode
(interp, current_bytecode)¶
-
privileged_block_fields
= (5,)¶
-
privileged_method_fields
= (3, 4)¶
-
promote_if_neccessary
()¶
-
pushActiveContextBytecode
(interp, current_bytecode)¶
-
pushClosureCopyCopiedValuesBytecode
(interp, current_bytecode)¶
-
pushConstantFalseBytecode
(interp, current_bytecode)¶
-
pushConstantMinusOneBytecode
(interp, current_bytecode)¶
-
pushConstantNilBytecode
(interp, current_bytecode)¶
-
pushConstantOneBytecode
(interp, current_bytecode)¶
-
pushConstantTrueBytecode
(interp, current_bytecode)¶
-
pushConstantTwoBytecode
(interp, current_bytecode)¶
-
pushConstantZeroBytecode
(interp, current_bytecode)¶
-
pushLiteralConstantBytecode
(interp, current_bytecode)¶
-
pushLiteralVariableBytecode
(interp, current_bytecode)¶
-
pushNewArrayBytecode
(interp, current_bytecode)¶
-
pushReceiverBytecode
(interp, current_bytecode)¶
-
pushReceiverVariableBytecode
(interp, current_bytecode)¶
-
pushRemoteTempLongBytecode
(interp, current_bytecode)¶
-
pushTemporaryVariableBytecode
(interp, current_bytecode)¶
-
repr_classname
= 'ContextPartShadow'¶
-
reset_pc
()¶
-
reset_stack
()¶
-
returnFalseBytecode
(interp, current_bytecode)¶
-
returnNilBytecode
(interp, current_bytecode)¶
-
returnReceiverBytecode
(interp, current_bytecode)¶
-
returnTopFromBlockBytecode
(interp, current_bytecode)¶
-
returnTopFromMethodBytecode
(interp, current_bytecode)¶
-
returnTrueBytecode
(interp, current_bytecode)¶
-
s_home_block_context
()¶
-
s_home_method_context
()¶
-
secondExtendedSendBytecode
(interp, current_bytecode)¶
-
sendLiteralSelectorBytecode
(interp, current_bytecode)¶
-
set_storage
(w_self, storage)¶
-
settemp_block_context
(index, w_value)¶
-
settemp_method_context
(index0, w_value)¶
-
shortConditionalJumpBytecode
(interp, current_bytecode)¶
-
shortUnconditionalJumpBytecode
(interp, current_bytecode)¶
-
singleExtendedSendBytecode
(interp, current_bytecode)¶
-
singleExtendedSuperBytecode
(interp, current_bytecode)¶
-
stackstart_block_context
()¶
-
stackstart_method_context
()¶
-
storeAndPopReceiverVariableBytecode
(interp, current_bytecode)¶
-
storeAndPopRemoteTempLongBytecode
(interp, current_bytecode)¶
-
storeAndPopTemporaryVariableBytecode
(interp, current_bytecode)¶
-
storeRemoteTempLongBytecode
(interp, current_bytecode)¶
-
store_block_context
(n0, w_value)¶
-
store_expected_argument_count
(argc)¶
-
store_initialip
(initialip)¶
-
store_method_context
(n0, w_value)¶
-
store_w_home
(w_home)¶
-
store_w_method
(w_method)¶
-
store_w_receiver
(w_receiver)¶
-
tempsize_block_context
()¶
-
tempsize_method_context
()¶
-
unknownBytecode
(interp, current_bytecode)¶
-
unwrap_store_eargc
(w_value)¶
-
unwrap_store_initialip
(w_value)¶
-
w_arguments_block_context
()¶
-
w_arguments_method_context
()¶
-
w_method_block_context
()¶
-
w_method_method_context
()¶
-
w_receiver_block_context
()¶
-
w_receiver_method_context
()¶
-
w_self
()¶
-
wrap_eargc
()¶
-
wrap_initialip
()¶
-
rsqueakvm.wrapper module¶
-
class
AssociationWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.Wrapper
-
key
()¶
-
store_value
(w_new)¶
-
value
()¶
-
-
class
CriticalSectionWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.LinkedListWrapper
-
owner
()¶
-
store_owner
(w_new)¶
-
-
class
FormWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.Wrapper
-
bits
()¶
-
depth
()¶
-
height
()¶
-
store_bits
(w_new)¶
-
store_depth
(new)¶
-
store_height
(new)¶
-
store_width
(new)¶
-
width
()¶
-
-
class
LinkWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.Wrapper
-
next_link
()¶
-
store_next_link
(w_new)¶
-
-
class
LinkedListWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.Wrapper
-
first_link
()¶
-
last_link
()¶
-
store_first_link
(w_new)¶
-
store_last_link
(w_new)¶
-
-
class
PointWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.Wrapper
-
store_x
(new)¶
-
store_y
(new)¶
-
x
()¶
-
y
()¶
-
-
class
ProcessWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.LinkWrapper
-
my_list
()¶
-
priority
()¶
-
store_my_list
(w_new)¶
-
store_suspended_context
(w_new)¶
-
suspended_context
()¶
-
-
class
SchedulerWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.Wrapper
-
active_process
()¶
-
store_active_process
(w_new)¶
-
-
class
SemaphoreWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.LinkedListWrapper
-
excess_signals
()¶
-
store_excess_signals
(new)¶
-
-
class
VarsizedWrapper
(space, w_self)[source]¶ Bases:
rsqueakvm.wrapper.Wrapper