ClementBera uploaded a new version of BytecodeSets to project VM Maker:
http://source.squeak.org/VMMaker/BytecodeSets.spur-cb.43.mcz
==================== Summary ====================
Name: BytecodeSets.spur-cb.43
Author: cb
Time: 5 April 2016, 5:38:19.957 pm
UUID: fc44c36f-2fa2-4dd5-8b8e-b85b8ad5857f
Ancestors: BytecodeSets.spur-cb.42
fixed flag extension for stores.
fixed comment
=============== Diff against BytecodeSets.spur-cb.42 ===============
Item was changed:
BytecodeEncoder subclass: #EncoderForSistaV1
(excessive size, no diff calculated)
Item was removed:
- ----- Method: EncoderForSistaV1>>genStackFlagExtensionIgnoreStoreCheck:notAContext: (in category 'extended bytecode generation') -----
- genStackFlagExtensionIgnoreStoreCheck: ignoreStoreCheck notAContext: notAContext
- "Can be applied to the long form of store and store pop of literal variable, remote inst var, remote temp, receiver inst var.
- The notAContext bit can be used only with instance variable stores."
- self genUnsignedSingleExtendB: ignoreStoreCheck asBit + (notAContext asBit << 1)!
Item was added:
+ ----- Method: EncoderForSistaV1>>genStoreFlagExtensionIgnoreStoreCheck:maybeContext: (in category 'extended bytecode generation') -----
+ genStoreFlagExtensionIgnoreStoreCheck: ignoreStoreCheck maybeContext: maybeContext
+ "Can be applied to the long form of store and store pop of literal variable, remote inst var, remote temp, receiver inst var.
+ The notAContext bit can be used only with instance variable stores."
+ self genUnsignedSingleExtendB: ignoreStoreCheck asBit + (maybeContext asBit << 1)!
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1769.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1769
Author: cb
Time: 5 April 2016, 5:34:00.076 pm
UUID: ff68a0fd-57fb-43a7-bfd9-9c72ab42b57d
Ancestors: VMMaker.oscog-cb.1768
Added no must be boolean flag
=============== Diff against VMMaker.oscog-cb.1768 ===============
Item was changed:
----- Method: StackInterpreter>>extJumpIfFalse (in category 'jump bytecodes') -----
extJumpIfFalse
"244 11110100 i i i i i i i i Pop and Jump 0n False i i i i i i i i (+ Extend B * 256, where Extend B >= 0)"
| byte offset |
byte := self fetchByte.
offset := byte + (extB << 8).
+ extB := extA := 0.
- extB := 0.
self jumplfFalseBy: offset!
Item was changed:
----- Method: StackInterpreter>>extJumpIfTrue (in category 'jump bytecodes') -----
extJumpIfTrue
"243 11110011 i i i i i i i i Pop and Jump 0n True i i i i i i i i (+ Extend B * 256, where Extend B >= 0)"
| byte offset |
byte := self fetchByte.
offset := byte + (extB << 8).
+ extB := extA := 0.
- extB := 0.
self jumplfTrueBy: offset!
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1767.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1767
Author: cb
Time: 5 April 2016, 4:54:59.54 pm
UUID: b8ef10ec-e7ee-458d-8b9c-47c0fb37d302
Ancestors: VMMaker.oscog-cb.1766
fixed a bug in and: or: generation in the SistaCogit.
Check quickly that all extA are restored to 0.
=============== Diff against VMMaker.oscog-cb.1766 ===============
Item was changed:
----- Method: SimpleStackBasedCogit>>genJumpIf:to: (in category 'bytecode generator support') -----
genJumpIf: boolean to: targetBytecodePC
<inline: false>
"Cunning trick by LPD. If true and false are contiguous subtract the smaller.
Correct result is either 0 or the distance between them. If result is not 0 or
their distance send mustBeBoolean."
| ok |
<var: #ok type: #'AbstractInstruction *'>
+ extA := 0.
self assert: (objectMemory objectAfter: objectMemory falseObject) = objectMemory trueObject.
self PopR: TempReg.
self annotate: (self SubCw: boolean R: TempReg) objRef: boolean.
self JumpZero: (self ensureFixupAt: targetBytecodePC - initialPC).
self CmpCq: (boolean == objectMemory falseObject
ifTrue: [objectMemory trueObject - objectMemory falseObject]
ifFalse: [objectMemory falseObject - objectMemory trueObject])
R: TempReg.
ok := self JumpZero: 0.
self CallRT: (boolean == objectMemory falseObject
ifTrue: [ceSendMustBeBooleanAddFalseTrampoline]
ifFalse: [ceSendMustBeBooleanAddTrueTrampoline]).
ok jmpTarget: (self annotateBytecode: self Label).
^0!
Item was changed:
----- Method: SistaStackToRegisterMappingCogit>>genCounterTripOnlyJumpIf:to: (in category 'bytecode generator support') -----
genCounterTripOnlyJumpIf: boolean to: targetBytecodePC
"Specific version if the branch is only reached while falling through if the counter trips after an inlined #== branch. We do not regenerate the counter logic in this case to avoid 24 bytes instructions."
<var: #ok type: #'AbstractInstruction *'>
<var: #mustBeBooleanTrampoline type: #'AbstractInstruction *'>
| ok mustBeBooleanTrampoline |
+ extA := 0.
+
self ssFlushTo: simStackPtr - 1.
self ssTop popToReg: TempReg.
self ssPop: 1.
counterIndex := counterIndex + 1. "counters are increased / decreased in the inlined branch"
"We need SendNumArgsReg because of the mustBeBooleanTrampoline"
self ssAllocateRequiredReg: SendNumArgsReg.
self MoveCq: 1 R: SendNumArgsReg.
"The first time this is reached, it calls necessarily the counter trip for the trampoline because SendNumArgsReg is non zero"
mustBeBooleanTrampoline := self CallRT: (boolean == objectMemory falseObject
ifTrue: [ceSendMustBeBooleanAddFalseTrampoline]
ifFalse: [ceSendMustBeBooleanAddTrueTrampoline]).
self annotateBytecode: self Label.
"Cunning trick by LPD. If true and false are contiguous subtract the smaller.
Correct result is either 0 or the distance between them. If result is not 0 or
their distance send mustBeBoolean."
self assert: (objectMemory objectAfter: objectMemory falseObject) = objectMemory trueObject.
self annotate: (self SubCw: boolean R: TempReg) objRef: boolean.
self JumpZero: (self ensureFixupAt: targetBytecodePC - initialPC).
self CmpCq: (boolean == objectMemory falseObject
ifTrue: [objectMemory trueObject - objectMemory falseObject]
ifFalse: [objectMemory falseObject - objectMemory trueObject])
R: TempReg.
ok := self JumpZero: 0.
self MoveCq: 0 R: SendNumArgsReg. "if counterReg is 0 this is a mustBeBoolean, not a counter trip."
self Jump: mustBeBooleanTrampoline.
ok jmpTarget: self Label.
^0!
Item was changed:
----- Method: SistaStackToRegisterMappingCogit>>genJumpIf:to: (in category 'bytecode generator support') -----
genJumpIf: boolean to: targetBytecodePC
"The heart of performance counting in Sista. Conditional branches are 6 times less
frequent than sends and can provide basic block frequencies (send counters can't).
Each conditional has a 32-bit counter split into an upper 16 bits counting executions
and a lower half counting untaken executions of the branch. Executing the branch
decrements the upper half, tripping if the count goes negative. Not taking the branch
decrements the lower half. N.B. We *do not* eliminate dead branches (true ifTrue:/true ifFalse:)
so that scanning for send and branch data is simplified and that branch data is correct."
<inline: false>
| ok counterAddress countTripped retry nextPC nextDescriptor |
<var: #ok type: #'AbstractInstruction *'>
<var: #retry type: #'AbstractInstruction *'>
<var: #countTripped type: #'AbstractInstruction *'>
<var: #nextDescriptor type: #'AbstractInstruction *'>
(coInterpreter isOptimizedMethod: methodObj) ifTrue: [ ^ super genJumpIf: boolean to: targetBytecodePC ].
branchReachedOnlyForCounterTrip ifTrue:
[ branchReachedOnlyForCounterTrip := false.
^ self genCounterTripOnlyJumpIf: boolean to: targetBytecodePC ].
+ boolean == objectMemory falseObject ifTrue:
- boolean ifFalse:
[ "detection of and: / or:"
nextPC := bytecodePC + (self generatorAt: byte0) numBytes.
nextDescriptor := self generatorAt: (objectMemory fetchByte: nextPC ofObject: methodObj) + bytecodeSetOffset.
nextDescriptor generator == #genPushConstantTrueBytecode ifTrue: [ ^ super genJumpIf: boolean to: targetBytecodePC ].
nextDescriptor := self generatorAt: (objectMemory fetchByte: targetBytecodePC ofObject: methodObj) + bytecodeSetOffset.
nextDescriptor generator == #genPushConstantFalseBytecode ifTrue: [ ^ super genJumpIf: boolean to: targetBytecodePC ]. ].
+ extA := 0.
self ssFlushTo: simStackPtr - 1.
self ssTop popToReg: TempReg.
self ssPop: 1.
"We need SendNumArgsReg because of the mustBeBooleanTrampoline"
self ssAllocateRequiredReg: SendNumArgsReg.
retry := self Label.
self
genExecutionCountLogicInto: [ :cAddress :countTripBranch |
counterAddress := cAddress.
countTripped := countTripBranch ]
counterReg: SendNumArgsReg.
counterIndex := counterIndex + 1.
"Cunning trick by LPD. If true and false are contiguous subtract the smaller.
Correct result is either 0 or the distance between them. If result is not 0 or
their distance send mustBeBoolean."
self assert: (objectMemory objectAfter: objectMemory falseObject) = objectMemory trueObject.
self annotate: (self SubCw: boolean R: TempReg) objRef: boolean.
self JumpZero: (self ensureFixupAt: targetBytecodePC - initialPC).
self genFallsThroughCountLogicCounterReg: SendNumArgsReg counterAddress: counterAddress.
self CmpCq: (boolean == objectMemory falseObject
ifTrue: [objectMemory trueObject - objectMemory falseObject]
ifFalse: [objectMemory falseObject - objectMemory trueObject])
R: TempReg.
ok := self JumpZero: 0.
self MoveCq: 0 R: SendNumArgsReg. "if counterReg is 0 this is a mustBeBoolean, not a counter trip."
countTripped jmpTarget:
(self CallRT: (boolean == objectMemory falseObject
ifTrue: [ceSendMustBeBooleanAddFalseTrampoline]
ifFalse: [ceSendMustBeBooleanAddTrueTrampoline])).
"If we're in an image which hasn't got the Sista code loaded then the ceCounterTripped:
trampoline will return directly to machine code, returning the boolean. So the code should
jump back to the retry point. The trampoline makes sure that TempReg has been reloaded."
self annotateBytecode: self Label.
self Jump: retry.
ok jmpTarget: self Label.
^0!
Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.1765.mcz
==================== Summary ====================
Name: VMMaker.oscog-nice.1765
Author: nice
Time: 6 April 2016, 12:28:15.115 am
UUID: 7a029a58-3e12-425a-aaa7-13b94d1ddee7
Ancestors: VMMaker.oscog-nice.1764
Ah, yet another simulator species that need support for byteSwapped32IfBigEndian: (resp. 64)
=============== Diff against VMMaker.oscog-nice.1764 ===============
Item was added:
+ ----- Method: StackInterpreterSimulatorLSB>>byteSwapped32IfBigEndian: (in category 'memory access') -----
+ byteSwapped32IfBigEndian: w
+ ^w bitAnd: 16rFFFFFFFF!
Item was added:
+ ----- Method: StackInterpreterSimulatorLSB>>byteSwapped64IfBigEndian: (in category 'memory access') -----
+ byteSwapped64IfBigEndian: w
+ ^w bitAnd: 16rFFFFFFFFFFFFFFFF!
No problem, my next commit will restart from cb.1763
2016-04-05 20:52 GMT+02:00 <commits(a)source.squeak.org>:
>
> Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
> http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1763.mcz
>
> ==================== Summary ====================
>
> Name: VMMaker.oscog-cb.1763
> Author: cb
> Time: 5 April 2016, 11:52:00.157 am
> UUID: eae47156-f323-4975-880e-399822579ff1
> Ancestors: VMMaker.oscog-nice.1760
>
> Nicolas, I had to temporarily revert some of my changes....
>
> I took your version and reapply only this single change.
>
> Sorry about that. Can you rebase form this version ?
>
> =============== Diff against VMMaker.oscog-nice.1760 ===============
>
> Item was changed:
> ----- Method: SistaStackToRegisterMappingCogit>>genJumpIf:to: (in
> category 'bytecode generator support') -----
> genJumpIf: boolean to: targetBytecodePC
> "The heart of performance counting in Sista. Conditional branches
> are 6 times less
> frequent than sends and can provide basic block frequencies (send
> counters can't).
> Each conditional has a 32-bit counter split into an upper 16 bits
> counting executions
> and a lower half counting untaken executions of the branch.
> Executing the branch
> decrements the upper half, tripping if the count goes negative.
> Not taking the branch
> decrements the lower half. N.B. We *do not* eliminate dead
> branches (true ifTrue:/true ifFalse:)
> so that scanning for send and branch data is simplified and that
> branch data is correct."
> <inline: false>
> + | ok counterAddress countTripped retry nextPC nextDescriptor |
> - | ok counterAddress countTripped retry |
> <var: #ok type: #'AbstractInstruction *'>
> <var: #retry type: #'AbstractInstruction *'>
> <var: #countTripped type: #'AbstractInstruction *'>
> + <var: #nextDescriptor type: #'AbstractInstruction *'>
>
> (coInterpreter isOptimizedMethod: methodObj) ifTrue: [ ^ super
> genJumpIf: boolean to: targetBytecodePC ].
>
> branchReachedOnlyForCounterTrip ifTrue:
> [ branchReachedOnlyForCounterTrip := false.
> ^ self genCounterTripOnlyJumpIf: boolean to:
> targetBytecodePC ].
> +
> + boolean ifFalse:
> + [ "detection of and: / or:"
> + nextPC := bytecodePC + (self generatorAt: byte0) numBytes.
> + nextDescriptor := self generatorAt: (objectMemory
> fetchByte: nextPC ofObject: methodObj) + bytecodeSetOffset.
> + nextDescriptor generator == #genPushConstantTrueBytecode
> ifTrue: [ ^ super genJumpIf: boolean to: targetBytecodePC ].
> + nextDescriptor := self generatorAt: (objectMemory
> fetchByte: targetBytecodePC ofObject: methodObj) + bytecodeSetOffset.
> + nextDescriptor generator == #genPushConstantFalseBytecode
> ifTrue: [ ^ super genJumpIf: boolean to: targetBytecodePC ]. ].
>
> +
> self ssFlushTo: simStackPtr - 1.
> self ssTop popToReg: TempReg.
> self ssPop: 1.
>
> "We need SendNumArgsReg because of the mustBeBooleanTrampoline"
> self ssAllocateRequiredReg: SendNumArgsReg.
>
> retry := self Label.
> self
> genExecutionCountLogicInto: [ :cAddress :countTripBranch |
> counterAddress := cAddress.
> countTripped := countTripBranch ]
> counterReg: SendNumArgsReg.
> counterIndex := counterIndex + 1.
>
> "Cunning trick by LPD. If true and false are contiguous subtract
> the smaller.
> Correct result is either 0 or the distance between them. If
> result is not 0 or
> their distance send mustBeBoolean."
> self assert: (objectMemory objectAfter: objectMemory falseObject)
> = objectMemory trueObject.
> self annotate: (self SubCw: boolean R: TempReg) objRef: boolean.
> self JumpZero: (self ensureFixupAt: targetBytecodePC - initialPC).
>
> self genFallsThroughCountLogicCounterReg: SendNumArgsReg
> counterAddress: counterAddress.
>
> self CmpCq: (boolean == objectMemory falseObject
> ifTrue: [objectMemory trueObject -
> objectMemory falseObject]
> ifFalse: [objectMemory falseObject
> - objectMemory trueObject])
> R: TempReg.
> ok := self JumpZero: 0.
> self MoveCq: 0 R: SendNumArgsReg. "if counterReg is 0 this is a
> mustBeBoolean, not a counter trip."
>
> countTripped jmpTarget:
> (self CallRT: (boolean == objectMemory falseObject
> ifTrue:
> [ceSendMustBeBooleanAddFalseTrampoline]
> ifFalse:
> [ceSendMustBeBooleanAddTrueTrampoline])).
>
> "If we're in an image which hasn't got the Sista code loaded then
> the ceCounterTripped:
> trampoline will return directly to machine code, returning the
> boolean. So the code should
> jump back to the retry point. The trampoline makes sure that
> TempReg has been reloaded."
> self annotateBytecode: self Label.
>
> self Jump: retry.
>
> ok jmpTarget: self Label.
> ^0!
>
>