Re: [Vm-dev] VM Maker: VMMaker.oscog-cb.1919.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] VM Maker: VMMaker.oscog-cb.1919.mcz

Eliot Miranda-2
I will generate and commit sources today.  If possible we should use the resulting VMs in the 5.1 release.  We have until early next week to test then harshly and see if they stand up to abuse ;-)

_,,,^..^,,,_ (phone)

On Aug 17, 2016, at 7:27 AM, Clément Bera <[hidden email]> wrote:

With that commit the VM is stable again. 

On Wed, Aug 17, 2016 at 4:11 PM, <[hidden email]> wrote:

ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1919.mcz

==================== Summary ====================

Name: VMMaker.oscog-cb.1919
Author: cb
Time: 17 August 2016, 4:10:53.445475 pm
UUID: 00a8dd2a-bc8d-4552-b400-be781c8aabec
Ancestors: VMMaker.oscog-cb.1918

fixed bug in scanner related to twoPath methods

=============== Diff against VMMaker.oscog-cb.1918 ===============

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>compileFrameBuild (in category 'compile abstract instructions') -----
  compileFrameBuild
        "Build a frame for a CogMethod activation.  See CoInterpreter class>>initializeFrameIndices.
         Override to push the register receiver and register arguments, if any."
        self cppIf: IMMUTABILITY ifTrue:
                [useTwoPaths ifTrue:
                        [self compileTwoPathFrameBuild.
                        ^self]].
        needsFrame ifFalse:
                [useTwoPaths ifTrue:
                        [self compileTwoPathFramelessInit].
                 self initSimStackForFramelessMethod: initialPC.
                 ^self].
+       self deny: useTwoPaths.
        self genPushRegisterArgs.
        super compileFrameBuild.
        self initSimStackForFramefulMethod: initialPC!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>scanMethod (in category 'compile abstract instructions') -----
  scanMethod
        "Scan the method (and all embedded blocks) to determine
                - what the last bytecode is; extra bytes at the end of a method are used to encode things like source pointers or temp names
                - if the method needs a frame or not
                - what are the targets of any backward branches.
                - how many blocks it creates
         Answer the block count or on error a negative error code"
        | latestContinuation nExts descriptor pc numBlocks distance targetPC framelessStackDelta seenInstVarStore |
        <var: #descriptor type: #'BytecodeDescriptor *'>
        needsFrame := useTwoPaths := seenInstVarStore := false.
        self maybeInitNumFixups.
        self maybeInitNumCounters.
        prevBCDescriptor := nil.
        NewspeakVM ifTrue:
                [numIRCs := 0].
        (primitiveIndex > 0
         and: [coInterpreter isQuickPrimitiveIndex: primitiveIndex]) ifTrue:
                [^0].
        pc := latestContinuation := initialPC.
        numBlocks := framelessStackDelta := nExts := extA := extB := 0.
        [pc <= endPC] whileTrue:
                [byte0 := (objectMemory fetchByte: pc ofObject: methodObj) + bytecodeSetOffset.
                 descriptor := self generatorAt: byte0.
                 descriptor isExtension ifTrue:
                        [descriptor opcode = Nop ifTrue: "unknown bytecode tag; see Cogit class>>#generatorTableFrom:"
                                [^EncounteredUnknownBytecode].
                         self loadSubsequentBytesForDescriptor: descriptor at: pc.
                         self perform: descriptor generator].
                 (descriptor isReturn
                  and: [pc >= latestContinuation]) ifTrue:
                        [endPC := pc].

                  needsFrame ifFalse:
                        [(descriptor needsFrameFunction isNil
                          or: [self perform: descriptor needsFrameFunction with: framelessStackDelta])
                                        ifTrue:
                                                ["With immutability we win simply by avoiding a frame build if the receiver is young and not immutable."
                                                 self cppIf: IMMUTABILITY
                                                        ifTrue: [descriptor is1ByteInstVarStore
                                                                        ifTrue: [useTwoPaths := true]
                                                                        ifFalse: [needsFrame := true. useTwoPaths := false]]
+                                                       ifFalse: [needsFrame := true. useTwoPaths := false]]
-                                                       ifFalse: [needsFrame := true]]
                                        ifFalse:
                                                [framelessStackDelta := framelessStackDelta + descriptor stackDelta.
                                                 "Without immutability we win if there are two or more stores and the receiver is new."
                                                 self cppIf: IMMUTABILITY
                                                        ifTrue: []
                                                        ifFalse:
                                                                [descriptor is1ByteInstVarStore ifTrue:
                                                                        [seenInstVarStore
                                                                                ifTrue: [useTwoPaths := true]
                                                                                ifFalse: [seenInstVarStore := true]]]]].

                 descriptor isBranch ifTrue:
                        [distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
                         targetPC := pc + descriptor numBytes + distance.
                         (self isBackwardBranch: descriptor at: pc exts: nExts in: methodObj)
                                ifTrue: [self initializeFixupAt: targetPC - initialPC]
                                ifFalse:
                                        [latestContinuation := latestContinuation max: targetPC.
                                         self maybeCountFixup.
                                         self maybeCountCounter]].
                 descriptor isBlockCreation ifTrue:
                        [numBlocks := numBlocks + 1.
                         distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
                         targetPC := pc + descriptor numBytes + distance.
                         latestContinuation := latestContinuation max: targetPC.
                         self maybeCountFixup].

                 NewspeakVM ifTrue:
                        [descriptor hasIRC ifTrue:
                                [numIRCs := numIRCs + 1]].
                 pc := pc + descriptor numBytes.
                 descriptor isExtension
                        ifTrue: [nExts := nExts + 1]
                        ifFalse: [nExts := extA := extB := 0].
                 prevBCDescriptor := descriptor].
        ^numBlocks!




Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] VM Maker: VMMaker.oscog-cb.1919.mcz

