Skip to content
Merged
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
12 changes: 10 additions & 2 deletions src/MethodProxies/MpDeactivator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ Class {
{ #category : 'class initialization' }
MpDeactivator class >> initialize [

WasMetaTempVariableIndex := (MpMethodProxy class >> #prototypeTrap) numTemps. "last temp"
CompleteTempVariableIndex := 2 "always the second temp"
| prototypeTraps tempIndexes |
prototypeTraps := MpMethodProxy class methods select: [ :e |
e hasPragmaNamed: #prototypeTrap ].

"Consider only the last temp, and verify that they all agree"
tempIndexes := prototypeTraps collect: [ :e | e numTemps ] as: Set.
self assert: tempIndexes size = 1.

WasMetaTempVariableIndex := tempIndexes anyOne.
CompleteTempVariableIndex := 2 "always the second temp"
]

{ #category : 'as yet unclassified' }
Expand Down
89 changes: 89 additions & 0 deletions src/MethodProxies/MpHandler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,109 @@ MpHandler >> afterExecutionWithReceiver: anObject arguments: anArrayOfObjects re
^ returnValue
]

{ #category : 'evaluating' }
MpHandler >> afterExecutionWithReceiver: anObject returnValue: aValue [
^ self afterExecutionWithReceiver: anObject arguments: {} returnValue: aValue
]

{ #category : 'evaluating' }
MpHandler >> afterExecutionWithReceiver: anObject with: arg1 returnValue: aValue [
^ self afterExecutionWithReceiver: anObject arguments: {arg1} returnValue: aValue
]

{ #category : 'evaluating' }
MpHandler >> afterExecutionWithReceiver: anObject with: arg1 with: arg2 returnValue: aValue [
^ self afterExecutionWithReceiver: anObject arguments: {arg1 . arg2} returnValue: aValue
]

{ #category : 'evaluating' }
MpHandler >> afterExecutionWithReceiver: anObject with: arg1 with: arg2 with: arg3 returnValue: aValue [
^ self afterExecutionWithReceiver: anObject arguments: {arg1 . arg2 . arg3} returnValue: aValue
]

{ #category : 'evaluating' }
MpHandler >> afterExecutionWithReceiver: anObject with: arg1 with: arg2 with: arg3 with: arg4 returnValue: aValue [
^ self afterExecutionWithReceiver: anObject arguments: {arg1 . arg2 . arg3 . arg4} returnValue: aValue
]

{ #category : 'evaluating' }
MpHandler >> afterExecutionWithReceiver: anObject with: arg1 with: arg2 with: arg3 with: arg4 with: arg5 returnValue: aValue [
^ self afterExecutionWithReceiver: anObject arguments: {arg1 . arg2 . arg3 . arg4 . arg5} returnValue: aValue
]

{ #category : 'evaluating' }
MpHandler >> afterMethod [


]

{ #category : 'evaluating' }
MpHandler >> beforeExecutionWithReceiver: anObject [
^ self beforeExecutionWithReceiver: anObject arguments: {}
]

{ #category : 'evaluating' }
MpHandler >> beforeExecutionWithReceiver: anObject arguments: anArrayOfObjects [

self beforeMethod
]

{ #category : 'evaluating' }
MpHandler >> beforeExecutionWithReceiver: anObject with: arg1 [
^ self beforeExecutionWithReceiver: anObject arguments: {arg1}
]

{ #category : 'evaluating' }
MpHandler >> beforeExecutionWithReceiver: anObject with: arg1 with: arg2 [
^ self beforeExecutionWithReceiver: anObject arguments: {arg1 . arg2}
]

{ #category : 'evaluating' }
MpHandler >> beforeExecutionWithReceiver: anObject with: arg1 with: arg2 with: arg3 [
^ self beforeExecutionWithReceiver: anObject arguments: {arg1 . arg2 . arg3}
]

{ #category : 'evaluating' }
MpHandler >> beforeExecutionWithReceiver: anObject with: arg1 with: arg2 with: arg3 with: arg4 [
^ self beforeExecutionWithReceiver: anObject arguments: {arg1 . arg2 . arg3 . arg4}
]

{ #category : 'evaluating' }
MpHandler >> beforeExecutionWithReceiver: anObject with: arg1 with: arg2 with: arg3 with: arg4 with: arg5 [
^ self beforeExecutionWithReceiver: anObject arguments: {arg1 . arg2 . arg3 . arg4 . arg5}
]

{ #category : 'evaluating' }
MpHandler >> beforeMethod [


]

{ #category : 'as yet unclassified' }
MpHandler >> overridesAfterMethodFor: anInteger [

| argKeywords |
argKeywords := '' join: ((1 to: anInteger) collect: [ :i | 'with:' ]).

^ (self class lookupSelector:
(#afterExecutionWithReceiver: , argKeywords, 'returnValue:') asSymbol)
methodClass ~= MpHandler
]

{ #category : 'configuring' }
MpHandler >> overridesBeforeMethod [

^(self class lookupSelector: #beforeExecutionWithReceiver:arguments:)
methodClass ~= MpHandler
]

{ #category : 'as yet unclassified' }
MpHandler >> overridesBeforeMethodFor: anInteger [

| argKeywords |
argKeywords := '' join: ((1 to: anInteger) collect: [ :i | 'with:' ]).

^ (self class lookupSelector:
(#beforeExecutionWithReceiver: , argKeywords) asSymbol)
methodClass ~= MpHandler
]
Loading
Loading