From 26de37696a8fd0cc094e2d79c0dddfd5952ef2dc Mon Sep 17 00:00:00 2001 From: Marcus Denker Date: Wed, 6 Nov 2019 09:31:17 +0100 Subject: [PATCH] Encoder is not referenced and just has two methods on the class side - move methods down - remove Encoder fixes #2334 --- ...r.extension.st => BytecodeEncoder.extension.st} | 4 ++-- .../BytecodeEncoder.class.st | 8 +++++++- src/Kernel-BytecodeEncoders/Encoder.class.st | 14 -------------- 3 files changed, 9 insertions(+), 17 deletions(-) rename src/Flashback-Decompiler/{Encoder.extension.st => BytecodeEncoder.extension.st} (50%) delete mode 100644 src/Kernel-BytecodeEncoders/Encoder.class.st diff --git a/src/Flashback-Decompiler/Encoder.extension.st b/src/Flashback-Decompiler/BytecodeEncoder.extension.st similarity index 50% rename from src/Flashback-Decompiler/Encoder.extension.st rename to src/Flashback-Decompiler/BytecodeEncoder.extension.st index 8b106159075..b6b81ed2c10 100644 --- a/src/Flashback-Decompiler/Encoder.extension.st +++ b/src/Flashback-Decompiler/BytecodeEncoder.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Encoder } +Extension { #name : #BytecodeEncoder } { #category : #'*Flashback-Decompiler' } -Encoder class >> skipTemps: numTemps for: aDecompiler [ +BytecodeEncoder class >> skipTemps: numTemps for: aDecompiler [ numTemps timesRepeat: [ aDecompiler goToNextInstruction ] ] diff --git a/src/Kernel-BytecodeEncoders/BytecodeEncoder.class.st b/src/Kernel-BytecodeEncoders/BytecodeEncoder.class.st index 724a223a7b5..b1eebf3231c 100644 --- a/src/Kernel-BytecodeEncoders/BytecodeEncoder.class.st +++ b/src/Kernel-BytecodeEncoders/BytecodeEncoder.class.st @@ -3,7 +3,7 @@ I am an abstract superclass for different bytecode set encoders. Subclasses inh " Class { #name : #BytecodeEncoder, - #superclass : #Encoder, + #superclass : #Object, #instVars : [ 'stream', 'position', @@ -56,6 +56,12 @@ BytecodeEncoder class >> nonExtensionPcAt: pc in: method [ ^thePC ] +{ #category : #'bytecode decoding' } +BytecodeEncoder class >> quickPrimSpecialConstants [ + "Note: they are different from the encoder special literals." + ^ #(true false nil -1 0 1 2) +] + { #category : #'bytecode decoding' } BytecodeEncoder class >> specialSelectors [ ^ #(#+ #- #< #> #'<=' #'>=' #= #'~=' #* #/ #'\\' #@ #bitShift: #'//' #bitAnd: #bitOr: #at: #at:put: #size #next #nextPut: #atEnd #'==' nil "class" #'~~' #value #value: #do: #new #new: #x #y) diff --git a/src/Kernel-BytecodeEncoders/Encoder.class.st b/src/Kernel-BytecodeEncoders/Encoder.class.st deleted file mode 100644 index 8bbae4dc757..00000000000 --- a/src/Kernel-BytecodeEncoders/Encoder.class.st +++ /dev/null @@ -1,14 +0,0 @@ -" -I encode names and literals into tree nodes with byte codes for the compiler. Byte codes for literals are not assigned until the tree-sizing pass of the compiler, because only then is it known which literals are actually needed. I also keep track of sourceCode ranges during parsing and code generation so I can provide an inverse map for the debugger. -" -Class { - #name : #Encoder, - #superclass : #Object, - #category : #'Kernel-BytecodeEncoders' -} - -{ #category : #'bytecode decoding' } -Encoder class >> quickPrimSpecialConstants [ - "Note: they are different from the encoder special literals." - ^ #(true false nil -1 0 1 2) -]