fniephaus
On Wed, Aug 17, 2016 at 4:41 PM Eliot Miranda <[hidden email]> wrote:
I will generate and commit sources today.  If possible we should use the resulting VMs in the 5.1 release.  We have until early next week to test then harshly and see if they stand up to abuse ;-)

So, shall we give this one a try then?

Fabio
 

_,,,^..^,,,_ (phone)

On Aug 17, 2016, at 7:27 AM, Clément Bera <[hidden email]> wrote:

With that commit the VM is stable again. 

On Wed, Aug 17, 2016 at 4:11 PM, <[hidden email]> wrote:

ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1919.mcz

==================== Summary ====================

Name: VMMaker.oscog-cb.1919
Author: cb
Time: 17 August 2016, 4:10:53.445475 pm
UUID: 00a8dd2a-bc8d-4552-b400-be781c8aabec
Ancestors: VMMaker.oscog-cb.1918

fixed bug in scanner related to twoPath methods

=============== Diff against VMMaker.oscog-cb.1918 ===============

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>compileFrameBuild (in category 'compile abstract instructions') -----
  compileFrameBuild
        "Build a frame for a CogMethod activation.  See CoInterpreter class>>initializeFrameIndices.
         Override to push the register receiver and register arguments, if any."
        self cppIf: IMMUTABILITY ifTrue:
                [useTwoPaths ifTrue:
                        [self compileTwoPathFrameBuild.
                        ^self]].
        needsFrame ifFalse:
                [useTwoPaths ifTrue:
                        [self compileTwoPathFramelessInit].
                 self initSimStackForFramelessMethod: initialPC.
                 ^self].
