[Vm-dev] VM Maker: VMMaker.oscog-rmacnak.1534.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Nov 28 02:22:15 UTC 2015
Ryan Macnak uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-rmacnak.1534.mcz
==================== Summary ====================
Name: VMMaker.oscog-rmacnak.1534
Author: rmacnak
Time: 27 November 2015, 6:12:43.777 pm
UUID: dbeb984f-191e-4919-94b7-ffb681765d32
Ancestors: VMMaker.oscog-rmacnak.1533
The receiver of initializeSpecificOpcodes:in: is not necessarily the defining class of its method argument.
=============== Diff against VMMaker.oscog-rmacnak.1533 ===============
Item was changed:
----- Method: CogAbstractInstruction class>>initializeSpecificOpcodes:in: (in category 'class initialization') -----
initializeSpecificOpcodes: opcodeSymbolSequence in: initializeMethod
"Declare as class variables, the opcodes in opcodeSymbolSequence.
Assign values to them from LastRTLOpcode on. Undeclare any obsolete
class vars. The assumption is that initializeMethod defines all class vars
+ in the class. This method should be used by subclasses wishing to declare
- in the class. This method should be used by subclasses wiching to declare
their own specific opcodes."
+ | pool classVariablesDefinedInMethod |
- | classVariablesDefinedInMethod |
self assert: self ~~ CogAbstractInstruction.
+ pool := initializeMethod methodClass classPool.
LastRTLCode ifNil:
[CogRTLOpcodes initialize].
+ classVariablesDefinedInMethod := (initializeMethod literals select: [:l| l isVariableBinding and: [pool includesKey: l key]]) collect:
- classVariablesDefinedInMethod := (initializeMethod literals select: [:l| l isVariableBinding and: [classPool includesKey: l key]]) collect:
[:ea| ea key].
"Undeclare any class var not defined in opcodeSymbolSequence or by the method."
+ (pool keys reject: [:k| (opcodeSymbolSequence includes: k) or: [classVariablesDefinedInMethod includes: k]]) do:
- (classPool keys reject: [:k| (opcodeSymbolSequence includes: k) or: [classVariablesDefinedInMethod includes: k]]) do:
[:k|
+ Undeclared declare: k from: pool].
- Undeclared declare: k from: classPool].
"Declare opcodeSymbolSequence's elements from LastRTLCode on up."
opcodeSymbolSequence withIndexDo:
[:classVarName :value|
+ pool
- self classPool
declare: classVarName from: Undeclared;
at: classVarName put: value + LastRTLCode - 1]!
More information about the Vm-dev
mailing list