diff --git a/src/BaselineOfSindarin/BaselineOfSindarin.class.st b/src/BaselineOfSindarin/BaselineOfSindarin.class.st index 3b412f1..d8f2a04 100644 --- a/src/BaselineOfSindarin/BaselineOfSindarin.class.st +++ b/src/BaselineOfSindarin/BaselineOfSindarin.class.st @@ -10,8 +10,6 @@ BaselineOfSindarin >> baseline: spec [ spec for: #common do: [ - spec postLoadDoIt: #postloadWithLoader:withPackageSpec:. - spec package: 'Sindarin'; package: 'Sindarin-Tests'; @@ -21,17 +19,3 @@ BaselineOfSindarin >> baseline: spec [ group: 'default' with: #( 'Sindarin' 'Sindarin-Tests' ); group: 'experiments' with: #( 'default' 'Sindarin-Experiments' ) ] - -{ #category : 'baselines' } -BaselineOfSindarin >> postloadWithLoader: loader withPackageSpec: spec [ - - InstructionStream compiledMethodAt: #willJumpIfFalse ifAbsent: [ - Smalltalk compiler - source: 'willJumpIfFalse - "Answer whether the next bytecode is a jump-if-false." - - ^ self method encoderClass isBranchIfFalseAt: pc in: self method'; - class: InstructionStream; - compile; - install ] -] diff --git a/src/Sindarin-Tests/SindarinDebuggerTest.class.st b/src/Sindarin-Tests/SindarinDebuggerTest.class.st index 07adb04..c007b18 100644 --- a/src/Sindarin-Tests/SindarinDebuggerTest.class.st +++ b/src/Sindarin-Tests/SindarinDebuggerTest.class.st @@ -2026,6 +2026,31 @@ SindarinDebuggerTest >> testStepUntilOverAnEnsureBlock [ ] +{ #category : 'tests' } +SindarinDebuggerTest >> testSteppingAQuickMethod [ + + | newContext aMethodContext | + aMethodContext := Context + sender: thisContext + receiver: Rectangle new + method: Rectangle >> #center + arguments: #( ). + + aMethodContext step. + aMethodContext stepIntoQuickMethod: true. + newContext := aMethodContext step. + + "We're in the quick method now, it should be steppable" + self assert: newContext sender identicalTo: aMethodContext. + self deny: newContext instructionStream willReturn. + + newContext := newContext step. + self assert: newContext instructionStream willReturn. + + newContext := newContext step. + self assert: newContext identicalTo: aMethodContext +] + { #category : 'tests' } SindarinDebuggerTest >> testSteppingAnExecutionSignalingExceptions [ | scdbg | @@ -2041,6 +2066,28 @@ SindarinDebuggerTest >> testSteppingAnExecutionSignalingExceptions [ raise: UnhandledExceptionSignalledByADebuggedExecution ] +{ #category : 'tests' } +SindarinDebuggerTest >> testSteppingReturnSelfMethod [ + + |newContext aMethodContext | + aMethodContext := Context + sender: thisContext + receiver: SimulationMock new + method: (SimulationMock >>#exampleSelfReturnCall) + arguments: #(). + + aMethodContext step. + aMethodContext stepIntoQuickMethod: true. + newContext := aMethodContext step. + + "We're in the quick method now, it should be steppable" + self assert: newContext sender identicalTo: aMethodContext. + self assert: newContext instructionStream willReturn. + + newContext := newContext step. + self assert: newContext identicalTo: aMethodContext +] + { #category : 'tests' } SindarinDebuggerTest >> testTemporaryNamed [ | dbg | diff --git a/src/Sindarin/InstructionStream.extension.st b/src/Sindarin/InstructionStream.extension.st index 5e8b26f..cfa0ba2 100644 --- a/src/Sindarin/InstructionStream.extension.st +++ b/src/Sindarin/InstructionStream.extension.st @@ -1,5 +1,12 @@ Extension { #name : 'InstructionStream' } +{ #category : '*Sindarin' } +InstructionStream >> willCreateBlock [ + "next bytecode is a block creation" + + ^ self method encoderClass isCreateFullBlockAt: pc in: self method +] + { #category : '*Sindarin' } InstructionStream >> willJump [ "Answer whether the next bytecode will jump." @@ -21,6 +28,20 @@ InstructionStream >> willJumpTo [ ^ self method encoderClass isJumpAt: pc in: self method ] +{ #category : '*Sindarin' } +InstructionStream >> willReturn [ + "Answer whether the next bytecode is a return." + + ^ self method encoderClass isReturnAt: pc in: self method +] + +{ #category : '*Sindarin' } +InstructionStream >> willSend [ + "Answer whether the next bytecode is a message-send." + + ^ self method encoderClass isSendAt: pc in: self method +] + { #category : '*Sindarin' } InstructionStream >> willSendOrReturnOrStoreOrCreateBlock [