Skip to content

Commit

Permalink
- IRMethod>>#removeReturn is dead code
Browse files Browse the repository at this point in the history
- IRPushClosureCopy ivar "lastBlockSequence" is set but never used (and not documented)
- #lookUpSelector:,  possibleSelectorFor: and #lookUpGlobalVar: on semantic scope are not needed
- formatting of #hasTemporaryVariableNamed: (remove () )
  • Loading branch information
MarcusDenker committed Oct 9, 2019
1 parent 848f6f5 commit 2874871
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 43 deletions.
1 change: 0 additions & 1 deletion src/OpalCompiler-Core/IRBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ IRBuilder >> startNewSequence [

currentSequence last transitionsToNextSequence
ifFalse: [ self add: (IRJump new destination: newSequence)].
self currentScope isPushClosureCopy ifTrue: [self currentScope lastBlockSequence: currentSequence].
currentSequence := newSequence.

]
Expand Down
5 changes: 0 additions & 5 deletions src/OpalCompiler-Core/IRMethod.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@ IRMethod >> removeEmptyStart [

]

{ #category : #inlining }
IRMethod >> removeReturn [
self allSequences last removeLast.
]

{ #category : #accessing }
IRMethod >> sourceInterval [
^self sourceNode sourceInterval
Expand Down
11 changes: 0 additions & 11 deletions src/OpalCompiler-Core/IRPushClosureCopy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Class {
'blockSequence',
'tempMap',
'copiedValues',
'lastBlockSequence',
'arguments'
],
#category : #'OpalCompiler-Core-IR-Nodes'
Expand Down Expand Up @@ -88,16 +87,6 @@ IRPushClosureCopy >> isPushClosureCopy [
^true
]

{ #category : #accessing }
IRPushClosureCopy >> lastBlockSequence [
^lastBlockSequence
]

{ #category : #accessing }
IRPushClosureCopy >> lastBlockSequence: aSequence [
lastBlockSequence := aSequence
]

{ #category : #accessing }
IRPushClosureCopy >> nonBodySuccessorSequences [

Expand Down
13 changes: 0 additions & 13 deletions src/OpalCompiler-Core/OCAbstractScope.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ OCAbstractScope >> isMethodScope [
^false
]

{ #category : #lookup }
OCAbstractScope >> lookupSelector: name [

Symbol hasInterned: name ifTrue: [ :sym | ^ sym].
^ nil
]

{ #category : #lookup }
OCAbstractScope >> lookupVar: name [
"search the scope (and the outer scopes) for a variable 'name' and return it"
Expand Down Expand Up @@ -100,12 +93,6 @@ OCAbstractScope >> outerScope: aSemScope [
aSemScope addChild: self.
]

{ #category : #lookup }
OCAbstractScope >> possibleSelectorsFor: string [

^ Symbol possibleSelectorsFor: string
]

{ #category : #levels }
OCAbstractScope >> scopeLevel [

Expand Down
9 changes: 0 additions & 9 deletions src/OpalCompiler-Core/OCRequestorScope.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ OCRequestorScope >> findVariable: aBlock ifNone: aNotFound [
^ outerScope findVariable: aBlock ifNone: aNotFound ]
]

{ #category : #lookup }
OCRequestorScope >> lookupGlobalVar: aName [
"consider variables with upper case as global vars resolveable in the outer scope "

^ aName first isUppercase
ifTrue: [ outerScope lookupVar: aName ]
ifFalse: [ nil ]
]

{ #category : #lookup }
OCRequestorScope >> lookupVar: name [

Expand Down
2 changes: 1 addition & 1 deletion src/Slot-Core/BlockClosure.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Extension { #name : #BlockClosure }

{ #category : #'*Slot-Core' }
BlockClosure >> hasTemporaryVariableNamed: aName [
^(self tempNames includes: aName)
^self tempNames includes: aName
]

{ #category : #'*Slot-Core' }
Expand Down
3 changes: 1 addition & 2 deletions src/Slot-Core/CompiledMethod.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ Extension { #name : #CompiledMethod }

{ #category : #'*Slot-Core' }
CompiledMethod >> hasTemporaryVariableNamed: aName [
^(self tempNames includes: aName)

^ self tempNames includes: aName
]

{ #category : #'*Slot-Core' }
Expand Down
2 changes: 1 addition & 1 deletion src/Slot-Core/Context.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Extension { #name : #Context }

{ #category : #'*Slot-Core' }
Context >> hasTemporaryVariableNamed: aName [
^(self tempNames includes: aName)
^ self tempNames includes: aName
]

0 comments on commit 2874871

Please sign in to comment.