+       self deny: useTwoPaths.
        self genPushRegisterArgs.
        super compileFrameBuild.
        self initSimStackForFramefulMethod: initialPC!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>scanMethod (in category 'compile abstract instructions') -----
  scanMethod
        "Scan the method (and all embedded blocks) to determine
                - what the last bytecode is; extra bytes at the end of a method are used to encode things like source pointers or temp names
                - if the method needs a frame or not
                - what are the targets of any backward branches.
                - how many blocks it creates
         Answer the block count or on error a negative error code"
        | latestContinuation nExts descriptor pc numBlocks distance targetPC framelessStackDelta seenInstVarStore |
        <var: #descriptor type: #'BytecodeDescriptor *'>
        needsFrame := useTwoPaths := seenInstVarStore := false.
        self maybeInitNumFixups.
        self maybeInitNumCounters.
        prevBCDescriptor := nil.
        NewspeakVM ifTrue:
                [numIRCs := 0].
        (primitiveIndex > 0
         and: [coInterpreter isQuickPrimitiveIndex: primitiveIndex]) ifTrue:
                [^0].
        pc := latestContinuation := initialPC.
        numBlocks := framelessStackDelta := nExts := extA := extB := 0.
        [pc <= endPC] whileTrue:
                [byte0 := (objectMemory fetchByte: pc ofObject: methodObj) + bytecodeSetOffset.
                 descriptor := self generatorAt: byte0.
                 descriptor isExtension ifTrue:
                        [descriptor opcode = Nop ifTrue: "unknown bytecode tag; see Cogit class>>#generatorTableFrom:"
                                [^EncounteredUnknownBytecode].
                         self loadSubsequentBytesForDescriptor: descriptor at: pc.
                         self perform: descriptor generator].
                 (descriptor isReturn
                  and: [pc >= latestContinuation]) ifTrue:
                        [endPC := pc].

                  needsFrame ifFalse:
                        [(descriptor needsFrameFunction isNil
                          or: [self perform: descriptor needsFrameFunction with: framelessStackDelta])
                                        ifTrue:
                                                ["With immutability we win simply by avoiding a frame build if the receiver is young and not immutable."
                                                 self cppIf: IMMUTABILITY
                                                        ifTrue: [descriptor is1ByteInstVarStore
                                                                        ifTrue: [useTwoPaths := true]
                                                                        ifFalse: [needsFrame := true. useTwoPaths := false]]
+                                                       ifFalse: [needsFrame := true. useTwoPaths := false]]
-                                                       ifFalse: [needsFrame := true]]
                                        ifFalse:
                                                [framelessStackDelta := framelessStackDelta + descriptor stackDelta.
                                                 "Without immutability we win if there are two or more stores and the receiver is new."
                                                 self cppIf: IMMUTABILITY
                                                        ifTrue: []
                                                        ifFalse:
                                                                [descriptor is1ByteInstVarStore ifTrue:
                                                                        [seenInstVarStore
                                                                                ifTrue: [useTwoPaths := true]
                                                                                ifFalse: [seenInstVarStore := true]]]]].

                 descriptor isBranch ifTrue:
                        [distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
                         targetPC := pc + descriptor numBytes + distance.
                         (self isBackwardBranch: descriptor at: pc exts: nExts in: methodObj)
                                ifTrue: [self initializeFixupAt: targetPC - initialPC]
                                ifFalse:
                                        [latestContinuation := latestContinuation max: targetPC.
                                         self maybeCountFixup.
                                         self maybeCountCounter]].
                 descriptor isBlockCreation ifTrue:
                        [numBlocks := numBlocks + 1.
                         distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
                         targetPC := pc + descriptor numBytes + distance.
                         latestContinuation := latestContinuation max: targetPC.
                         self maybeCountFixup].

                 NewspeakVM ifTrue:
                        [descriptor hasIRC ifTrue:
                                [numIRCs := numIRCs + 1]].
                 pc := pc + descriptor numBytes.
                 descriptor isExtension
                        ifTrue: [nExts := nExts + 1]
                        ifFalse: [nExts := extA := extB := 0].
                 prevBCDescriptor := descriptor].
        ^numBlocks!




Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] VM Maker: VMMaker.oscog-cb.1919.mcz

Eliot Miranda-2


On Wed, Aug 17, 2016 at 12:50 PM, Fabio Niephaus <[hidden email]> wrote:
On Wed, Aug 17, 2016 at 4:41 PM Eliot Miranda <[hidden email]> wrote:
I will generate and commit sources today.  If possible we should use the resulting VMs in the 5.1 release.  We have until early next week to test then harshly and see if they stand up to abuse ;-)

So, shall we give this one a try then?

That would be the one!
 


Fabio
 

_,,,^..^,,,_ (phone)

On Aug 17, 2016, at 7:27 AM, Clément Bera <[hidden email]> wrote:

With that commit the VM is stable again. 

On Wed, Aug 17, 2016 at 4:11 PM, <[hidden email]> wrote:

ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1919.mcz

==================== Summary ====================

Name: VMMaker.oscog-cb.1919
Author: cb
Time: 17 August 2016, 4:10:53.445475 pm
UUID: 00a8dd2a-bc8d-4552-b400-be781c8aabec
Ancestors: VMMaker.oscog-cb.1918

fixed bug in scanner related to twoPath methods

=============== Diff against VMMaker.oscog-cb.1918 ===============

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>compileFrameBuild (in category 'compile abstract instructions') -----
  compileFrameBuild
        "Build a frame for a CogMethod activation.  See CoInterpreter class>>initializeFrameIndices.
         Override to push the register receiver and register arguments, if any."
        self cppIf: IMMUTABILITY ifTrue:
                [useTwoPaths ifTrue:
                        [self compileTwoPathFrameBuild.
                        ^self]].
        needsFrame ifFalse:
                [useTwoPaths ifTrue:
                        [self compileTwoPathFramelessInit].
                 self initSimStackForFramelessMethod: initialPC.
                 ^self].
