ClosureCompiler-ajh for 3.8

Description

Prerequisites: 3.8a6315, Compiler (version 19) This package adds a closure compiler to the standard Squeak image without replacing the existing compiler. A new 'general' preference called #compileBlocksAsClosures determines which compiler to use for NEW methods only. When true the closure compiler is used, when false the existing compiler is used (default). Block contexts will still be created by existing methods. Etoy scripts/tiles do not work yet with the closure compiler so be sure to use them with the above preference set to false. The closure compiler is a total rewrite of the Smalltalk compiler using the SmaCC parser generator and the Refactory abstract systax tree (www.refactory.com). A special thanks goes to John Brant and Don Roberts for creating both the Refactory Browser and Smacc, and to Daniel Vainsencher and Markus Gaelli for porting them, respectively, to Squeak. For more details on the compiler organization itself see the Compiler class comment. Below is a description of how the compiler creates block closures. Each non-inlined blocks has its own CompiledMethod. These block methods are held in the literals of the home method and sent the #createBlock: message at runtime to create BlockClosures. Home method temps captured by inner blocks are placed inside a ClosureEnvironment when the home method is started. This environment is supplied as the argument to each #createBlock:. When #value... is sent to a block closure, its method is executed in a new MethodContext with its closure environment as the receiver. The block method accesses its free variables (captured home temps) via this environment. Closure environments are nested mirroring the nesting of blocks. Each environment points to its parent environment (the top method environment has no parent). However, for efficiency, environments that have no captured temps are skipped (never created). For example, an environment's parent may actually be its grand-parent. There is no special parent variable in

Details

Source
SqueakMap
Dialect
squeak (65% confidence)

Categories

UI / Graphics IDE / Dev Tools Education / Howto Serialization System / OS Language Extensions Concurrency
← Back to results