[Vm-dev] VM Maker: VMMaker.oscog-cb.1804.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Apr 15 16:38:31 UTC 2016
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1804.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1804
Author: cb
Time: 15 April 2016, 9:36:54.882067 am
UUID: ff06dd0e-1af8-4146-9fee-e6d59deb27d3
Ancestors: VMMaker.oscog-eem.1803
Minor fix: a Full closure can now be created and executed from machine code. It seems there is a remaining bug in code compaction.
=============== Diff against VMMaker.oscog-eem.1803 ===============
Item was changed:
----- Method: Cogit class>>activeCompilerClass (in category 'translation') -----
activeCompilerClass
^initializationOptions
at: #CogCompilerClass
ifPresent: [:compilerClassName| Smalltalk classNamed: compilerClassName]
ifAbsent:
[(CogAbstractInstruction subclasses detect:
[:compilerClass|
+ compilerClass ISA == (initializationOptions at: #ISA ifAbsent: [#IA32])]) defaultCompilerClass]!
- compilerClass ISA == (initializationOptions at: #ISA)]) defaultCompilerClass]!
Item was changed:
----- Method: StackToRegisterMappingCogit>>genExtPushFullClosureBytecode (in category 'bytecode generators') -----
genExtPushFullClosureBytecode
"Full Block creation compilation. The block's actual code will be compiled separatedly."
"* 255 11111111 xxxxxxxx siyyyyyy push Closure Compiled block literal index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 ignoreOuterContext: i = 1"
| numCopied ignoreContext receiverIsOnStack compiledBlock reg |
self assert: needsFrame.
compiledBlock := self getLiteral: byte1 + (extA << 8).
extA := 0.
numCopied := byte2 bitAnd: 1<< 6 - 1.
receiverIsOnStack := byte2 anyMask: 1 << 7.
ignoreContext := byte2 anyMask: 1 << 6.
optStatus isReceiverResultRegLive: false.
self ssAllocateCallReg: ReceiverResultReg
and: SendNumArgsReg
and: ClassReg.
objectRepresentation
genCreateFullClosure: compiledBlock
numArgs: (coInterpreter argumentCountOf: compiledBlock)
numCopied: numCopied
ignoreContext: ignoreContext
contextNumArgs: methodOrBlockNumArgs
large: (coInterpreter methodNeedsLargeContext: methodObj)
inBlock: inBlock.
"Closure in ReceiverResultReg"
1 to: numCopied do:
[:i|
reg := self ssStorePop: true toPreferredReg: TempReg.
objectRepresentation
genStoreSourceReg: reg
+ slotIndex: FullClosureFirstCopiedValueIndex + numCopied - i
- slotIndex: ClosureFirstCopiedValueIndex + numCopied - i
intoNewObjectInDestReg: ReceiverResultReg].
receiverIsOnStack
ifTrue: [reg := self ssStorePop: true toPreferredReg: TempReg]
ifFalse: [(self addressOf: simSelf) storeToReg: (reg := TempReg)].
objectRepresentation
genStoreSourceReg: reg
slotIndex: FullClosureReceiverIndex
intoNewObjectInDestReg: ReceiverResultReg.
self ssPushRegister: ReceiverResultReg.
^0!
More information about the Vm-dev
mailing list