+       self deny: useTwoPaths.
        self genPushRegisterArgs.
        super compileFrameBuild.
        self initSimStackForFramefulMethod: initialPC!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>scanMethod (in category 'compile abstract instructions') -----
  scanMethod
        "Scan the method (and all embedded blocks) to determine
                - what the last bytecode is; extra bytes at the end of a method are used to encode things like source pointers or temp names
                - if the method needs a frame or not
                - what are the targets of any backward branches.
                - how many blocks it creates
         Answer the block count or on error a negative error code"
        | latestContinuation nExts descriptor pc numBlocks distance targetPC framelessStackDelta seenInstVarStore |
        <var: #descriptor type: #'BytecodeDescriptor *'>
        needsFrame := useTwoPaths := seenInstVarStore := false.
        self maybeInitNumFixups.
        self maybeInitNumCounters.
        prevBCDescriptor := nil.
        NewspeakVM ifTrue:
                [numIRCs := 0].
        (primitiveIndex > 0
         and: [coInterpreter isQuickPrimitiveIndex: primitiveIndex]) ifTrue:
                [^0].
        pc := latestContinuation := initialPC.
        numBlocks := framelessStackDelta := nExts := extA := extB := 0.
        [pc <= endPC] whileTrue:
                [byte0 := (objectMemory fetchByte: pc ofObject: methodObj) + bytecodeSetOffset.
                 descriptor := self generatorAt: byte0.
                 descriptor isExtension ifTrue:
                        [descriptor opcode = Nop ifTrue: "unknown bytecode tag; see Cogit class>>#generatorTableFrom:"
                                [^EncounteredUnknownBytecode].
                         self loadSubsequentBytesForDescriptor: descriptor at: pc.
                         self perform: descriptor generator].
                 (descriptor isReturn
                  and: [pc >= latestContinuation]) ifTrue:
                        [endPC := pc].

                  needsFrame ifFalse:
                        [(descriptor needsFrameFunction isNil
                          or: [self perform: descriptor needsFrameFunction with: framelessStackDelta])
                                        ifTrue:
                                                ["With immutability we win simply by avoiding a frame build if the receiver is young and not immutable."
                                                 self cppIf: IMMUTABILITY
                                                        ifTrue: [descriptor is1ByteInstVarStore
                                                                        ifTrue: [useTwoPaths := true]
                                                                        ifFalse: [needsFrame := true. useTwoPaths := false]]
+                                                       ifFalse: [needsFrame := true. useTwoPaths := false]]
-                                                       ifFalse: [needsFrame := true]]
                                        ifFalse:
                                                [framelessStackDelta := framelessStackDelta + descriptor stackDelta.
                                                 "Without immutability we win if there are two or more stores and the receiver is new."
                                                 self cppIf: IMMUTABILITY
                                                        ifTrue: []
                                                        ifFalse:
                                                                [descriptor is1ByteInstVarStore ifTrue:
                                                                        [seenInstVarStore
                                                                                ifTrue: [useTwoPaths := true]
                                                                                ifFalse: [seenInstVarStore := true]]]]].

                 descriptor isBranch ifTrue:
                        [distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
                         targetPC := pc + descriptor numBytes + distance.
                         (self isBackwardBranch: descriptor at: pc exts: nExts in: methodObj)
                                ifTrue: [self initializeFixupAt: targetPC - initialPC]
                                ifFalse:
                                        [latestContinuation := latestContinuation max: targetPC.
                                         self maybeCountFixup.
                                         self maybeCountCounter]].
                 descriptor isBlockCreation ifTrue:
                        [numBlocks := numBlocks + 1.
                         distance := self spanFor: descriptor at: pc exts: nExts in: methodObj.
                         targetPC := pc + descriptor numBytes + distance.
                         latestContinuation := latestContinuation max: targetPC.
                         self maybeCountFixup].

                 NewspeakVM ifTrue:
                        [descriptor hasIRC ifTrue:
                                [numIRCs := numIRCs + 1]].
                 pc := pc + descriptor numBytes.
                 descriptor isExtension
                        ifTrue: [nExts := nExts + 1]
                        ifFalse: [nExts := extA := extB := 0].
                 prevBCDescriptor := descriptor].
        ^numBlocks!





--
_,,,^..^,,,_
best, Eliot