Skip to content

Commit

Permalink
Cache binary encoding in ProcessorInstructionDeclaration
Browse files Browse the repository at this point in the history
This commit caches encoding bitvector in ProcessorInstructionDeclaration
instead of creating it on demand.

This change speeds up decoding of ~170 instructions from ~35secs to
~15 secs (which is still appalling).
  • Loading branch information
janvrany committed Sep 4, 2024
1 parent fbaed30 commit 1494ffe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ArchC-Core/ProcessorInstructionDeclaration.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Class {
'format',
'internalBindings',
'syntax',
'isa'
'isa',
'binaryEncoding'
],
#classVars : [
'EmptyBindings'
Expand Down Expand Up @@ -132,7 +133,10 @@ ProcessorInstructionDeclaration >> assertInvariants [

{ #category : #accessing }
ProcessorInstructionDeclaration >> binaryEncoding [
^format binaryEncoding inEnvironment: internalBindings
binaryEncoding isNil ifTrue: [
binaryEncoding := format binaryEncoding inEnvironment: internalBindings.
].
^ binaryEncoding
]

{ #category : #accessing }
Expand Down

0 comments on commit 1494ffe

Please sign in to comment.