Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/BaselineOfSindarin/BaselineOfSindarin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ BaselineOfSindarin >> baseline: spec [

<baseline>
spec for: #common do: [
spec postLoadDoIt: #postloadWithLoader:withPackageSpec:.

spec
package: 'Sindarin';
package: 'Sindarin-Tests';
Expand All @@ -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 ]
]
47 changes: 47 additions & 0 deletions src/Sindarin-Tests/SindarinDebuggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down
21 changes: 21 additions & 0 deletions src/Sindarin/InstructionStream.extension.st
Original file line number Diff line number Diff line change
@@ -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."
Expand All @@ -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 [

Expand Down
Loading